[Lemon-commits] deba: r3276 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon May 7 10:48:40 CEST 2007


Author: deba
Date: Mon May  7 10:48:40 2007
New Revision: 3276

Modified:
   lemon/trunk/lemon/bfs.h

Log:
Bug fix in Bfs class.

Patch from Peter Kovacs



Modified: lemon/trunk/lemon/bfs.h
==============================================================================
--- lemon/trunk/lemon/bfs.h	(original)
+++ lemon/trunk/lemon/bfs.h	Mon May  7 10:48:40 2007
@@ -541,7 +541,7 @@
 	  _reached->set(m,true);
 	  _pred->set(m,e);
 	  _dist->set(m,_curr_dist);
-          reached = reach || nm[m];
+          reach = reach || nm[m];
 	}
       return n;
     }
@@ -605,7 +605,7 @@
     void start(Node dest)
     {
       bool reach = false;
-      while ( !emptyQueue() && !reach) processNextNode(dest, reach);
+      while ( !emptyQueue() && !reach ) processNextNode(dest, reach);
     }
     
     ///Executes the algorithm until a condition is met.
@@ -623,7 +623,7 @@
     void start(const NM &nm)
     {
       bool reach = false;
-      while ( !emptyQueue() && !reach) processNextNode(nm, reach);
+      while ( !emptyQueue() && !reach ) processNextNode(nm, reach);
     }
     
     ///Runs %BFS algorithm from node \c s.
@@ -664,7 +664,7 @@
       init();
       addSource(s);
       start(t);
-      return reached(t)? _curr_dist : 0;
+      return reached(t) ? _curr_dist : 0;
     }
     
     ///@}
@@ -1503,9 +1503,7 @@
     /// with addSource() before using this function.
     void start(Node dest) {
       bool reach = false;
-      while (!emptyQueue() && !reach) { 
-	processNextNode(dest, reach);
-      }
+      while ( !emptyQueue() && !reach ) processNextNode(dest, reach);
     }
     
     /// \brief Executes the algorithm until a condition is met.
@@ -1521,9 +1519,7 @@
     template <typename NM>
     void start(const NM &nm) {
       bool reach = false;
-      while (!emptyQueue() && !reach) {
-        processNextNode(nm, reach);
-      }
+      while ( !emptyQueue() && !reach ) processNextNode(nm, reach);
     }
 
     /// \brief Runs %BFSVisit algorithm from node \c s.



More information about the Lemon-commits mailing list