Changeset 286:da414906fe21 in lemon-1.2 for lemon/dfs.h
- Timestamp:
- 09/26/08 12:40:11 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/dfs.h
r278 r286 559 559 /// 560 560 ///This method runs the %DFS algorithm from the root node 561 ///in order to compute the DFS path to \c dest.561 ///in order to compute the DFS path to \c t. 562 562 /// 563 563 ///The algorithm computes 564 ///- the %DFS path to \c dest,565 ///- the distance of \c dest from the root in the %DFS tree.564 ///- the %DFS path to \c t, 565 ///- the distance of \c t from the root in the %DFS tree. 566 566 /// 567 567 ///\pre init() must be called and a root node should be 568 568 ///added with addSource() before using this function. 569 void start(Node dest)570 { 571 while ( !emptyQueue() && G->target(_stack[_stack_head])!= dest )569 void start(Node t) 570 { 571 while ( !emptyQueue() && G->target(_stack[_stack_head])!=t ) 572 572 processNextArc(); 573 573 } … … 599 599 } 600 600 601 ///Runs the algorithm from the given node.601 ///Runs the algorithm from the given source node. 602 602 603 603 ///This method runs the %DFS algorithm from node \c s … … 623 623 624 624 ///This method runs the %DFS algorithm from node \c s 625 ///in order to compute the DFS path to \c t.626 /// 627 /// \return The length of the <tt>s</tt>--<tt>t</tt> DFS path,628 /// if \c t is reachable form \c s, \c 0 otherwise.625 ///in order to compute the DFS path to node \c t 626 ///(it stops searching when \c t is processed) 627 /// 628 ///\return \c true if \c t is reachable form \c s. 629 629 /// 630 630 ///\note Apart from the return value, <tt>d.run(s,t)</tt> is … … 635 635 /// d.start(t); 636 636 ///\endcode 637 intrun(Node s,Node t) {637 bool run(Node s,Node t) { 638 638 init(); 639 639 addSource(s); 640 640 start(t); 641 return reached(t) ?_stack_head+1:0;641 return reached(t); 642 642 } 643 643 … … 1527 1527 /// 1528 1528 /// This method runs the %DFS algorithm from the root node 1529 /// in order to compute the DFS path to \c dest.1529 /// in order to compute the DFS path to \c t. 1530 1530 /// 1531 1531 /// The algorithm computes 1532 /// - the %DFS path to \c dest,1533 /// - the distance of \c dest from the root in the %DFS tree.1532 /// - the %DFS path to \c t, 1533 /// - the distance of \c t from the root in the %DFS tree. 1534 1534 /// 1535 1535 /// \pre init() must be called and a root node should be added 1536 1536 /// with addSource() before using this function. 1537 void start(Node dest) {1538 while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != dest )1537 void start(Node t) { 1538 while ( !emptyQueue() && _digraph->target(_stack[_stack_head]) != t ) 1539 1539 processNextArc(); 1540 1540 } … … 1565 1565 } 1566 1566 1567 /// \brief Runs the algorithm from the given node.1567 /// \brief Runs the algorithm from the given source node. 1568 1568 /// 1569 1569 /// This method runs the %DFS algorithm from node \c s. … … 1589 1589 1590 1590 /// This method runs the %DFS algorithm from node \c s 1591 /// in order to compute the DFS path to \c t.1592 /// 1593 /// \return The length of the <tt>s</tt>--<tt>t</tt> DFS path,1594 /// if \c t is reachable form \c s, \c 0 otherwise.1591 /// in order to compute the DFS path to node \c t 1592 /// (it stops searching when \c t is processed). 1593 /// 1594 /// \return \c true if \c t is reachable form \c s. 1595 1595 /// 1596 1596 /// \note Apart from the return value, <tt>d.run(s,t)</tt> is … … 1601 1601 /// d.start(t); 1602 1602 ///\endcode 1603 intrun(Node s,Node t) {1603 bool run(Node s,Node t) { 1604 1604 init(); 1605 1605 addSource(s); 1606 1606 start(t); 1607 return reached(t) ?_stack_head+1:0;1607 return reached(t); 1608 1608 } 1609 1609
Note: See TracChangeset
for help on using the changeset viewer.