Skip to main content
FRAMES NO FRAMES

Class IlcIntVarDeltaIterator

Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Map of IlcIntVarDeltaIteratorIlcIntVarDeltaIteratorIlcIntVarDeltaIterator
The iterator class for delta-domain of integer variables.

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 in CP Optimizer, Domain-delta in CP Optimizer and Iterator.

See Also:

Method Summary
public IlcIntVarDeltaIterator(const IlcIntVar var)
public IlcBoolok() const
public IlcIntoperator*() const
public IlcIntVarDeltaIterator &operator++()
Method 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.


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:

 for (IlcIntVarDeltaIterator iter(var); iter.ok(); ++iter) {
   IlcInt 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.