# HG changeset patch # User Peter Kovacs # Date 2009-07-09 02:39:47 # Node ID bdc7dfc8c054a3033e317e4aee597ac5c11af468 # Parent d1a9224f1e305286f983295c5215b2fa7b8ae0bc Bug fix in PairingHeap::pop() (#301) 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 IntHeap; -// checkConcept, IntHeap>(); -// heapSortTest(); -// heapIncreaseTest(); -// -// typedef PairingHeap NodeHeap; -// checkConcept, NodeHeap>(); -// dijkstraHeapTest(digraph, length, source); -// } + { + typedef PairingHeap IntHeap; + checkConcept, IntHeap>(); + heapSortTest(); + heapIncreaseTest(); + + typedef PairingHeap NodeHeap; + checkConcept, NodeHeap>(); + dijkstraHeapTest(digraph, length, source); + } // RadixHeap {