FRAMES NO FRAMES

Class IloAnySetVar

Definition file: ilconcert/iloanyset.h
For IBM® ILOG® Solver: a class to represent a set of enumerated values as a constrained variable.

An instance of this class offers a convenient way to represent a set of enumerated values as a constrained variable in Concert Technology.

A constrained variable representing a set of enumerated values (that is, an instance of IloAnySetVar) is defined in terms of two other sets: its required elements and its possible elements. Its required elements are those that must be in the set. Its possible elements are those that may be in the set. This class offers member functions for accessing the required and possible elements of a set of enumerated values.

The function IloCard offers you a way to constrain the number of elements in a set variable. That is, IloCard constrains the cardinality of a set variable.

Most member functions in this class contain assert statements. For an explanation of the macro NDEBUG (a way to turn on or turn off these assert statements), see the concept Assert and NDEBUG.

See Also:

Constructor Summary
public IloAnySetVar()
public IloAnySetVar(IloIntSetVarI * impl)
public IloAnySetVar(const IloEnv env, const IloAnyArray possible, const char * name=0)
public IloAnySetVar(const IloEnv env, const IloAnyArray possible, const IloAnyArray required, const char * name=0)
public IloAnySetVar(const IloAnyCollection possible, const char * name=0)
public IloAnySetVar(const IloAnyCollection possible, const IloAnyCollection required, const char * name=0)
Method Summary
public voidaddPossible(IloAny elt) const
public voidaddRequired(IloAny elt) const
public IloIntSetVarI *getImpl() const
public voidgetPossibleSet(IloAnySet set) const
public IloAnySetgetPossibleSet() const
public IloAnySet::IteratorgetPossibleSetIterator() const
public voidgetRequiredSet(IloAnySet set) const
public IloAnySetgetRequiredSet() const
public IloAnySet::IteratorgetRequiredSetIterator() const
public voidremovePossible(IloAny elt) const
public voidremoveRequired(IloAny elt) const
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject
Constructor Detail

IloAnySetVar

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

IloAnySetVar

public IloAnySetVar(IloIntSetVarI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloAnySetVar

public IloAnySetVar(const IloEnv env, const IloAnyArray possible, const char * name=0)

This constructor creates a constrained set variable from the values in possible and makes the set variable part of the environment specified by env, where the set consists of enumerated values. By default, its name is the empty string, but you can specify a name of your own choice.


IloAnySetVar

public IloAnySetVar(const IloEnv env, const IloAnyArray possible, const IloAnyArray required, const char * name=0)

With this constructor, you can specify both the required and the possible sets that characterize the instance of IloAnySetVar that it creates. By default, its name is the empty string, but you can specify a name of your own choice.


IloAnySetVar

public IloAnySetVar(const IloAnyCollection possible, const char * name=0)

This constructor creates a constrained set variable and makes it part of the environment env, where the set consists of integer values.


IloAnySetVar

public IloAnySetVar(const IloAnyCollection possible, const IloAnyCollection required, const char * name=0)

This constructor creates a constrained set variable and makes it part of the environment env, where the set consists of integer values.


Method Detail

addPossible

public void addPossible(IloAny elt) const

This member function adds elt to the set of possible elements of the invoking set variable.

Note
The member function addPossible notifies Concert Technology algorithms about this change of this invoking object.

addRequired

public void addRequired(IloAny elt) const

This member function adds elt to the set of required elements of the invoking set variable.

Note
The member function addRequired notifies Concert Technology algorithms about this change of this invoking object.

getImpl

public IloIntSetVarI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.

getPossibleSet

public void getPossibleSet(IloAnySet set) const

This member function accesses the possible elements of the invoking set variable and puts those elements into its argument set.


getPossibleSet

public IloAnySet getPossibleSet() const

This member function returns the possible elements of the invoking set variable.


getPossibleSetIterator

public IloAnySet::Iterator getPossibleSetIterator() const

This member function returns an IloAnySet::Iterator to traverse the possible elements of the invoking set variable.


getRequiredSet

public void getRequiredSet(IloAnySet set) const

This member function accesses the required elements of the invoking set variable and puts those elements into its argument set.


getRequiredSet

public IloAnySet getRequiredSet() const

This member function returns the required elements of the invoking set variable.


getRequiredSetIterator

public IloAnySet::Iterator getRequiredSetIterator() const

This member function returns an IloAnySet::Iterator to traverse the required elements of the invoking set variable.


removePossible

public void removePossible(IloAny elt) const

This member function removes elt as a possible element of the invoking set variable.

Note
The member function removePossible notifies Concert Technology algorithms about this change of this invoking object.

removeRequired

public void removeRequired(IloAny elt) const

This member function removes elt as a required element of the invoking set variable.

Note
The member function removeRequired notifies Concert Technology algorithms about this change of this invoking object.