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

Range-index backend that builds the full eps-neighborhood adjacency in one fused pairwise sweep. More...

#include <clustering/index/brute_force_pairwise.h>

Public Member Functions

 BruteForcePairwise (const NDArray< T, 2 > &points) noexcept
 Constructs the backend over a borrowed point matrix.
std::vector< std::vector< std::int32_t > > query (T radius, math::Pool pool) const
 Returns the full radius-neighborhood adjacency over the indexed point cloud.

Detailed Description

template<class T>
class clustering::BruteForcePairwise< T >

Range-index backend that builds the full eps-neighborhood adjacency in one fused pairwise sweep.

At high dim, where tree pruning collapses, a blocked pairwise sweep with the eps-threshold fused into the microkernel epilogue is the right primitive for DBSCAN: core-point detection and cluster expansion both reduce to adjacency lookups, so one N*N sweep retires all the pairwise compute the algorithm needs.

Template Parameters
TElement type of the point cloud (float or double).
Warning
The instance borrows the input matrix. The caller must keep points alive for the lifetime of the BruteForcePairwise.

Definition at line 28 of file brute_force_pairwise.h.

Constructor & Destructor Documentation

◆ BruteForcePairwise()

template<class T>
clustering::BruteForcePairwise< T >::BruteForcePairwise ( const NDArray< T, 2 > & points)
inlineexplicitnoexcept

Constructs the backend over a borrowed point matrix.

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

Definition at line 38 of file brute_force_pairwise.h.

Member Function Documentation

◆ query()

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

Returns the full radius-neighborhood adjacency over the indexed point cloud.

Emits surviving (i, j) pairs directly from the fused AVX2 threshold kernel; the outer driver partitions X rows across pool so per-row pushes are race-free.

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

Definition at line 51 of file brute_force_pairwise.h.


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