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§
Sourcefn add_scalar(
self,
rhs: Self::DType,
) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
fn add_scalar( self, rhs: Self::DType, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
Construct a scalar addition operation.
Sourcefn div_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>
Construct a scalar division operation.
Sourcefn log_scalar(
self,
base: 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>
Construct a scalar logarithm operation.
Sourcefn mul_scalar(
self,
rhs: 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>
Construct a scalar multiplication operation.
Sourcefn pow_scalar(
self,
exp: 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>
Construct a scalar exponentiation 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.