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

Function hamming_opposite_is_dim

nodedb-vector/src/quantize/binary.rs:112–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111 #[test]
112 fn hamming_opposite_is_dim() {
113 let a_vec = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0];
114 let b_vec = [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0];
115 let a = encode(&a_vec);
116 let b = encode(&b_vec);
117 assert_eq!(hamming_distance(&a, &b), 8);
118 }
119
120 #[test]
121 fn hamming_fast_matches_simple() {

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected