Expand description
Pure-Rust core for annflat. Flat brute-force ANN over (n, d) f32
vectors with cosine / L2 / inner-product metrics.
Cosine is implemented as inner product over L2-normalized vectors, so adding under the cosine metric runs an in-place normalization once at insert time. Subsequent search is a single matrix-vector dot.
score is “higher is better”: for cosine it’s the cosine similarity
in [-1, 1], for inner product it’s the dot, for L2 it’s -distance
(so the same top_k heap logic works across metrics).
Structs§
- Hit
- One match returned by
Index::search. - Index
- In-memory flat ANN index.
Enums§
- AnnFlat
Error - All errors surfaced by
annflat-core. - Metric
- Distance metric.
Type Aliases§
- Result
- Crate-wide result alias.