|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface for modeling objects representing ranged
constraints of the format lb <= expr <= ub
.
lb
and ub
are double values, referred
to as the lower bound and upper bound of the ranged constraint,
and expr
is an expression. Values +- infinity
can be used as bounds. This allows you to use IloRange
objects to represent more commonly used constraints:
expr == rhs
, set lb = ub = rhs
expr <= rhs
, set lb = -infinity
and
ub = rhs
expr >= rhs
, set lb = rhs
and
ub = infinity
Through the selection of lb
and ub
, constraints
usually written as expr ~ rhs
with ~
in
<=, >=,
or ==
can also be expressed.
IloRange
objects
can be constructed using a variety of methods
defined for IloModeler: addRange(), addEq(), addLe(), addGe(),
range(), eq(), le()
, and ge()
. The methods of
IloRange
allow you to query the expressions and bounds of a
ranged constraint and to change its bounds or replace the expression. In
addition to this, the CPLEX methods
IloMPModeler.setLinearCoef()
and
IloMPModeler.setLinearCoefs()
allow you to edit the constraint
expression for the special case of a linear expression, as supported by
IloMPModeler
. IloMPModeler
is available to users
of ILOG CPLEX.
IloModeler.addRange(double, IloNumExpr, double)
,
IloModeler.addEq(IloNumExpr, double)
,
IloModeler.addGe(IloNumExpr, double)
,
IloModeler.addLe(IloNumExpr, double)
Method Summary | |
void |
clearExpr()
Sets the expression of the ranged constraint to 0 . |
ilog.concert.IloNumExpr |
getExpr()
Queries the expression of the invoking IloRange object. |
double |
getLB()
Queries the lower bound of the ranged constraints. |
double |
getUB()
Queries the upper bound of the ranged constraints. |
void |
setBounds(double lb,
double ub)
Sets the lower and upper bound of the ranged constraints. |
void |
setExpr(ilog.concert.IloNumExpr expr)
Sets the expression of the invoking IloRange object to
expr . |
void |
setLB(double lb)
Sets the lower bound of the ranged constraints. |
void |
setUB(double ub)
Sets the upper bound of the ranged constraints. |
Methods inherited from interface ilog.concert.IloAddable |
getName, setName |
Method Detail |
public double getLB() throws IloException
IloException
public double getUB() throws IloException
IloException
public void setLB(double lb) throws IloException
lb
- The new lower bound of the ranged constraints.
IloException
public void setUB(double ub) throws IloException
ub
- The new upper bound of the ranged constraints.
IloException
public void setBounds(double lb, double ub) throws IloException
lb
- The new lower bound of the ranged constraints.ub
- The new upper bound of the ranged constraints.
IloException
public ilog.concert.IloNumExpr getExpr() throws IloException
IloRange
object.
IloException
public void setExpr(ilog.concert.IloNumExpr expr) throws IloException
IloRange
object to
expr
.
expr
- The new expression of the ranged constraint.
IloException
public void clearExpr() throws IloException
0
.
IloException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |