Skip to content

Class Argos::KDTree

ClassList > Argos > KDTree

Simple kd-tree for nearest-neighbour queries on a static point set. More...

  • #include <KDTree.h>

Public Functions

Type Name
KDTree (const std::vector< Argos::Vector3D< double > > & points)
Build a kd-tree from a set of points.
double nearestDistance (const Argos::Vector3D< double > & query) const
Squared distance to the nearest point in the tree.
~KDTree ()
Destructor — frees all nodes.

Detailed Description

Builds a balanced binary tree by splitting on the median along alternating axes. Supports squared-distance nearest-point lookup.

Public Functions Documentation

function KDTree

Build a kd-tree from a set of points.

Argos::KDTree::KDTree (
    const std::vector< Argos::Vector3D < double > > & points
) 

Parameters:

  • points The reference point cloud (must outlive the tree).

function nearestDistance

Squared distance to the nearest point in the tree.

double Argos::KDTree::nearestDistance (
    const  Argos::Vector3D < double > & query
) const

Parameters:

  • query Query point.

Returns:

Squared Euclidean distance to the closest stored point.


function ~KDTree

Destructor — frees all nodes.

Argos::KDTree::~KDTree () 



The documentation for this class was generated from the following file include/structure/KDTree.h