Changeset 1981:81c8efe92706 in lemon-0.x
- Timestamp:
- 02/23/06 10:03:18 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2574
- Location:
- lemon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/graph_extender.h
r1979 r1981 380 380 /// If the given bool is true the given undirected edge and the 381 381 /// returned edge have the same source node. 382 Edge direct(const UEdge &ue, bool d) const{382 static Edge direct(const UEdge &ue, bool d) { 383 383 return Edge(ue, d); 384 384 } … … 389 389 /// \todo reference to the corresponding point of the undirected graph 390 390 /// concept. "What does the direction of an undirected edge mean?" 391 bool direction(const Edge &e) const{ return e.forward; }391 static bool direction(const Edge &e) { return e.forward; } 392 392 393 393 -
lemon/dfs.h
r1956 r1981 574 574 } 575 575 576 ///Runs %DFS algorithm to visit all nodes in the graph. 577 578 ///This method runs the %DFS algorithm in order to 579 ///compute the 580 ///%DFS path to each node. The algorithm computes 581 ///- The %DFS tree. 582 ///- The distance of each node from the root in the %DFS tree. 583 /// 584 ///\note d.run() is just a shortcut of the following code. 585 ///\code 586 /// d.init(); 587 /// for (NodeIt it(graph); it != INVALID; ++it) { 588 /// if (!d.reached(it)) { 589 /// d.addSource(it); 590 /// d.start(); 591 /// } 592 /// } 593 ///\endcode 594 void run() { 595 init(); 596 for (NodeIt it(*G); it != INVALID; ++it) { 597 if (!reached(it)) { 598 addSource(it); 599 start(); 600 } 601 } 602 } 603 576 604 ///Runs %DFS algorithm from node \c s. 577 605 … … 652 680 ///Returns the distance of a node from the root(s). 653 681 ///\pre \ref run() must be called before using this function. 654 ///\warning If node \c v is unreachable from the root(s) then the return value655 /// of this funcion is undefined.682 ///\warning If node \c v is unreachable from the root(s) then the return 683 ///value of this funcion is undefined. 656 684 int dist(Node v) const { return (*_dist)[v]; } 657 685 … … 1441 1469 } 1442 1470 1443 /// \brief Runs %DFS algorithm from node \c s.1471 /// \brief Runs %DFSVisit algorithm from node \c s. 1444 1472 /// 1445 1473 /// This method runs the %DFS algorithm from a root node \c s. … … 1455 1483 start(); 1456 1484 } 1485 1486 /// \brief Runs %DFSVisit algorithm to visit all nodes in the graph. 1487 1488 /// This method runs the %DFS algorithm in order to 1489 /// compute the %DFS path to each node. The algorithm computes 1490 /// - The %DFS tree. 1491 /// - The distance of each node from the root in the %DFS tree. 1492 /// 1493 ///\note d.run() is just a shortcut of the following code. 1494 ///\code 1495 /// d.init(); 1496 /// for (NodeIt it(graph); it != INVALID; ++it) { 1497 /// if (!d.reached(it)) { 1498 /// d.addSource(it); 1499 /// d.start(); 1500 /// } 1501 /// } 1502 ///\endcode 1503 void run() { 1504 init(); 1505 for (NodeIt it(*_graph); it != INVALID; ++it) { 1506 if (!reached(it)) { 1507 addSource(it); 1508 start(); 1509 } 1510 } 1511 } 1457 1512 ///@} 1458 1513 -
lemon/dijkstra.h
r1956 r1981 485 485 ///If you don't use this function before calling \ref run(), 486 486 ///it will allocate one. The destuctor deallocates this 487 ///automatically allocated map, of course.487 ///automatically allocated heap and cross reference, of course. 488 488 ///\return <tt> (*this) </tt> 489 489 Dijkstra &heap(Heap& heap, HeapCrossRef &crossRef) -
lemon/graph_utils.h
r1956 r1981 567 567 } 568 568 569 void run() {}569 void run() const {} 570 570 571 571 private: … … 778 778 } 779 779 780 void run() {}780 void run() const {} 781 781 782 782 private:
Note: See TracChangeset
for help on using the changeset viewer.