Exact search: every query is compared to every indexed sample, SIMD
accelerated and multi-threaded. The ground truth to measure the approximate
indices against, and faster than you might think up to a few hundred
thousand samples. Large query batches go through a blocked GEMM path, which
on macOS runs on Apple Accelerate, so it can outrun the thread count set by
ann_set_threads().
Super class
AnnIndex -> ExhaustiveIndex
Methods
Inherited methods
ExhaustiveIndex$new()
Build the index.
Usage
ExhaustiveIndex$new(
data,
metric = c("euclidean", "sqeuclidean", "cosine", "manhattan"),
precision = c("float", "double")
)Arguments
dataNumeric matrix or data.frame. Samples x features. An index pointer is also accepted;
load_ann_index()uses that path.metricString. One of
c("euclidean", "sqeuclidean", "cosine", "manhattan").precisionString.
"float"stores the data as f32,"double"as f64.
Examples
x <- generate_clustered_data(1000L, 16L)$data
idx <- ExhaustiveIndex$new(x)
res <- idx$predict(x[1:5, ], k = 10L)
