public class LinearConstraint
extends java.lang.Object
Constructor and Description |
---|
LinearConstraint(ModelBuilderHelper helper) |
Modifier and Type | Method and 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
|
public LinearConstraint(ModelBuilderHelper helper)
public int getIndex()
public ModelBuilderHelper getHelper()
public double getLowerBound()
public void setLowerBound(double lb)
public double getUpperBound()
public void setUpperBound(double ub)
public java.lang.String getName()
public void setName(java.lang.String name)
public void addTerm(Variable v, double coeff)
public void setCoefficient(Variable v, double coeff)
public void clearTerms()
public LinearConstraint withName(java.lang.String name)
Copyright © 2025. All rights reserved.