An ordered set of values represented by an array.
A tuple is an ordered set of values represented by an array. A set of enumerated
tuples in a model is represented by an instance of
IloIntTupleSet. That is, the
elements of a tuple set are tuples of enumerated values (such as pointers). The
number of values in a tuple is known as the arity of the tuple, and the arity of
the tuples in a set is called the arity of the set. (In contrast, the number of
tuples in the set is known as the cardinality of the set.)
IloIntTupleSet manages certain set operations efficiently. In particular,
elements can be added to such a set. It is also possible to search a given set with
the method
IloIntTupleSet.isIn to see whether or not the set contains a given element.
In addition, a set of tuples can represent a constraint defined on a constrained variable, either
as the set of allowed combinations of values of the constrained variable on which the constraint
is defined, or as the set of forbidden combinations of values.
There are a few conventions governing tuple sets:
- When you create the set, you must specify the arity of the tuple-elements it contains.
- You use the method
IloIntTupleSet.add to add tuples to the set. You can add tuples to
the set in a model; you cannot add tuples to an instance of this class during a search, nor
inside a constraint, nor inside a goal.
Concert Technology will throw an exception if you attempt:
- to add a tuple with a different number of variables from the arity of the set;
- to search for a tuple with an arity different from the set arity.