Class LinearConstraint
java.lang.Object
com.google.ortools.modelbuilder.LinearConstraint
Wrapper around a linear constraint stored in the ModelBuilderHelper instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds var * coeff to the constraint.void
Clear all terms.Returns the constraint builder.int
getIndex()
Returns the index of the constraint in the model.double
Returns the lower bound of the constraint.getName()
Returns the name of the constraint given upon creation.double
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
Sets the name of the constraint.void
setUpperBound
(double ub) Returns the upper bound of the constraint.Inline setter
-
Constructor Details
-
LinearConstraint
-
-
Method Details
-
getIndex
public int getIndex()Returns the index of the constraint in the model. -
getHelper
Returns the constraint builder. -
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
Returns the name of the constraint given upon creation. -
setName
Sets the name of the constraint. -
addTerm
Adds var * coeff to the constraint. -
setCoefficient
Sets the coefficient of v to coeff, adding or removing a term if needed. -
clearTerms
public void clearTerms()Clear all terms. -
withName
Inline setter
-