# HG changeset patch
# User Peter Madarasi <madarasi@cs.elte.hu>
# Date 1665755093 -7200
# Fri Oct 14 15:44:53 2022 +0200
# Node ID 1f8d55a3912780197bb795344572db56421f10da
# Parent a278d16bd2d082aa3c52ff4a9b0e2224ddc0549a
Bugfix in binomial_heap.h and tests
diff -r a278d16bd2d0 -r 1f8d55a39127 lemon/binomial_heap.h
a
|
b
|
|
174 | 174 | _min=i; |
175 | 175 | } else { |
176 | 176 | merge(i); |
177 | | if( _comp(_data[i].prio, _data[_min].prio) ) _min=i; |
| 177 | _min=findMin(); |
178 | 178 | } |
179 | 179 | ++_num_items; |
180 | 180 | } |
diff -r a278d16bd2d0 -r 1f8d55a39127 test/heap_test.cc
a
|
b
|
|
255 | 255 | typedef BinomialHeap<Prio, IntNodeMap > NodeHeap; |
256 | 256 | checkConcept<Heap<Prio, IntNodeMap >, NodeHeap>(); |
257 | 257 | dijkstraHeapTest<NodeHeap>(digraph, length, source); |
| 258 | |
| 259 | { |
| 260 | ListDigraph g; |
| 261 | ListDigraph::Node v0 = g.addNode(); |
| 262 | ListDigraph::Node v1 = g.addNode(); |
| 263 | ListDigraph::NodeMap<int> ref(g,-1); |
| 264 | lemon::BinomialHeap<int,ListDigraph::NodeMap<int> > h(ref); |
| 265 | h.push(v0,0); |
| 266 | h.push(v1,0); |
| 267 | h.pop(); |
| 268 | h.pop(); |
| 269 | } |
258 | 270 | } |
259 | 271 | |
260 | 272 | // BucketHeap, SimpleBucketHeap |