cvflann::Heap< T > Class Template Reference
#include <heap.h>
List of all members.
Detailed Description
template<typename T>
class cvflann::Heap< T >
Priority Queue Implementation
The priority queue is implemented with a heap. A heap is a complete (full) binary tree in which each parent is less than both of its children, but the order of the children is unspecified. Note that a heap uses 1-based indexing to allow for power-of-2 location of parents and children. We ignore element 0 of Heap array.
Definition at line 51 of file heap.h.
Constructor & Destructor Documentation
Constructor.
Params: size = heap size
Definition at line 75 of file heap.h.
Destructor.
Definition at line 87 of file heap.h.
Member Function Documentation
Clears the heap.
Definition at line 114 of file heap.h.
Tests if the heap is empty
Returns: true is heap empty, false otherwise
Definition at line 106 of file heap.h.
Reorganizes the heap (a parent is smaller than its children) starting with a node.
Params: parent = node form which to start heap reorganization.
Definition at line 182 of file heap.h.
Insert a new element in the heap.
We select the next empty leaf node, and then keep moving any larger parents down until the right location is found to store this element.
Params: value = the new element to be inserted in the heap
Definition at line 129 of file heap.h.
Returns the node of minimum value from the heap (top of the heap).
Params: value = out parameter used to return the min element Returns: false if heap empty
Definition at line 158 of file heap.h.
Returns: heap size
Definition at line 96 of file heap.h.
Member Data Documentation
Number of element in the heap
Definition at line 63 of file heap.h.
Storage array for the heap. Type T must be comparable.
Definition at line 57 of file heap.h.
The documentation for this class was generated from the following file: