Class IloIfThen
Definition file: ilconcert/ilomodel.h
This class represents a condition constraint.
An instance of IloIfThen
represents a condition constraint. Generally,
a condition constraint is composed of an if part (the conditional statement or left
side) and a then part (the consequence or right side).
In order for a constraint to take effect, you must add it to a model with the
template IloAdd
or the member function
IloModel::add
and extract the model for an algorithm
with the member function IloAlgorithm::extract
.
Most member functions in this class contain assert
statements. For an
explanation of the macro NDEBUG
(a way to turn on or turn off these
assert
statements), see the concept
Assert and NDEBUG.
See Also:
IloConstraint
Method Summary |
---|
public IloIfThenI * | getImpl() const |
Inherited Methods from IloExtractable |
---|
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject |
public IloIfThen()
This constructor creates an empty handle. You must initialize it before you use it.
public IloIfThen(IloIfThenI * impl)
This constructor creates a handle object from a pointer to an implementation object.
This constructor creates a condition constraint in the
environment specified by env
.
The argument left
specifies the if-part of the condition.
The argument right
specifies the then-part of the condition.
The string name
specifies the name of the constraint;
it is 0
(zero) by default. For the constraint
to take effect, you must add it to a model and extract
the model for an algorithm.
public IloIfThenI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.