18 #ifndef _KDTREE_KDTREE_H_
19 #define _KDTREE_KDTREE_H_
37 static double getCoord(
const T& t,
size_t index);
46 static bool isCloserThan(
const T& a,
const T& b,
double distance);
55 static bool isCloserThan(
const T& a,
const T& b,
double distance);
67 template <
typename T,
typename DistanceMethod = Eucl
ideanDistance<T>>
102 template <
typename U>
116 template <
typename U, std::
size_t S>
A simple N-dimensional KdTree for speeding-up elements within range types of queries.
static double getCoord(const std::vector< U > &t, size_t index)
std::vector< T > findPointsWithinRadius(const T &coord, double radius) const
std::size_t m_dimensionality
static std::size_t getDimensions(const std::vector< U > &t)
std::size_t countPointsWithinRadius(const T &coord, double radius) const
static bool isCloserThan(const T &a, const T &b, double distance)
static double getCoord(const std::array< U, S > &t, size_t index)
std::shared_ptr< Node > m_root
static std::size_t getDimensions(const T &t)
KdTree(const std::vector< T > &data, std::size_t leaf_size=100)
static bool isCloserThan(const T &a, const T &b, double distance)
static double getCoord(const T &t, size_t index)
static std::size_t getDimensions(const std::array< U, S > &t)