Skip to main content

simhash_from_sparse_vector

Function simhash_from_sparse_vector 

Source
pub fn simhash_from_sparse_vector(
    entries: &[(u32, f32)],
    weight_threshold: f32,
    max_weight: f32,
) -> u64
Expand description

Compute SimHash from a sparse vector using quantized u8 impacts.

This matches exactly what reorder_bmp_blob computes from BMP block data, ensuring build-time and reorder-time SimHash are identical. Entries below weight_threshold or that quantize to zero impact are excluded — same as what survives into the BMP block postings.