| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

An instance of IloInverse represents an inverse constraint.
Informally, we say that an inverse constraint works on two arrays,
say, f and
invf, so that an element of f composed with the
corresponding element of invf produces the index of
that element.
In formal terms, if the length of the arrays f
and invf is n, then the inverse
constraint makes sure that:
i in the interval [0, n-1],
invf[f[i]] == i;j in the interval [0, n-1],
f[invf[j]] == j.
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.
Note: This constraint cannot be used in a logical constraint.
See Also:
| Method Summary | |
|---|---|
public IloInverseI * | getImpl() const |
public | IloInverse() |
public | IloInverse(IloInverseI * impl) |
public | IloInverse(const IloEnv env, const IloIntExprArray f, const IloIntExprArray invf, 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 |
|---|
This constructor creates an inverse constraint that if the length of the arrays f
and invf is n, then this function returns a
constraint that ensures that:
i in the interval [0, n-1],
invf[f[i]] == i;j in the interval [0, n-1],
f[invf[j]] == j.