Changeset 1732:edeee3cbd80c in lemon-0.x
- Timestamp:
- 10/21/05 10:34:47 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2259
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/all_pairs_shortest_path_test.cc
r1711 r1732 11 11 12 12 #include <lemon/time_measure.h> 13 #include "test_tools.h" 13 14 14 15 using namespace lemon; … … 27 28 28 29 const int n = argc > 1 ? atoi(argv[1]) : 20; 29 const int e = argc > 2 ? atoi(argv[2]) : (int)(n * log( n));30 const int e = argc > 2 ? atoi(argv[2]) : (int)(n * log((double)n)); 30 31 const double m = argc > 3 ? (double)atoi(argv[3]) : 100.0; 31 32 … … 65 66 for (NodeIt it(graph); it != INVALID; ++it) { 66 67 for (NodeIt jt(graph); jt != INVALID; ++jt) { 67 assert(johnson.connected(it, jt) == floyd.connected(it, jt)); 68 check(johnson.connected(it, jt) == floyd.connected(it, jt), 69 "Wrong connection in all pairs shortest path"); 68 70 if (johnson.connected(it, jt)) { 69 assert(johnson.dist(it, jt) == floyd.dist(it, jt)); 71 check(johnson.dist(it, jt) == floyd.dist(it, jt), 72 "Wrong distance in all pairs shortest path"); 70 73 if (it != jt) { 71 assert(johnson.dist(it, jt) == 72 johnson.dist(it, johnson.predNode(it, jt)) + 73 length[johnson.pred(it, jt)]); 74 assert(floyd.dist(it, jt) == 75 floyd.dist(it, floyd.predNode(it, jt)) + 76 length[floyd.pred(it, jt)]); 74 check(johnson.dist(it, jt) == 75 johnson.dist(it, johnson.predNode(it, jt)) + 76 length[johnson.pred(it, jt)], 77 "Wrong edge in all pairs shortest path"); 78 check(floyd.dist(it, jt) == 79 floyd.dist(it, floyd.predNode(it, jt)) + 80 length[floyd.pred(it, jt)], 81 "Wrong edge in all pairs shortest path"); 77 82 } 78 83 }
Note: See TracChangeset
for help on using the changeset viewer.