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

brute-force implementation of heap More...

#include <index_heap.h>

Classes

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

Public Types

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

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 More...
 
const VT & headValue () const
 get the largest value of the heap More...
 
 IndexHeapBruteForceVector (const size_t size)
 Constructor. More...
 
void replaceHead (const Index index, const Value value)
 replace the largest value of the heap More...
 
void reset ()
 reset to the empty heap More...
 
void sort ()
 sort the entries, from the smallest to the largest More...
 

Public Attributes

Entries data
 storage for the tree More...
 
const VT & headValueRef
 reference to the largest value in the tree, to optimise access speed More...
 
const size_t sizeMinusOne
 pre-competed size minus one, to optimise access speed More...
 

Detailed Description

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

brute-force implementation of heap

It uses a vector and linear search, which provides replacement in O(n), but with a very low constant overhead.

Definition at line 264 of file index_heap.h.

Member Typedef Documentation

◆ Entries

template<typename IT , typename VT >
typedef std::vector<Entry> Nabo::IndexHeapBruteForceVector< IT, VT >::Entries

vector of entry, type for the storage of the tree

Definition at line 283 of file index_heap.h.

◆ Index

template<typename IT , typename VT >
typedef IT Nabo::IndexHeapBruteForceVector< IT, VT >::Index

type of an index

Definition at line 267 of file index_heap.h.

◆ IndexVector

template<typename IT , typename VT >
typedef Eigen::Matrix<Index, Eigen::Dynamic, 1> Nabo::IndexHeapBruteForceVector< IT, VT >::IndexVector

vector of indices

Definition at line 285 of file index_heap.h.

◆ Value

template<typename IT , typename VT >
typedef VT Nabo::IndexHeapBruteForceVector< IT, VT >::Value

type of a value

Definition at line 269 of file index_heap.h.

◆ ValueVector

template<typename IT , typename VT >
typedef Eigen::Matrix<Value, Eigen::Dynamic, 1> Nabo::IndexHeapBruteForceVector< IT, VT >::ValueVector

vector of values

Definition at line 287 of file index_heap.h.

Constructor & Destructor Documentation

◆ IndexHeapBruteForceVector()

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

Constructor.

Parameters
sizenumber of elements in the heap

Definition at line 298 of file index_heap.h.

Member Function Documentation

◆ getData()

template<typename IT , typename VT >
template<typename DI , typename DV >
void Nabo::IndexHeapBruteForceVector< 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

Definition at line 346 of file index_heap.h.

◆ headValue()

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

get the largest value of the heap

Returns
the smallest value in the heap

Definition at line 317 of file index_heap.h.

◆ replaceHead()

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

replace the largest value of the heap

Parameters
indexnew point index
valuenew distance value

Definition at line 322 of file index_heap.h.

◆ reset()

template<typename IT , typename VT >
void Nabo::IndexHeapBruteForceVector< IT, VT >::reset ( )
inline

reset to the empty heap

Definition at line 306 of file index_heap.h.

◆ sort()

template<typename IT , typename VT >
void Nabo::IndexHeapBruteForceVector< IT, VT >::sort ( )
inline

sort the entries, from the smallest to the largest

Definition at line 337 of file index_heap.h.

Member Data Documentation

◆ data

template<typename IT , typename VT >
Entries Nabo::IndexHeapBruteForceVector< IT, VT >::data

storage for the tree

Definition at line 290 of file index_heap.h.

◆ headValueRef

template<typename IT , typename VT >
const VT& Nabo::IndexHeapBruteForceVector< IT, VT >::headValueRef

reference to the largest value in the tree, to optimise access speed

Definition at line 292 of file index_heap.h.

◆ sizeMinusOne

template<typename IT , typename VT >
const size_t Nabo::IndexHeapBruteForceVector< IT, VT >::sizeMinusOne

pre-competed size minus one, to optimise access speed

Definition at line 294 of file index_heap.h.


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


libnabo
Author(s): Stéphane Magnenat
autogenerated on Mon Feb 28 2022 22:41:38