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 DoubleLinearExprCreates an affine expression (var * coefficient + offset).static DoubleLinearExprCreates an affine expression (lit * coefficient + offset).static DoubleLinearExprconstant(double value) Creates a constant expression.doublegetCoefficient(int index) Returns the ith coefficient.doubleReturns the constant part of the expression.intgetVariableIndex(int index) Returns the ith variable.intReturns the number of elements in the interface.static DoubleLinearExprCreates a sum expression.static DoubleLinearExprCreates a sum expression.static DoubleLinearExprsumWithOffset(IntVar[] variables, double offset) Creates a sum expression with a double offset.static DoubleLinearExprsumWithOffset(Literal[] literals, double offset) Creates a sum expression with a double offset.static DoubleLinearExprCreates a linear term (var * coefficient).static DoubleLinearExprCreates a linear term (lit * coefficient).static DoubleLinearExprweightedSum(IntVar[] variables, double[] coefficients) Creates a scalar product.static DoubleLinearExprweightedSum(Literal[] literals, double[] coefficients) Creates a scalar product.static DoubleLinearExprweightedSumWithOffset(IntVar[] variables, double[] coefficients, double offset) Creates a scalar product.static DoubleLinearExprweightedSumWithOffset(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.
-