template<class T, std::size_t N>
KDTree class

Container for the KD-tree.

Template parameters
T the type of point (must be a real floating point type)
N the dimension of the point (must be greater than zero)

Public types

using Point = Eigen::Matrix<T, N, 1>
using KDPointArray = std::vector<Point*>
using ArrayIter = KDPointArray::iterator
using SplitFunction = std::function<ArrayIter(const ArrayIter&, const ArrayIter&, const std::size_t)>

Constructors, destructors, conversion operators

KDTree() deleted
KDTree(const KDTree&) deleted
~KDTree() defaulted
KDTree(KDPointArray& arr, const SplitFunction& splitFun)

Public functions

auto operator=(const KDTree&) -> KDTree& deleted
auto nearest(const Point& point) const -> Point
auto memoryUsage() -> std::size_t

Typedef documentation

template<class T, std::size_t N>
typedef Eigen::Matrix<T, N, 1> KDTree<T, N>::Point

Alias for the internal point structure

template<class T, std::size_t N>
typedef std::vector<Point*> KDTree<T, N>::KDPointArray

Alias for the input KDPoint shared pointer vector

template<class T, std::size_t N>
typedef KDPointArray::iterator KDTree<T, N>::ArrayIter

Alias for the KDPointArray iterator

template<class T, std::size_t N>
typedef std::function<ArrayIter(const ArrayIter&, const ArrayIter&, const std::size_t)> KDTree<T, N>::SplitFunction

Alias for the split function used for the construction of the tree

Function documentation

template<class T, std::size_t N>
KDTree<T, N>::KDTree() deleted

Deletion of the default constructor

template<class T, std::size_t N>
KDTree<T, N>::KDTree(const KDTree&) deleted

Deletion of the copy constructor

template<class T, std::size_t N>
KDTree<T, N>::~KDTree() defaulted

Default destructor

template<class T, std::size_t N>
KDTree<T, N>::KDTree(KDPointArray& arr, const SplitFunction& splitFun)

Parameters
arr the input array of KDPoint
splitFun the split function used for the construction

Construct a KDTree from an array of KDPoint

template<class T, std::size_t N>
KDTree& KDTree<T, N>::operator=(const KDTree&) deleted

Deletion of the assignement constructor

template<class T, std::size_t N>
Point KDTree<T, N>::nearest(const Point& point) const

Parameters
point the input point

Interface for the nearest point query

template<class T, std::size_t N>
std::size_t KDTree<T, N>::memoryUsage()

Estimates the current memory usage of the tree