MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / exact_asymmetric_distance

Method exact_asymmetric_distance

nodedb-vector/src/quantize/binary_codec.rs:94–96  ·  view source on GitHub ↗
(&self, q: &Self::Query, v: &Self::Quantized)

Source from the content-addressed store, hash-verified

92 /// Asymmetric Hamming distance: pre-encoded query bits vs stored candidate.
93 #[inline]
94 fn exact_asymmetric_distance(&self, q: &Self::Query, v: &Self::Quantized) -> f32 {
95 binary::hamming_distance(q, packed_bits_of(v)) as f32
96 }
97}
98
99// ── Tests ─────────────────────────────────────────────────────────────────────

Calls 2

hamming_distanceFunction · 0.70
packed_bits_ofFunction · 0.70