Struct OPQMatrixImpl

Source
pub struct OPQMatrixImpl { /* private fields */ }

Implementations§

Source§

impl OPQMatrixImpl

Source

pub fn new(d: u32, m: u32, d2: u32) -> Result<Self>

Source

pub fn set_verbose(&mut self, value: bool)

Source

pub fn verbose(&self) -> bool

Source

pub fn set_niter(&mut self, value: u32)

Source

pub fn niter(&self) -> u32

Source

pub fn set_niter_pq(&mut self, value: u32)

Source

pub fn niter_pq(&self) -> u32

Trait Implementations§

Source§

impl Drop for OPQMatrixImpl

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl LinearTransform for OPQMatrixImpl

Source§

fn transform_transpose(&self, y: &[f32]) -> Vec<f32>

compute x = A^T * (x - b) is reverse transform if A has orthonormal lines
Source§

fn set_is_orthonormal(&mut self)

compute A^T * A to set the is_orthonormal flag
Source§

fn have_bias(&self) -> bool

Getter for have_bias
Source§

fn is_orthonormal(&self) -> bool

Getter for is_orthonormal
Source§

impl NativeVectorTransform for OPQMatrixImpl

Source§

fn inner_ptr(&self) -> *mut FaissVectorTransform

Retrieve a pointer to the native object.
Source§

impl Send for OPQMatrixImpl

Source§

impl Sync for OPQMatrixImpl

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.
Source§

impl<T> VectorTransform for T

Source§

fn is_trained(&self) -> bool

Getter for is_trained
Source§

fn d_in(&self) -> u32

Getter for input dimension
Source§

fn d_out(&self) -> u32

Getter for output dimension
Source§

fn train(&mut self, n: usize, x: &[f32]) -> Result<(), Error>

Perform training on a representative set of vectors
Source§

fn apply_noalloc(&self, x: &[f32]) -> Vec<f32>

apply transformation and result is pre-allocated
Source§

fn reverse_transform(&self, xt: &[f32]) -> Vec<f32>

reverse transformation. May not be implemented or may return approximate result