Class LinearConstraint


  • public class LinearConstraint
    extends java.lang.Object
    Wrapper around a linear constraint stored in the ModelBuilderHelper instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTerm​(Variable v, double coeff)
      Adds var * coeff to the constraint.
      void clearTerms()
      Clear all terms.
      ModelBuilderHelper getHelper()
      Returns the constraint builder.
      int getIndex()
      Returns the index of the constraint in the model.
      double getLowerBound()
      Returns the lower bound of the constraint.
      java.lang.String getName()
      Returns the name of the constraint given upon creation.
      double getUpperBound()
      Returns the upper bound of the constraint.
      void setCoefficient​(Variable v, double coeff)
      Sets the coefficient of v to coeff, adding or removing a term if needed.
      void setLowerBound​(double lb)
      Returns the lower bound of the constraint.
      void setName​(java.lang.String name)
      Sets the name of the constraint.
      void setUpperBound​(double ub)
      Returns the upper bound of the constraint.
      LinearConstraint withName​(java.lang.String name)
      Inline setter
      • Methods inherited from class java.lang.Object

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

      • getIndex

        public int getIndex()
        Returns the index of the constraint in the model.
      • getLowerBound

        public double getLowerBound()
        Returns the lower bound of the constraint.
      • setLowerBound

        public void setLowerBound​(double lb)
        Returns the lower bound of the constraint.
      • getUpperBound

        public double getUpperBound()
        Returns the upper bound of the constraint.
      • setUpperBound

        public void setUpperBound​(double ub)
        Returns the upper bound of the constraint.
      • getName

        public java.lang.String getName()
        Returns the name of the constraint given upon creation.
      • setName

        public void setName​(java.lang.String name)
        Sets the name of the constraint.
      • addTerm

        public void addTerm​(Variable v,
                            double coeff)
        Adds var * coeff to the constraint.
      • setCoefficient

        public void setCoefficient​(Variable v,
                                   double coeff)
        Sets the coefficient of v to coeff, adding or removing a term if needed.
      • clearTerms

        public void clearTerms()
        Clear all terms.
      • withName

        public LinearConstraint withName​(java.lang.String name)
        Inline setter