Changeset 774:4297098d9677 in lemon-0.x for src/hugo/dijkstra.h
- Timestamp:
- 08/30/04 14:01:47 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1066
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/dijkstra.h
r758 r774 85 85 bool local_distance; 86 86 87 //The source node of the last execution. 88 Node source; 89 87 90 ///Initialize maps 88 91 … … 213 216 init_maps(); 214 217 215 for ( NodeIt u(*G) ; G->valid(u) ; G->next(u) ) { 218 source = s; 219 220 for ( NodeIt u(*G) ; u!=INVALID ; ++u ) { 216 221 predecessor->set(u,INVALID); 217 222 pred_node->set(u,INVALID); … … 236 241 237 242 238 for(OutEdgeIt e(*G,v); G->valid(e); G->next(e)) {239 Node w=G-> bNode(e);243 for(OutEdgeIt e(*G,v); e!=INVALID; ++e) { 244 Node w=G->head(e); 240 245 241 246 switch(heap.state(w)) { … … 311 316 312 317 ///Returns \c true if \c v is reachable from the root. 313 ///\warning the root node is reported to be unreached! 314 ///\todo Is this what we want? 318 ///\warning the root node is reported to be reached! 315 319 ///\pre \ref run() must be called before using this function. 316 320 /// 317 bool reached(Node v) { return G->valid((*predecessor)[v]); }321 bool reached(Node v) { return v==source || (*predecessor)[v]==INVALID; } 318 322 319 323 };
Note: See TracChangeset
for help on using the changeset viewer.