Interface LinearExpr

    • Method Detail

      • numElements

        int numElements()
        Returns the number of terms (excluding the constant one) in this expression.
      • getVariableIndex

        int getVariableIndex​(int index)
        Returns the index of the ith variable.
      • getCoefficient

        double getCoefficient​(int index)
        Returns the ith coefficient.
      • getOffset

        double getOffset()
        Returns the constant part of the expression.
      • constant

        static LinearExpr constant​(double value)
        Shortcut for newBuilder().add(value).build()
      • term

        static LinearExpr term​(LinearArgument expr,
                               double coeff)
        Shortcut for newBuilder().addTerm(expr, coeff).build()
      • affine

        static LinearExpr affine​(LinearArgument expr,
                                 double coeff,
                                 double offset)
        Shortcut for newBuilder().addTerm(expr, coeff).add(offset).build()
      • weightedSum

        static LinearExpr weightedSum​(LinearArgument[] exprs,
                                      double[] coeffs)
        Shortcut for newBuilder().addWeightedSum(exprs, coeffs).build()