Skip to main content

VectorSpace

Trait VectorSpace 

Source
pub trait VectorSpace<S: Field>:
    Module<S>
    + Div<S, Output = Self>
    + Copy {
    type NonZero;

    // Required method
    fn map<F>(self, f: F) -> Self
       where F: FnMut(S) -> S;

    // Provided methods
    fn sigvec(self) -> Self
       where S: SignedExt { ... }
    fn interpolate(a: Self, b: Self, t: Normalized<S>) -> Self { ... }
    fn extrapolate(a: Self, b: Self, t: S) -> Self { ... }
}
Expand description

Module with scalars taken from a Field

Required Associated Types§

Required Methods§

Source

fn map<F>(self, f: F) -> Self
where F: FnMut(S) -> S,

Provided Methods§

Source

fn sigvec(self) -> Self
where S: SignedExt,

Map signum_or_zero over each element of the given vector

Source

fn interpolate(a: Self, b: Self, t: Normalized<S>) -> Self

Linear interpolation

Source

fn extrapolate(a: Self, b: Self, t: S) -> Self

Linear extrapolation

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl VectorSpace<f32> for f32

Source§

type NonZero = NonZero<f32>

Source§

fn map<F>(self, f: F) -> Self
where F: FnMut(Self) -> Self,

Source§

impl VectorSpace<f64> for f64

Source§

type NonZero = NonZero<f64>

Source§

fn map<F>(self, f: F) -> Self
where F: FnMut(Self) -> Self,

Source§

impl<U> VectorSpace<FixedI8<U>> for FixedI8<U>
where U: Unsigned + IsLessOrEqual<U6, Output = True> + IsLessOrEqual<U5, Output = True> + LtU8,

Source§

type NonZero = NonZero<FixedI8<U>>

Source§

fn map<F>(self, f: F) -> Self
where F: FnMut(Self) -> Self,

Source§

impl<U> VectorSpace<FixedI16<U>> for FixedI16<U>
where U: Unsigned + IsLessOrEqual<U14, Output = True> + IsLessOrEqual<U13, Output = True> + LtU16,

Source§

type NonZero = NonZero<FixedI16<U>>

Source§

fn map<F>(self, f: F) -> Self
where F: FnMut(Self) -> Self,

Source§

impl<U> VectorSpace<FixedI32<U>> for FixedI32<U>
where U: Unsigned + IsLessOrEqual<U30, Output = True> + IsLessOrEqual<U29, Output = True> + LtU32,

Source§

type NonZero = NonZero<FixedI32<U>>

Source§

fn map<F>(self, f: F) -> Self
where F: FnMut(Self) -> Self,

Source§

impl<U> VectorSpace<FixedI64<U>> for FixedI64<U>
where U: Unsigned + IsLessOrEqual<U62, Output = True> + IsLessOrEqual<U61, Output = True> + LtU64,

Source§

type NonZero = NonZero<FixedI64<U>>

Source§

fn map<F>(self, f: F) -> Self
where F: FnMut(Self) -> Self,

Implementors§

Source§

impl<S, U> VectorSpace<S> for Displacement2<S, U>
where S: Field, U: Debug, Vector2<S>: VectorSpace<S>,

Source§

impl<S, U> VectorSpace<S> for Displacement3<S, U>
where S: Field, U: Debug, Vector3<S>: VectorSpace<S>,

Source§

impl<S, U> VectorSpace<S> for Displacement4<S, U>
where S: Field, U: Debug, Vector4<S>: VectorSpace<S>,

Source§

impl<S: Field> VectorSpace<S> for Vector2<S>

Source§

impl<S: Field> VectorSpace<S> for Vector3<S>

Source§

impl<S: Field> VectorSpace<S> for Vector4<S>