Neighbors Brute Force Module
Rust module: cuvs::neighbors::brute_force
Source: rust/cuvs/src/neighbors/brute_force.rs
Brute-force (exact) k-NN.
Build an [Index] over a dataset, then search it with
device-resident queries and output buffers. Tensors are borrowed through the
AsDlTensor / AsDlTensorMut traits; see the dlpack
module for the tensor model and examples/cagra.rs for the same
build/search workflow.
crate::neighbors::filters::{Bitmap, Bitset, Filter, FilterKind}
Source: rust/cuvs/src/neighbors/brute_force.rs:20
BruteForceError
Error type for brute-force operations.
Source: rust/cuvs/src/neighbors/brute_force.rs:28
Index
Brute-force KNN index.
Methods
build
Builds a brute-force index over dataset for exact k-NN search.
metric selects the distance (use [DistanceType::LpUnexpanded] to set
the Minkowski exponent p). dataset is a row-major matrix on the host
or device implementing [AsDlTensor]; the C++ index keeps a non-owning
view of it, so the returned [Index] borrows it for 'd and cannot
outlive it.
Source: rust/cuvs/src/neighbors/brute_force.rs:54
search
Searches the index for the k nearest neighbors of each query.
queries, neighbors, and distances must reside in device memory and
implement [AsDlTensor] / [AsDlTensorMut]. neighbors receives the
neighbor indices and distances their distances; both are written in
place.
Source: rust/cuvs/src/neighbors/brute_force.rs:86
search_filtered
Searches the index using a row bitset or per-query bitmap filter.
Source: rust/cuvs/src/neighbors/brute_force.rs:105
Source: rust/cuvs/src/neighbors/brute_force.rs:39