Trait array_matrix::matrix::sub::MSub

source ·
pub trait MSub<Rhs: Matrix>: Matrixwhere
    Self::Output: Matrix,
{ type Output; fn sub(self, rhs: Rhs) -> Self::Output; }

Required Associated Types§

Required Methods§

Subtracts one matrix from another of equal dimensions

A - B

Arguments
  • rhs - The subtracted matrix
Examples
let a = [
    [1.0, 2.0],
    [3.0, 4.0]
];
let b = [
    [4.0, 3.0],
    [2.0, 1.0]
];
let s = [
    [a[0][0] - b[0][0], a[0][1] - b[0][1]],
    [a[1][0] - b[1][0], a[1][1] - b[1][1]]
];
assert_eq!(a.sub(b), s);

Implementations on Foreign Types§

Implementors§