Class DoubleLinearExpr

java.lang.Object
com.google.ortools.sat.DoubleLinearExpr

public class DoubleLinearExpr extends Object
A linear expression interface that can be parsed.
  • Constructor Details

    • DoubleLinearExpr

      public DoubleLinearExpr(IntVar[] variables, double[] coefficients, double offset)
    • DoubleLinearExpr

      public DoubleLinearExpr(Literal[] literals, double[] coefficients, double offset)
    • DoubleLinearExpr

      public DoubleLinearExpr(IntVar var, double coefficient, double offset)
    • DoubleLinearExpr

      public DoubleLinearExpr(Literal lit, double coefficient, double offset)
    • DoubleLinearExpr

      public DoubleLinearExpr(IntVar[] vars, double offset)
    • DoubleLinearExpr

      public DoubleLinearExpr(Literal[] literals, double offset)
  • Method Details

    • sum

      public static DoubleLinearExpr sum(IntVar[] variables)
      Creates a sum expression.
    • sum

      public static DoubleLinearExpr sum(Literal[] literals)
      Creates a sum expression.
    • sumWithOffset

      public static DoubleLinearExpr sumWithOffset(IntVar[] variables, double offset)
      Creates a sum expression with a double offset.
    • sumWithOffset

      public static DoubleLinearExpr sumWithOffset(Literal[] literals, double offset)
      Creates a sum expression with a double offset.
    • weightedSum

      public static DoubleLinearExpr weightedSum(IntVar[] variables, double[] coefficients)
      Creates a scalar product.
    • weightedSum

      public static DoubleLinearExpr weightedSum(Literal[] literals, double[] coefficients)
      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

      public static DoubleLinearExpr term(IntVar variable, double coefficient)
      Creates a linear term (var * coefficient).
    • term

      public static DoubleLinearExpr term(Literal lit, double coefficient)
      Creates a linear term (lit * coefficient).
    • affine

      public static DoubleLinearExpr affine(IntVar variable, double coefficient, double offset)
      Creates an affine expression (var * coefficient + offset).
    • affine

      public static DoubleLinearExpr affine(Literal lit, double coefficient, double offset)
      Creates an affine expression (lit * coefficient + offset).
    • constant

      public static DoubleLinearExpr constant(double value)
      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.