FRAMES NO FRAMES

Class IlcAnyTupleSet

Definition file: ilsolver/ilcany.h
Include file: <ilsolver/ilosolver.h>

A tuple is an ordered set of values represented by an array. A set of tuples is represented by an instance of IlcAnyTupleSet. That is, the elements of a tuple set are tuples. 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, IlcAnyTupleSet 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 IlcAnyTupleSet::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:

Solver 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, Solver manages allocation and de-allocation transparently for you.

See Also:

Constructor Summary
public IlcAnyTupleSet()
public IlcAnyTupleSet(IlcECSetOfSharedTupleI * impl)
public IlcAnyTupleSet(IloSolver solver, IlcInt arity)
Method Summary
public voidadd(IlcAnyArray tuple) const
public voidclose() const
public IlcECSetOfSharedTupleI *getImpl() const
public IlcBoolisClosed() const
public IlcBoolisIn(IlcAnyArray tuple) const
public voidoperator=(const IlcAnyTupleSet & h)
public voidsetBigTuple() const
public voidsetHoloTuple() const
public voidsetSimpleTuple() const
Constructor Detail

IlcAnyTupleSet

public IlcAnyTupleSet()

This constructor creates an empty handle. You must initialize it before you use it.


IlcAnyTupleSet

public IlcAnyTupleSet(IlcECSetOfSharedTupleI * impl)

This constructor creates a handle object from a pointer to an implementation object.


IlcAnyTupleSet

public IlcAnyTupleSet(IloSolver solver, IlcInt arity)

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


Method Detail

add

public void add(IlcAnyArray tuple) const

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. Solver will throw an exception (an instance of IloSolver::SolverErrorException) if the set has already been closed. Solver also will throw an exception if the size of the array is not equal to the arity of the invoking set.


close

public void close() const

This member function closes the invoking set. That is, it states that all the tuples in the set are known so efficient data structures can be defined and exploited.


getImpl

public IlcECSetOfSharedTupleI * getImpl() const
This constructor creates an object by copying another one.

This member function returns a pointer to the implementation object of the invoking handle.


isClosed

public IlcBool isClosed() const

This member function returns IlcTrue if the invoking set has been closed. Otherwise, it returns IlcFalse.


isIn

public IlcBool isIn(IlcAnyArray tuple) const

This member function returns IlcTrue if tuple belongs to the invoking set. Otherwise, it returns IlcFalse. Solver will throw an exception (an instance of IloSolver::SolverErrorException) if the set has not yet been closed. Solver will also throw an exception if the size of the array is not equal to the arity of the invoking set.


operator=

public void operator=(const IlcAnyTupleSet & h)

This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.


setBigTuple

public void setBigTuple() const

This member function states that the tuples in the set will be compile in a specific data structure. It must be called before close().


setHoloTuple

public void setHoloTuple() const

This member function states that the tuples in the set will be compile in a specific data structure. It must be called before close().


setSimpleTuple

public void setSimpleTuple() const

This member function states that the tuples in the set will be compile in a specific data structure (the one by default). It must be called before close().