# HG changeset patch # User kpeter # Date 1194472377 0 # Node ID 6520edb2c3f3b5dc4c0381126ce53319ab58661e # Parent 216c6bd5c18cd19c8026aefe380dc9fb0d81c2ed Small bug fix. diff -r 216c6bd5c18c -r 6520edb2c3f3 lemon/capacity_scaling.h --- a/lemon/capacity_scaling.h Tue Oct 30 20:44:53 2007 +0000 +++ b/lemon/capacity_scaling.h Wed Nov 07 21:52:57 2007 +0000 @@ -364,7 +364,7 @@ s += _lower[e]; for (OutEdgeIt e(graph, n); e != INVALID; ++e) s -= _lower[e]; - supply[n] = imbalance[n] = s; + supply[n] = s; sum += s; } valid_supply = sum == 0; @@ -445,7 +445,7 @@ s += _lower[e]; for (OutEdgeIt e(graph, n); e != INVALID; ++e) s -= _lower[e]; - supply[n] = imbalance[n] = s; + supply[n] = s; } valid_supply = true; } @@ -533,6 +533,7 @@ /// \brief Initializes the algorithm. bool init() { if (!valid_supply) return false; + imbalance = supply; // Initalizing Dijkstra class updater.potentialMap(potential); diff -r 216c6bd5c18c -r 6520edb2c3f3 lemon/min_cost_max_flow.h --- a/lemon/min_cost_max_flow.h Tue Oct 30 20:44:53 2007 +0000 +++ b/lemon/min_cost_max_flow.h Wed Nov 07 21:52:57 2007 +0000 @@ -75,6 +75,7 @@ /// \brief The type of the flow map. typedef typename Graph::template EdgeMap FlowMap; + typedef typename CostMap::Value Cost; private: @@ -133,7 +134,7 @@ /// \pre \ref run() must be called before using this function. Cost totalCost() const { Cost c = 0; - for (EdgeIt e(graph); e != INVALID; ++e) + for (typename Graph::EdgeIt e(graph); e != INVALID; ++e) c += flow[e] * cost[e]; return c; }