Changeset 1155:fe0fcdb5687b in lemon0.x
 Timestamp:
 02/18/05 15:46:04 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1556
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/dijkstra.h
r1151 r1155 484 484 ///Adds a new source node. 485 485 486 ///Adds a new source node the the priority heap. 487 ///It checks if the node has already been added to the heap. 486 ///Adds a new source node to the priority heap. 488 487 /// 489 488 ///The optional second parameter is the initial distance of the node. 490 489 /// 491 ///\todo Do we really want to check it? 490 ///It checks if the node has already been added to the heap and 491 ///It is pushed to the heap only if either it was not in the heap 492 ///or the shortest path found till then is longer then \c dst. 492 493 void addSource(Node s,Value dst=0) 493 494 { 494 495 source = s; 495 496 if(_heap.state(s) != Heap::IN_HEAP) _heap.push(s,dst); 496 } 497 497 else if(_heap[s]<dst) { 498 _heap.push(s,dst); 499 _pred>set(s,INVALID); 500 } 501 } 502 503 ///Processes the next node in the priority heap 504 505 ///Processes the next node in the priority heap. 506 /// 507 ///\warning The priority heap must not be empty! 498 508 void processNextNode() 499 509 { … … 524 534 } 525 535 536 ///Returns \c false if there are nodes to be processed in the priority heap 537 538 ///Returns \c false if there are nodes to be processed in the priority heap 539 /// 540 bool emptyHeap() { return heap.empty(); } 541 ///Returns the number of the nodes to be processed in the priority heap 542 543 ///Returns the number of the nodes to be processed in the priority heap 544 /// 545 int heapSize() { return heap.size(); } 546 526 547 ///Executes the algorithm. 527 548
Note: See TracChangeset
for help on using the changeset viewer.