FRAMES NO FRAMES

Class IlcFloatSetIterator

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

An instance of the class IlcFloatSetIterator is an iterator that traverses the elements of a finite set of discrete floating-point numbers (instance of IlcFloatSet).

For more information, see the concept Iterator.

See Also:

Constructor Summary
public IlcFloatSetIterator(IlcFloatSet set)
Method Summary
public IlcBoolok() const
public IlcFloatoperator*() const
public IlcFloatSetIterator &operator++()
Constructor Detail

IlcFloatSetIterator

public IlcFloatSetIterator(IlcFloatSet set)

This constructor creates an iterator associated with set to traverse its elements.


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 elements of a finite set of discrete floating-point numbers, use the following code:

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

operator*

public IlcFloat operator*() const

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


operator++

public IlcFloatSetIterator & operator++()

This operator advances the iterator to point to the next value in the set.