knncolle
Collection of KNN methods in C++
|
Perform a brute-force nearest neighbor search. More...
#include <Bruteforce.hpp>
Public Member Functions | |
Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > * | build_raw (const Matrix_ &data) const |
Public Member Functions inherited from knncolle::Builder< Matrix_, Float_ > | |
std::shared_ptr< Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > > | build_shared (const Matrix_ &data) const |
std::unique_ptr< Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > > | build_unique (const Matrix_ &data) const |
Perform a brute-force nearest neighbor search.
The brute-force search computes all pairwise distances between data and query points to identify nearest neighbors of the latter. It has quadratic complexity and is theoretically the worst-performing method; however, it has effectively no overhead from constructing or querying indexing structures, potentially making it faster in cases where indexing provides little benefit (e.g., few data points, high dimensionality).
Distance_ | A distance calculation class satisfying the MockDistance contract. |
Matrix_ | Matrix-like type that satisfies the MockMatrix interface. |
Float_ | Floating point type for the query data and output distances. |
|
inlinevirtual |
Creates a BruteforcePrebuilt
instance.
Implements knncolle::Builder< Matrix_, Float_ >.