Skip to main content

NDArrayMath

Trait NDArrayMath 

Source
pub trait NDArrayMath<O: NDArray<DType = Self::DType>>: NDArray + Sized {
    type Output: Access<Self::DType>;

    // Required methods
    fn add(
        self,
        rhs: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn div(
        self,
        rhs: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn log(
        self,
        base: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
       where Self::DType: Float;
    fn mul(
        self,
        rhs: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn pow(
        self,
        exp: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn sub(
        self,
        rhs: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn rem(
        self,
        rhs: O,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
       where Self::DType: Real;
}
Expand description

Array arithmetic operations

Required Associated Types§

Required Methods§

Source

fn add( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>

Construct an addition operation with the given rhs.

Source

fn div( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>

Construct a division operation with the given rhs.

Source

fn log( self, base: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
where Self::DType: Float,

Construct a logarithm operation with the given base.

Source

fn mul( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>

Construct a multiplication operation with the given rhs.

Source

fn pow( self, exp: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>

Construct an operation to raise these data to the power of the given exponent.

Source

fn sub( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>

Construct an array subtraction operation with the given rhs.

Source

fn rem( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
where Self::DType: Real,

Construct a modulo operation with the given rhs.

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§