Trait array_matrix::vector::abs::VAbs

source ·
pub trait VAbs: Vector {
    type Output;

    fn abs_sqr(&self) -> Self::Output;
    fn abs(&self) -> Self::Output;
}

Required Associated Types§

Required Methods§

Returns the square euclidian absolute value of any vector-array

||u||²

Examples
let u = [1.0, 2.0];
let u_abs_sqr = u[0]*u[0] + u[1]*u[1];
 
assert_eq!(u.abs_sqr(), u_abs_sqr);

Returns the euclidian absolute value of any vector-array

||u||

Examples
let u = [1.0, 2.0];
let u_abs = (u[0]*u[0] + u[1]*u[1]).sqrt();
 
assert_eq!(u.abs(), u_abs);

Implementations on Foreign Types§

Implementors§