Trait reductive::linalg::SquaredEuclideanDistance [−][src]
pub trait SquaredEuclideanDistance<A, D> {
type Output;
fn squared_euclidean_distance<S>(
&self,
other: ArrayBase<S, D>
) -> Self::Output
where
S: Data<Elem = A>;
}
Expand description
Squared euclidean distance |u-v|^2.
Computes the squared euclidean distances between two arrays.
- If
self
andother
are vectors, a scalar is returned. - If
self
is a vector andother
a matrix, a vector of distances betweenself
and the rows ofother
is returned. - If
self
andother
are both matrices, a matrix of distances is returned were (i, j) is the distance between row i ofself
and row j ofother
.
Associated Types
Required methods
fn squared_euclidean_distance<S>(&self, other: ArrayBase<S, D>) -> Self::Output where
S: Data<Elem = A>,
fn squared_euclidean_distance<S>(&self, other: ArrayBase<S, D>) -> Self::Output where
S: Data<Elem = A>,
Compute the squared Euclidean distance(s).