MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / test_zero_hamming_distance

Function test_zero_hamming_distance

tests/math.rs:23–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 // Test the zero case for hamming_distance
22 #[test]
23 fn test_zero_hamming_distance() {
24 let a: [u8; QUANTIZED_VECTOR_SIZE] = [0xFF; QUANTIZED_VECTOR_SIZE]; // All bits set
25 let b: [u8; QUANTIZED_VECTOR_SIZE] = [0xFF; QUANTIZED_VECTOR_SIZE]; // All bits set
26 assert_eq!(hamming_distance(&a, &b), 0);
27 }
28
29 // Helper function to create identity matrix for testing GEMV and GEMM
30 fn identity_matrix(size: usize) -> Vec<[f32; VECTOR_SIZE]> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected