pub enum DistanceMetric {
Euclidean,
Manhattan,
Cosine,
}Expand description
Enumeration of distance metrics for mathematical computations.
This enum defines common distance metrics used in machine learning, clustering, and similarity calculations. Each variant represents a different approach to measuring the distance between points or vectors.
Variantsยง
Euclidean
Euclidean distance (L2 norm) - straight-line distance between points
Manhattan
Manhattan distance (L1 norm) - sum of absolute differences along each dimension
Cosine
Cosine distance - measures the cosine of the angle between vectors
Trait Implementationsยง
Sourceยงimpl Clone for DistanceMetric
impl Clone for DistanceMetric
Sourceยงfn clone(&self) -> DistanceMetric
fn clone(&self) -> DistanceMetric
Returns a duplicate 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 Debug for DistanceMetric
impl Debug for DistanceMetric
impl Copy 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 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