[Lemon-commits] [lemon_svn] deba: r2273 - hugo/trunk/test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:51:25 CET 2006


Author: deba
Date: Wed Oct 26 13:10:18 2005
New Revision: 2273

Modified:
   hugo/trunk/test/all_pairs_shortest_path_test.cc
   hugo/trunk/test/heap_test.h

Log:
Upgrading tests



Modified: hugo/trunk/test/all_pairs_shortest_path_test.cc
==============================================================================
--- hugo/trunk/test/all_pairs_shortest_path_test.cc	(original)
+++ hugo/trunk/test/all_pairs_shortest_path_test.cc	Wed Oct 26 13:10:18 2005
@@ -9,6 +9,8 @@
 #include <lemon/floyd_warshall.h>
 #include <lemon/johnson.h>
 
+#include <lemon/fib_heap.h>
+
 #include <lemon/time_measure.h>
 #include "test_tools.h"
 
@@ -56,6 +58,15 @@
     cout << "Johnson: " << timer << endl;
   }
 
+  typedef FibHeap<Node, double, Graph::NodeMap<int> > DoubleFibHeap;
+  Johnson<Graph, LengthMap>::DefStandardHeap<DoubleFibHeap>
+    ::Create fibJohnson(graph, length);
+  {
+    Timer timer;
+    fibJohnson.run();
+    cout << "Johnson with fibonacci heap: " << timer << endl;
+  }
+
   FloydWarshall<Graph, LengthMap> 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)],

Modified: hugo/trunk/test/heap_test.h
==============================================================================
--- hugo/trunk/test/heap_test.h	(original)
+++ hugo/trunk/test/heap_test.h	Wed Oct 26 13:10:18 2005
@@ -78,7 +78,7 @@
   typedef typename Graph::NodeIt NodeIt;
   typedef typename Graph::EdgeIt EdgeIt;
 
-  typename Dijkstra<Graph, LengthMap>::template DefHeap<Heap>::
+  typename Dijkstra<Graph, LengthMap>::template DefStandardHeap<Heap>::
     Create dijkstra(graph, length);
 
   dijkstra.run(start);



More information about the Lemon-commits mailing list