Changeset 887:ec6a528dafd2 in lemon-0.x for src/test
- Timestamp:
- 09/20/04 10:27:34 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1195
- Location:
- src/test
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/test/preflow_test.cc
r880 r887 72 72 std::string f_name; 73 73 if( getenv("srcdir") ) { 74 f_name = std::string(getenv("srcdir")) + "/preflow_graph. inp";74 f_name = std::string(getenv("srcdir")) + "/preflow_graph.dim"; 75 75 } 76 76 else { 77 f_name = "preflow_graph. inp";77 f_name = "preflow_graph.dim"; 78 78 } 79 79 … … 88 88 89 89 FlowMap flow(G,0); 90 90 91 92 91 93 PType preflow_test(G, s, t, cap, flow); 92 94 preflow_test.run(PType::ZERO_FLOW); 93 94 95 95 96 CutMap mincut(G,false); 96 97 preflow_test.minCut(mincut); … … 113 114 114 115 116 115 117 for(EdgeIt e(G); e!=INVALID; ++e) cap[e]=2*cap[e]; 116 118 preflow_test.setCap(cap); 117 118 NodeIt tmp_node(G,t);119 ++tmp_node;120 t=tmp_node;121 122 preflow_test.setTarget(t); //the max flow value remains 2*flow_value123 //warning: ++t must be a valid node. In preflow_graph, it is.124 119 125 120 preflow_test.phase1(PType::PRE_FLOW); … … 142 137 preflow_test.minMinCut(minmincut2); 143 138 min_min_cut_value=cut_value(G,minmincut2,cap); 144 145 139 146 140 preflow_test.maxMinCut(maxmincut); 147 148 141 max_min_cut_value=cut_value(G,maxmincut,cap); 149 142 … … 154 147 "The max flow value or the three min cut values were not doubled"); 155 148 149 150 156 151 EdgeIt e(G); 157 for( int i=1; i==10 00; ++i ) {158 flow [e]=0;152 for( int i=1; i==10; ++i ) { 153 flow.set(e,0); 159 154 ++e; 160 155 } 161 156 162 157 preflow_test.setFlow(flow); 158 159 NodeIt tmp1(G,s); 160 ++tmp1; 161 if ( tmp1 != INVALID ) s=tmp1; 162 163 NodeIt tmp2(G,t); 164 ++tmp2; 165 if ( tmp2 != INVALID ) t=tmp2; 166 163 167 preflow_test.setSource(s); 164 168 preflow_test.setTarget(t); 169 165 170 preflow_test.run(); 166 171
Note: See TracChangeset
for help on using the changeset viewer.