Skip to main content

encode_rabitq_quantizer

Function encode_rabitq_quantizer 

Source
pub fn encode_rabitq_quantizer(rq: &RabitqQuantizer) -> Vec<u8> 
Expand description

Encode a RaBitQ quantizer into a QUANT_SEG payload.

Header layout (within the shared 64-byte aligned header; bytes 4..20 were zero padding in pre-RaBitQ payloads, so old types are unaffected):

[quant_type=4: u8] [tier: u8] [dim: u16 LE]
[version: u8] [rounds: u8] [reserved: u16]
[seed: u64 LE] [padded_dim: u32 LE] [padding to 64B]
[centroid: dim * f32 LE]