[Lemon-commits] [lemon_svn] deba: r1605 - hugo/trunk/src/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:46:31 CET 2006
Author: deba
Date: Fri Mar 4 18:18:25 2005
New Revision: 1605
Modified:
hugo/trunk/src/lemon/dijkstra.h
Log:
Bug fix, and g++ 3.4 compatibility changes.
Modified: hugo/trunk/src/lemon/dijkstra.h
==============================================================================
--- hugo/trunk/src/lemon/dijkstra.h (original)
+++ hugo/trunk/src/lemon/dijkstra.h Fri Mar 4 18:18:25 2005
@@ -337,7 +337,7 @@
DefReachedMapTraits<T> > { };
struct DefGraphReachedMapTraits : public Traits {
- typedef typename Graph::NodeMap<bool> ReachedMap;
+ typedef typename Graph::template NodeMap<bool> 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<class NM>
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<Graph,LengthMap,TR> 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<Graph,LengthMap,TR>
+ 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<class T>
DijkstraWizard<DefPredMapBase<T> > predMap(const T &t)
{
- _pred=(void *)&t;
+ Base::_pred=(void *)&t;
return DijkstraWizard<DefPredMapBase<T> >(*this);
}
@@ -895,7 +896,7 @@
template<class T>
DijkstraWizard<DefPredNodeMapBase<T> > predNodeMap(const T &t)
{
- _predNode=(void *)&t;
+ Base::_predNode=(void *)&t;
return DijkstraWizard<DefPredNodeMapBase<T> >(*this);
}
@@ -915,7 +916,7 @@
template<class T>
DijkstraWizard<DefDistMapBase<T> > distMap(const T &t)
{
- _dist=(void *)&t;
+ Base::_dist=(void *)&t;
return DijkstraWizard<DefDistMapBase<T> >(*this);
}
@@ -925,7 +926,7 @@
/// \param s is the source node.
DijkstraWizard<TR> &source(Node s)
{
- source=(void *)&s;
+ Base::_source=(void *)&s;
return *this;
}
More information about the Lemon-commits
mailing list