Alexandria 2.31.2
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
KdTree::KdTree< T, DistanceMethod > Class Template Reference

#include <KdTree.h>

Collaboration diagram for KdTree::KdTree< T, DistanceMethod >:

Classes

class  Leaf
 
class  Node
 
class  Split
 

Public Types

using Traits = KdTreeTraits<T>
 

Public Member Functions

 KdTree (const std::vector< T > &data, std::size_t leaf_size=100)
 
std::vector< T > findPointsWithinRadius (const T &coord, double radius) const
 
std::size_t countPointsWithinRadius (const T &coord, double radius) const
 

Private Attributes

std::size_t m_dimensionality
 
std::shared_ptr< Nodem_root
 

Detailed Description

template<typename T, typename DistanceMethod = EuclideanDistance<T>>
class KdTree::KdTree< T, DistanceMethod >

Definition at line 68 of file KdTree.h.

Member Typedef Documentation

◆ Traits

template<typename T , typename DistanceMethod = EuclideanDistance<T>>
using KdTree::KdTree< T, DistanceMethod >::Traits = KdTreeTraits<T>

Definition at line 70 of file KdTree.h.

Constructor & Destructor Documentation

◆ KdTree()

template<typename T , typename DistanceMethod >
KdTree::KdTree< T, DistanceMethod >::KdTree ( const std::vector< T > & data,
std::size_t leaf_size = 100 )
explicit

Definition at line 123 of file KdTree.icpp.

References std::vector< T >::empty(), std::vector< T >::front(), std::make_shared(), std::move(), and std::vector< T >::size().

Here is the call graph for this function:

Member Function Documentation

◆ countPointsWithinRadius()

template<typename T , typename DistanceMethod >
std::size_t KdTree::KdTree< T, DistanceMethod >::countPointsWithinRadius ( const T & coord,
double radius ) const

Count how many points are within the given radius from the coordonate coord

Parameters
coord
radius
Returns

Definition at line 146 of file KdTree.icpp.

◆ findPointsWithinRadius()

template<typename T , typename DistanceMethod >
std::vector< T > KdTree::KdTree< T, DistanceMethod >::findPointsWithinRadius ( const T & coord,
double radius ) const

Return the points that are within the given radius from the coordinate coord

Parameters
coord
radius
Returns

Definition at line 139 of file KdTree.icpp.

Member Data Documentation

◆ m_dimensionality

template<typename T , typename DistanceMethod = EuclideanDistance<T>>
std::size_t KdTree::KdTree< T, DistanceMethod >::m_dimensionality
private

Definition at line 95 of file KdTree.h.

◆ m_root

template<typename T , typename DistanceMethod = EuclideanDistance<T>>
std::shared_ptr<Node> KdTree::KdTree< T, DistanceMethod >::m_root
private

Definition at line 96 of file KdTree.h.


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