public class LinearConstraint extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LinearConstraint.EnumSense
Represents the equation sense.
|
Constructor and Description |
---|
LinearConstraint(double[] coef,
LinearConstraint.EnumSense sense,
double rhs)
Construct a linear constraint, with empty name.
|
LinearConstraint(double[] coef,
LinearConstraint.EnumSense sense,
double rhs,
String name)
Constructs a linear constraint.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getCoef()
Returns the coefficient vector; not deep copy.
|
String |
getName()
Get the name of this constraint.
|
double |
getRhs()
Returns the right hand side of this equation.
|
LinearConstraint.EnumSense |
getSense()
Returns the sign of this equation.
|
void |
setCoef(double[] coef)
Sets the coefficient of each variable in this problem for this equation.
|
void |
setName(String name)
Set the name of this constraint.
|
void |
setRhs(double rhs)
Sets the right hand side (rhs) of this equation.
|
void |
setSense(LinearConstraint.EnumSense s)
Sets the sign of the equation.
|
public LinearConstraint(double[] coef, LinearConstraint.EnumSense sense, double rhs)
coef
- the coefficient of each variable in the problem for this constraintsense
- the sense of this constraintrhs
- the right hand side constant valuepublic LinearConstraint(double[] coef, LinearConstraint.EnumSense sense, double rhs, String name)
coef
- the coefficient of each variable in the problem for this constraintsense
- the sense of this constraintrhs
- the right hand side constant valuename
- the name of this constraintpublic final void setCoef(double[] coef)
coef
- the coefficient of each variable in this problem for this equationpublic double[] getCoef()
public void setSense(LinearConstraint.EnumSense s)
s
- the sign of the equationpublic LinearConstraint.EnumSense getSense()
public void setRhs(double rhs)
rhs
- the right hand side to setpublic double getRhs()
public void setName(String name)
name
- the name of the constraintpublic String getName()