Bug fix in PairingHeap::pop() (#301)
authorPeter Kovacs <kpeter@inf.elte.hu>
Thu, 09 Jul 2009 02:39:47 +0200
changeset 702bdc7dfc8c054
parent 701 d1a9224f1e30
child 703 bb3392fe91f2
Bug fix in PairingHeap::pop() (#301)
lemon/pairing_heap.h
test/heap_test.cc
     1.1 --- a/lemon/pairing_heap.h	Thu Jul 09 02:38:01 2009 +0200
     1.2 +++ b/lemon/pairing_heap.h	Thu Jul 09 02:39:47 2009 +0200
     1.3 @@ -266,6 +266,8 @@
     1.4          minimum = container[minimum].child;
     1.5        }
     1.6  
     1.7 +      if (minimum >= 0) container[minimum].left_child = false;
     1.8 +
     1.9        --num_items;
    1.10      }
    1.11  
     2.1 --- a/test/heap_test.cc	Thu Jul 09 02:38:01 2009 +0200
     2.2 +++ b/test/heap_test.cc	Thu Jul 09 02:39:47 2009 +0200
     2.3 @@ -222,16 +222,16 @@
     2.4    }
     2.5  
     2.6    // PairingHeap
     2.7 -//  {
     2.8 -//    typedef PairingHeap<Prio, ItemIntMap> IntHeap;
     2.9 -//    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    2.10 -//    heapSortTest<IntHeap>();
    2.11 -//    heapIncreaseTest<IntHeap>();
    2.12 -//
    2.13 -//    typedef PairingHeap<Prio, IntNodeMap > NodeHeap;
    2.14 -//    checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    2.15 -//    dijkstraHeapTest<NodeHeap>(digraph, length, source);
    2.16 -//  }
    2.17 +  {
    2.18 +    typedef PairingHeap<Prio, ItemIntMap> IntHeap;
    2.19 +    checkConcept<Heap<Prio, ItemIntMap>, IntHeap>();
    2.20 +    heapSortTest<IntHeap>();
    2.21 +    heapIncreaseTest<IntHeap>();
    2.22 +
    2.23 +    typedef PairingHeap<Prio, IntNodeMap > NodeHeap;
    2.24 +    checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>();
    2.25 +    dijkstraHeapTest<NodeHeap>(digraph, length, source);
    2.26 +  }
    2.27  
    2.28    // RadixHeap
    2.29    {