GenerateData( )
{
// Init objects
- this->_ConfigureOutputs( TOutputValue( 0 ) );
+ this->_ConfigureOutputs( std::numeric_limits< TOutputValue >::max( ) );
this->_InitMarks( this->GetNumberOfSeeds( ) );
TMST* mst = this->GetMinimumSpanningTree( );
// Init queue
std::vector< _TNode > q;
unsigned long frontId = 1;
- for( TVertex seed: this->GetSeeds( ) )
- q.push_back( _TNode( seed, seed, frontId++ ) );
+ typename TSeedsInterface::TSeeds::const_iterator sIt = this->BeginSeeds( );
+ for( ; sIt != this->EndSeeds( ); ++sIt )
+ q.push_back( _TNode( *sIt, *sIt, frontId++ ) );
// Main loop
while( q.size( ) > 0 )
// Add neighborhood
TVertices neighbors = this->_GetNeighbors( node.Vertex );
- 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
)
+ {
q.clear( );
+ coll = true;
+
+ } // fi
}
else
{
} // fi
} // fi
+ ++neighIt;
- } // rof
+ } // elihw
} // elihw
this->_FreeMarks( );
// Complete data into minimum spanning tree
mst->ClearSeeds( );
mst->SetCollisions( this->m_Collisions );
- for( TVertex seed: this->GetSeeds( ) )
- mst->AddSeed( seed );
+ for( sIt = this->BeginSeeds( ); sIt != this->EndSeeds( ); ++sIt )
+ mst->AddSeed( *sIt );
}
#endif // __fpa__Base__Dijkstra__hxx__