pub struct DistDot;
Expand description
This is essentially the Cosine distance but we suppose
all vectors (graph construction and request vectors have been l2 normalized to unity
BEFORE INSERTING in HNSW!.
No control is made, so it is the user responsability to send normalized vectors
everywhere in inserting and searching.
In large dimensions (hundreds) this pre-normalization spare cpu time.
At low dimensions (a few ten’s there is not a significant gain).
This distance makes sense only for f16, f32 or f64
We provide for avx2 implementations for f32 that provides consequent gains
in large dimensions
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DistDot
impl RefUnwindSafe for DistDot
impl Send for DistDot
impl Sync for DistDot
impl Unpin for DistDot
impl UnwindSafe for DistDot
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