NO FRAMES

Class IloAnyTupleSet

Definition file: ilconcert/ilotupleset.h
A class to represent set of enumerated tuples in a model.

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:

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:

Constructor Summary
public IloAnyTupleSet()
public IloAnyTupleSet(IloAnyTupleSet::ImplClass *)
public IloAnyTupleSet(const IloEnv, const IloInt)
Method Summary
public IloBooladd(const IloAnyArray)
public IloAnyTupleSet::ImplClass *getImpl()
public IloBoolisIn(const IloAnyArray)
public IloBoolremove(const IloAnyArray)
Inherited Methods from IloExtractable
end, getEnv, getId, getImpl, getName, getObject, setName, setObject
Constructor Detail

IloAnyTupleSet

public IloAnyTupleSet()
This constructor creates an empty handle. You must initialize it before you use it.

IloAnyTupleSet

public IloAnyTupleSet(IloAnyTupleSet::ImplClass * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloAnyTupleSet

public IloAnyTupleSet(const IloEnv env, const IloInt arity)

This constructor creates a set of tuples (an instance of the class IloAnyTupleSet) with the arity indicated by arity.


Method Detail

add

public IloBool add(const IloAnyArray tuple)

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.


getImpl

public IloAnyTupleSet::ImplClass * getImpl()
This member function returns a pointer to the implementation object of the invoking handle.

isIn

public IloBool isIn(const IloAnyArray tuple)

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.


remove

public IloBool remove(const IloAnyArray tuple)

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.