pub trait EuclideanDistance<T, Rhs = Self> {
// Required methods
fn euclidean_distance(&self, rhs: &Rhs) -> T;
fn euclidean_squared(&self, rhs: &Rhs) -> T;
}Required Methods§
fn euclidean_distance(&self, rhs: &Rhs) -> T
Sourcefn euclidean_squared(&self, rhs: &Rhs) -> T
fn euclidean_squared(&self, rhs: &Rhs) -> T
It is especially suitable when only the length needs to be compared
a square root operation is generally 14 instruction cycles
and the square root cannot be used in some spaces, like Z^n
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".