knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
knncolle::BruteforceBuilder< Distance_, Matrix_, Float_ > Class Template Reference

Perform a brute-force nearest neighbor search. More...

#include <Bruteforce.hpp>

Inheritance diagram for knncolle::BruteforceBuilder< Distance_, Matrix_, Float_ >:
Inheritance graph
[legend]
Collaboration diagram for knncolle::BruteforceBuilder< Distance_, Matrix_, Float_ >:
Collaboration graph
[legend]

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
 

Detailed Description

template<class Distance_ = EuclideanDistance, class Matrix_ = SimpleMatrix<int, int, double>, typename Float_ = double>
class knncolle::BruteforceBuilder< Distance_, Matrix_, Float_ >

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).

Template Parameters
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.

Member Function Documentation

◆ build_raw()

template<class Distance_ = EuclideanDistance, class Matrix_ = SimpleMatrix<int, int, double>, typename Float_ = double>
Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > * knncolle::BruteforceBuilder< Distance_, Matrix_, Float_ >::build_raw ( const Matrix_ &  data) const
inlinevirtual

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