MatrixCompare

Trait MatrixCompare 

Source
pub trait MatrixCompare<T> {
    // Required methods
    fn row_count(&self) -> usize;
    fn col_count(&self) -> usize;
    fn at(&self, i: usize, j: usize) -> &T;
}
Expand description

Used by crate::assert_matrix_eq to compare objects that are matrices in a very general sense.

Required Methods§

Source

fn row_count(&self) -> usize

Returns the number of rows of the matrix.

Source

fn col_count(&self) -> usize

Returns the number of columns of the matrix.

Source

fn at(&self, i: usize, j: usize) -> &T

Returns a reference to the element at the given position.

Implementations on Foreign Types§

Source§

impl<'a, T, M: MatrixCompare<T>> MatrixCompare<T> for &'a M

Source§

fn col_count(&self) -> usize

Source§

fn row_count(&self) -> usize

Source§

fn at(&self, i: usize, j: usize) -> &T

Source§

impl<T, const ROWS: usize, const COLS: usize> MatrixCompare<T> for [[T; COLS]; ROWS]

Source§

fn col_count(&self) -> usize

Source§

fn row_count(&self) -> usize

Source§

fn at(&self, i: usize, j: usize) -> &T

Source§

impl<T, const ROWS: usize, const COLS: usize> MatrixCompare<T> for [DerefArray<T, COLS>; ROWS]

Source§

fn col_count(&self) -> usize

Source§

fn row_count(&self) -> usize

Source§

fn at(&self, i: usize, j: usize) -> &T

Implementors§

Source§

impl<'a, V: AsPointerToSlice<T>, T> MatrixCompare<T> for Submatrix<'a, V, T>

Source§

impl<'a, V: AsPointerToSlice<T>, T> MatrixCompare<T> for SubmatrixMut<'a, V, T>

Source§

impl<'a, V: AsPointerToSlice<T>, T, const TRANSPOSED: bool> MatrixCompare<T> for TransposableSubmatrix<'a, V, T, TRANSPOSED>

Source§

impl<'a, V: AsPointerToSlice<T>, T, const TRANSPOSED: bool> MatrixCompare<T> for TransposableSubmatrixMut<'a, V, T, TRANSPOSED>

Source§

impl<T> MatrixCompare<T> for OwnedMatrix<T>