NO FRAMES

Class IloSolution::Iterator

Definition file: ilconcert/ilosolution.h

Iterator is a class nested in the class IloSolution. It allows you to traverse the variables in a solution. The iterator scans the objects in the same order as they were added to the solution.

This iterator is not robust. If the variable at the current position is deleted from the solution being iterated over, the behavior of this iterator afterwards is undefined.

 IloExtractable elem = *iter;

 ++iter;

 solution.remove(elem);
 
 solution.remove(*iter); // bad idea

 ++iter;
 

See Also:

Method Summary
public IloBoolok()
public IloExtractableoperator *()
public Iterator &operator++()
Method Detail

ok

public IloBool ok()

This member function returns IloTrue if the current position of the iterator is a valid one. It returns IloFalse if all variables have been scanned by the iterator.


operator *

public IloExtractable operator *()

This operator returns the extractable object corresponding to the variable located at the current iterator position. If all variables have been scanned, this operator returns an empty handle.


operator++

public Iterator & operator++()

This operator moves the iterator to the next variable in the solution.