Trait array_math::ArrayMath

source ·
pub trait ArrayMath<T, const N: usize>: ArrayOps<T, N> {
    // Required methods
    fn magnitude_squared(self) -> <T as Mul<T>>::Output
       where T: Mul<T, Output: AddAssign + ZeroConst> + Copy;
    fn normalize(
        self
    ) -> Self::MappedTo<<T as Mul<<T as Mul<T>>::Output>>::Output>
       where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt + Copy> + Mul<<T as Mul<T>>::Output> + Copy;
    fn normalize_to<Rhs>(
        self,
        magnitude: Rhs
    ) -> Self::MappedTo<<T as Mul<<<T as Mul<T>>::Output as Mul<Rhs>>::Output>>::Output>
       where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt + Mul<Rhs, Output: Copy>> + Mul<<<T as Mul<T>>::Output as Mul<Rhs>>::Output> + Copy;

    // Provided methods
    fn sum(self) -> T
       where T: AddAssign + ZeroConst { ... }
    fn product(self) -> T
       where T: MulAssign + OneConst { ... }
    fn avg(self) -> <T as Div>::Output
       where u8: Into<T>,
             T: Div + AddAssign + ZeroConst { ... }
    fn avg16(self) -> <T as Div>::Output
       where u16: Into<T>,
             T: Div + AddAssign + ZeroConst { ... }
    fn avg32(self) -> <T as Div>::Output
       where u32: Into<T>,
             T: Div + AddAssign + ZeroConst { ... }
    fn avg64(self) -> <T as Div>::Output
       where u64: Into<T>,
             T: Div + AddAssign + ZeroConst { ... }
    fn mul_dot<Rhs>(self, rhs: Self::MappedTo<Rhs>) -> <T as Mul<Rhs>>::Output
       where T: Mul<Rhs, Output: AddAssign + ZeroConst> { ... }
    fn magnitude(self) -> <T as Mul<T>>::Output
       where T: Mul<T, Output: AddAssign + ZeroConst + ApproxSqrt> + Copy { ... }
    fn magnitude_inv(self) -> <T as Mul<T>>::Output
       where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt> + Copy { ... }
}

Required Methods§

source

fn magnitude_squared(self) -> <T as Mul<T>>::Output
where T: Mul<T, Output: AddAssign + ZeroConst> + Copy,

source

fn normalize(self) -> Self::MappedTo<<T as Mul<<T as Mul<T>>::Output>>::Output>
where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt + Copy> + Mul<<T as Mul<T>>::Output> + Copy,

source

fn normalize_to<Rhs>( self, magnitude: Rhs ) -> Self::MappedTo<<T as Mul<<<T as Mul<T>>::Output as Mul<Rhs>>::Output>>::Output>
where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt + Mul<Rhs, Output: Copy>> + Mul<<<T as Mul<T>>::Output as Mul<Rhs>>::Output> + Copy,

Provided Methods§

source

fn sum(self) -> T
where T: AddAssign + ZeroConst,

source

fn product(self) -> T
where T: MulAssign + OneConst,

source

fn avg(self) -> <T as Div>::Output
where u8: Into<T>, T: Div + AddAssign + ZeroConst,

source

fn avg16(self) -> <T as Div>::Output
where u16: Into<T>, T: Div + AddAssign + ZeroConst,

source

fn avg32(self) -> <T as Div>::Output
where u32: Into<T>, T: Div + AddAssign + ZeroConst,

source

fn avg64(self) -> <T as Div>::Output
where u64: Into<T>, T: Div + AddAssign + ZeroConst,

source

fn mul_dot<Rhs>(self, rhs: Self::MappedTo<Rhs>) -> <T as Mul<Rhs>>::Output
where T: Mul<Rhs, Output: AddAssign + ZeroConst>,

source

fn magnitude(self) -> <T as Mul<T>>::Output
where T: Mul<T, Output: AddAssign + ZeroConst + ApproxSqrt> + Copy,

source

fn magnitude_inv(self) -> <T as Mul<T>>::Output
where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt> + Copy,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T, const N: usize> ArrayMath<T, N> for [T; N]

source§

fn magnitude_squared(self) -> <T as Mul<T>>::Output
where T: Mul<T, Output: AddAssign + ZeroConst> + Copy,

source§

fn normalize(self) -> Self::MappedTo<<T as Mul<<T as Mul<T>>::Output>>::Output>
where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt + Copy> + Mul<<T as Mul<T>>::Output> + Copy,

source§

fn normalize_to<Rhs>( self, magnitude: Rhs ) -> Self::MappedTo<<T as Mul<<<T as Mul<T>>::Output as Mul<Rhs>>::Output>>::Output>
where T: Mul<T, Output: AddAssign + ZeroConst + ApproxInvSqrt + Mul<Rhs, Output: Copy>> + Mul<<<T as Mul<T>>::Output as Mul<Rhs>>::Output> + Copy,

Implementors§