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>;
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>;
}
Expand description
Array arithmetic operations
Required Associated Types§
Required Methods§
Sourcefn add(
self,
rhs: O,
) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
fn add( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
Construct an addition operation with the given rhs
.
Sourcefn div(
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>
Construct a division operation with the given rhs
.
Sourcefn log(
self,
base: O,
) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
fn log( self, base: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
Construct a logarithm operation with the given base
.
Sourcefn mul(
self,
rhs: O,
) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
fn mul( self, rhs: O, ) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
Construct a multiplication operation with the given rhs
.
Sourcefn pow(
self,
exp: O,
) -> Result<Array<Self::DType, Self::Output, Self::Platform>, Error>
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 exp
onent.
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.