|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface of 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:
for expr == rhs
set lb = ub = rhs
,
for expr <= rhs set lb = -infinity
and ub = rhs
,
and for 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 be expressed as well.
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 . |
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(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
public double getUB() throws IloException
public void setLB(double lb) throws IloException
lb
- The new lower bound of the ranged constraints.public void setUB(double ub) throws IloException
ub
- The new upper bound of the ranged constraints.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.public IloNumExpr getExpr() throws IloException
IloRange
object.public void setExpr(IloNumExpr expr) throws IloException
IloRange
object to
expr
.expr
- The new expression of the ranged constraint.public void clearExpr() throws IloException
0
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |