Overview | Group | Tree | Graph | Index | Concepts |
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 IloIntVar
or one of its subclasses) that have appeared as
an argument 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 IloCP
or IloSolver
,
that extracts that constraint.
IloCplex
does not extract instances
of IloAllDiff
.
See Also:
IloAdd, IloConstraint, IloDiff
Constructor Summary | |
---|---|
public | IloAllDiff() |
public | IloAllDiff(IloAllDiffI * impl) |
public | IloAllDiff(const IloEnv env, const IloIntVarArray vars, const char * name=0) |
Method Summary | |
---|---|
public IloAllDiffI * | getImpl() const |
Inherited Methods from IloConstraint |
---|
getImpl |
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 |
---|
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 |
---|