Changeset 788:c3187cafcabf in lemon-0.x for src
- Timestamp:
- 09/02/04 18:56:33 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1081
- Location:
- src
- Files:
-
- 3 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)]; -
src/hugo/minlengthpaths.h
r776 r788 13 13 #include <vector> 14 14 #include <hugo/mincostflows.h> 15 #include <for_each_macros.h>16 15 17 16 namespace hugo { … … 84 83 EdgeIntMap reversed(G); 85 84 86 //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){ 87 for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){ 85 for(typename Graph::EdgeIt e(G); e!=INVALID; ++e) 88 86 reversed[e] = mincost_flow.getFlow()[e]; 89 }90 87 91 88 paths.clear(); -
src/test/Makefile.am
r780 r788 5 5 check_PROGRAMS = graph_test dijkstra_test bfs_test dfs_test time_measure_test \ 6 6 error_test xy_test \ 7 unionfind_test test_tools_pass test_tools_fail 7 unionfind_test test_tools_pass test_tools_fail \ 8 minlengthpaths_test mincostflows_test 8 9 9 10 TESTS = $(check_PROGRAMS) … … 20 21 test_tools_pass_SOURCES = test_tools_pass.cc 21 22 test_tools_fail_SOURCES = test_tools_fail.cc 23 minlengthpaths_test_SOURCES = minlengthpaths_test.cc 24 mincostflows_test_SOURCES = mincostflows_test.cc 22 25
Note: See TracChangeset
for help on using the changeset viewer.