# HG changeset patch # User deba # Date 1109956705 0 # Node ID c3585aec8cb3a92e4b191148dc192b9f36e8a267 # Parent aa4483befa56900ec5dd94c9c3b4c1a91769e244 Bug fix, and g++ 3.4 compatibility changes. diff -r aa4483befa56 -r c3585aec8cb3 src/lemon/dijkstra.h --- a/src/lemon/dijkstra.h Fri Mar 04 17:16:01 2005 +0000 +++ b/src/lemon/dijkstra.h Fri Mar 04 17:18:25 2005 +0000 @@ -337,7 +337,7 @@ DefReachedMapTraits > { }; struct DefGraphReachedMapTraits : public Traits { - typedef typename Graph::NodeMap ReachedMap; + typedef typename Graph::template NodeMap ReachedMap; static ReachedMap *createReachedMap(const Graph &G) { return new ReachedMap(G); @@ -539,12 +539,12 @@ ///Returns \c false if there are nodes to be processed in the priority heap /// - bool emptyHeap() { return heap.empty(); } + bool emptyHeap() { return _heap.empty(); } ///Returns the number of the nodes to be processed in the priority heap ///Returns the number of the nodes to be processed in the priority heap /// - int heapSize() { return heap.size(); } + int heapSize() { return _heap.size(); } ///Executes the algorithm. @@ -597,7 +597,7 @@ template void start(const NM &nm) { - while ( !_heap.empty() && !mn[_heap.top()] ) processNextNode(); + while ( !_heap.empty() && !nm[_heap.top()] ) processNextNode(); if ( !_heap.empty() ) finalizeNodeData(_heap.top()); } @@ -840,12 +840,13 @@ ///The node can be given by the \ref source function. void run() { - if(_source==0) throw UninitializedParameter(); - Dijkstra Dij(*(Graph*)_g,*(LengthMap*)_length); - if(_pred) Dij.predMap(*(PredMap*)_pred); - if(_predNode) Dij.predNodeMap(*(PredNodeMap*)_predNode); - if(_dist) Dij.distMap(*(DistMap*)_dist); - Dij.run(*(Node*)_source); + if(Base::_source==0) throw UninitializedParameter(); + Dijkstra + Dij(*(Graph*)Base::_g,*(LengthMap*)Base::_length); + if(Base::_pred) Dij.predMap(*(PredMap*)Base::_pred); + if(Base::_predNode) Dij.predNodeMap(*(PredNodeMap*)Base::_predNode); + if(Base::_dist) Dij.distMap(*(DistMap*)Base::_dist); + Dij.run(*(Node*)Base::_source); } ///Runs Dijkstra algorithm from the given node. @@ -854,7 +855,7 @@ ///\param s is the given source. void run(Node s) { - _source=(void *)&s; + Base::_source=(void *)&s; run(); } @@ -874,7 +875,7 @@ template DijkstraWizard > predMap(const T &t) { - _pred=(void *)&t; + Base::_pred=(void *)&t; return DijkstraWizard >(*this); } @@ -895,7 +896,7 @@ template DijkstraWizard > predNodeMap(const T &t) { - _predNode=(void *)&t; + Base::_predNode=(void *)&t; return DijkstraWizard >(*this); } @@ -915,7 +916,7 @@ template DijkstraWizard > distMap(const T &t) { - _dist=(void *)&t; + Base::_dist=(void *)&t; return DijkstraWizard >(*this); } @@ -925,7 +926,7 @@ /// \param s is the source node. DijkstraWizard &source(Node s) { - source=(void *)&s; + Base::_source=(void *)&s; return *this; }