template<typename Index_, typename Data_, typename Distance_, class Matrix_ = Matrix<Index_, Data_>, class DistanceMetric_ = DistanceMetric<Data_, Distance_>>
class knncolle::BruteforceBuilder< Index_, Data_, Distance_, Matrix_, DistanceMetric_ >
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
-
| Index_ | Integer type for the indices. |
| Data_ | Numeric type for the input and query data. |
| Distance_ | Numeric type for the distances, usually floating-point. |
| Matrix_ | Class of the input data matrix. This should satisfy the Matrix interface. |
| DistanceMetric_ | Class implementing the distance metric calculation. This should satisfy the DistanceMetric interface. |