Skip to main content

encode_binary

Function encode_binary 

Source
pub fn encode_binary(vector: &[f32]) -> Vec<u8> 
Expand description

Encode a float vector to binary: 1 bit per dimension (sign bit).

Bit layout: dimension d maps to bit d % 8 of byte d / 8. A positive value (>= 0) is encoded as 1, negative as 0.