Changeset 1734:2fb5ceac10e7 in lemon0.x for lemon/dijkstra.h
 Timestamp:
 10/24/05 10:09:59 (14 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2261
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/dijkstra.h
r1721 r1734 23 23 /// 24 24 ///\todo getPath() should be implemented! (also for BFS and DFS) 25 ///\todo dijkstraZero() solution should be revised. 25 26 26 27 #include <lemon/list_graph.h> … … 32 33 namespace lemon { 33 34 34 35 template<class T> T dijkstraZero() {return 0;} 35 36 36 37 ///Default traits class of Dijkstra class. … … 500 501 ///It is pushed to the heap only if either it was not in the heap 501 502 ///or the shortest path found till then is longer then \c dst. 502 void addSource(Node s,Value dst= 0)503 void addSource(Node s,Value dst=dijkstraZero<Value>()) 503 504 { 504 505 if(_heap>state(s) != Heap::IN_HEAP) { … … 660 661 addSource(s); 661 662 start(t); 662 return (*_pred)[t]==INVALID? 0:(*_dist)[t];663 return (*_pred)[t]==INVALID?dijkstraZero<Value>():(*_dist)[t]; 663 664 } 664 665 … … 747 748 /// 748 749 bool reached(Node v) { return (*_heap_cross_ref)[v] != Heap::PRE_HEAP; } 750 751 ///Checks if a node is processed. 752 753 ///Returns \c true if \c v is processed, i.e. the shortest 754 ///path to \c v has already found. 755 ///\pre \ref run() must be called before using this function. 756 /// 757 bool processed(Node v) { return (*_heap_cross_ref)[v] == Heap::POST_HEAP; } 749 758 750 759 ///@}
Note: See TracChangeset
for help on using the changeset viewer.