Function flechasdb::linalg::norm2

source ·
pub fn norm2<T>(xs: &[T]) -> Twhere
    T: Abs + One + Sqrt + Zero + AddAssign + Div<Output = T> + Mul<Output = T> + PartialOrd + PartialEq + Copy,
Expand description

Calculates the Euclidean norm of a given vector.

This function is safe if xs contains an extermely large or small value whose square overflows or underflows.

Returns zero if the vector is empty.