Trait scirust::matrix::update::traits::CopyUpdates [] [src]

pub trait CopyUpdates<T: MagmaBase + Num>: Shape<T> + MatrixBuffer<T> {
    fn copy_add_scalar(&self, rhs: T) -> Self;
    fn copy_mul_scalar(&self, rhs: T) -> Self;
    fn copy_div_scalar(&self, rhs: T) -> Self;
    fn copy_sub_vec_from_cols(&self, vec: &Matrix<T>) -> SRResult<Self>;
    fn copy_sub_vec_from_rows(&self, vec: &Matrix<T>) -> SRResult<Self>;
    fn copy_add_vec_to_cols(&self, vec: &Matrix<T>) -> SRResult<Self>;
    fn copy_add_vec_to_rows(&self, vec: &Matrix<T>) -> SRResult<Self>;
    fn copy_mul_vec_to_cols(&self, vec: &Matrix<T>) -> SRResult<Self>;
    fn copy_mul_vec_to_rows(&self, vec: &Matrix<T>) -> SRResult<Self>;
}

Matrix Copy and Update API

These methods create a new copy of the matrix and apply changes to it. Care is taken to avoid extra operations. The copying process and update process are merged together to save processing cycles.

Remarks

These methods require immutable reference to the matrix being updated.

Required Methods

fn copy_add_scalar(&self, rhs: T) -> Self

Add the matrix by a scalar

fn copy_mul_scalar(&self, rhs: T) -> Self

Multiply the matrix by a scalar

fn copy_div_scalar(&self, rhs: T) -> Self

Divide the matrix by a scalar

fn copy_sub_vec_from_cols(&self, vec: &Matrix<T>) -> SRResult<Self>

Subtract a vector from each column

fn copy_sub_vec_from_rows(&self, vec: &Matrix<T>) -> SRResult<Self>

Subtract a vector from each row

fn copy_add_vec_to_cols(&self, vec: &Matrix<T>) -> SRResult<Self>

Subtract a vector from each column

fn copy_add_vec_to_rows(&self, vec: &Matrix<T>) -> SRResult<Self>

Subtract a vector from each row

fn copy_mul_vec_to_cols(&self, vec: &Matrix<T>) -> SRResult<Self>

Subtract a vector from each column

fn copy_mul_vec_to_rows(&self, vec: &Matrix<T>) -> SRResult<Self>

Subtract a vector from each row

Implementors