Bug fix, and g++ 3.4 compatibility changes.
authordeba
Fri, 04 Mar 2005 17:18:25 +0000
changeset 1193c3585aec8cb3
parent 1192 aa4483befa56
child 1194 7bce0ef61d6b
Bug fix, and g++ 3.4 compatibility changes.
src/lemon/dijkstra.h
     1.1 --- a/src/lemon/dijkstra.h	Fri Mar 04 17:16:01 2005 +0000
     1.2 +++ b/src/lemon/dijkstra.h	Fri Mar 04 17:18:25 2005 +0000
     1.3 @@ -337,7 +337,7 @@
     1.4  					DefReachedMapTraits<T> > { };
     1.5      
     1.6      struct DefGraphReachedMapTraits : public Traits {
     1.7 -      typedef typename Graph::NodeMap<bool> ReachedMap;
     1.8 +      typedef typename Graph::template NodeMap<bool> ReachedMap;
     1.9        static ReachedMap *createReachedMap(const Graph &G) 
    1.10        {
    1.11  	return new ReachedMap(G);
    1.12 @@ -539,12 +539,12 @@
    1.13  
    1.14      ///Returns \c false if there are nodes to be processed in the priority heap
    1.15      ///
    1.16 -    bool emptyHeap() { return heap.empty(); }
    1.17 +    bool emptyHeap() { return _heap.empty(); }
    1.18      ///Returns the number of the nodes to be processed in the priority heap
    1.19  
    1.20      ///Returns the number of the nodes to be processed in the priority heap
    1.21      ///
    1.22 -    int heapSize() { return heap.size(); }
    1.23 +    int heapSize() { return _heap.size(); }
    1.24      
    1.25      ///Executes the algorithm.
    1.26  
    1.27 @@ -597,7 +597,7 @@
    1.28      template<class NM>
    1.29      void start(const NM &nm)
    1.30      {
    1.31 -      while ( !_heap.empty() && !mn[_heap.top()] ) processNextNode();
    1.32 +      while ( !_heap.empty() && !nm[_heap.top()] ) processNextNode();
    1.33        if ( !_heap.empty() ) finalizeNodeData(_heap.top());
    1.34      }
    1.35      
    1.36 @@ -840,12 +840,13 @@
    1.37      ///The node can be given by the \ref source function.
    1.38      void run()
    1.39      {
    1.40 -      if(_source==0) throw UninitializedParameter();
    1.41 -      Dijkstra<Graph,LengthMap,TR> Dij(*(Graph*)_g,*(LengthMap*)_length);
    1.42 -      if(_pred) Dij.predMap(*(PredMap*)_pred);
    1.43 -      if(_predNode) Dij.predNodeMap(*(PredNodeMap*)_predNode);
    1.44 -      if(_dist) Dij.distMap(*(DistMap*)_dist);
    1.45 -      Dij.run(*(Node*)_source);
    1.46 +      if(Base::_source==0) throw UninitializedParameter();
    1.47 +      Dijkstra<Graph,LengthMap,TR> 
    1.48 +	Dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length);
    1.49 +      if(Base::_pred) Dij.predMap(*(PredMap*)Base::_pred);
    1.50 +      if(Base::_predNode) Dij.predNodeMap(*(PredNodeMap*)Base::_predNode);
    1.51 +      if(Base::_dist) Dij.distMap(*(DistMap*)Base::_dist);
    1.52 +      Dij.run(*(Node*)Base::_source);
    1.53      }
    1.54  
    1.55      ///Runs Dijkstra algorithm from the given node.
    1.56 @@ -854,7 +855,7 @@
    1.57      ///\param s is the given source.
    1.58      void run(Node s)
    1.59      {
    1.60 -      _source=(void *)&s;
    1.61 +      Base::_source=(void *)&s;
    1.62        run();
    1.63      }
    1.64  
    1.65 @@ -874,7 +875,7 @@
    1.66      template<class T>
    1.67      DijkstraWizard<DefPredMapBase<T> > predMap(const T &t) 
    1.68      {
    1.69 -      _pred=(void *)&t;
    1.70 +      Base::_pred=(void *)&t;
    1.71        return DijkstraWizard<DefPredMapBase<T> >(*this);
    1.72      }
    1.73      
    1.74 @@ -895,7 +896,7 @@
    1.75      template<class T>
    1.76      DijkstraWizard<DefPredNodeMapBase<T> > predNodeMap(const T &t) 
    1.77      {
    1.78 -      _predNode=(void *)&t;
    1.79 +      Base::_predNode=(void *)&t;
    1.80        return DijkstraWizard<DefPredNodeMapBase<T> >(*this);
    1.81      }
    1.82     
    1.83 @@ -915,7 +916,7 @@
    1.84      template<class T>
    1.85      DijkstraWizard<DefDistMapBase<T> > distMap(const T &t) 
    1.86      {
    1.87 -      _dist=(void *)&t;
    1.88 +      Base::_dist=(void *)&t;
    1.89        return DijkstraWizard<DefDistMapBase<T> >(*this);
    1.90      }
    1.91      
    1.92 @@ -925,7 +926,7 @@
    1.93      /// \param s is the source node.
    1.94      DijkstraWizard<TR> &source(Node s) 
    1.95      {
    1.96 -      source=(void *)&s;
    1.97 +      Base::_source=(void *)&s;
    1.98        return *this;
    1.99      }
   1.100