# HG changeset patch # User deba # Date 1130325018 0 # Node ID d356e54bdafc10b862d8eac8ac50e5345e742a4e # Parent 51d5d41e15b16e3eb468bc1384ed112e2b5bc38d Upgrading tests diff -r 51d5d41e15b1 -r d356e54bdafc test/all_pairs_shortest_path_test.cc --- a/test/all_pairs_shortest_path_test.cc Wed Oct 26 11:09:29 2005 +0000 +++ b/test/all_pairs_shortest_path_test.cc Wed Oct 26 11:10:18 2005 +0000 @@ -9,6 +9,8 @@ #include #include +#include + #include #include "test_tools.h" @@ -56,6 +58,15 @@ cout << "Johnson: " << timer << endl; } + typedef FibHeap > DoubleFibHeap; + Johnson::DefStandardHeap + ::Create fibJohnson(graph, length); + { + Timer timer; + fibJohnson.run(); + cout << "Johnson with fibonacci heap: " << timer << endl; + } + FloydWarshall floyd(graph, length); { Timer timer; @@ -67,14 +78,22 @@ for (NodeIt jt(graph); jt != INVALID; ++jt) { check(johnson.connected(it, jt) == floyd.connected(it, jt), "Wrong connection in all pairs shortest path"); + check(johnson.connected(it, jt) == fibJohnson.connected(it, jt), + "Wrong connection in all pairs shortest path"); if (johnson.connected(it, jt)) { check(johnson.dist(it, jt) == floyd.dist(it, jt), "Wrong distance in all pairs shortest path"); + check(johnson.dist(it, jt) == fibJohnson.dist(it, jt), + "Wrong distance in all pairs shortest path"); if (it != jt) { check(johnson.dist(it, jt) == johnson.dist(it, johnson.predNode(it, jt)) + length[johnson.pred(it, jt)], "Wrong edge in all pairs shortest path"); + check(fibJohnson.dist(it, jt) == + fibJohnson.dist(it, fibJohnson.predNode(it, jt)) + + length[fibJohnson.pred(it, jt)], + "Wrong edge in all pairs shortest path"); check(floyd.dist(it, jt) == floyd.dist(it, floyd.predNode(it, jt)) + length[floyd.pred(it, jt)], diff -r 51d5d41e15b1 -r d356e54bdafc test/heap_test.h --- a/test/heap_test.h Wed Oct 26 11:09:29 2005 +0000 +++ b/test/heap_test.h Wed Oct 26 11:10:18 2005 +0000 @@ -78,7 +78,7 @@ typedef typename Graph::NodeIt NodeIt; typedef typename Graph::EdgeIt EdgeIt; - typename Dijkstra::template DefHeap:: + typename Dijkstra::template DefStandardHeap:: Create dijkstra(graph, length); dijkstra.run(start);