- Bugfix in setting the previous Node
authoralpar
Fri, 04 Mar 2005 23:14:36 +0000
changeset 11964bebc22ab77c
parent 1195 4d07dd56fa9a
child 1197 a2cd33e6f61c
- Bugfix in setting the previous Node
- Bugfix in DijkstraWizard _source member initialization
src/lemon/dijkstra.h
     1.1 --- a/src/lemon/dijkstra.h	Fri Mar 04 23:12:10 2005 +0000
     1.2 +++ b/src/lemon/dijkstra.h	Fri Mar 04 23:14:36 2005 +0000
     1.3 @@ -451,7 +451,7 @@
     1.4      {
     1.5        _reached->set(v,true);
     1.6        _dist->set(v, dst);
     1.7 -      _predNode->set(v,G->source((*_pred)[v]));
     1.8 +      if((*_pred)[v]!=INVALID) _predNode->set(v,G->source((*_pred)[v])); ///\todo What to do?
     1.9      }
    1.10  
    1.11    public:
    1.12 @@ -751,7 +751,7 @@
    1.13      /// This constructor does not require parameters, therefore it initiates
    1.14      /// all of the attributes to default values (0, INVALID).
    1.15      DijkstraWizardBase() : _g(0), _length(0), _pred(0), _predNode(0),
    1.16 -		       _dist(0), _source(INVALID) {}
    1.17 +		       _dist(0), _source(0) {}
    1.18  
    1.19      /// Constructor.
    1.20      
    1.21 @@ -763,7 +763,7 @@
    1.22      /// \param s is the initial value of  \ref _source
    1.23      DijkstraWizardBase(const GR &g,const LM &l, Node s=INVALID) :
    1.24        _g((void *)&g), _length((void *)&l), _pred(0), _predNode(0),
    1.25 -		  _dist(0), _source((void *)&s) {}
    1.26 +		  _dist(0), _source((s==INVALID)?0:(void *)&s) {}
    1.27  
    1.28    };
    1.29