#[repr(C)]pub enum DistanceTypes {
DIST_USER = -1,
DIST_L1 = 1,
DIST_L2 = 2,
DIST_C = 3,
DIST_L12 = 4,
DIST_FAIR = 5,
DIST_WELSCH = 6,
DIST_HUBER = 7,
}
Expand description
Variants§
DIST_USER = -1
User defined distance
DIST_L1 = 1
distance = |x1-x2| + |y1-y2|
DIST_L2 = 2
the simple euclidean distance
DIST_C = 3
distance = max(|x1-x2|,|y1-y2|)
DIST_L12 = 4
L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1))
DIST_FAIR = 5
distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998
DIST_WELSCH = 6
distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846
DIST_HUBER = 7
distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345
Trait Implementations§
Source§impl Clone for DistanceTypes
impl Clone for DistanceTypes
Source§fn clone(&self) -> DistanceTypes
fn clone(&self) -> DistanceTypes
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 Debug for DistanceTypes
impl Debug for DistanceTypes
Source§impl From<DistanceTypes> for i32
impl From<DistanceTypes> for i32
Source§fn from(v: DistanceTypes) -> Self
fn from(v: DistanceTypes) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DistanceTypes
impl PartialEq for DistanceTypes
Source§impl TryFrom<i32> for DistanceTypes
impl TryFrom<i32> for DistanceTypes
impl Copy for DistanceTypes
impl Eq for DistanceTypes
impl StructuralPartialEq for DistanceTypes
Auto Trait Implementations§
impl Freeze for DistanceTypes
impl RefUnwindSafe for DistanceTypes
impl Send for DistanceTypes
impl Sync for DistanceTypes
impl Unpin for DistanceTypes
impl UnwindSafe for DistanceTypes
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