Overview | Group | Tree | Graph | Index | Concepts |
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.)
As a handle class, 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 member function 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:
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:
See Also:
IloIntTupleSetIterator, IloExtractable
Constructor Summary | |
---|---|
public | IloIntTupleSet(const IloEnv env, const IloInt arity) |
Method Summary | |
---|---|
public IloBool | add(const IloIntArray tuple) const |
public void | end() |
public IloInt | getArity() const |
public IloInt | getCardinality() const |
public IloIntTupleSetI * | getImpl() const |
public IloBool | isIn(const IloIntArray tuple) const |
public IloBool | remove(const IloIntArray tuple) const |
Constructor Detail |
---|
This constructor creates a set of tuples (an instance of the class
IloIntTupleSet
)
with the arity specified by arity
.
Method Detail |
---|
This member function adds a tuple represented by the array tuple
to the
invoking set. If you attempt to add an element that is already in the set,
that element will not be added again.
Added elements are not copied; that is, there is no
memory duplication. Concert Technology will throw an exception
if the size of the array
is not equal to the arity of the invoking set.
You may use this member function to add
tuples to the invoking set in a model;
you may not add tuples in this way during a search,
inside a constraint, or inside a goal.
For those purposes, see IlcIntTupleSet
,
documented in the IBM ILOG CP Optimizer Reference Manual and the
IBM ILOG Solver Reference Manual.
This member function deletes the invoking set. That is, it frees all the resources used by the invoking object. After a call to this member function, you cannot use the invoking extractable object again.
This member function returns the arity of the tupleset.
This member function returns the cardinality of the tupleset.
This member function returns a pointer to the implementation object of the invoking extractable object. This member function is useful when you need to be sure that you are using the same copy of the invoking extractable object in more than one situation.
This member function returns IloTrue
if tuple
belongs to the
invoking set. Otherwise, it returns IloFalse
. Concert Technology will throw
an exception if the size of the array is not equal to the arity of the invoking set.
This member function removes tuple
from the invoking set in a model. You
may use this member function to remove tuples from the invoking set in a model; you may
not remove tuples in this way during a search, inside a constraint, or inside a goal.