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 and other are vectors, a scalar is returned.
  • If self is a vector and other a matrix, a vector of distances between self and the rows of other is returned.
  • If self and other are both matrices, a matrix of distances is returned were (i, j) is the distance between row i of self and row j of other.

Associated Types

Required methods

Compute the squared Euclidean distance(s).

Implementations on Foreign Types

Implementors