FRAMES NO FRAMES

Class IlcIntVarDeltaIterator

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

An instance of the class IlcIntVarDeltaIterator is an iterator that traverses the values belonging to the domain-delta of a constrained integer variable (that is, an instance of IlcIntVar).

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

See Also:

Constructor and Destructor Summary
public IlcIntVarDeltaIterator(const IlcIntVar var)
Method Summary
public IlcBoolok() const
public IlcIntoperator*() const
public IlcIntVarDeltaIterator &operator++()
Constructor and Destructor Detail

IlcIntVarDeltaIterator

public IlcIntVarDeltaIterator(const IlcIntVar 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 iterator points to it. Otherwise, it returns IlcFalse.

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

 IlcInt val;
 for (IlcIntVarDeltaIterator iter(var); iter.ok(); ++iter){
         val = *iter;
         // do something with val
 }

operator*

public IlcInt operator*() const

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


operator++

public IlcIntVarDeltaIterator & operator++()

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