Stride Reference Manual  - generated for commit 9643b11
geopop::kd::Node< P, D > Class Template Reference

A node in the KdTree (parameter P: the type of point, parameter D: dimension this node splits on). More...

#include <KdNode.h>

Inheritance diagram for geopop::kd::Node< P, D >:
Inheritance graph
Collaboration diagram for geopop::kd::Node< P, D >:
Collaboration graph

Public Member Functions

 Node (P pt)
 
BaseNode< P > * BorrowLeft () const override
 Get a non-owning pointer to the left child (nullptr if no such child). More...
 
BaseNode< P > * BorrowRight () const override
 Get a non-owning pointer to the right child (nullptr if no such child). More...
 
BaseNode< P > * BorrowSplitChild (const P &point) const override
 Get a non-owning pointer to the child corresponding to the correct split for point. More...
 
void AddChild (P point) override
 Add a new child in the right place, according to split. More...
 
GetPoint () const override
 Gets the point for this node. More...
 
- Public Member Functions inherited from geopop::kd::BaseNode< P >
virtual ~BaseNode ()=default
 

Private Types

using Child = Node< P,(D+1)%P::dim >
 

Private Attributes

m_point
 
std::unique_ptr< Childm_left
 
std::unique_ptr< Childm_right
 

Friends

class KdTree< P >
 

Detailed Description

template<typename P, std::size_t D>
class geopop::kd::Node< P, D >

A node in the KdTree (parameter P: the type of point, parameter D: dimension this node splits on).

Definition at line 58 of file KdNode.h.

Member Typedef Documentation

template<typename P, std::size_t D>
using geopop::kd::Node< P, D >::Child = Node<P, (D + 1) % P::dim>
private

Definition at line 92 of file KdNode.h.

Constructor & Destructor Documentation

template<typename P, std::size_t D>
geopop::kd::Node< P, D >::Node ( pt)
inlineexplicit

Definition at line 61 of file KdNode.h.

Member Function Documentation

template<typename P, std::size_t D>
BaseNode<P>* geopop::kd::Node< P, D >::BorrowLeft ( ) const
inlineoverridevirtual

Get a non-owning pointer to the left child (nullptr if no such child).

Implements geopop::kd::BaseNode< P >.

Definition at line 63 of file KdNode.h.

template<typename P, std::size_t D>
BaseNode<P>* geopop::kd::Node< P, D >::BorrowRight ( ) const
inlineoverridevirtual

Get a non-owning pointer to the right child (nullptr if no such child).

Implements geopop::kd::BaseNode< P >.

Definition at line 65 of file KdNode.h.

template<typename P, std::size_t D>
BaseNode<P>* geopop::kd::Node< P, D >::BorrowSplitChild ( const P &  point) const
inlineoverridevirtual

Get a non-owning pointer to the child corresponding to the correct split for point.

Implements geopop::kd::BaseNode< P >.

Definition at line 67 of file KdNode.h.

template<typename P, std::size_t D>
void geopop::kd::Node< P, D >::AddChild ( point)
inlineoverridevirtual

Add a new child in the right place, according to split.

Implements geopop::kd::BaseNode< P >.

Definition at line 78 of file KdNode.h.

template<typename P, std::size_t D>
P geopop::kd::Node< P, D >::GetPoint ( ) const
inlineoverridevirtual

Gets the point for this node.

Implements geopop::kd::BaseNode< P >.

Definition at line 89 of file KdNode.h.

Friends And Related Function Documentation

template<typename P, std::size_t D>
friend class KdTree< P >
friend

Definition at line 97 of file KdNode.h.

Member Data Documentation

template<typename P, std::size_t D>
P geopop::kd::Node< P, D >::m_point
private

Definition at line 94 of file KdNode.h.

template<typename P, std::size_t D>
std::unique_ptr<Child> geopop::kd::Node< P, D >::m_left
private

Definition at line 95 of file KdNode.h.

template<typename P, std::size_t D>
std::unique_ptr<Child> geopop::kd::Node< P, D >::m_right
private

Definition at line 95 of file KdNode.h.


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