23 #include <boost/heap/fibonacci_heap.hpp>
25 #include <fast_methods/datastructures/fmcompare.hpp>
31 typedef boost::heap::fibonacci_heap<const cell_t *, boost::heap::compare<FMCompare<cell_t> > >
fib_heap_t;
34 typedef typename fib_heap_t::handle_type
handle_t;
58 const unsigned int idx =
heap_.top()->getIndex();
void setMaxSize(const size_t &n)
Sets the maximum number of cells the heap will contain.
void update(const cell_t *c)
Updates the position of the cell in the heap. Its priority can increase or decrease.
fib_heap_t heap_
The actual heap for cell_t.
size_t size() const
Returns current size of the heap.
void increase(const cell_t *c)
Updates the position of the cell in the heap. Its priority can only increase. It is more efficient th...
void clear()
Deallocates heap memory.
fib_heap_t::handle_type handle_t
Shorthand for heap element handle type.
std::vector< handle_t > handles_
Stores the handles of each cell by keeping the indices: handles_(0) is the handle for the cell with i...
FMFibHeap(const size_t &n)
Creates a heap with n maximum elements.
boost::heap::fibonacci_heap< const cell_t *, boost::heap::compare< FMCompare< cell_t > > > fib_heap_t
Shorthand for heap type.
void push(const cell_t *c)
Pushes a new element into the heap.
bool empty() const
Returns true if the heap is empty.
unsigned int popMinIdx()
Pops index of the element with lowest value and removes it from the heap.