# HG changeset patch # User kpeter # Date 1204167323 0 # Node ID 4f1ac622bb7aa01ba135960cc657f45edd7d3ec1 # Parent 054566ac093441af707d591fe758075f32e348d8 Avoid map copy in MinCostMaxFlow. diff -r 054566ac0934 -r 4f1ac622bb7a lemon/min_cost_max_flow.h --- a/lemon/min_cost_max_flow.h Thu Feb 28 02:54:27 2008 +0000 +++ b/lemon/min_cost_max_flow.h Thu Feb 28 02:55:23 2008 +0000 @@ -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