BinaryIVFIndexImpl

Struct BinaryIVFIndexImpl 

Source
pub struct BinaryIVFIndexImpl { /* private fields */ }
Expand description

Native implementation of a binary IVF index.

Implementations§

Source§

impl BinaryIVFIndexImpl

Source

pub fn nprobe(&self) -> u32

Get number of probes at query time

Source

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

Set number of probes at query time

Source

pub fn nlist(&self) -> u32

Get number of possible key values

Source

pub fn max_codes(&self) -> u32

Get max number of codes to visit to do a query

Source

pub fn set_max_codes(&self, value: u32)

Set max number of codes to visit to do a query

Source

pub fn imbalance_factor(&self) -> f64

Check the inverted lists’ imbalance factor.

1 = perfectly balanced, > 1: imbalanced

Trait Implementations§

Source§

impl ConcurrentIndex<u8, i32> for BinaryIVFIndexImpl
where Self: Index<u8, i32> + NativeIndex<u8, i32>,

Source§

fn assign(&self, query: &[u8], k: usize) -> Result<AssignSearchResult>

Similar to search, but only provides the labels.
Source§

fn search(&self, query: &[u8], k: usize) -> Result<SearchResult<i32>>

Perform a search for the k closest vectors to the given query vectors.
Source§

fn range_search(&self, query: &[u8], radius: i32) -> Result<RangeSearchResult>

Perform a ranged search for the vectors closest to the given query vectors by the given radius.
Source§

impl Debug for BinaryIVFIndexImpl

Source§

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

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

impl Drop for BinaryIVFIndexImpl

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl FromInnerPtr<u8, i32> for BinaryIVFIndexImpl

Source§

unsafe fn from_inner_ptr(inner_ptr: *mut FaissIndexBinary) -> Self

Create an index using the given pointer to a native object. Read more
Source§

impl Index<u8, i32> for BinaryIVFIndexImpl

Source§

fn is_trained(&self) -> bool

Whether the Index does not require training, or if training is done already
Source§

fn ntotal(&self) -> u64

The total number of vectors indexed
Source§

fn d(&self) -> u32

The dimensionality of the indexed vectors
Source§

fn metric_type(&self) -> MetricType

The metric type assumed by the index
Source§

fn add(&mut self, x: &[u8]) -> Result<()>

Add new data vectors to the index. This assumes a C-contiguous memory slice of vectors, where the total number of vectors is x.len() / d.
Source§

fn add_with_ids(&mut self, x: &[u8], xids: &[Idx]) -> Result<()>

Add new data vectors to the index with IDs. This assumes a C-contiguous memory slice of vectors, where the total number of vectors is x.len() / d. Not all index types may support this operation.
Source§

fn train(&mut self, x: &[u8]) -> Result<()>

Train the underlying index with the given data.
Source§

fn assign(&mut self, query: &[u8], k: usize) -> Result<AssignSearchResult>

Similar to search, but only provides the labels.
Source§

fn search(&mut self, query: &[u8], k: usize) -> Result<SearchResult<i32>>

Perform a search for the k closest vectors to the given query vectors.
Perform a ranged search for the vectors closest to the given query vectors by the given radius.
Source§

fn reconstruct(&self, idx: Idx, output: &mut [u8]) -> Result<()>

Reconstruct a single stored vector (or an approximation if lossy coding) Read more
Source§

fn reconstruct_n( &self, first_key: Idx, count: usize, output: &mut [u8], ) -> Result<()>

Reconstruct vectors i0 to i0 + ni - 1. Read more
Source§

fn reset(&mut self) -> Result<()>

Clear the entire index.
Source§

fn remove_ids(&mut self, sel: &IdSelector) -> Result<usize>

Remove data vectors represented by IDs.
Source§

fn verbose(&self) -> bool

Index verbosity level
Source§

fn set_verbose(&mut self, value: bool)

Set Index verbosity level
Source§

impl NativeIndex<u8, i32> for BinaryIVFIndexImpl

Source§

type Inner = FaissIndexBinary_H

The underlying native Faiss index.
Source§

fn inner_ptr(&self) -> *mut FaissIndexBinary

Retrieve a pointer to the native index object.
Source§

impl TryClone for BinaryIVFIndexImpl

Source§

fn try_clone(&self) -> Result<Self>
where Self: Sized,

Create an independent clone of this index. Read more
Source§

impl CpuIndex<u8, i32> for BinaryIVFIndexImpl

Source§

impl Send for BinaryIVFIndexImpl

Source§

impl Sync for BinaryIVFIndexImpl

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<NI> UpcastIndex<u8, i32> for NI
where NI: NativeIndex<u8, i32, Inner = FaissIndexBinary_H>,

Source§

type Output = BinaryIndexImpl

The output type that can be converted into the base IndexImpl(BinaryIndexImpl) types.
Source§

fn upcast(self) -> <NI as UpcastIndex<u8, i32>>::Output