[Lemon-commits] kpeter: r3362 - lemon/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Wed Nov 7 22:52:58 CET 2007
Author: kpeter
Date: Wed Nov 7 22:52:57 2007
New Revision: 3362
Modified:
lemon/trunk/lemon/capacity_scaling.h
lemon/trunk/lemon/min_cost_max_flow.h
Log:
Small bug fix.
Modified: lemon/trunk/lemon/capacity_scaling.h
==============================================================================
--- lemon/trunk/lemon/capacity_scaling.h (original)
+++ lemon/trunk/lemon/capacity_scaling.h Wed Nov 7 22:52:57 2007
@@ -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);
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 Wed Nov 7 22:52:57 2007
@@ -75,6 +75,7 @@
/// \brief The type of the flow map.
typedef typename Graph::template EdgeMap<Capacity> 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;
}
More information about the Lemon-commits
mailing list