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

Function use_vector_codec

nodedb-vector/src/quantize/sq8_codec.rs:158–162  ·  view source on GitHub ↗

Verify the trait impl compiles via a generic function.

(c: &C, q: &[f32], v: &[f32])

Source from the content-addressed store, hash-verified

156
157 /// Verify the trait impl compiles via a generic function.
158 fn use_vector_codec<C: VectorCodec>(c: &C, q: &[f32], v: &[f32]) -> f32 {
159 let qv = c.encode(v);
160 let qq = c.prepare_query(q);
161 c.fast_symmetric_distance(&qv, &qv) + c.exact_asymmetric_distance(&qq, &qv)
162 }
163
164 #[test]
165 fn trait_bounds_compile() {

Callers 1

trait_bounds_compileFunction · 0.70

Calls 4

encodeMethod · 0.45
prepare_queryMethod · 0.45

Tested by 1

trait_bounds_compileFunction · 0.56