Java Reference
Java Reference
LinearExpr.java
Go to the documentation of this file.
A linear expression interface that can be parsed.
Definition: Constant.java:17
Exception thrown when parallel arrays have mismatched lengths.
Definition: CpModel.java:51
An integer variable.
Definition: java/com/google/ortools/sat/IntVar.java:21
A linear expression interface that can be parsed.
Definition: ScalProd.java:17
A linear expression interface that can be parsed.
Definition: SumOfVariables.java:17
A linear expression interface that can be parsed.
Definition: LinearExpr.java:17
static LinearExpr affine(Literal lit, long coefficient, long offset)
Creates an affine expression (lit * coefficient + offset).
Definition: LinearExpr.java:98
static LinearExpr booleanSum(Literal[] literals)
Creates a sum expression.
Definition: LinearExpr.java:36
long getCoefficient(int index)
Returns the ith coefficient.
int numElements()
Returns the number of elements in the interface.
static LinearExpr term(Literal lit, long coefficient)
Creates a linear term (lit * coefficient).
Definition: LinearExpr.java:88
long getOffset()
Returns the constant part of the expression.
static LinearExpr booleanScalProd(Literal[] literals, int[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:70
static LinearExpr constant(long value)
Creates an constant expression.
Definition: LinearExpr.java:103
static LinearExpr affine(IntVar variable, long coefficient, long offset)
Creates an affine expression (var * coefficient + offset).
Definition: LinearExpr.java:93
static LinearExpr booleanScalProd(Literal[] literals, long[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:62
static LinearExpr term(IntVar variable, long coefficient)
Creates a linear term (var * coefficient).
Definition: LinearExpr.java:83
static LinearExpr scalProd(IntVar[] variables, int[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:50
static LinearExpr scalProd(IntVar[] variables, long[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:42
Interface to describe a boolean variable or its negation.
Definition: Literal.java:17