lemon/bfs.h
changeset 2360 72c7075ad5ba
parent 2335 27aa03cd3121
child 2376 0ed45a6c74b1
equal deleted inserted replaced
23:e2d86439ed51 24:15e116be705b
   518     ///reached node has true value in the \c nm nodemap. If one node
   518     ///reached node has true value in the \c nm nodemap. If one node
   519     ///with true value is reachable from the processed node then the
   519     ///with true value is reachable from the processed node then the
   520     ///reached parameter will be set true. The reached parameter
   520     ///reached parameter will be set true. The reached parameter
   521     ///should be initially false.
   521     ///should be initially false.
   522     ///
   522     ///
   523     ///\param target The nodemaps of possible targets.
   523     ///\param nm The nodemaps of possible targets.
   524     ///\retval reached Indicates that one of the target nodes is reached.
   524     ///\retval reached Indicates that one of the target nodes is reached.
   525     ///\return The processed node.
   525     ///\return The processed node.
   526     ///
   526     ///
   527     ///\warning The queue must not be empty!
   527     ///\warning The queue must not be empty!
   528     template<class NM>
   528     template<class NM>
   615     ///\pre init() must be called and at least one node should be added
   615     ///\pre init() must be called and at least one node should be added
   616     ///with addSource() before using this function.
   616     ///with addSource() before using this function.
   617     ///
   617     ///
   618     ///\param nm must be a bool (or convertible) node map. The
   618     ///\param nm must be a bool (or convertible) node map. The
   619     ///algorithm will stop when it reached a node \c v with
   619     ///algorithm will stop when it reached a node \c v with
   620     ///<tt>nm[v]</tt> true.
   620     /// <tt>nm[v]</tt> true.
   621     ///\todo query the reached target
   621     ///\todo query the reached target
   622     template<class NM>
   622     template<class NM>
   623     void start(const NM &nm)
   623     void start(const NM &nm)
   624     {
   624     {
   625       bool reached = false;
   625       bool reached = false;
  1433     /// reached node has true value in the \c nm nodemap. If one node
  1433     /// reached node has true value in the \c nm nodemap. If one node
  1434     /// with true value is reachable from the processed node then the
  1434     /// with true value is reachable from the processed node then the
  1435     /// reached parameter will be set true. The reached parameter
  1435     /// reached parameter will be set true. The reached parameter
  1436     /// should be initially false.
  1436     /// should be initially false.
  1437     ///
  1437     ///
  1438     /// \param target The nodemaps of possible targets.
  1438     /// \param nm The nodemaps of possible targets.
  1439     /// \retval reached Indicates that one of the target nodes is reached.
  1439     /// \retval reached Indicates that one of the target nodes is reached.
  1440     /// \return The processed node.
  1440     /// \return The processed node.
  1441     ///
  1441     ///
  1442     /// \warning The queue must not be empty!
  1442     /// \warning The queue must not be empty!
  1443     template <typename NM>
  1443     template <typename NM>
  1512     /// \pre init() must be called and at least one node should be added
  1512     /// \pre init() must be called and at least one node should be added
  1513     /// with addSource() before using this function.
  1513     /// with addSource() before using this function.
  1514     ///
  1514     ///
  1515     ///\param nm must be a bool (or convertible) node map. The
  1515     ///\param nm must be a bool (or convertible) node map. The
  1516     ///algorithm will stop when it reached a node \c v with
  1516     ///algorithm will stop when it reached a node \c v with
  1517     ///<tt>nm[v]</tt> true.
  1517     /// <tt>nm[v]</tt> true.
  1518     template <typename NM>
  1518     template <typename NM>
  1519     void start(const NM &nm) {
  1519     void start(const NM &nm) {
  1520       bool reached = false;
  1520       bool reached = false;
  1521       while (!emptyQueue() && !reached) {
  1521       while (!emptyQueue() && !reached) {
  1522         processNextNode(nm, reached);
  1522         processNextNode(nm, reached);