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

Method prepare_query

nodedb-codec/src/vector_quant/ternary/codec.rs:84–90  ·  view source on GitHub ↗
(&self, q: &[f32])

Source from the content-addressed store, hash-verified

82 }
83
84 fn prepare_query(&self, q: &[f32]) -> TernaryQuery {
85 let (trits, scale) = quantize(q);
86 TernaryQuery {
87 trits_hot: pack_hot(&trits),
88 scale,
89 }
90 }
91
92 fn fast_symmetric_distance(&self, q: &Self::Quantized, v: &Self::Quantized) -> f32 {
93 let qh = q.0.header();

Callers

nothing calls this directly

Calls 2

quantizeFunction · 0.85
pack_hotFunction · 0.85

Tested by

no test coverage detected