nanoflann
C++ header-only ANN library
 All Classes Functions Variables Typedefs Groups Pages
Classes | Public Member Functions | Protected Types | Protected Member Functions | List of all members
nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType > Class Template Reference

#include <nanoflann.hpp>

Classes

struct  Interval
 
struct  Node
 

Public Member Functions

void freeIndex (Derived &obj)
 

Protected Types

typedef Distance::ElementType ElementType
 
typedef Distance::DistanceType DistanceType
 
typedef NodeNodePtr
 
typedef
array_or_vector_selector< DIM,
Interval >::container_t 
BoundingBox
 
typedef
array_or_vector_selector< DIM,
DistanceType >::container_t 
distance_vector_t
 

Protected Member Functions

size_t size (const Derived &obj) const
 
size_t veclen (const Derived &obj)
 
size_t usedMemory (Derived &obj)
 
void computeMinMax (const Derived &obj, IndexType *ind, IndexType count, int element, ElementType &min_elem, ElementType &max_elem)
 
NodePtr divideTree (Derived &obj, const IndexType left, const IndexType right, BoundingBox &bbox)
 
void middleSplit_ (Derived &obj, IndexType *ind, IndexType count, IndexType &index, int &cutfeat, DistanceType &cutval, const BoundingBox &bbox)
 
void planeSplit (Derived &obj, IndexType *ind, const IndexType count, int cutfeat, DistanceType &cutval, IndexType &lim1, IndexType &lim2)
 
DistanceType computeInitialDistances (const Derived &obj, const ElementType *vec, distance_vector_t &dists) const
 

Detailed Description

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
class nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >

kd-tree base-class

Contains the member functions common to the classes KDTreeSingleIndexAdaptor and KDTreeSingleIndexDynamicAdaptor_.

Template Parameters
DerivedThe name of the class which inherits this class.
DatasetAdaptorThe user-provided adaptor (see comments above).
DistanceThe distance metric to use, these are all classes derived from nanoflann::Metric
DIMDimensionality of data points (e.g. 3 for 3D points)
IndexTypeWill be typically size_t or int

Member Typedef Documentation

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
typedef array_or_vector_selector<DIM,Interval>::container_t nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::BoundingBox
protected

Define "BoundingBox" as a fixed-size or variable-size container depending on "DIM"

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
typedef array_or_vector_selector<DIM,DistanceType>::container_t nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::distance_vector_t
protected

Define "distance_vector_t" as a fixed-size or variable-size container depending on "DIM"

Member Function Documentation

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
NodePtr nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::divideTree ( Derived &  obj,
const IndexType  left,
const IndexType  right,
BoundingBox bbox 
)
inlineprotected

Create a tree node that subdivides the list of vecs from vind[first] to vind[last]. The routine is called recursively on each sublist.

Parameters
leftindex of the first vector
rightindex of the last vector
template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::freeIndex ( Derived &  obj)
inline

Frees the previously-built index. Automatically called within buildIndex().

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::planeSplit ( Derived &  obj,
IndexType *  ind,
const IndexType  count,
int  cutfeat,
DistanceType &  cutval,
IndexType &  lim1,
IndexType &  lim2 
)
inlineprotected

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

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
size_t nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::size ( const Derived &  obj) const
inlineprotected

Returns number of points in dataset

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
size_t nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::usedMemory ( Derived &  obj)
inlineprotected

Computes the inde memory usage Returns: memory used by the index

template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
size_t nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::veclen ( const Derived &  obj)
inlineprotected

Returns the length of each point in the dataset


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