Bugfix, thanks to Janos.
authoralpar
Mon, 21 Mar 2005 07:47:00 +0000
changeset 1229aa65e46aebc3
parent 1228 0a7719037acb
child 1230 daf41fe81728
Bugfix, thanks to Janos.
src/lemon/dijkstra.h
     1.1 --- a/src/lemon/dijkstra.h	Sat Mar 19 09:44:27 2005 +0000
     1.2 +++ b/src/lemon/dijkstra.h	Mon Mar 21 07:47:00 2005 +0000
     1.3 @@ -472,10 +472,11 @@
     1.4      ///Initializes the internal data structures.
     1.5      ///
     1.6      ///\todo _heap_map's type could also be in the traits class.
     1.7 +    ///\todo The heaps should be able to make themselves empty directly.
     1.8      void init()
     1.9      {
    1.10        create_maps();
    1.11 -      
    1.12 +      while(!_heap.empty()) _heap.pop();
    1.13        for ( NodeIt u(*G) ; u!=INVALID ; ++u ) {
    1.14  	_pred->set(u,INVALID);
    1.15  // 	_predNode->set(u,INVALID);
    1.16 @@ -584,7 +585,7 @@
    1.17      void start(Node dest)
    1.18      {
    1.19        while ( !_heap.empty() && _heap.top()!=dest ) processNextNode();
    1.20 -      if ( _heap.top()==dest ) finalizeNodeData(_heap.top());
    1.21 +      if ( !_heap.empty() ) finalizeNodeData(_heap.top(),_heap.prio());
    1.22      }
    1.23      
    1.24      ///Executes the algorithm until a condition is met.
    1.25 @@ -600,7 +601,7 @@
    1.26      void start(const NM &nm)
    1.27      {
    1.28        while ( !_heap.empty() && !nm[_heap.top()] ) processNextNode();
    1.29 -      if ( !_heap.empty() ) finalizeNodeData(_heap.top());
    1.30 +      if ( !_heap.empty() ) finalizeNodeData(_heap.top(),_heap.prio());
    1.31      }
    1.32      
    1.33      ///Runs %Dijkstra algorithm from node \c s.
    1.34 @@ -854,7 +855,7 @@
    1.35  
    1.36    };
    1.37    
    1.38 -  /// A class to make easier the usage of Dijkstra algorithm
    1.39 +  /// A class to make the usage of Dijkstra algorithm easier
    1.40  
    1.41    /// This class is created to make it easier to use Dijkstra algorithm.
    1.42    /// It uses the functions and features of the plain \ref Dijkstra,