libnabo  1.1.2
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Nabo::IndexHeapSTL< IT, VT > Struct Template Reference

balanced-tree implementation of heap More...

#include <index_heap.h>

Classes

struct  Entry
 an entry of the heap tree More...
 

Public Types

typedef IT Index
 type of an index
 
typedef VT Value
 type of a value
 
typedef std::vector< EntryEntries
 vector of entry, type for the storage of the tree
 
typedef Eigen::Matrix< Index, Eigen::Dynamic, 1 > IndexVector
 vector of indices
 
typedef Eigen::Matrix< Value, Eigen::Dynamic, 1 > ValueVector
 vector of values
 

Public Member Functions

 IndexHeapSTL (const size_t size)
 Constructor. More...
 
void reset ()
 reset to the empty heap
 
const VT & headValue () const
 get the largest value of the heap More...
 
void replaceHead (const Index index, const Value value)
 put value into heap, replace the largest value if full More...
 
void sort ()
 sort the entries, from the smallest to the largest
 
template<typename DI , typename DV >
void getData (const Eigen::MatrixBase< DI > &indices, const Eigen::MatrixBase< DV > &values) const
 get the data from the heap More...
 

Public Attributes

Entries data
 storage for the tree
 
const size_t nbNeighbours
 number of neighbours requested
 

Detailed Description

template<typename IT, typename VT>
struct Nabo::IndexHeapSTL< IT, VT >

balanced-tree implementation of heap

It uses a binary heap, which provides replacement in O(log(n)), however the constant overhead is significative.

Constructor & Destructor Documentation

◆ IndexHeapSTL()

template<typename IT , typename VT >
Nabo::IndexHeapSTL< IT, VT >::IndexHeapSTL ( const size_t  size)
inline

Constructor.

Parameters
sizenumber of elements in the heap

Member Function Documentation

◆ getData()

template<typename IT , typename VT >
template<typename DI , typename DV >
void Nabo::IndexHeapSTL< IT, VT >::getData ( const Eigen::MatrixBase< DI > &  indices,
const Eigen::MatrixBase< DV > &  values 
) const
inline

get the data from the heap

Parameters
indicesindex vector
valuesvalue vector

◆ headValue()

template<typename IT , typename VT >
const VT& Nabo::IndexHeapSTL< IT, VT >::headValue ( ) const
inline

get the largest value of the heap

Returns
the largest value in the heap

◆ replaceHead()

template<typename IT , typename VT >
void Nabo::IndexHeapSTL< IT, VT >::replaceHead ( const Index  index,
const Value  value 
)
inline

put value into heap, replace the largest value if full

Parameters
indexnew point index
valuenew distance value

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