Overview | Group | Tree | Graph | Index | Concepts |
This function creates and returns an array of constrained variables for use during a
Solver search. The argument vars
should be an array of constrained variables.
The argument values
is an array of integers or pointers. The argument
abstractValue
is a value that must not belong to any of the variables
in vars
and must not appear in values
.
For each vars[i]
, Solver creates a variable corresponding to the
abstraction of vars[i]
with respect to values
. In other words,
for every variable in vars
, vars[i]
, Solver creates a variable
w[i]
such that the domain of w[i]
is equal to the set made up of
the value abstractValue
plus all those values vars[j]
that also
belong to the array values
. Then internally, Solver enforces these conditions:
vars[i]
is one of the values in the array
values
if and only if
w[i] == vars[i]
;
vars[i]
is
not one of the values in the array
values
if and only if
w[i] == abstractValue
.This function makes it easy to define constraints that impinge only on a particular set of values from the domains of constrained variables.
For a function that returns a constraint (rather than an array),
see IlcEqAbstraction
.
For a constraint suitable for use in a model, see IloAbstraction
.
See Also:
IloAbstraction, IlcBoolAbstraction, IlcEqAbstraction