pub struct LinearSearchExternal<'a, const N: usize> { /* private fields */ }
Expand description
A linear search implementation of the ANNIndex trait. This performs no indexing and simply scans the entire dataset for each query. It’s useful as a baseline comparison and for small datasets.
Trait Implementations§
Source§impl<'a, const N: usize> ANNIndexExternal<'a, N> for LinearSearchExternal<'a, N>
impl<'a, const N: usize> ANNIndexExternal<'a, N> for LinearSearchExternal<'a, N>
type Index = LinearSearchExternal<'a, N>
Source§fn build<R: Rng>(
_num_trees: usize,
_max_leaf_size: usize,
vectors: &'a [Vector<N>],
_rng: &mut R,
) -> Result<Self::Index, &'static str>
fn build<R: Rng>( _num_trees: usize, _max_leaf_size: usize, vectors: &'a [Vector<N>], _rng: &mut R, ) -> Result<Self::Index, &'static str>
Build the index for the given vectors and ids. Read more
Source§fn search(&self, query: &Vector<N>, top_k: usize) -> Vec<(usize, f32)>
fn search(&self, query: &Vector<N>, top_k: usize) -> Vec<(usize, f32)>
Search for the top_k nearest neighbors of the query vector. Read more
Source§fn memory_usage(&self) -> usize
fn memory_usage(&self) -> usize
Get the memory usage of the index.
Auto Trait Implementations§
impl<'a, const N: usize> Freeze for LinearSearchExternal<'a, N>
impl<'a, const N: usize> RefUnwindSafe for LinearSearchExternal<'a, N>
impl<'a, const N: usize> Send for LinearSearchExternal<'a, N>
impl<'a, const N: usize> Sync for LinearSearchExternal<'a, N>
impl<'a, const N: usize> Unpin for LinearSearchExternal<'a, N>
impl<'a, const N: usize> UnwindSafe for LinearSearchExternal<'a, N>
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