Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
picoflann::KdTreeIndex< DIMS, Adapter, DistanceType > Class Template Reference

#include <picoflann.h>

Classes

struct  Index
 
struct  Node
 
class  ResultSet
 

Public Member Functions

template<typename Container >
void build (const Container &container)
 
void clear ()
 
void fromStream (std::istream &str)
 
template<typename Type , typename Container >
std::vector< std::pair< uint32_t, double > > radiusSearch (const Container &container, const Type &val, double dist, bool sorted=true, int maxNN=-1) const
 
template<typename Type , typename Container >
void radiusSearch (std::vector< std::pair< uint32_t, double > > &res, const Container &container, const Type &val, double dist, bool sorted=true, int maxNN=-1)
 
template<typename Type , typename Container >
std::vector< std::pair< uint32_t, double > > searchKnn (const Container &container, const Type &val, int nn, bool sorted=true)
 
void toStream (std::ostream &str) const
 

Private Types

typedef std::vector< std::pair< double, double > > BoundingBox
 

Private Member Functions

template<typename Container >
void computeBoundingBox (BoundingBox &bbox, int start, int end, const Container &container)
 
template<typename Type >
double computeInitialDistances (const Type &elem, double dists[], const BoundingBox &bbox) const
 
template<typename Container >
void divideTree (Index &index, uint64_t nodeIdx, int startIndex, int endIndex, BoundingBox &bbox, const Container &container)
 
template<typename Type , typename Container >
void generalSearch (std::vector< std::pair< uint32_t, double > > &res, const Container &container, const Type &val, double dist, bool sorted=true, uint32_t maxNn=std::numeric_limits< int >::max()) const
 
template<typename Container >
void mean_var_calculate (int startindex, int endIndex, double var[], double mean[], const Container &container)
 
template<typename Container >
void planeSplit (uint32_t *ind, int count, int cutfeat, float cutval, int &lim1, int &lim2, const Container &container)
 
template<typename Type , typename Container >
void searchExactLevel (const Index &index, int64_t nodeIdx, const Type &elem, ResultSet &res, double mindistsq, double dists[], double epsError, const Container &container) const
 

Private Attributes

DistanceType _distance
 
Index _index
 
int _maxLeafSize = 10
 
Adapter adapter
 
std::vector< uint32_t > all_indices
 

Detailed Description

template<int DIMS, typename Adapter, typename DistanceType = L2>
class picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >

Definition at line 149 of file picoflann.h.

Member Typedef Documentation

◆ BoundingBox

template<int DIMS, typename Adapter , typename DistanceType = L2>
typedef std::vector<std::pair<double, double> > picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::BoundingBox
private

Definition at line 240 of file picoflann.h.

Member Function Documentation

◆ build()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::build ( const Container &  container)
inline

Builds the index using the data passes in your container and the adapter

Definition at line 156 of file picoflann.h.

◆ clear()

template<int DIMS, typename Adapter , typename DistanceType = L2>
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::clear ( )
inline

Definition at line 174 of file picoflann.h.

◆ computeBoundingBox()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::computeBoundingBox ( BoundingBox bbox,
int  start,
int  end,
const Container &  container 
)
inlineprivate

Definition at line 398 of file picoflann.h.

◆ computeInitialDistances()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Type >
double picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::computeInitialDistances ( const Type &  elem,
double  dists[],
const BoundingBox bbox 
) const
inlineprivate

Definition at line 500 of file picoflann.h.

◆ divideTree()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::divideTree ( Index index,
uint64_t  nodeIdx,
int  startIndex,
int  endIndex,
BoundingBox bbox,
const Container &  container 
)
inlineprivate

SELECT THE COL (DIMENSION) ON WHICH PARTITION IS MADE

SELECT THE COL (DIMENSION) ON WHICH PARTITION IS MADE

Definition at line 261 of file picoflann.h.

◆ fromStream()

template<int DIMS, typename AAdapter , typename DistanceType >
void picoflann::KdTreeIndex< DIMS, AAdapter, DistanceType >::fromStream ( std::istream &  str)
inline

Definition at line 786 of file picoflann.h.

◆ generalSearch()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Type , typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::generalSearch ( std::vector< std::pair< uint32_t, double > > &  res,
const Container &  container,
const Type &  val,
double  dist,
bool  sorted = true,
uint32_t  maxNn = std::numeric_limits<int>::max() 
) const
inlineprivate

Definition at line 525 of file picoflann.h.

◆ mean_var_calculate()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::mean_var_calculate ( int  startindex,
int  endIndex,
double  var[],
double  mean[],
const Container &  container 
)
inlineprivate

Definition at line 418 of file picoflann.h.

◆ planeSplit()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::planeSplit ( uint32_t *  ind,
int  count,
int  cutfeat,
float  cutval,
int &  lim1,
int &  lim2,
const Container &  container 
)
inlineprivate

Subdivide the list of points by a plane perpendicular on axe corresponding to the 'cutfeat' dimension at 'cutval' position.

On return: dataset[ind[0..lim1-1]][cutfeat]<cutval dataset[ind[lim1..lim2-1]][cutfeat]==cutval dataset[ind[lim2..count]][cutfeat]>cutval

Definition at line 463 of file picoflann.h.

◆ radiusSearch() [1/2]

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Type , typename Container >
std::vector<std::pair<uint32_t, double> > picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::radiusSearch ( const Container &  container,
const Type &  val,
double  dist,
bool  sorted = true,
int  maxNN = -1 
) const
inline

Definition at line 197 of file picoflann.h.

◆ radiusSearch() [2/2]

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Type , typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::radiusSearch ( std::vector< std::pair< uint32_t, double > > &  res,
const Container &  container,
const Type &  val,
double  dist,
bool  sorted = true,
int  maxNN = -1 
)
inline

Definition at line 209 of file picoflann.h.

◆ searchExactLevel()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Type , typename Container >
void picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::searchExactLevel ( const Index index,
int64_t  nodeIdx,
const Type &  elem,
ResultSet res,
double  mindistsq,
double  dists[],
double  epsError,
const Container &  container 
) const
inlineprivate

Definition at line 663 of file picoflann.h.

◆ searchKnn()

template<int DIMS, typename Adapter , typename DistanceType = L2>
template<typename Type , typename Container >
std::vector<std::pair<uint32_t, double> > picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::searchKnn ( const Container &  container,
const Type &  val,
int  nn,
bool  sorted = true 
)
inline

Definition at line 186 of file picoflann.h.

◆ toStream()

template<int DIMS, typename AAdapter , typename DistanceType >
void picoflann::KdTreeIndex< DIMS, AAdapter, DistanceType >::toStream ( std::ostream &  str) const
inline

Definition at line 780 of file picoflann.h.

Member Data Documentation

◆ _distance

template<int DIMS, typename Adapter , typename DistanceType = L2>
DistanceType picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::_distance
private

Definition at line 251 of file picoflann.h.

◆ _index

template<int DIMS, typename Adapter , typename DistanceType = L2>
Index picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::_index
private

Definition at line 250 of file picoflann.h.

◆ _maxLeafSize

template<int DIMS, typename Adapter , typename DistanceType = L2>
int picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::_maxLeafSize = 10
private

Definition at line 255 of file picoflann.h.

◆ adapter

template<int DIMS, typename Adapter , typename DistanceType = L2>
Adapter picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::adapter
private

Definition at line 252 of file picoflann.h.

◆ all_indices

template<int DIMS, typename Adapter , typename DistanceType = L2>
std::vector<uint32_t> picoflann::KdTreeIndex< DIMS, Adapter, DistanceType >::all_indices
private

Definition at line 254 of file picoflann.h.


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


aruco
Author(s): Rafael Muñoz Salinas , Bence Magyar
autogenerated on Sat Sep 23 2023 02:26:45