Interface LinearExpr

All Known Implementing Classes:
IntVar, ScalProd, SumOfVariables

public interface LinearExpr
A linear expression interface that can be parsed.
  • Method Details

    • numElements

      int numElements()
      Returns the number of elements in the interface.
    • getVariable

      IntVar getVariable​(int index)
      Returns the ith variable.
    • getCoefficient

      long getCoefficient​(int index)
      Returns the ith coefficient.
    • getOffset

      long getOffset()
      Returns the constant part of the expression.
    • sum

      static LinearExpr sum​(IntVar[] variables)
      Creates a sum expression.
    • booleanSum

      static LinearExpr booleanSum​(Literal[] literals)
      Creates a sum expression.
    • scalProd

      static LinearExpr scalProd​(IntVar[] variables, long[] coefficients)
      Creates a scalar product.
    • scalProd

      static LinearExpr scalProd​(IntVar[] variables, int[] coefficients)
      Creates a scalar product.
    • booleanScalProd

      static LinearExpr booleanScalProd​(Literal[] literals, long[] coefficients)
      Creates a scalar product.
    • booleanScalProd

      static LinearExpr booleanScalProd​(Literal[] literals, int[] coefficients)
      Creates a scalar product.
    • term

      static LinearExpr term​(IntVar variable, long coefficient)
      Creates a linear term (var * coefficient).