pub struct ScanOps { /* private fields */ }Expand description
High-level scan operations using best available SIMD
Implementations§
Source§impl ScanOps
impl ScanOps
Sourcepub fn with_kernel(kernel: Box<dyn DistanceKernel>) -> Self
pub fn with_kernel(kernel: Box<dyn DistanceKernel>) -> Self
Create with specific kernel
Sourcepub fn top_k_l2(
&self,
query: &[f32],
vectors: &[f32],
dim: usize,
k: usize,
) -> Vec<(u32, f32)>
pub fn top_k_l2( &self, query: &[f32], vectors: &[f32], dim: usize, k: usize, ) -> Vec<(u32, f32)>
Scan vectors and return top-k by L2 distance
Sourcepub fn top_k_dot(
&self,
query: &[f32],
vectors: &[f32],
dim: usize,
k: usize,
) -> Vec<(u32, f32)>
pub fn top_k_dot( &self, query: &[f32], vectors: &[f32], dim: usize, k: usize, ) -> Vec<(u32, f32)>
Scan vectors and return top-k by dot product (descending)
Sourcepub fn simd_level(&self) -> SimdLevel
pub fn simd_level(&self) -> SimdLevel
Get SIMD level being used
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ScanOps
impl !UnwindSafe for ScanOps
impl Freeze for ScanOps
impl Send for ScanOps
impl Sync for ScanOps
impl Unpin for ScanOps
impl UnsafeUnpin for ScanOps
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more