Skip to main content

dot_bit4

Function dot_bit4 

Source
pub fn dot_bit4(q: &[i8], codes: &[u8]) -> i32
Expand description

Scores a signed-byte query against one packed four-bit row.

Two unsigned fields are stored most-significant first in each byte and decoded to the doubled quantization grid 2 * code - 15. Callers must pre-validate codes.len() == q.len().div_ceil(2) and q.len() <= MAX_DOT_I8_DIMENSION; an unused trailing field is ignored. The hot path allocates no memory.