1 #ifndef __FPA__BASE__DIJKSTRA__H__
2 #define __FPA__BASE__DIJKSTRA__H__
5 #include <fpa/Base/Algorithm.h>
13 template< class V, class C, class VV, class VC >
20 typedef VV TVertexValue;
21 typedef VC TVertexCmp;
22 typedef long TFrontId;
30 TNode( const TVertex& v, const TFrontId& f )
33 Result( TResult( 0 ) ),
37 TNode( const TVertex& v, const TResult& r, const TFrontId& f )
47 // NOTE: stl::heaps work as maximum priority queues
48 bool operator<( const TNode& other ) const
49 { return( other.Cost < this->Cost ); }
58 typedef std::vector< TNode > TNodes;
62 * Dijkstra is a front propagation algorithm that minimizes costs
64 template< class V, class C, class VV, class VC, class B >
66 : public Algorithm< DijkstraTraits< V, C, VV, VC >, B >
72 typedef VV TVertexValue;
73 typedef B TBaseFilter;
74 typedef DijkstraTraits< V, C, VV, VC > TTraits;
76 // Standard class typdedefs
77 typedef Dijkstra Self;
78 typedef Algorithm< TTraits, B > Superclass;
79 typedef itk::SmartPointer< Self > Pointer;
80 typedef itk::SmartPointer< const Self > ConstPointer;
83 typedef typename TTraits::TFrontId _TFrontId;
84 typedef typename TTraits::TNode _TNode;
85 typedef typename TTraits::TNodes _TNodes;
87 typedef std::vector< _TNode > _TQueue;
90 itkTypeMacro( Dijkstra, Base );
96 virtual void _InitializeQueue ( );
97 virtual bool _IsQueueEmpty ( ) const;
98 virtual void _QueuePush ( const _TNode& n );
99 virtual _TNode _QueuePop ( );
100 virtual void _QueueClear ( );
101 virtual bool _UpdateNeigh ( _TNode& nn, const _TNode& n );
104 // Purposely not implemented
105 Dijkstra( const Self& );
106 void operator=( const Self& );
116 #include <fpa/Base/Dijkstra.hxx>
118 #endif // __FPA__BASE__DIJKSTRA__H__