typedef std::pair< TVertex, unsigned long > _TNode;
std::queue< _TNode > q;
unsigned long frontId = 1;
- for( TVertex seed: this->GetSeeds( ) )
- q.push( _TNode( seed, frontId++ ) );
+ typename TSeedsInterface::TSeeds::const_iterator sIt = this->BeginSeeds( );
+ for( ; sIt != this->EndSeeds( ); ++sIt )
+ q.push( _TNode( *sIt, frontId++ ) );
// Main loop
while( q.size( ) > 0 )
// Add neighborhood
TVertices neighbors = this->_GetNeighbors( node.first );
- for( TVertex neigh: neighbors )
+ typename TVertices::const_iterator neighIt = neighbors.begin( );
+ bool coll = false;
+ while( neighIt != neighbors.end( ) && !coll )
{
+ TVertex neigh = *neighIt;
if( this->_IsMarked( neigh ) )
{
// Invoke stop at collisions
this->GetNumberOfSeeds( ) > 1 &&
nColl == 1
)
+ {
while( q.size( ) > 0 )
q.pop( );
+ coll = true;
+
+ } // fi
}
else
q.push( _TNode( neigh, node.second ) );
+ ++neighIt;
- } // rof
+ } // elihw
} // elihw
this->_FreeMarks( );