Class AffineExpression

  • All Implemented Interfaces:
    LinearArgument, LinearExpr

    public final class AffineExpression
    extends java.lang.Object
    implements LinearExpr
    A specialized linear expression: a * x + b
    • Constructor Summary

      Constructors 
      Constructor Description
      AffineExpression​(int varIndex, long coefficient, long offset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LinearExpr build()
      Builds a linear expression.
      long getCoefficient​(int index)
      Returns the ith coefficient.
      long getOffset()
      Returns the constant part of the expression.
      int getVariableIndex​(int index)
      Returns the index of the ith variable.
      int numElements()
      Returns the number of terms (excluding the constant one) in this expression.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AffineExpression

        public AffineExpression​(int varIndex,
                                long coefficient,
                                long offset)
    • Method Detail

      • numElements

        public int numElements()
        Description copied from interface: LinearExpr
        Returns the number of terms (excluding the constant one) in this expression.
        Specified by:
        numElements in interface LinearExpr
      • getVariableIndex

        public int getVariableIndex​(int index)
        Description copied from interface: LinearExpr
        Returns the index of the ith variable.
        Specified by:
        getVariableIndex in interface LinearExpr
      • getCoefficient

        public long getCoefficient​(int index)
        Description copied from interface: LinearExpr
        Returns the ith coefficient.
        Specified by:
        getCoefficient in interface LinearExpr
      • getOffset

        public long getOffset()
        Description copied from interface: LinearExpr
        Returns the constant part of the expression.
        Specified by:
        getOffset in interface LinearExpr