Changeset 287:bb40b6db0a58 in lemon1.2 for lemon/dfs.h
 Timestamp:
 09/27/08 14:33:28 (11 years ago)
 Branch:
 default
 Children:
 288:47b3a3b67837, 290:f6899946c1ac
 Parents:
 286:da414906fe21 (diff), 285:d8dc5acf739b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.  Phase:
 public
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

lemon/dfs.h
r281 r287 556 556 /// 557 557 ///This method runs the %DFS algorithm from the root node 558 ///in order to compute the DFS path to \c dest.558 ///in order to compute the DFS path to \c t. 559 559 /// 560 560 ///The algorithm computes 561 /// the %DFS path to \c dest,562 /// the distance of \c dest from the root in the %DFS tree.561 /// the %DFS path to \c t, 562 /// the distance of \c t from the root in the %DFS tree. 563 563 /// 564 564 ///\pre init() must be called and a root node should be 565 565 ///added with addSource() before using this function. 566 void start(Node dest)567 { 568 while ( !emptyQueue() && G>target(_stack[_stack_head])!= dest )566 void start(Node t) 567 { 568 while ( !emptyQueue() && G>target(_stack[_stack_head])!=t ) 569 569 processNextArc(); 570 570 } … … 596 596 } 597 597 598 ///Runs the algorithm from the given node.598 ///Runs the algorithm from the given source node. 599 599 600 600 ///This method runs the %DFS algorithm from node \c s … … 620 620 621 621 ///This method runs the %DFS algorithm from node \c s 622 ///in order to compute the DFS path to \c t.623 /// 624 /// \return The length of the <tt>s</tt><tt>t</tt> DFS path,625 /// if \c t is reachable form \c s, \c 0 otherwise.622 ///in order to compute the DFS path to node \c t 623 ///(it stops searching when \c t is processed) 624 /// 625 ///\return \c true if \c t is reachable form \c s. 626 626 /// 627 627 ///\note Apart from the return value, <tt>d.run(s,t)</tt> is … … 632 632 /// d.start(t); 633 633 ///\endcode 634 intrun(Node s,Node t) {634 bool run(Node s,Node t) { 635 635 init(); 636 636 addSource(s); 637 637 start(t); 638 return reached(t) ?_stack_head+1:0;638 return reached(t); 639 639 } 640 640 … … 1522 1522 /// 1523 1523 /// This method runs the %DFS algorithm from the root node 1524 /// in order to compute the DFS path to \c dest.1524 /// in order to compute the DFS path to \c t. 1525 1525 /// 1526 1526 /// The algorithm computes 1527 ///  the %DFS path to \c dest,1528 ///  the distance of \c dest from the root in the %DFS tree.1527 ///  the %DFS path to \c t, 1528 ///  the distance of \c t from the root in the %DFS tree. 1529 1529 /// 1530 1530 /// \pre init() must be called and a root node should be added 1531 1531 /// with addSource() before using this function. 1532 void start(Node dest) {1533 while ( !emptyQueue() && _digraph>target(_stack[_stack_head]) != dest )1532 void start(Node t) { 1533 while ( !emptyQueue() && _digraph>target(_stack[_stack_head]) != t ) 1534 1534 processNextArc(); 1535 1535 } … … 1560 1560 } 1561 1561 1562 /// \brief Runs the algorithm from the given node.1562 /// \brief Runs the algorithm from the given source node. 1563 1563 /// 1564 1564 /// This method runs the %DFS algorithm from node \c s. … … 1584 1584 1585 1585 /// This method runs the %DFS algorithm from node \c s 1586 /// in order to compute the DFS path to \c t.1587 /// 1588 /// \return The length of the <tt>s</tt><tt>t</tt> DFS path,1589 /// if \c t is reachable form \c s, \c 0 otherwise.1586 /// in order to compute the DFS path to node \c t 1587 /// (it stops searching when \c t is processed). 1588 /// 1589 /// \return \c true if \c t is reachable form \c s. 1590 1590 /// 1591 1591 /// \note Apart from the return value, <tt>d.run(s,t)</tt> is … … 1596 1596 /// d.start(t); 1597 1597 ///\endcode 1598 intrun(Node s,Node t) {1598 bool run(Node s,Node t) { 1599 1599 init(); 1600 1600 addSource(s); 1601 1601 start(t); 1602 return reached(t) ?_stack_head+1:0;1602 return reached(t); 1603 1603 } 1604 1604 
lemon/dfs.h
r286 r287 56 56 ///\param g is the digraph, to which we would like to define the 57 57 ///\ref PredMap. 58 ///\todo The digraph alone may be insufficient to initialize59 58 static PredMap *createPredMap(const Digraph &g) 60 59 { … … 66 65 ///The type of the map that indicates which nodes are processed. 67 66 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 68 ///By default it is a NullMap.69 67 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 70 68 ///Instantiates a \ref ProcessedMap. … … 197 195 int _stack_head; 198 196 199 ///Creates the maps if necessary. 200 ///\todo Better memory allocation (instead of new). 197 //Creates the maps if necessary. 201 198 void create_maps() 202 199 { … … 783 780 ///\param g is the digraph, to which we would like to define the 784 781 ///\ref PredMap. 785 ///\todo The digraph alone may be insufficient to initialize786 782 static PredMap *createPredMap(const Digraph &g) 787 783 { … … 1318 1314 int _stack_head; 1319 1315 1320 ///Creates the maps if necessary. 1321 ///\todo Better memory allocation (instead of new). 1316 //Creates the maps if necessary. 1322 1317 void create_maps() { 1323 1318 if(!_reached) {
Note: See TracChangeset
for help on using the changeset viewer.