n-Dimensional Fast Methods  0.7
 All Classes Functions Variables Typedefs Pages
FMFibHeap< cell_t > Class Template Reference

#include <fmfibheap.hpp>

Public Member Functions

 FMFibHeap (const size_t &n)
 Creates a heap with n maximum elements.
 
void setMaxSize (const size_t &n)
 Sets the maximum number of cells the heap will contain.
 
void push (const cell_t *c)
 Pushes a new element into the heap.
 
unsigned int popMinIdx ()
 Pops index of the element with lowest value and removes it from the heap.
 
size_t size () const
 Returns current size of the heap.
 
void update (const cell_t *c)
 Updates the position of the cell in the heap. Its priority can increase or decrease.
 
void increase (const cell_t *c)
 Updates the position of the cell in the heap. Its priority can only increase. It is more efficient than the update() function if it is ensured that the priority will increase.
 
void clear ()
 Deallocates heap memory.
 
bool empty () const
 Returns true if the heap is empty.
 

Protected Attributes

fib_heap_t heap_
 The actual heap for cell_t. More...
 
std::vector< handle_thandles_
 Stores the handles of each cell by keeping the indices: handles_(0) is the handle for the cell with index 0 in the grid. Makes possible to update the heap.
 

Private Types

typedef
boost::heap::fibonacci_heap
< const cell_t
*, boost::heap::compare
< FMCompare< cell_t > > > 
fib_heap_t
 Shorthand for heap type.
 
typedef fib_heap_t::handle_type handle_t
 Shorthand for heap element handle type.
 

Detailed Description

template<class cell_t = FMCell>
class FMFibHeap< cell_t >

Note
for memory efficiency, use map instead of vector for handles_.

Definition at line 28 of file fmfibheap.hpp.

Member Data Documentation

template<class cell_t = FMCell>
fib_heap_t FMFibHeap< cell_t >::heap_
protected

The actual heap for cell_t.

Definition at line 98 of file fmfibheap.hpp.


The documentation for this class was generated from the following file: