FRAMES NO FRAMES

Class IlcAnyVarDeltaIterator

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

An instance of the class IlcAnyVarDeltaIterator is an iterator that traverses the values belonging to the domain-delta of a constrained enumerated variable (that is, an instance of IlcAnyVar).

For more information, see the concepts Propagation, Iterator, and Domain-Delta.

See Also:

Constructor and Destructor Summary
public IlcAnyVarDeltaIterator(const IlcAnyVar var)
Method Summary
public IlcBoolok() const
public IlcAnyoperator*() const
public IlcAnyVarDeltaIterator &operator++()
Inherited Methods from IlcIntVarDeltaIterator
ok, operator*, operator++
Constructor and Destructor Detail

IlcAnyVarDeltaIterator

public IlcAnyVarDeltaIterator(const IlcAnyVar var)

This constructor creates an iterator associated with var to traverse the values belonging to the domain-delta of var.


Method Detail

ok

public IlcBool ok() const

This member function returns IlcTrue if there is a current element and the invoking iterator points to it. Otherwise, it returns IlcFalse.

To traverse the values belonging to the domain-delta of a constrained enumerated variable, use the following code:

 IlcAny val;
 for(IlcAnyVarDeltaIterator iter(set); iter.ok(); ++iter){
	       val = *iter;
	       // do something with val
 }
 

operator*

public IlcAny operator*() const

This operator returns the current element, the one to which the invoking iterator points.


operator++

public IlcAnyVarDeltaIterator & operator++()

This operator advances the iterator to point to the next value in the domain-delta of the constrained enumerated variable.