fn distance(self, rhs: Self) -> f32
    where
        C: Into<f32>,
    {
        let differences = self
            .iter()
            .zip(rhs.iter())
            .map(|(a, b)| a.into() - b.into());

        differences.map(|n| n * n).sum::<f32>().sqrt()
    }
/// Compute the distance between two vectors
Compute the distance between two vectors
Compute the distance between two vectors
fn distance(self, rhs: Self) -> f32
    where
        C: Into<f32>,
    {
        let differences = self
            .iter()
            .zip(rhs.iter())
            .map(|(a, b)| a.into() - b.into());
        differences.map(|n| n * n).sum::<f32>().sqrt()
    }
fn distance ( self , rhs : Self ) -> f32 where C : Into < f32 > , { let differences = self . iter ( ) . zip ( rhs . iter ( ) ) . map ( | ( a , b ) | a . into ( ) - b . into ( ) ) ; differences . map ( | n | n * n ) . sum :: < f32 > ( ) . sqrt ( ) }
Compute the distance between two vectors
Compute the distance between two vectors
self
rhs
Self
self
rhs
Self