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.
index::CoreAdjacency query (T radius, std::size_t minPts, math::Pool pool) const
 Returns the core-aware radius 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 31 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 41 of file brute_force_pairwise.h.

Member Function Documentation

◆ query()

template<class T>
index::CoreAdjacency clustering::BruteForcePairwise< T >::query ( T radius,
std::size_t minPts,
math::Pool pool ) const
inlinenodiscard

Returns the core-aware radius 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. Full two-sided degrees come from per-worker histograms over the upper halves, so core flags never need the mirrored edges materialized; only non-core rows receive their j < i neighbours, which the border-assignment scan is the sole reader of.

Parameters
radiusNon-negative neighbourhood radius; comparison runs on the squared distance.
minPtsCore threshold on the self-inclusive neighbour count.
poolParallelism injection forwarded to the thresholded sweep.
Returns
Rows and core flags per the clustering::index::CoreAdjacency contract.

Definition at line 57 of file brute_force_pairwise.h.


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