pub struct Distance<T, U>where
T: 'static,
U: 'static,{ /* private fields */ }Expand description
A function pointer-like type for computing distances between &[T] and &[U].
See: DistanceProvider.
Implementations§
Source§impl<T, U> Distance<T, U>where
T: 'static,
U: 'static,
impl<T, U> Distance<T, U>where
T: 'static,
U: 'static,
Sourcepub fn call(&self, x: &[T], y: &[U]) -> f32
pub fn call(&self, x: &[T], y: &[U]) -> f32
Compute a distances between x and y.
The actual distance computed depends on the metric supplied to DistanceProvider.
Additionally, if a dimension were given to DistanceProvider, this function may
panic if provided with slices with a length not equal to this dimension.
Trait Implementations§
impl<T, U> Copy for Distance<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Distance<T, U>
impl<T, U> RefUnwindSafe for Distance<T, U>
impl<T, U> Send for Distance<T, U>
impl<T, U> Sync for Distance<T, U>
impl<T, U> Unpin for Distance<T, U>
impl<T, U> UnsafeUnpin for Distance<T, U>
impl<T, U> UnwindSafe for Distance<T, U>
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