OpenCV  4.1.1-pre
Open Source Computer Vision
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
cvflann::Heap< T > Class Template Reference

Priority Queue Implementation. More...

#include <opencv2/flann/heap.h>

Classes

struct  CompareT
 

Public Member Functions

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

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.

Constructor & Destructor Documentation

◆ Heap()

template<typename T>
cvflann::Heap< T >::Heap ( int  sz)
inline

Constructor.

Params: sz = heap size

Member Function Documentation

◆ clear()

template<typename T>
void cvflann::Heap< T >::clear ( )
inline

Clears the heap.

◆ empty()

template<typename T>
bool cvflann::Heap< T >::empty ( )
inline

Tests if the heap is empty.

Returns: true is heap empty, false otherwise

References cvflann::Heap< T >::size().

Here is the call graph for this function:

◆ insert()

template<typename T>
void cvflann::Heap< T >::insert ( value)
inline

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

Referenced by cvflann::KDTreeIndex< Distance >::getParameters(), cvflann::KMeansIndex< Distance >::getParameters(), and cvflann::HierarchicalClusteringIndex< Distance >::getParameters().

Here is the caller graph for this function:

◆ popMin()

template<typename T>
bool cvflann::Heap< T >::popMin ( T &  value)
inline

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

Referenced by cvflann::KMeansIndex< Distance >::findNeighbors(), cvflann::HierarchicalClusteringIndex< Distance >::findNeighbors(), and cvflann::KDTreeIndex< Distance >::getParameters().

Here is the caller graph for this function:

◆ size()

template<typename T>
int cvflann::Heap< T >::size ( )
inline

Returns: heap size.

Referenced by cvflann::Heap< T >::empty().

Here is the caller graph for this function:

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