# HG changeset patch # User alpar # Date 1111391220 0 # Node ID aa65e46aebc3b0f8abfe0862f2fb19e0bc180eca # Parent 0a7719037acb7e158f14352fcc8559af84620677 Bugfix, thanks to Janos. diff -r 0a7719037acb -r aa65e46aebc3 src/lemon/dijkstra.h --- a/src/lemon/dijkstra.h Sat Mar 19 09:44:27 2005 +0000 +++ b/src/lemon/dijkstra.h Mon Mar 21 07:47:00 2005 +0000 @@ -472,10 +472,11 @@ ///Initializes the internal data structures. /// ///\todo _heap_map's type could also be in the traits class. + ///\todo The heaps should be able to make themselves empty directly. void init() { create_maps(); - + while(!_heap.empty()) _heap.pop(); for ( NodeIt u(*G) ; u!=INVALID ; ++u ) { _pred->set(u,INVALID); // _predNode->set(u,INVALID); @@ -584,7 +585,7 @@ void start(Node dest) { while ( !_heap.empty() && _heap.top()!=dest ) processNextNode(); - if ( _heap.top()==dest ) finalizeNodeData(_heap.top()); + if ( !_heap.empty() ) finalizeNodeData(_heap.top(),_heap.prio()); } ///Executes the algorithm until a condition is met. @@ -600,7 +601,7 @@ void start(const NM &nm) { while ( !_heap.empty() && !nm[_heap.top()] ) processNextNode(); - if ( !_heap.empty() ) finalizeNodeData(_heap.top()); + if ( !_heap.empty() ) finalizeNodeData(_heap.top(),_heap.prio()); } ///Runs %Dijkstra algorithm from node \c s. @@ -854,7 +855,7 @@ }; - /// A class to make easier the usage of Dijkstra algorithm + /// A class to make the usage of Dijkstra algorithm easier /// This class is created to make it easier to use Dijkstra algorithm. /// It uses the functions and features of the plain \ref Dijkstra,