1.1 --- a/src/hugo/min_cost_flow.h Sun Sep 26 21:43:38 2004 +0000
1.2 +++ b/src/hugo/min_cost_flow.h Mon Sep 27 18:11:27 2004 +0000
1.3 @@ -71,26 +71,26 @@
1.4 typedef typename Graph::template EdgeMap<int> EdgeIntMap;
1.5
1.6
1.7 - typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResGraphType;
1.8 - typedef typename ResGraphType::Edge ResGraphEdge;
1.9 + typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResGW;
1.10 + typedef typename ResGW::Edge ResGraphEdge;
1.11
1.12 class ModLengthMap {
1.13 typedef typename Graph::template NodeMap<Length> NodeMap;
1.14 - const ResGraphType& G;
1.15 + const ResGW& G;
1.16 const LengthMap &ol;
1.17 const NodeMap &pot;
1.18 public :
1.19 typedef typename LengthMap::KeyType KeyType;
1.20 typedef typename LengthMap::ValueType ValueType;
1.21
1.22 - ValueType operator[](typename ResGraphType::Edge e) const {
1.23 + ValueType operator[](typename ResGW::Edge e) const {
1.24 if (G.forward(e))
1.25 return ol[e]-(pot[G.head(e)]-pot[G.tail(e)]);
1.26 else
1.27 return -ol[e]-(pot[G.head(e)]-pot[G.tail(e)]);
1.28 }
1.29
1.30 - ModLengthMap(const ResGraphType& _G,
1.31 + ModLengthMap(const ResGW& _G,
1.32 const LengthMap &o, const NodeMap &p) :
1.33 G(_G), /*rev(_rev),*/ ol(o), pot(p){};
1.34 };//ModLengthMap
1.35 @@ -152,12 +152,12 @@
1.36
1.37
1.38 //We need a residual graph
1.39 - ResGraphType res_graph(G, capacity, flow);
1.40 + ResGW res_graph(G, capacity, flow);
1.41
1.42
1.43 ModLengthMap mod_length(res_graph, length, potential);
1.44
1.45 - Dijkstra<ResGraphType, ModLengthMap> dijkstra(res_graph, mod_length);
1.46 + Dijkstra<ResGW, ModLengthMap> dijkstra(res_graph, mod_length);
1.47
1.48 int i;
1.49 for (i=0; i<k; ++i){
1.50 @@ -168,7 +168,7 @@
1.51 };
1.52
1.53 //We have to change the potential
1.54 - for(typename ResGraphType::NodeIt n(res_graph); n!=INVALID; ++n)
1.55 + for(typename ResGW::NodeIt n(res_graph); n!=INVALID; ++n)
1.56 potential[n] += dijkstra.distMap()[n];
1.57
1.58