balanced-tree implementation of heap More...
#include <index_heap.h>
Classes | |
struct | Entry |
an entry of the heap tree More... | |
Public Types | |
typedef std::vector< Entry > | Entries |
vector of entry, type for the storage of the tree | |
typedef IT | Index |
type of an index | |
typedef Eigen::Matrix< Index, Eigen::Dynamic, 1 > | IndexVector |
vector of indices | |
typedef VT | Value |
type of a value | |
typedef Eigen::Matrix< Value, Eigen::Dynamic, 1 > | ValueVector |
vector of values | |
Public Member Functions | |
template<typename DI , typename DV > | |
void | getData (const Eigen::MatrixBase< DI > &indices, const Eigen::MatrixBase< DV > &values) const |
get the data from the heap | |
const VT & | headValue () const |
get the largest value of the heap | |
IndexHeapSTL (const size_t size) | |
Constructor. | |
void | replaceHead (const Index index, const Value value) |
put value into heap, replace the largest value if full | |
void | reset () |
reset to the empty heap | |
void | sort () |
sort the entries, from the smallest to the largest | |
Public Attributes | |
Entries | data |
storage for the tree | |
const size_t | nbNeighbours |
number of neighbours requested |
balanced-tree implementation of heap
It uses a binary heap, which provides replacement in O(log(n)), however the constant overhead is significative.
Definition at line 52 of file index_heap.h.
typedef std::vector<Entry> Nabo::IndexHeapSTL< IT, VT >::Entries |
vector of entry, type for the storage of the tree
Definition at line 71 of file index_heap.h.
typedef IT Nabo::IndexHeapSTL< IT, VT >::Index |
type of an index
Definition at line 55 of file index_heap.h.
typedef Eigen::Matrix<Index, Eigen::Dynamic, 1> Nabo::IndexHeapSTL< IT, VT >::IndexVector |
vector of indices
Definition at line 73 of file index_heap.h.
typedef VT Nabo::IndexHeapSTL< IT, VT >::Value |
type of a value
Definition at line 57 of file index_heap.h.
typedef Eigen::Matrix<Value, Eigen::Dynamic, 1> Nabo::IndexHeapSTL< IT, VT >::ValueVector |
vector of values
Definition at line 75 of file index_heap.h.
Nabo::IndexHeapSTL< IT, VT >::IndexHeapSTL | ( | const size_t | size | ) | [inline] |
Constructor.
size | number of elements in the heap |
Definition at line 85 of file index_heap.h.
void Nabo::IndexHeapSTL< IT, VT >::getData | ( | const Eigen::MatrixBase< DI > & | indices, |
const Eigen::MatrixBase< DV > & | values | ||
) | const [inline] |
get the data from the heap
indices | index vector |
values | value vector |
Definition at line 132 of file index_heap.h.
const VT& Nabo::IndexHeapSTL< IT, VT >::headValue | ( | ) | const [inline] |
get the largest value of the heap
Definition at line 101 of file index_heap.h.
void Nabo::IndexHeapSTL< IT, VT >::replaceHead | ( | const Index | index, |
const Value | value | ||
) | [inline] |
put value into heap, replace the largest value if full
index | new point index |
value | new distance value |
Definition at line 106 of file index_heap.h.
void Nabo::IndexHeapSTL< IT, VT >::reset | ( | ) | [inline] |
reset to the empty heap
Definition at line 93 of file index_heap.h.
void Nabo::IndexHeapSTL< IT, VT >::sort | ( | ) | [inline] |
sort the entries, from the smallest to the largest
Definition at line 123 of file index_heap.h.
Entries Nabo::IndexHeapSTL< IT, VT >::data |
storage for the tree
Definition at line 78 of file index_heap.h.
const size_t Nabo::IndexHeapSTL< IT, VT >::nbNeighbours |
number of neighbours requested
Definition at line 80 of file index_heap.h.