Changeset 247:fefccf1bdc23 in lemon0.x for src/work/alpar/dijkstra/dijkstra.h
 Timestamp:
 03/26/04 15:03:02 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@347
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/alpar/dijkstra/dijkstra.h
r242 r247 69 69 template <typename Graph, 70 70 typename LengthMap=typename Graph::EdgeMap<int>, 71 typename Heap=BinHeap <typename Graph::Node, 72 typename LengthMap::ValueType, 73 typename Graph::NodeMap<int> > > 71 template <class,class,class> class Heap = BinHeap > 72 // typename Heap=BinHeap <typename Graph::Node, 73 // typename LengthMap::ValueType, 74 // typename Graph::NodeMap<int> > > 74 75 #endif 75 76 class Dijkstra{ … … 105 106 G(_G), length(_length), predecessor(_G), pred_node(_G), distance(_G) { } 106 107 107 108 108 void run(Node s); 109 109 … … 174 174 /// The shortest path tree. 175 175 /// The distance of each node from the source. 176 template <typename Graph, typename LengthMap, typename Heap > 176 template <typename Graph, typename LengthMap, 177 template<class,class,class> class Heap > 177 178 void Dijkstra<Graph,LengthMap,Heap>::run(Node s) { 178 179 … … 192 193 typename Graph::NodeMap<int> heap_map(G,1); 193 194 194 Heap heap(heap_map); 195 //Heap heap(heap_map); 196 Heap<Node,ValueType,typename Graph::NodeMap<int> > heap(heap_map); 195 197 196 198 heap.push(s,0); … … 208 210 209 211 switch(heap.state(w)) { 210 case Heap::PRE_HEAP:212 case heap.PRE_HEAP: 211 213 // reach.set(w,true); 212 214 heap.push(w,oldvalue+length[e]); … … 214 216 pred_node.set(w,v); 215 217 break; 216 case Heap::IN_HEAP:218 case heap.IN_HEAP: 217 219 if ( oldvalue+length[e] < heap[w] ) { 218 220 heap.decrease(w, oldvalue+length[e]); … … 221 223 } 222 224 break; 223 case Heap::POST_HEAP:225 case heap.POST_HEAP: 224 226 break; 225 227 }
Note: See TracChangeset
for help on using the changeset viewer.