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

Method sym_dist

nodedb-vector/src/codec_index/build.rs:246–252  ·  view source on GitHub ↗
(&self, a_idx: u32, b_idx: u32)

Source from the content-addressed store, hash-verified

244 /// Symmetric distance between two nodes identified by their dense indices.
245 #[inline]
246 pub(crate) fn sym_dist(&self, a_idx: u32, b_idx: u32) -> f32 {
247 let a = &self.nodes[a_idx as usize].quantized;
248 let b = &self.nodes[b_idx as usize].quantized;
249 // Both borrows are read-only; safe even through raw pointers if
250 // called for distinct indices, but here we just borrow directly.
251 self.codec.fast_symmetric_distance(a, b)
252 }
253}
254
255#[cfg(test)]

Callers 2

greedy_nearestMethod · 0.80
search_layer_buildMethod · 0.80

Calls 1

Tested by

no test coverage detected