Changeset 547:50184b822370 in lemon-0.x for src/work/athos
- Timestamp:
- 05/06/04 16:23:48 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@720
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/work/athos/mincostflows.h ¶
r530 r547 53 53 typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResGraphType; 54 54 typedef typename ResGraphType::Edge ResGraphEdge; 55 55 56 class ModLengthMap { 56 typedef typename ResGraphType::template NodeMap<Length> NodeMap; 57 //typedef typename ResGraphType::template NodeMap<Length> NodeMap; 58 typedef typename Graph::template NodeMap<Length> NodeMap; 57 59 const ResGraphType& G; 58 60 // const EdgeIntMap& rev; … … 88 90 //exactly those that are reversed 89 91 EdgeIntMap flow; 92 typename Graph::template NodeMap<Length> potential; 90 93 91 94 //Container to store found paths … … 101 104 102 105 MinCostFlows(Graph& _G, LengthMap& _length, CapacityMap& _cap) : G(_G), 103 length(_length), capacity(_cap), flow(_G) /*, dijkstra_dist(_G)*/{ }106 length(_length), capacity(_cap), flow(_G), potential(_G){ } 104 107 105 108 … … 113 116 //Resetting variables from previous runs 114 117 total_length = 0; 118 115 119 FOR_EACH_LOC(typename Graph::EdgeIt, e, G){ 116 120 flow.set(e,0); 117 121 } 122 123 FOR_EACH_LOC(typename Graph::NodeIt, n, G){ 124 //cout << potential[n]<<endl; 125 potential.set(n,0); 126 } 127 118 128 119 129 … … 122 132 123 133 //Initialize the copy of the Dijkstra potential to zero 124 typename ResGraphType::template NodeMap<Length> dijkstra_dist(res_graph); 125 ModLengthMap mod_length(res_graph, length, dijkstra_dist); 134 135 //typename ResGraphType::template NodeMap<Length> potential(res_graph); 136 137 138 ModLengthMap mod_length(res_graph, length, potential); 126 139 127 140 Dijkstra<ResGraphType, ModLengthMap> dijkstra(res_graph, mod_length); … … 139 152 typename ResGraphType::NodeIt n; 140 153 for ( res_graph.first(n) ; res_graph.valid(n) ; res_graph.next(n) ) { 141 dijkstra_dist[n] += dijkstra.distMap()[n];154 potential[n] += dijkstra.distMap()[n]; 142 155 } 143 156 } … … 167 180 168 181 182 169 183 ///This function gives back the total length of the found paths. 170 184 ///Assumes that \c run() has been run and nothing changed since then.
Note: See TracChangeset
for help on using the changeset viewer.