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 IloAnyTupleSet
. 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, IloAnyTupleSet
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 IloAnyTupleSet::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:
IloAnyTupleSet::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 (an instance of
IloSolver::SolverErrorException
) if you attempt:
You do not have to worry about memory allocation. If you respect these conventions, Concert Technology manages allocation and de-allocation transparently for you.
See Also the class IlcIntTupleSet
in the
IBM ILOG CP Optimizer Reference Manual and the IBM ILOG Solver Reference
Manual.
See Also:
IloAnyTupleSetIterator, IloTableConstraint, IloExtractable
Constructor Summary | |
---|---|
public | IloAnyTupleSet(const IloEnv env, const IloInt arity) |
Method Summary | |
---|---|
public IloBool | add(const IloAnyArray tuple) const |
public IloInt | getArity() const |
public IloAnyTupleSetI * | getImpl() const |
public IloBool | isIn(const IloAnyArray tuple) const |
public IloBool | remove(const IloAnyArray tuple) const |
Constructor Detail |
---|
This constructor creates a set of tuples (an instance of the class
IloAnyTupleSet
) 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 returns the arity 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. For
those purposes, see IlcIntTupleSet
documented in the IBM ILOG CP Optimizer
Reference Manual and the IBM ILOG Solver Reference Manual.