Package com.google.ortools.sat
Interface LinearExpr
- All Known Implementing Classes:
IntVar,ScalProd,SumOfVariables
public interface LinearExpr
A linear expression interface that can be parsed.
-
Method Summary
Modifier and Type Method Description static LinearExprbooleanScalProd(Literal[] literals, int[] coefficients)Creates a scalar product.static LinearExprbooleanScalProd(Literal[] literals, long[] coefficients)Creates a scalar product.static LinearExprbooleanSum(Literal[] literals)Creates a sum expression.longgetCoefficient(int index)Returns the ith coefficient.longgetOffset()Returns the constant part of the expression.IntVargetVariable(int index)Returns the ith variable.intnumElements()Returns the number of elements in the interface.static LinearExprscalProd(IntVar[] variables, int[] coefficients)Creates a scalar product.static LinearExprscalProd(IntVar[] variables, long[] coefficients)Creates a scalar product.static LinearExprsum(IntVar[] variables)Creates a sum expression.static LinearExprterm(IntVar variable, long coefficient)Creates a linear term (var * coefficient).
-
Method Details
-
numElements
int numElements()Returns the number of elements in the interface. -
getVariable
Returns the ith variable. -
getCoefficient
long getCoefficient(int index)Returns the ith coefficient. -
getOffset
long getOffset()Returns the constant part of the expression. -
sum
Creates a sum expression. -
booleanSum
Creates a sum expression. -
scalProd
Creates a scalar product. -
scalProd
Creates a scalar product. -
booleanScalProd
Creates a scalar product. -
booleanScalProd
Creates a scalar product. -
term
Creates a linear term (var * coefficient).
-