Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector'

This commit is contained in:
ruv
2026-02-28 14:39:40 -05:00
7854 changed files with 3522914 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
//! Common quantization trait shared by all quantizer types.
use crate::tier::TemperatureTier;
use alloc::vec::Vec;
/// Trait for vector quantization codecs.
///
/// Every quantizer can encode a float vector into a compact byte representation
/// and decode it back to an approximate float vector.
pub trait Quantizer {
/// Encode a float vector into compact codes.
fn encode(&self, vector: &[f32]) -> Vec<u8>;
/// Decode compact codes back to an approximate float vector.
fn decode(&self, codes: &[u8]) -> Vec<f32>;
/// The temperature tier this quantizer is designed for.
fn tier(&self) -> TemperatureTier;
/// The dimensionality this quantizer was trained for.
fn dim(&self) -> usize;
}