NO FRAMES

Class IloConstraint

Definition file: ilconcert/iloexpression.h
An instance of this class is a constraint in a model.

An instance of this class is a constraint in a model. To create a constraint, you can:

 IloAllDiff allDiff(env, vars); 
 IloOr myOr = myConstraint1 || myConstraint2; 
 IloRange rng = ( x + 3*y <= 7 ); 

After you create a constraint, you must explicitly add it to the model in order for it to be taken into account. To do so, use the member function IloModel::add or the template IloAdd. Then 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:

Constructor Summary
public IloConstraint()
public IloConstraint(IloConstraintI * impl)
Method Summary
public IloConstraintI *getImpl() const
Inherited Methods from IloIntExprArg
getImpl
Inherited Methods from IloNumExprArg
getImpl
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject
Constructor Detail

IloConstraint

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

IloConstraint

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

Method Detail

getImpl

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