Skip to main content

batch_distances

Function batch_distances 

Source
pub fn batch_distances(
    query: &[f32],
    candidates: &[&[f32]],
    metric: DistanceMetric,
) -> Vec<f32>
Expand description

Compute distances from a query vector to multiple candidate vectors.

Returns a Vec of distances, one per candidate, in the same order. Processes candidates in batches for better cache behavior.