Skip to main content

two_phase_l2_squared

Function two_phase_l2_squared 

Source
pub fn two_phase_l2_squared(
    a: &[f32],
    b: &[f32],
    importance: &DimensionImportance,
    threshold: f32,
    sample_fraction: f32,
) -> Option<f32>
Expand description

Two-phase distance computation with early rejection.

Phase 1: Compute distance on sampled dimensions Phase 2: If estimate passes threshold, compute full distance

Returns None if rejected in phase 1.