Struct CompressionParams

Source
pub struct CompressionParams(pub cuvsCagraCompressionParams_t);
Expand description

Supplemental parameters to build CAGRA Index

Tuple Fields§

§0: cuvsCagraCompressionParams_t

Implementations§

Source§

impl CompressionParams

Source

pub fn new() -> Result<CompressionParams>

Returns a new CompressionParams

Source

pub fn set_pq_bits(self, pq_bits: u32) -> CompressionParams

The bit length of the vector element after compression by PQ.

Source

pub fn set_pq_dim(self, pq_dim: u32) -> CompressionParams

The dimensionality of the vector after compression by PQ. When zero, an optimal value is selected using a heuristic.

Source

pub fn set_vq_n_centers(self, vq_n_centers: u32) -> CompressionParams

Vector Quantization (VQ) codebook size - number of “coarse cluster centers”. When zero, an optimal value is selected using a heuristic.

Source

pub fn set_kmeans_n_iters(self, kmeans_n_iters: u32) -> CompressionParams

The number of iterations searching for kmeans centers (both VQ & PQ phases).

Source

pub fn set_vq_kmeans_trainset_fraction( self, vq_kmeans_trainset_fraction: f64, ) -> CompressionParams

The fraction of data to use during iterative kmeans building (VQ phase). When zero, an optimal value is selected using a heuristic.

Source

pub fn set_pq_kmeans_trainset_fraction( self, pq_kmeans_trainset_fraction: f64, ) -> CompressionParams

The fraction of data to use during iterative kmeans building (PQ phase). When zero, an optimal value is selected using a heuristic.

Trait Implementations§

Source§

impl Debug for CompressionParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CompressionParams

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.