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

Public Types

using Traits
 
- Public Types inherited from KdTree::KdTree< T, DistanceMethod >::Node< T, DistanceMethod >
using Traits
 

Public Member Functions

 Leaf (const std::vector< T > &&data)
 
virtual ~Leaf ()=default
 
void findPointsWithinRadius (const T &coord, double radius, std::vector< T > &selection) const override
 
std::size_t countPointsWithinRadius (const T &coord, double radius) const override
 
 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
 
- Public Member Functions inherited from KdTree::KdTree< T, DistanceMethod >::Node< T, DistanceMethod >
virtual ~Node ()=default
 
 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

const std::vector< T > m_data
 
std::size_t m_dimensionality
 
std::shared_ptr< Nodem_root
 

Detailed Description

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

Definition at line 31 of file KdTree.icpp.

Member Typedef Documentation

◆ Traits

using KdTree::KdTree< T, DistanceMethod >::Traits

Definition at line 70 of file KdTree.h.

Constructor & Destructor Documentation

◆ Leaf()

template<typename T, typename DistanceMethod = EuclideanDistance<T>>
template<typename T, typename DistanceMethod>
KdTree::KdTree< T, DistanceMethod >::Leaf< T, DistanceMethod >::Leaf ( const std::vector< T > && data)
inlineexplicit

Definition at line 33 of file KdTree.icpp.

References m_data.

◆ ~Leaf()

template<typename T, typename DistanceMethod = EuclideanDistance<T>>
template<typename T, typename DistanceMethod>
virtual KdTree::KdTree< T, DistanceMethod >::Leaf< T, DistanceMethod >::~Leaf ( )
virtualdefault

Member Function Documentation

◆ countPointsWithinRadius() [1/2]

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

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

Parameters
coord
radius
Returns

Implements KdTree::KdTree< T, DistanceMethod >::Node< T, DistanceMethod >.

Definition at line 88 of file KdTree.icpp.

References std::move().

Here is the call graph for this function:

◆ countPointsWithinRadius() [2/2]

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

Implements KdTree::KdTree< T, DistanceMethod >::Node< T, DistanceMethod >.

Definition at line 45 of file KdTree.icpp.

References m_data.

◆ findPointsWithinRadius() [1/2]

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 80 of file KdTree.icpp.

References std::make_shared(), and std::move().

Here is the call graph for this function:

◆ findPointsWithinRadius() [2/2]

template<typename T, typename DistanceMethod = EuclideanDistance<T>>
template<typename T, typename DistanceMethod>
void KdTree::KdTree< T, DistanceMethod >::Leaf< T, DistanceMethod >::findPointsWithinRadius ( const T & coord,
double radius,
std::vector< T > & selection ) const
inlineoverridevirtual

◆ KdTree()

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

Definition at line 72 of file KdTree.icpp.

Member Data Documentation

◆ m_data

template<typename T, typename DistanceMethod = EuclideanDistance<T>>
template<typename T, typename DistanceMethod>
const std::vector<T> KdTree::KdTree< T, DistanceMethod >::Leaf< T, DistanceMethod >::m_data
private

Definition at line 56 of file KdTree.icpp.

Referenced by countPointsWithinRadius(), findPointsWithinRadius(), and Leaf().

◆ m_dimensionality

std::size_t KdTree::KdTree< T, DistanceMethod >::m_dimensionality
private

Definition at line 95 of file KdTree.h.

◆ m_root

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 file: