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 may 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:
IlcAnyTupleSet documented in the ILOG Solver Reference Manual , IloAnyTupleSetIterator, IloTableConstraint, IloExtractable
Constructor Summary | |
---|---|
public | IloAnyTupleSet() |
public | IloAnyTupleSet(IloAnyTupleSet::ImplClass *) |
public | IloAnyTupleSet(const IloEnv, const IloInt) |
Method Summary | |
---|---|
public IloBool | add(const IloAnyArray) |
public IloAnyTupleSet::ImplClass * | getImpl() |
public IloBool | isIn(const IloAnyArray) |
public IloBool | remove(const IloAnyArray) |
Inherited Methods from IloExtractable |
---|
end, getEnv, getId, getImpl, getName, getObject, setName, setObject |
Constructor Detail |
---|
This constructor creates a set of tuples (an instance of the class IloAnyTupleSet
)
with the arity indicated 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 IlcAnyTupleSet
, documented in the ILOG Solver Reference
Manual.
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 IlcAnyTupleSet
documented in the ILOG Solver Reference
Manual.