Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NodeDB-Lab/nodedb
/ hamming_identical_is_zero
Function
hamming_identical_is_zero
nodedb-vector/src/quantize/binary.rs:104–109 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
102
103
#[test]
104
fn hamming_identical_is_zero() {
105
let v = [1.0, -1.0, 1.0, 0.5];
106
let a = encode(&v);
107
let b = encode(&v);
108
assert_eq!(hamming_distance(&a, &b), 0);
109
}
110
111
#[test]
112
fn hamming_opposite_is_dim() {
Callers
nothing calls this directly
Calls
1
encode
Function · 0.70
Tested by
no test coverage detected