Skip to main content

DataRef

Type Alias DataRef 

Source
pub type DataRef<'a, const NBITS: usize> = VectorRef<'a, NBITS, Unsigned, MinMaxCompensation, Dense>;
Expand description

A borrowed Data vector

See: meta::Vector.

Aliased Type§

pub struct DataRef<'a, const NBITS: usize> { /* private fields */ }

Implementations§

Source§

impl<const NBITS: usize> DataRef<'_, NBITS>
where Unsigned: Representation<NBITS>,

Source

pub fn decompress_into(&self, dst: &mut [f32]) -> Result<(), DecompressError>

Decompresses a MinMax quantized vector back into its original floating-point representation.

This method reconstructs the original vector values using the stored quantization parameters and the MinMax dequantization formula: x = x' * a + b and stores the result in dst

§Arguments
  • dst - A mutable slice of f32 values where the decompressed data will be written. Must have the same length as the compressed vector.
§Returns
  • Ok(()) - On successful decompression
  • Err(DecompressError::LengthMismatch(src_len, dst_len)) - If the destination slice length doesn’t match the compressed vector length