Skip to main content

compute_distance

Function compute_distance 

Source
pub fn compute_distance(
    a: &[u8],
    b: &[u8],
    vtype: VectorType,
    metric: DistanceMetric,
    dim: usize,
) -> Result<f64, DistanceError>
Expand description

Compute distance between two vector blobs.

Both blobs must be the same type and dimension. For int2/int4 types, values are cast to f32 before computation since usearch only supports f32, f64, f16, and i8 natively.