Class DoubleLinearExpr
java.lang.Object
com.google.ortools.sat.DoubleLinearExpr
A linear expression interface that can be parsed.
-
Constructor Summary
ConstructorsConstructorDescriptionDoubleLinearExpr
(IntVar[] vars, double offset) DoubleLinearExpr
(IntVar[] variables, double[] coefficients, double offset) DoubleLinearExpr
(IntVar var, double coefficient, double offset) DoubleLinearExpr
(Literal[] literals, double offset) DoubleLinearExpr
(Literal[] literals, double[] coefficients, double offset) DoubleLinearExpr
(Literal lit, double coefficient, double offset) -
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleLinearExpr
Creates an affine expression (var * coefficient + offset).static DoubleLinearExpr
Creates an affine expression (lit * coefficient + offset).static DoubleLinearExpr
constant
(double value) Creates a constant expression.double
getCoefficient
(int index) Returns the ith coefficient.double
Returns the constant part of the expression.int
getVariableIndex
(int index) Returns the ith variable.int
Returns the number of elements in the interface.static DoubleLinearExpr
Creates a sum expression.static DoubleLinearExpr
Creates a sum expression.static DoubleLinearExpr
sumWithOffset
(IntVar[] variables, double offset) Creates a sum expression with a double offset.static DoubleLinearExpr
sumWithOffset
(Literal[] literals, double offset) Creates a sum expression with a double offset.static DoubleLinearExpr
Creates a linear term (var * coefficient).static DoubleLinearExpr
Creates a linear term (lit * coefficient).static DoubleLinearExpr
weightedSum
(IntVar[] variables, double[] coefficients) Creates a scalar product.static DoubleLinearExpr
weightedSum
(Literal[] literals, double[] coefficients) Creates a scalar product.static DoubleLinearExpr
weightedSumWithOffset
(IntVar[] variables, double[] coefficients, double offset) Creates a scalar product.static DoubleLinearExpr
weightedSumWithOffset
(Literal[] literals, double[] coefficients, double offset) Creates a scalar product with a double offset.
-
Constructor Details
-
DoubleLinearExpr
-
DoubleLinearExpr
-
DoubleLinearExpr
-
DoubleLinearExpr
-
DoubleLinearExpr
-
DoubleLinearExpr
-
-
Method Details
-
sum
Creates a sum expression. -
sum
Creates a sum expression. -
sumWithOffset
Creates a sum expression with a double offset. -
sumWithOffset
Creates a sum expression with a double offset. -
weightedSum
Creates a scalar product. -
weightedSum
Creates a scalar product. -
weightedSumWithOffset
public static DoubleLinearExpr weightedSumWithOffset(IntVar[] variables, double[] coefficients, double offset) Creates a scalar product. -
weightedSumWithOffset
public static DoubleLinearExpr weightedSumWithOffset(Literal[] literals, double[] coefficients, double offset) Creates a scalar product with a double offset. -
term
Creates a linear term (var * coefficient). -
term
Creates a linear term (lit * coefficient). -
affine
Creates an affine expression (var * coefficient + offset). -
affine
Creates an affine expression (lit * coefficient + offset). -
constant
Creates a constant expression. -
numElements
public int numElements()Returns the number of elements in the interface. -
getVariableIndex
public int getVariableIndex(int index) Returns the ith variable. -
getCoefficient
public double getCoefficient(int index) Returns the ith coefficient. -
getOffset
public double getOffset()Returns the constant part of the expression.
-