Opened 6 years ago
Last modified 6 years ago
#12679 new Bugs
Merging heaps causes them to "forget" pending lazy updates.
Reported by: | Owned by: | timblechmann | |
---|---|---|---|
Milestone: | To Be Determined | Component: | heap |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | heap, lazy, merge | Cc: |
Description
In my opinion, a reasonable behavior for the code below would be to print out: 99, 2, 1, In reality, though, the output is: 2, 99, 1,
This means that the lazy_update() is somehow forgotten in the process of merging the two heaps.
boost::heap::fibonacci_heap<float> q1, q2; std::vector<boost::heap::fibonacci_heap<float>::handle_type> handles; handles.push_back(q1.push(0.f)); handles.push_back(q1.push(1.f)); handles.push_back(q2.push(2.f)); q1.update_lazy(handles[0], 99.f); q1.merge(q2); while (!q1.empty()) { std::cout << q1.top() << ", "; q1.pop(); }
Note:
See TracTickets
for help on using tickets.
I have tried this code. It is showing the expected behavior and printing 99,2,1.