Expand description
Zero-sized types representing distance functions.
The types defined here are zero-sized types that represent logical distance function operations.
Some types like bit-vectors and crate::bits::BitSlices can be efficiently
implemented as pure functions and therefore can use PureDistanceFunction semantics
for these types directly.
Other quantization schemes such as scalar quantization (e.g.
crate::scalar::CompensatedSquaredL2) need auxiliary state and therefore need
customized, stateful distance function types.
Macros§
- check_
lengths - Check that
x.len() == y.len(), returningErr(diskann_vector::distances::UnequalLengths)if the results are different.
Structs§
- Hamming
- Compute the hamming distance between bit-vectors.
- Inner
Product - Compute the inner-product between vector-like types.
- Squared
L2 - Compute the squared Euclidean distance between vector-like types.
- Unequal
Lengths - A marker type that indicates a distance computation failed because the arguments had unequal lengths.
Type Aliases§
- Mathematical
Result - Upcoming return type for distance functions to allow graceful failure instead of panicking when incorrect dimensions are provided.
- Result
- Upcoming return type for distance functions to allow graceful failure instead of panicking when incorrect dimensions are provided.