NO FRAMES

Class IloIntTupleSet

Definition file: ilconcert/ilotupleset.h
Ordered set of values represented by an array.

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:

Concert Technology will throw an exception if you attempt:

See Also:

Constructor Summary
public IloIntTupleSet(const IloEnv env, const IloInt arity)
Method Summary
public IloBooladd(const IloIntArray tuple) const
public voidend()
public IloIntgetArity() const
public IloIntgetCardinality() const
public IloIntTupleSetI *getImpl() const
public IloBoolisIn(const IloIntArray tuple) const
public IloBoolremove(const IloIntArray tuple) const
Constructor Detail

IloIntTupleSet

public IloIntTupleSet(const IloEnv env, const IloInt arity)

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


Method Detail

add

public IloBool add(const IloIntArray 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. 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 ILOG CP Optimizer Reference Manual and the ILOG Solver Reference Manual.


end

public void end()

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.


getArity

public IloInt getArity() const

This member function returns the arity of the tupleset.


getCardinality

public IloInt getCardinality() const

This member function returns the cardinality of the tupleset.


getImpl

public IloIntTupleSetI * getImpl() const

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.


isIn

public IloBool isIn(const IloIntArray tuple) const

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 IloIntArray tuple) const

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.