nyx_space::linalg

Trait Normed

source
pub trait Normed {
    type Norm: SimdRealField;

    // Required methods
    fn norm(&self) -> Self::Norm;
    fn norm_squared(&self) -> Self::Norm;
    fn scale_mut(&mut self, n: Self::Norm);
    fn unscale_mut(&mut self, n: Self::Norm);
}
Expand description

Trait implemented by entities scan be be normalized and put in an Unit struct.

Required Associated Types§

source

type Norm: SimdRealField

The type of the norm.

Required Methods§

source

fn norm(&self) -> Self::Norm

Computes the norm.

source

fn norm_squared(&self) -> Self::Norm

Computes the squared norm.

source

fn scale_mut(&mut self, n: Self::Norm)

Multiply self by n.

source

fn unscale_mut(&mut self, n: Self::Norm)

Divides self by n.

Implementations on Foreign Types§

source§

impl<T> Normed for Complex<T>
where T: SimdRealField,

source§

type Norm = <T as SimdComplexField>::SimdRealField

source§

fn norm(&self) -> <T as SimdComplexField>::SimdRealField

source§

fn norm_squared(&self) -> <T as SimdComplexField>::SimdRealField

source§

fn scale_mut(&mut self, n: <Complex<T> as Normed>::Norm)

source§

fn unscale_mut(&mut self, n: <Complex<T> as Normed>::Norm)

Implementors§

source§

impl<T> Normed for DualQuaternion<T>
where T: SimdRealField,

source§

type Norm = <T as SimdComplexField>::SimdRealField

source§

impl<T> Normed for Quaternion<T>
where T: SimdRealField,

source§

type Norm = <T as SimdComplexField>::SimdRealField

source§

impl<T, R, C> Normed for Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>
where T: SimdComplexField, R: Dim, C: Dim, DefaultAllocator: Allocator<R, C>,

source§

type Norm = <T as SimdComplexField>::SimdRealField