adiar icon indicating copy to clipboard operation
adiar copied to clipboard

Add `.peek()`/`.top()` to sorters

Open SSoelvsten opened this issue 2 years ago • 0 comments

By adding a .peek / .top() function to both types of sorters, we can simplify the levelized priority queue and also the reduce algorithm: currently they both store the peeked values in their own variables.

  • [x] Add .top() to sorter<>.
  • [ ] Simplify __reduce_level in src/adiar/internal/reduce.h by using .top().
  • [ ] Simplify the bucketed levelized priority queue in src/adiar/internal/levelized_priority_queue.h by using .top().

Now that we are at it, we may as well include the following other functions of the priority queue.

  • [ ] Add a .peek() alias for .top()
  • [ ] Add a .pop() function to sorter<>

SSoelvsten avatar Jun 22 '22 09:06 SSoelvsten