Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
clustering::index::AutoRangeIndex< T > Class Template Reference

Range-index policy that picks KDTree below a dimension threshold and BruteForcePairwise above it. More...

#include <clustering/index/auto_range_index.h>

Public Member Functions

 AutoRangeIndex (const NDArray< T, 2 > &points)
 Constructs the policy, picking the backend once against points.dim(1).
std::vector< std::vector< std::int32_t > > query (T radius, math::Pool pool) const
 Returns the full radius-neighborhood adjacency from the held backend.

Static Public Attributes

static constexpr std::size_t bruteForceDimFloor = 16
 Dimension threshold at or above which the brute-force backend is selected.

Detailed Description

template<class T>
class clustering::index::AutoRangeIndex< T >

Range-index policy that picks KDTree below a dimension threshold and BruteForcePairwise above it.

Above AutoRangeIndex::bruteForceDimFloor KDTree pruning collapses on the curse of dimensionality and a blocked pairwise sweep wins; below it the tree's log-depth walks are cheaper than an N*N sweep. The choice is made once at construction.

Template Parameters
TElement type of the point cloud.

Definition at line 25 of file auto_range_index.h.

Constructor & Destructor Documentation

◆ AutoRangeIndex()

template<class T>
clustering::index::AutoRangeIndex< T >::AutoRangeIndex ( const NDArray< T, 2 > & points)
inlineexplicit

Constructs the policy, picking the backend once against points.dim(1).

Parameters
pointsRow-major n x d point matrix. Must outlive the instance.

Definition at line 44 of file auto_range_index.h.

Member Function Documentation

◆ query()

template<class T>
std::vector< std::vector< std::int32_t > > clustering::index::AutoRangeIndex< T >::query ( T radius,
math::Pool pool ) const
inlinenodiscard

Returns the full radius-neighborhood adjacency from the held backend.

Parameters
radiusNon-negative neighbourhood radius; comparison runs on the squared distance.
poolParallelism injection forwarded to the held backend.
Returns
Length-n vector where element i lists every j with ||x_i - x_j||^2 <= radius^2.

Definition at line 54 of file auto_range_index.h.

Member Data Documentation

◆ bruteForceDimFloor

template<class T>
std::size_t clustering::index::AutoRangeIndex< T >::bruteForceDimFloor = 16
staticconstexpr

Dimension threshold at or above which the brute-force backend is selected.

Definition at line 36 of file auto_range_index.h.


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