pub enum DistanceMetric {
Cosine,
Euclidean,
DotProduct,
}Expand description
The closed set of supported vector distance metrics.
Each metric defines how similarity is computed between vectors.
Variants§
Cosine
Cosine similarity (1 - cosine_similarity as distance).
Euclidean
Euclidean (L2) distance.
DotProduct
Negative inner (dot) product distance.
Implementations§
Trait Implementations§
Source§impl Clone for DistanceMetric
impl Clone for DistanceMetric
impl Copy for DistanceMetric
Source§impl Debug for DistanceMetric
impl Debug for DistanceMetric
Source§impl Display for DistanceMetric
impl Display for DistanceMetric
impl Eq for DistanceMetric
Source§impl Hash for DistanceMetric
impl Hash for DistanceMetric
Source§impl Ord for DistanceMetric
impl Ord for DistanceMetric
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DistanceMetric
impl PartialEq for DistanceMetric
Source§impl PartialOrd for DistanceMetric
impl PartialOrd for DistanceMetric
impl StructuralPartialEq for DistanceMetric
Auto Trait Implementations§
impl Freeze for DistanceMetric
impl RefUnwindSafe for DistanceMetric
impl Send for DistanceMetric
impl Sync for DistanceMetric
impl Unpin for DistanceMetric
impl UnsafeUnpin for DistanceMetric
impl UnwindSafe for DistanceMetric
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