Changeset 788:c3187cafcabf in lemon-0.x for src/hugo/mincostflows.h
- Timestamp:
- 09/02/04 18:56:33 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1081
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/mincostflows.h
r785 r788 12 12 #include <hugo/maps.h> 13 13 #include <vector> 14 #include <hugo/for_each_macros.h>15 14 16 15 namespace hugo { … … 117 116 total_length = 0; 118 117 119 for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){ 120 flow.set(e,0); 121 } 118 for (typename Graph::EdgeIt e(G); e!=INVALID; ++e) flow.set(e, 0); 122 119 123 120 //Initialize the potential to zero 124 for(typename Graph::NodeIt n=loopFirst(typename Graph::NodeIt(), (G)); n!=INVALID; ++n){ 125 potential.set(n,0); 126 } 127 128 121 for (typename Graph::NodeIt n(G); n!=INVALID; ++n) potential.set(n, 0); 122 129 123 130 124 //We need a residual graph … … 145 139 146 140 //We have to change the potential 147 //#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) 148 //FOR_EACH_LOC(typename ResGraphType::NodeIt, n, res_graph){ 149 for(typename ResGraphType::NodeIt n=loopFirst(typename ResGraphType::NodeIt(), (res_graph)); n!=INVALID; ++n){ 141 for(typename ResGraphType::NodeIt n(res_graph); n!=INVALID; ++n) 150 142 potential[n] += dijkstra.distMap()[n]; 151 }152 143 153 144 … … 198 189 Length mod_pot; 199 190 Length fl_e; 200 //#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) 201 //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){ 202 for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){ 191 for(typename Graph::EdgeIt e(G); e!=INVALID; ++e) { 203 192 //C^{\Pi}_{i,j} 204 193 mod_pot = length[e]-potential[G.head(e)]+potential[G.tail(e)];
Note: See TracChangeset
for help on using the changeset viewer.