ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
flann::Heap< T > Class Template Reference

#include <heap.h>

Classes

struct  CompareT
 

Public Member Functions

 Heap (int size)
 
int size ()
 
bool empty ()
 
void clear ()
 
void insert (const T &value)
 
bool popMin (T &value)
 

Detailed Description

template<typename T>
class flann::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()

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

Constructor.

Params: size = heap size

Definition at line 73 of file heap.h.

References count, length(), and flann::Heap< T >::size().

Member Function Documentation

◆ clear()

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

Clears the heap.

Definition at line 102 of file heap.h.

References count.

◆ empty()

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

Tests if the heap is empty

Returns: true is heap empty, false otherwise

Definition at line 94 of file heap.h.

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

◆ insert()

template<typename T >
void flann::Heap< T >::insert ( const T &  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

Definition at line 127 of file heap.h.

References count, and length().

◆ popMin()

template<typename T >
bool flann::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

Definition at line 149 of file heap.h.

References count.

◆ size()

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

Returns: heap size

Definition at line 84 of file heap.h.

References count.

Referenced by flann::Heap< T >::empty(), and flann::Heap< T >::Heap().


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