Skip to main content

NormedVectorSpace

Trait NormedVectorSpace 

Source
pub trait NormedVectorSpace<S: Field>: InnerProductSpace<S> {
    type Unit: Into<Self>;

    // Required methods
    fn norm_squared(self) -> NonNegative<S>;
    fn norm_max(self) -> NonNegative<S>
       where S: SignedExt;
    fn normalize(self) -> Self::Unit
       where S: Sqrt;

    // Provided methods
    fn norm(self) -> NonNegative<S>
       where S: Sqrt { ... }
    fn unit_sigvec(self) -> Self
       where S: SignedExt + Sqrt { ... }
}
Expand description

VectorSpace with vector length/magnitude function

Required Associated Types§

Source

type Unit: Into<Self>

Required Methods§

Source

fn norm_squared(self) -> NonNegative<S>

Source

fn norm_max(self) -> NonNegative<S>
where S: SignedExt,

Infinity norm or uniform norm

Source

fn normalize(self) -> Self::Unit
where S: Sqrt,

Provided Methods§

Source

fn norm(self) -> NonNegative<S>
where S: Sqrt,

Source

fn unit_sigvec(self) -> Self
where S: SignedExt + Sqrt,

Returns zero vector if input is the zero vector, otherwise a normalized vector of each axis sign.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S> NormedVectorSpace<S> for Vector2<S>
where S: OrderedField,

Source§

impl<S> NormedVectorSpace<S> for Vector3<S>
where S: OrderedField,

Source§

impl<S> NormedVectorSpace<S> for Vector4<S>
where S: OrderedField,

Source§

impl<S, U> NormedVectorSpace<S> for Displacement2<S, U>
where S: Real, U: Debug,

Source§

impl<S, U> NormedVectorSpace<S> for Displacement3<S, U>
where S: Real, U: Debug,

Source§

impl<S, U> NormedVectorSpace<S> for Displacement4<S, U>
where S: Real, U: Debug,