20 #ifndef FMUNTIDYQUEUE_HPP_
21 #define FMUNTIDYQUEUE_HPP_
23 #include <fast_methods/thirdparty/untidy_queue.hpp>
24 #include <fast_methods/ndgridmap/fmcell.h>
32 (
unsigned s = 1000,
double inc = 2) {
33 queue_ =
new levelset::PriorityQueue<const cell_t * >(s, inc);
41 c->setBucket(
queue_->push(c, c->getArrivalTime()) );
54 c->setBucket(
queue_->increase_priority(c, c->getBucket(), c->getArrivalTime()) );
60 return queue_->top()->getIndex();
83 levelset::PriorityQueue<const cell_t * > *
queue_;
void push(cell_t *c)
Pushes a new element into the heap.
size_t size() const
Returns current size of the heap.
FMUntidyQueue(unsigned s=1000, double inc=2)
Creates an object with s buckets of size s.
Wraps the UntidyQueue implementation by Jerome Piovano
void increase(cell_t *c)
Updates the position of the cell in the priority queue. Its priority can only increase. Also updates the bucket of the cell.
void pop()
Removes the top value of the heap.
bool empty() const
Returns true if the heap is empty.
levelset::PriorityQueue< const cell_t * > * queue_
The actual Unitidy queue for cell_t.
void clear()
Deallocates heap memory.
unsigned int topIdx()
Returns index of the element with lowest value (to be popped next).