adiar
adiar copied to clipboard
Add `.peek()`/`.top()` to sorters
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()
tosorter<>
. - [ ] 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 tosorter<>