Struct IndexParams

Source
pub struct IndexParams(pub cuvsIvfFlatIndexParams_t);

Tuple Fields§

§0: cuvsIvfFlatIndexParams_t

Implementations§

Source§

impl IndexParams

Source

pub fn new() -> Result<IndexParams>

Returns a new IndexParams

Source

pub fn set_n_lists(self, n_lists: u32) -> IndexParams

The number of clusters used in the coarse quantizer.

Source

pub fn set_metric(self, metric: DistanceType) -> IndexParams

DistanceType to use for building the index

Source

pub fn set_metric_arg(self, metric_arg: f32) -> IndexParams

The number of iterations searching for kmeans centers during index building.

Source

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

The number of iterations searching for kmeans centers during index building.

Source

pub fn set_kmeans_trainset_fraction( self, kmeans_trainset_fraction: f64, ) -> IndexParams

If kmeans_trainset_fraction is less than 1, then the dataset is subsampled, and only n_samples * kmeans_trainset_fraction rows are used for training.

Source

pub fn set_add_data_on_build(self, add_data_on_build: bool) -> IndexParams

After training the coarse and fine quantizers, we will populate the index with the dataset if add_data_on_build == true, otherwise the index is left empty, and the extend method can be used to add new vectors to the index.

Trait Implementations§

Source§

impl Debug for IndexParams

Source§

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

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

impl Drop for IndexParams

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.