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 OPQMatrixImplwhere Self: NativeVectorTransform + VectorTransform,

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: NativeVectorTransform,

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, Global>

apply transformation and result is pre-allocated
source§

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

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