[Lemon-commits] [lemon_svn] alpar: r1141 - hugo/trunk/src/test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:43:29 CET 2006


Author: alpar
Date: Mon Sep 13 19:20:03 2004
New Revision: 1141

Modified:
   hugo/trunk/src/test/preflow_test.cc

Log:
Fix a DANGEROUS bug.

Modified: hugo/trunk/src/test/preflow_test.cc
==============================================================================
--- hugo/trunk/src/test/preflow_test.cc	(original)
+++ hugo/trunk/src/test/preflow_test.cc	Mon Sep 13 19:20:03 2004
@@ -57,6 +57,7 @@
 
   typedef SmartGraph Graph;
   
+  typedef Graph::Node Node;
   typedef Graph::NodeIt NodeIt;
   typedef Graph::EdgeIt EdgeIt;
   typedef Graph::EdgeMap<int> CapMap;
@@ -68,7 +69,7 @@
   std::ifstream file("preflow_graph");
   
   Graph G;
-  NodeIt s, t;
+  Node s, t;
   CapMap cap(G);
   readDimacs(file, G, cap, s, t);
 
@@ -100,7 +101,12 @@
 
   for(EdgeIt e(G); e!=INVALID; ++e) cap[e]=2*cap[e]; 
   preflow_test.setCap(cap);  
-  preflow_test.setTarget(++t); //the max flow value remains 2*flow_value
+
+  NodeIt tmp_node(G,t);
+  ++tmp_node;
+  t=tmp_node;
+  
+  preflow_test.setTarget(t); //the max flow value remains 2*flow_value
   //warning: ++t must be a valid node. In preflow_graph, it is.
 
   preflow_test.phase1(PType::PRE_FLOW);



More information about the Lemon-commits mailing list