Skip to main content
FRAMES NO FRAMES

Class IloTupleSet

Definition file: ilopl/ilotuplecollection.h
Map of IloTupleSetIloTupleSetIloTupleSetIloTupleCollectionIloAnyCollectionIloDiscreteDataCollectionIloDataCollection
This class offers a convenient way to represent a set of columns of different types.

An instance of this class allows you to represent a set of columns of different types in Concert Technology.

Method Summary
public IloIntcommit(IloTupleBuffer line, IloBool check=IloTrue)
public voiddisplayRow(IloInt i, ostream & out) const
public IloTuplefind(IloTupleBuffer buffer)
public const char *getColumnName(IloIntArray path) const
public const char *getColumnName(IloInt index) const
public IloTupleSetI *getImpl() const
public IloIntgetIndex(IloTuple tuple) const
public IloIntgetLength() const
public const char *getName() const
public IloTupleSchemagetSchema() const
public IloIntgetSize() const
public IloTupleSet(IloTupleSetI * impl)
public IloTupleSet(IloEnv env, IloTupleSchema const & schema)
public IloBoolisIn(IloTupleBuffer buffer)
public IloTupleIterator *iterator()
public IloTuplemakeFirst() const
public IloTuplemakeLast() const
public IloTuplemakeNext(IloTuple value, IloInt n=0) const
public IloTuplemakeNextC(IloTuple value, IloInt n=0) const
public IloTuplemakePrevious(IloTuple value, IloInt n=0) const
public IloTuplemakePreviousC(IloTuple value, IloInt n=0) const
public IloTuplemakeTuple(IloInt index) const
public IloTupleBuffermakeTupleBuffer(IloInt index=-1) const
public voidsetColumnName(IloIntArray path, const char * name)
public voidsetColumnName(IloInt index, const char * name)
public voidsetName(const char * name)
Inherited Methods from IloTupleCollection
getImpl, IloTupleCollection
Inherited Methods from IloDiscreteDataCollection
getImpl, getIndex, getIndex, getIndex, getIndex, getIndex, getSize, IloDiscreteDataCollection, IloDiscreteDataCollection, isOrdered, isReversed, isSorted, iterator
Inherited Methods from IloDataCollection
display, end, getEnv, getName, isIntRange, isIntSet, isNumRange, isNumSet, isSymbolSet, isTupleSet, sort, sort, sort, sort
Method Detail

IloTupleSet

public IloTupleSet(IloTupleSetI * impl)

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

Parameters:

impl
A pointer to the implementation object of this class.

IloTupleSet

public IloTupleSet(IloEnv env, IloTupleSchema const & schema)

This constructor creates a set of tuple based on schema.

Parameters:

env
The environment that this object belongs to.
schema
The tuple set schema.

commit

public IloInt commit(IloTupleBuffer line, IloBool check=IloTrue)

Commits the buffer into the set; that is, it adds a new line if the index is -1, or sets the line otherwise.

Parameters:

line
The values of the tuple.
check
A flag to tell whether we must check for duplicates or not.

Returns:

the index of the tuple when it is committed. If it is a duplicate, the index will be -1.

displayRow

public void displayRow(IloInt i, ostream & out) const

This member function is used to display an indexed row.

Parameters:

i
The index to the row you want to display.
out
The output stream.

find

public IloTuple find(IloTupleBuffer buffer)

This member function checks whether a given IloTupleBuffer object is in the collection. It returns a new tuple if the buffer exists in the collection, otherwise it returns an empty handle.

Parameters:

buffer
The buffer you want to check.

getColumnName

public const char * getColumnName(IloIntArray path) const

This member function returns the name of a column.

Parameters:

path
The path to the column you want the name of.

Returns:

The name of the passed column.

getColumnName

public const char * getColumnName(IloInt index) const

This member function returns the name of a column.

Parameters:

index
The index of the column you want the name of.

Returns:

The name of the indexed column.

getImpl

public IloTupleSetI * getImpl() const

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.

Returns:

A pointer to the implementation object of the invoking object.

getIndex

public IloInt getIndex(IloTuple tuple) const

This member function checks whether a given IloTuple is in the collection. It will return the index if the tuple exists or -1 if the tuple does not exist in the index. You can give the whole values or only the key values in a buffer instance of the tuple, or a tuple from another collection.

Parameters:

tuple
The tuple you want to check.

getLength

public IloInt getLength() const

This member function returns the number of columns.

Returns:

The number of columns.

getName

public const char * getName() const

This member function used to retrieve the name of the tupleset.

Returns:

The name of the object.

getSchema

public IloTupleSchema getSchema() const

This member function returns the schema of the tupleset.

Returns:

The schema of the object.

getSize

public IloInt getSize() const

This member function returns the number of lines.

Returns:

The number of lines.

isIn

public IloBool isIn(IloTupleBuffer buffer)

This member function checks whether a given IloTupleBuffer object is in the collection. You can give the whole values or only the key values.

Parameters:

buffer
The buffer you want to check.

iterator

public IloTupleIterator * iterator()

Returns an iterator on the IloTupleSet.


makeFirst

public IloTuple makeFirst() const

Creates the first tuple.

Returns:

Returns the first tuple of the collection.

makeLast

public IloTuple makeLast() const

Creates the last tuple.

Returns:

Returns the last tuple of the collection.

makeNext

public IloTuple makeNext(IloTuple value, IloInt n=0) const

Creates the next tuple. Returns the item in the collection that comes after value and produces an execution error if item is the last item.

For this TupleSet:

 (< a,b >, < a,c >, < a,d >, < a,e >, < a,f >)
 

makeNext( < a,e > ) returns < a,e > and makeNext( < a,e >, 1 ) returns < a,f > and makeNext( < a,e >, 3 ) returns an execution error.

Parameters:

value
The element in the set.
n
The offset to apply for the computation. An offset of 0 returns the same object.

makeNextC

public IloTuple makeNextC(IloTuple value, IloInt n=0) const

A circular version of next. Creates the next tuple. Returns the item in the collection that comes after value

For this TupleSet:

 ( <a,b> <a,c> <a,d> <a,e> <a,f> )
 

makeNextC( <a,e> ) returns <a,e> and makeNextC( <a,e> 1 ) returns <a,f> and makeNextC( <a,e> 3 ) returns <a,c> .

Parameters:

value
The element in the set.
n
The offset to apply for the computation. An offset of 0 returns the same object.

makePrevious

public IloTuple makePrevious(IloTuple value, IloInt n=0) const

Creates the previous tuple. Returns the item in the collection that comes before value and produces an execution error if item is the last item.

For this TupleSet:

 ( <a,b> <a,c> <a,d> <a,e> <a,f> )
 

makePrevious( <a,e> ) returns <a,e> and makePrevious( <a,e> 1 ) returns <a,d> and makePrevious( <a,e> 5 ) returns execution error.

Parameters:

value
The element in the set.
n
The offset to apply for the computation. An offset of 0 returns the same object.

makePreviousC

public IloTuple makePreviousC(IloTuple value, IloInt n=0) const

A circular version of previous. Creates the previous tuple. Returns the item in the collection that comes before value

For this TupleSet:

 ( <a,b> <a,c> <a,d> <a,e> <a,f> )
 

makePreviousC( <a,e> ) returns <a,e> and makePreviousC( <a,e> 1 ) returns <a,d> and makePreviousC( <a,e> 4 ) returns <a,f>.

Parameters:

value
The element in the set.
n
The offset to apply for the computation. An offset of 0 returns the same object.

makeTuple

public IloTuple makeTuple(IloInt index) const

This member function is used to return an indexed tuple.

Parameters:

index
The index of the tuple you want to point to.

Returns:

The tuple pointed to by the index.

makeTupleBuffer

public IloTupleBuffer makeTupleBuffer(IloInt index=-1) const

Edits the tuple to modify it, or create a new tuple.

Parameters:

index
The index of the tuple you want to edit; (index == -1) adds a new line.

Returns:

The tuple pointed to by the index.

setColumnName

public void setColumnName(IloIntArray path, const char * name)

This member function is used to set the name of a column.

Parameters:

path
The path to the column you want to set the name of.

setColumnName

public void setColumnName(IloInt index, const char * name)

This member function is used to set the name of a column.

Parameters:

index
The index of the column you want to set the name of.

setName

public void setName(const char * name)

This member function is used to set the name of the tupleset.

Parameters:

name
The name to be assigned to the tupleset.