Changes in test/suurballe_test.cc [858:9f6ed854d409:623:7c1324b35d89] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/suurballe_test.cc
r858 r623 24 24 #include <lemon/suurballe.h> 25 25 #include <lemon/concepts/digraph.h> 26 #include <lemon/concepts/heap.h>27 26 28 27 #include "test_tools.h" … … 83 82 typedef concepts::ReadMap<Arc, VType> LengthMap; 84 83 85 typedef Suurballe<Digraph, LengthMap> ST; 86 typedef Suurballe<Digraph, LengthMap> 87 ::SetFlowMap<ST::FlowMap> 88 ::SetPotentialMap<ST::PotentialMap> 89 ::SetPath<SimplePath<Digraph> > 90 ::SetHeap<concepts::Heap<VType, Digraph::NodeMap<int> > > 91 ::Create SuurballeType; 84 typedef Suurballe<Digraph, LengthMap> SuurballeType; 92 85 93 86 Digraph g; … … 109 102 k = suurb_test.run(n, n, k); 110 103 suurb_test.init(n); 111 suurb_test.fullInit(n);112 suurb_test.start(n);113 suurb_test.start(n, k);114 104 k = suurb_test.findFlow(n); 115 105 k = suurb_test.findFlow(n, k); … … 206 196 run(); 207 197 208 // Check run()198 // Find 2 paths 209 199 { 210 200 Suurballe<ListDigraph> suurballe(digraph, length); 211 212 // Find 2 paths213 201 check(suurballe.run(s, t) == 2, "Wrong number of paths"); 214 202 check(checkFlow(digraph, suurballe.flowMap(), s, t, 2), … … 220 208 for (int i = 0; i < suurballe.pathNum(); ++i) 221 209 check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); 222 223 // Find 3 paths 210 } 211 212 // Find 3 paths 213 { 214 Suurballe<ListDigraph> suurballe(digraph, length); 224 215 check(suurballe.run(s, t, 3) == 3, "Wrong number of paths"); 225 216 check(checkFlow(digraph, suurballe.flowMap(), s, t, 3), … … 231 222 for (int i = 0; i < suurballe.pathNum(); ++i) 232 223 check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); 233 234 // Find 5 paths (only 3 can be found) 224 } 225 226 // Find 5 paths (only 3 can be found) 227 { 228 Suurballe<ListDigraph> suurballe(digraph, length); 235 229 check(suurballe.run(s, t, 5) == 3, "Wrong number of paths"); 236 230 check(checkFlow(digraph, suurballe.flowMap(), s, t, 3), … … 243 237 check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); 244 238 } 245 246 // Check fullInit() + start()247 {248 Suurballe<ListDigraph> suurballe(digraph, length);249 suurballe.fullInit(s);250 251 // Find 2 paths252 check(suurballe.start(t) == 2, "Wrong number of paths");253 check(suurballe.totalLength() == 510, "The flow is not optimal");254 255 // Find 3 paths256 check(suurballe.start(t, 3) == 3, "Wrong number of paths");257 check(suurballe.totalLength() == 1040, "The flow is not optimal");258 259 // Find 5 paths (only 3 can be found)260 check(suurballe.start(t, 5) == 3, "Wrong number of paths");261 check(suurballe.totalLength() == 1040, "The flow is not optimal");262 }263 239 264 240 return 0;
Note: See TracChangeset
for help on using the changeset viewer.