pub struct BinaryIVFIndexImpl { /* private fields */ }Expand description
Native implementation of a binary IVF index.
Implementations§
Source§impl BinaryIVFIndexImpl
impl BinaryIVFIndexImpl
Sourcepub fn set_nprobe(&mut self, value: u32)
pub fn set_nprobe(&mut self, value: u32)
Set number of probes at query time
Sourcepub fn set_max_codes(&self, value: u32)
pub fn set_max_codes(&self, value: u32)
Set max number of codes to visit to do a query
Sourcepub fn imbalance_factor(&self) -> f64
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
impl ConcurrentIndex<u8, i32> for BinaryIVFIndexImpl
Source§fn assign(&self, query: &[u8], k: usize) -> Result<AssignSearchResult>
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>>
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>
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
impl Debug for BinaryIVFIndexImpl
Source§impl Drop for BinaryIVFIndexImpl
impl Drop for BinaryIVFIndexImpl
Source§impl FromInnerPtr<u8, i32> for BinaryIVFIndexImpl
impl FromInnerPtr<u8, i32> for BinaryIVFIndexImpl
Source§unsafe fn from_inner_ptr(inner_ptr: *mut FaissIndexBinary) -> Self
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
impl Index<u8, i32> for BinaryIVFIndexImpl
Source§fn is_trained(&self) -> bool
fn is_trained(&self) -> bool
Whether the Index does not require training, or if training is done already
Source§fn metric_type(&self) -> MetricType
fn metric_type(&self) -> MetricType
The metric type assumed by the index
Source§fn add(&mut self, x: &[u8]) -> Result<()>
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<()>
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 assign(&mut self, query: &[u8], k: usize) -> Result<AssignSearchResult>
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>>
fn search(&mut 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(
&mut self,
query: &[u8],
radius: i32,
) -> Result<RangeSearchResult>
fn range_search( &mut 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§fn reconstruct(&self, idx: Idx, output: &mut [u8]) -> Result<()>
fn reconstruct(&self, idx: Idx, output: &mut [u8]) -> Result<()>
Reconstruct a single stored vector (or an approximation if lossy coding) Read more
Source§fn remove_ids(&mut self, sel: &IdSelector) -> Result<usize>
fn remove_ids(&mut self, sel: &IdSelector) -> Result<usize>
Remove data vectors represented by IDs.
Source§fn set_verbose(&mut self, value: bool)
fn set_verbose(&mut self, value: bool)
Set Index verbosity level
Source§impl NativeIndex<u8, i32> for BinaryIVFIndexImpl
impl NativeIndex<u8, i32> for BinaryIVFIndexImpl
Source§type Inner = FaissIndexBinary_H
type Inner = FaissIndexBinary_H
The underlying native Faiss index.
Source§fn inner_ptr(&self) -> *mut FaissIndexBinary
fn inner_ptr(&self) -> *mut FaissIndexBinary
Retrieve a pointer to the native index object.
Source§impl TryClone for BinaryIVFIndexImpl
impl TryClone for BinaryIVFIndexImpl
impl CpuIndex<u8, i32> for BinaryIVFIndexImpl
impl Send for BinaryIVFIndexImpl
impl Sync for BinaryIVFIndexImpl
Auto Trait Implementations§
impl Freeze for BinaryIVFIndexImpl
impl RefUnwindSafe for BinaryIVFIndexImpl
impl Unpin for BinaryIVFIndexImpl
impl UnwindSafe for BinaryIVFIndexImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more