]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/DijkstraBase.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / DijkstraBase.hxx
index a78554b82107e7d746954a8132dc86c77b64e317..d04ecf56e7bba0299b5190043b423fbc3f0e232b 100644 (file)
@@ -40,26 +40,13 @@ fpa::Base::DijkstraBase< _TAlgorithm >::
 {
 }
 
-// -------------------------------------------------------------------------
-template< class _TAlgorithm >
-typename fpa::Base::DijkstraBase< _TAlgorithm >::
-TOutputValue fpa::Base::DijkstraBase< _TAlgorithm >::
-_ComputeOutputValue( const TNode& n )
-{
-  TOutputValue c = this->m_WeightFunction->Evaluate( n.Vertex, n.Parent );
-  return( c + this->_GetOutputValue( n.Parent ) );
-}
-
 // -------------------------------------------------------------------------
 template< class _TAlgorithm >
 void fpa::Base::DijkstraBase< _TAlgorithm >::
-_QueueInit( )
+_ComputeOutputValue( TNode& n )
 {
-  typedef typename Superclass::TSeedsInterface::TSeeds::iterator _TIt;
-
-  this->Superclass::_QueueInit( );
-  for( _TIt sIt = this->BeginSeeds( ); sIt != this->EndSeeds( ); ++sIt )
-    sIt->Value = TOutputValue( 0 );
+  TOutputValue c = this->m_WeightFunction->Evaluate( n.Vertex, n.Parent );
+  n.Value = c + this->_GetOutputValue( n.Parent );
 }
 
 // -------------------------------------------------------------------------
@@ -109,6 +96,16 @@ _QueueSize( ) const
   return( this->m_Queue.size( ) );
 }
 
+// -------------------------------------------------------------------------
+template< class _TAlgorithm >
+void fpa::Base::DijkstraBase< _TAlgorithm >::
+_PrepareSeeds( TNodes& nodes )
+{
+  typename TNodes::iterator nIt = nodes.begin( );
+  for( ; nIt != nodes.end( ); ++nIt )
+    nIt->Value = TOutputValue( 0 );
+}
+
 #endif // __fpa__Base__DijkstraBase__hxx__
 
 // eof - $RCSfile$