Skip to main content
FRAMES NO FRAMES

Class IloIfThen

Definition file: ilconcert/ilomodel.h
Map of IloIfThenIloIfThenIloIfThenIloConstraintIloIntExprArgIloNumExprArgIloExtractable
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:

Method Summary
public IloIfThenI *getImpl() const
public IloIfThen()
public IloIfThen(IloIfThenI * impl)
public IloIfThen(const IloEnv env, const IloConstraint left, const IloConstraint right, const char * name=0)
Inherited Methods from IloConstraint
getImpl, IloConstraint, IloConstraint
Inherited Methods from IloIntExprArg
getImpl, IloIntExprArg, IloIntExprArg
Inherited Methods from IloNumExprArg
getImpl, IloNumExprArg, IloNumExprArg
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, IloExtractable, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, removeFromAll, setLocation, setName, setObject
Method Detail

IloIfThen

public IloIfThen()
This constructor creates an empty handle. You must initialize it before you use it.

IloIfThen

public IloIfThen(IloIfThenI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloIfThen

public IloIfThen(const IloEnv env, const IloConstraint left, const IloConstraint right, const char * name=0)

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.


getImpl

public IloIfThenI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.