pub trait MatMul<Rhs> {
type Output;
// Required method
fn matmul(&self, rhs: &Rhs) -> Self::Output;
}Expand description
Matrix multiplication.
Required Associated Types§
Required Methods§
Sourcefn matmul(&self, rhs: &Rhs) -> Self::Output
fn matmul(&self, rhs: &Rhs) -> Self::Output
Multiply two matrices.
§Example
use hoomd_linear_algebra::{
Full, GeneralMatrix, MatMul, SquareMatrix,
matrix::{DiagonalMatrix, Matrix, Matrix22},
};
let a = Matrix22::full(5.0);
assert_eq!(a.matmul(&Matrix22::identity()), a);
let b = Matrix::with_diagonal([3.0, 2.0]);
assert_eq!(a.matmul(&b).rows, [[15.0, 10.0], [15.0, 10.0]]);