Struct hnsw_rs::prelude::DistHellinger
source · pub struct DistHellinger;
Expand description
A structure to compute Hellinger distance between probalilities. Vector must be >= 0 and normalized to 1.
The distance computation does not check that and in fact simplifies the expression of distance assuming vectors are positive and L1 normalised to 1. The user must enforce these conditions before inserting otherwise results will be meaningless at best or code will panic!
For f32 a simd implementation is provided if avx2 is detected.
Trait Implementations§
source§impl Clone for DistHellinger
impl Clone for DistHellinger
source§fn clone(&self) -> DistHellinger
fn clone(&self) -> DistHellinger
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for DistHellinger
impl Default for DistHellinger
source§fn default() -> DistHellinger
fn default() -> DistHellinger
Returns the “default value” for a type. Read more
impl Copy for DistHellinger
Auto Trait Implementations§
impl Freeze for DistHellinger
impl RefUnwindSafe for DistHellinger
impl Send for DistHellinger
impl Sync for DistHellinger
impl Unpin for DistHellinger
impl UnwindSafe for DistHellinger
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