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:53
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:20
static LinearExpr affine(Literal lit, long coefficient, long offset)
Creates an affine expression (lit * coefficient + offset).
Definition: LinearExpr.java:101
static LinearExpr booleanSum(Literal[] literals)
Creates a sum expression.
Definition: LinearExpr.java:39
long getCoefficient(int index)
Returns the ith coefficient.
static LinearExpr rebuildFromLinearExpressionProto(LinearExpressionProto proto, CpModelProto.Builder builder)
Definition: LinearExpr.java:110
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:91
long getOffset()
Returns the constant part of the expression.
static LinearExpr booleanScalProd(Literal[] literals, int[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:73
static LinearExpr constant(long value)
Creates an constant expression.
Definition: LinearExpr.java:106
static LinearExpr affine(IntVar variable, long coefficient, long offset)
Creates an affine expression (var * coefficient + offset).
Definition: LinearExpr.java:96
static LinearExpr booleanScalProd(Literal[] literals, long[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:65
static LinearExpr term(IntVar variable, long coefficient)
Creates a linear term (var * coefficient).
Definition: LinearExpr.java:86
static LinearExpr scalProd(IntVar[] variables, int[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:53
static LinearExpr scalProd(IntVar[] variables, long[] coefficients)
Creates a scalar product.
Definition: LinearExpr.java:45
Interface to describe a boolean variable or its negation.
Definition: Literal.java:17