Expand description
Mathematical utilities for vector operations.
This module provides general-purpose vector math as well as the
EmbeddingVector<State> typestate wrapper that encodes L2-normalization at the
type level. Use EmbeddingVector::<Normalized> as the required parameter type on
functions that feed vectors directly into Qdrant cosine-distance searches.
Structs§
- Embedding
Vector - An embedding vector tagged with a normalization-state marker.
- Normalized
- Typestate marker indicating that an
EmbeddingVectorhas been L2-normalized to unit length. - Unnormalized
- Typestate marker indicating that an
EmbeddingVectorhas not been normalized yet (raw output from a model or loaded from storage).
Functions§
- cosine_
similarity - Compute cosine similarity between two equal-length f32 vectors.