Changes in test/suurballe_test.cc [670:7c1324b35d89:932:9f6ed854d409] in lemon
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

test/suurballe_test.cc
r670 r932 24 24 #include <lemon/suurballe.h> 25 25 #include <lemon/concepts/digraph.h> 26 #include <lemon/concepts/heap.h> 26 27 27 28 #include "test_tools.h" … … 82 83 typedef concepts::ReadMap<Arc, VType> LengthMap; 83 84 84 typedef Suurballe<Digraph, LengthMap> SuurballeType; 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; 85 92 86 93 Digraph g; … … 102 109 k = suurb_test.run(n, n, k); 103 110 suurb_test.init(n); 111 suurb_test.fullInit(n); 112 suurb_test.start(n); 113 suurb_test.start(n, k); 104 114 k = suurb_test.findFlow(n); 105 115 k = suurb_test.findFlow(n, k); … … 196 206 run(); 197 207 198 // Find 2 paths208 // Check run() 199 209 { 200 210 Suurballe<ListDigraph> suurballe(digraph, length); 211 212 // Find 2 paths 201 213 check(suurballe.run(s, t) == 2, "Wrong number of paths"); 202 214 check(checkFlow(digraph, suurballe.flowMap(), s, t, 2), … … 208 220 for (int i = 0; i < suurballe.pathNum(); ++i) 209 221 check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); 210 } 211 212 // Find 3 paths 213 { 214 Suurballe<ListDigraph> suurballe(digraph, length); 222 223 // Find 3 paths 215 224 check(suurballe.run(s, t, 3) == 3, "Wrong number of paths"); 216 225 check(checkFlow(digraph, suurballe.flowMap(), s, t, 3), … … 222 231 for (int i = 0; i < suurballe.pathNum(); ++i) 223 232 check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); 224 } 225 226 // Find 5 paths (only 3 can be found) 227 { 228 Suurballe<ListDigraph> suurballe(digraph, length); 233 234 // Find 5 paths (only 3 can be found) 229 235 check(suurballe.run(s, t, 5) == 3, "Wrong number of paths"); 230 236 check(checkFlow(digraph, suurballe.flowMap(), s, t, 3), … … 237 243 check(checkPath(digraph, suurballe.path(i), s, t), "Wrong path"); 238 244 } 245 246 // Check fullInit() + start() 247 { 248 Suurballe<ListDigraph> suurballe(digraph, length); 249 suurballe.fullInit(s); 250 251 // Find 2 paths 252 check(suurballe.start(t) == 2, "Wrong number of paths"); 253 check(suurballe.totalLength() == 510, "The flow is not optimal"); 254 255 // Find 3 paths 256 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 } 239 263 240 264 return 0;
Note: See TracChangeset
for help on using the changeset viewer.