pub struct RingQuery<'a> {
pub query: &'a [f32],
pub d: f32,
pub lambda: f32,
}Expand description
A ring query: find all vectors whose Euclidean distance to query
lies within [d - lambda, d + lambda].
Internally, ringdb uses squared L2 distances to avoid computing square roots. The ring bounds become:
lower_sq = max(0, d - lambda)²
upper_sq = (d + lambda)²Fields§
§query: &'a [f32]The query vector. Must have length equal to RingDb::dims().
d: f32Target distance (centre of the ring).
lambda: f32Half-width of the ring.
Auto Trait Implementations§
impl<'a> Freeze for RingQuery<'a>
impl<'a> RefUnwindSafe for RingQuery<'a>
impl<'a> Send for RingQuery<'a>
impl<'a> Sync for RingQuery<'a>
impl<'a> Unpin for RingQuery<'a>
impl<'a> UnsafeUnpin for RingQuery<'a>
impl<'a> UnwindSafe for RingQuery<'a>
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
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