20 #ifndef FMPRIORITYQUEUE_H_
21 #define FMPRIORITYQUEUE_H_
23 #include <boost/heap/priority_queue.hpp>
25 #include <fast_methods/datastructures/fmcompare.hpp>
59 const int idx =
heap_.top()->getIndex();
84 boost::heap::priority_queue<const cell_t *, boost::heap::compare<FMCompare<cell_t> > >
heap_;
void clear()
Deallocates heap memory.
Wrap for the Boost Priority Queue class to be used in the FM algorithms. Ready to be used with FMCell...
size_t size() const
Returns current size of the heap.
bool empty() const
Returns true if the heap is empty.
void setMaxSize(const int &n)
Sets the maximum number of cells the heap will contain.
FMPriorityQueue(const int &n)
Shorthand for heap element handle type.
boost::heap::priority_queue< const cell_t *, boost::heap::compare< FMCompare< cell_t > > > heap_
The actual queue for FMCells.
void increase(const cell_t *c)
Priority queues do not allow key increasing. Therefore, it pushes the element again. This is done so that SFMM is implemented as FMM with this heap.
void push(const cell_t *c)
Pushes a new element into the heap.
int popMinIdx()
Pops index of the element with lowest value and removes it from the heap.