Small bug fix.
1.1 --- a/lemon/capacity_scaling.h Tue Oct 30 20:44:53 2007 +0000
1.2 +++ b/lemon/capacity_scaling.h Wed Nov 07 21:52:57 2007 +0000
1.3 @@ -364,7 +364,7 @@
1.4 s += _lower[e];
1.5 for (OutEdgeIt e(graph, n); e != INVALID; ++e)
1.6 s -= _lower[e];
1.7 - supply[n] = imbalance[n] = s;
1.8 + supply[n] = s;
1.9 sum += s;
1.10 }
1.11 valid_supply = sum == 0;
1.12 @@ -445,7 +445,7 @@
1.13 s += _lower[e];
1.14 for (OutEdgeIt e(graph, n); e != INVALID; ++e)
1.15 s -= _lower[e];
1.16 - supply[n] = imbalance[n] = s;
1.17 + supply[n] = s;
1.18 }
1.19 valid_supply = true;
1.20 }
1.21 @@ -533,6 +533,7 @@
1.22 /// \brief Initializes the algorithm.
1.23 bool init() {
1.24 if (!valid_supply) return false;
1.25 + imbalance = supply;
1.26
1.27 // Initalizing Dijkstra class
1.28 updater.potentialMap(potential);
2.1 --- a/lemon/min_cost_max_flow.h Tue Oct 30 20:44:53 2007 +0000
2.2 +++ b/lemon/min_cost_max_flow.h Wed Nov 07 21:52:57 2007 +0000
2.3 @@ -75,6 +75,7 @@
2.4
2.5 /// \brief The type of the flow map.
2.6 typedef typename Graph::template EdgeMap<Capacity> FlowMap;
2.7 + typedef typename CostMap::Value Cost;
2.8
2.9 private:
2.10
2.11 @@ -133,7 +134,7 @@
2.12 /// \pre \ref run() must be called before using this function.
2.13 Cost totalCost() const {
2.14 Cost c = 0;
2.15 - for (EdgeIt e(graph); e != INVALID; ++e)
2.16 + for (typename Graph::EdgeIt e(graph); e != INVALID; ++e)
2.17 c += flow[e] * cost[e];
2.18 return c;
2.19 }