[Lemon-commits] Peter Kovacs: Bug fix in PairingHeap::pop() (#301)

Lemon HG hg at lemon.cs.elte.hu
Mon Aug 31 12:21:04 CEST 2009


details:   http://lemon.cs.elte.hu/hg/lemon/rev/bdc7dfc8c054
changeset: 755:bdc7dfc8c054
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Thu Jul 09 02:39:47 2009 +0200
description:
	Bug fix in PairingHeap::pop() (#301)

diffstat:

 lemon/pairing_heap.h |   2 ++
 test/heap_test.cc    |  20 ++++++++++----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diffs (42 lines):

diff --git a/lemon/pairing_heap.h b/lemon/pairing_heap.h
--- a/lemon/pairing_heap.h
+++ b/lemon/pairing_heap.h
@@ -266,6 +266,8 @@
         minimum = container[minimum].child;
       }
 
+      if (minimum >= 0) container[minimum].left_child = false;
+
       --num_items;
     }
 
diff --git a/test/heap_test.cc b/test/heap_test.cc
--- a/test/heap_test.cc
+++ b/test/heap_test.cc
@@ -222,16 +222,16 @@
   }
 
   // PairingHeap
-//  {
-//    typedef PairingHeap<Prio, ItemIntMap> IntHeap;
-//    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
-//    heapSortTest<IntHeap>();
-//    heapIncreaseTest<IntHeap>();
-//
-//    typedef PairingHeap<Prio, IntNodeMap > NodeHeap;
-//    checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
-//    dijkstraHeapTest<NodeHeap>(digraph, length, source);
-//  }
+  {
+    typedef PairingHeap<Prio, ItemIntMap> IntHeap;
+    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
+    heapSortTest<IntHeap>();
+    heapIncreaseTest<IntHeap>();
+
+    typedef PairingHeap<Prio, IntNodeMap > NodeHeap;
+    checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
+    dijkstraHeapTest<NodeHeap>(digraph, length, source);
+  }
 
   // RadixHeap
   {



More information about the Lemon-commits mailing list