Trait rustml::ops::MatrixScalarOps [] [src]

pub trait MatrixScalarOps<T> {
    fn add_scalar(&self, scalar: T) -> Matrix<T>;
    fn sub_scalar(&self, scalar: T) -> Matrix<T>;
    fn mul_scalar(&self, scalar: T) -> Matrix<T>;
    fn div_scalar(&self, scalar: T) -> Matrix<T>;
}

Trait for matrix scalar operations.

Required Methods

fn add_scalar(&self, scalar: T) -> Matrix<T>

Adds a scalar to each element of the matrix and returns the result.

fn sub_scalar(&self, scalar: T) -> Matrix<T>

Subtracts a scalar from each element of the matrix and returns the result.

fn mul_scalar(&self, scalar: T) -> Matrix<T>

Multiplies each element of the matrix with a scalar and returns the result.

fn div_scalar(&self, scalar: T) -> Matrix<T>

Divides each element of the matrix by a scalar and returns the result.

Implementors