MatMul

Trait MatMul 

Source
pub trait MatMul<Rhs> {
    type Output;

    // Required method
    fn matmul(&self, rhs: &Rhs) -> Self::Output;
}
Expand description

Matrix multiplication.

Required Associated Types§

Source

type Output

The type of the output matrix.

Required Methods§

Source

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]]);

Implementors§

Source§

impl<const N: usize, const M: usize> MatMul<DiagonalMatrix<M>> for Matrix<N, M>

Source§

type Output = Matrix<N, M>

Source§

impl<const N: usize, const M: usize, const K: usize> MatMul<Matrix<M, K>> for Matrix<N, M>

Source§

type Output = Matrix<N, K>