[Lemon-commits] kpeter: r3465 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Thu Feb 28 03:55:23 CET 2008


Author: kpeter
Date: Thu Feb 28 03:55:23 2008
New Revision: 3465

Modified:
   lemon/trunk/lemon/min_cost_max_flow.h

Log:
Avoid map copy in MinCostMaxFlow.


Modified: lemon/trunk/lemon/min_cost_max_flow.h
==============================================================================
--- lemon/trunk/lemon/min_cost_max_flow.h	(original)
+++ lemon/trunk/lemon/min_cost_max_flow.h	Thu Feb 28 03:55:23 2008
@@ -54,8 +54,8 @@
   ///
   /// \warning
   /// - Edge capacities and costs should be \e non-negative \e integers.
-  ///   However \c CostMap::Value must be signed type.
   /// - \c CapacityMap::Value must be convertible to \c CostMap::Value.
+  /// - \c CostMap::Value must be signed type.
   ///
   /// \author Peter Kovacs
 
@@ -128,9 +128,7 @@
       preflow.flowMap(_flow).runMinCut();
       MinCostFlowImpl mcf( _graph, _capacity, _cost,
                            _source, _target, preflow.flowValue() );
-      mcf.run();
-      _flow = mcf.flowMap();
-      _potential = mcf.potentialMap();
+      mcf.flowMap(_flow).potentialMap(_potential).run();
     }
 
     /// \brief Returns a const reference to the edge map storing the



More information about the Lemon-commits mailing list