Trait NDArrayMathScalar

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

    // Required methods
    fn add_scalar(
        self,
        rhs: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn div_scalar(
        self,
        rhs: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn log_scalar(
        self,
        base: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn mul_scalar(
        self,
        rhs: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn pow_scalar(
        self,
        exp: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn rem_scalar(
        self,
        rhs: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
    fn sub_scalar(
        self,
        rhs: Self::DType,
    ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>;
}
Expand description

Array arithmetic operations with a scalar argument

Required Associated Types§

Required Methods§

Source

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

Construct a scalar addition operation.

Source

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

Construct a scalar division operation.

Source

fn log_scalar( self, base: Self::DType, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>

Construct a scalar logarithm operation.

Source

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

Construct a scalar multiplication operation.

Source

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

Construct a scalar exponentiation operation.

Source

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

Construct a scalar modulo operation.

Source

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

Construct a scalar subtraction operation.

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§