opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Heap< T > Class Template Reference

Heap< T > Class Template Reference

Priority Queue Implementation. More...

#include <heap.h>

Public Member Functions

 Heap (int sz)
 Constructor.
int size ()
 Returns: heap size.
bool empty ()
 Tests if the heap is empty.
void clear ()
 Clears the heap.
void insert (T value)
 Insert a new element in the heap.
bool popMin (T &value)
 Returns the node of minimum value from the heap (top of the heap).

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.

Definition at line 48 of file heap.h.


Constructor & Destructor Documentation

Heap ( int  sz )

Constructor.

Params: sz = heap size

Definition at line 73 of file heap.h.


Member Function Documentation

void clear (  )

Clears the heap.

Definition at line 102 of file heap.h.

bool empty (  )

Tests if the heap is empty.

Returns: true is heap empty, false otherwise

Definition at line 94 of file heap.h.

void insert ( value )

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 125 of file heap.h.

bool popMin ( T &  value )

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 147 of file heap.h.

int size (  )

Returns: heap size.

Definition at line 84 of file heap.h.