Avoid map copy in MinCostMaxFlow.
authorkpeter
Thu, 28 Feb 2008 02:55:23 +0000
changeset 25824f1ac622bb7a
parent 2581 054566ac0934
child 2583 7216b6a52ab9
Avoid map copy in MinCostMaxFlow.
lemon/min_cost_max_flow.h
     1.1 --- a/lemon/min_cost_max_flow.h	Thu Feb 28 02:54:27 2008 +0000
     1.2 +++ b/lemon/min_cost_max_flow.h	Thu Feb 28 02:55:23 2008 +0000
     1.3 @@ -54,8 +54,8 @@
     1.4    ///
     1.5    /// \warning
     1.6    /// - Edge capacities and costs should be \e non-negative \e integers.
     1.7 -  ///   However \c CostMap::Value must be signed type.
     1.8    /// - \c CapacityMap::Value must be convertible to \c CostMap::Value.
     1.9 +  /// - \c CostMap::Value must be signed type.
    1.10    ///
    1.11    /// \author Peter Kovacs
    1.12  
    1.13 @@ -128,9 +128,7 @@
    1.14        preflow.flowMap(_flow).runMinCut();
    1.15        MinCostFlowImpl mcf( _graph, _capacity, _cost,
    1.16                             _source, _target, preflow.flowValue() );
    1.17 -      mcf.run();
    1.18 -      _flow = mcf.flowMap();
    1.19 -      _potential = mcf.potentialMap();
    1.20 +      mcf.flowMap(_flow).potentialMap(_potential).run();
    1.21      }
    1.22  
    1.23      /// \brief Returns a const reference to the edge map storing the