NO FRAMES

Class IloAllDiff

Definition file: ilconcert/ilomodel.h
A constraint that forces constrained integer variables to assume different values in a model.

An instance of this class is a constraint that forces constrained integer variables to assume different values from one another in a model. In other words, no two of those integer variables will have the same integer value when this constraint is satisfied.

In order for the 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.

What Is Extracted

All the variables (that is, instances of IloNumVar or one of its subclasses) that have appeared as a parameter of a constructor of IloAllDiff and all variables that have been explicitly added to the instance of IloAllDiff will be extracted by an algorithm (such as an instance of IloSolver, documented in the ILOG Solver Reference Manual) that extracts that constraint.

See Also:

Constructor Summary
public IloAllDiff()
public IloAllDiff(IloAllDiff::ImplClass *)
public IloAllDiff(const IloEnv, const IloIntVarArray, const char *)
Method Summary
public IloAllDiff::ImplClass *getImpl()
Inherited Methods from IloConstraint
getImpl
Inherited Methods from IloIntExprArg
getImpl
Inherited Methods from IloNumExprArg
getImpl
Inherited Methods from IloExtractable
end, getEnv, getId, getImpl, getName, getObject, setName, setObject
Constructor Detail

IloAllDiff

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

IloAllDiff

public IloAllDiff(IloAllDiff::ImplClass * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloAllDiff

public IloAllDiff(const IloEnv env, const IloIntVarArray vars, const char * name)

This constructor creates a constraint that forces all the integer variables in vars to assume different values from each other. If vars is empty, this constructor creates an empty instance of IloAllDiff, and then you must fill the constraint; that is, you must put variables into the array. You must add this constraint to a model and extract the model for an algorithm in order for it to be taken into account.


Method Detail

getImpl

public IloAllDiff::ImplClass * getImpl()
This member function returns a pointer to the implementation object of the invoking handle.