Trait Matrix

Source
pub trait Matrix: UnsafeGet {
    type NROWS: Unsigned;
    type NCOLS: Unsigned;

    // Provided methods
    fn get(self, r: usize, c: usize) -> Self::Elem { ... }
    fn size(self) -> (usize, usize) { ... }
    fn nrows(self) -> usize { ... }
    fn ncols(self) -> usize { ... }
}
Expand description

A matrix

Required Associated Types§

Source

type NROWS: Unsigned

Number of rows

Source

type NCOLS: Unsigned

Number of columns

Provided Methods§

Source

fn get(self, r: usize, c: usize) -> Self::Elem

Returns the element at row r and column c

§Panics

This operation panics if r or c exceed the matrix dimensions

Source

fn size(self) -> (usize, usize)

Returns the size of the matrix

Source

fn nrows(self) -> usize

Returns the number of rows of the matrix

Source

fn ncols(self) -> usize

Returns the number of columns of the matrix

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, T, NROWS, NCOLS> Matrix for &'a Mat<T, NROWS, NCOLS>
where NROWS: Mul<NCOLS> + Unsigned, NCOLS: Unsigned, Prod<NROWS, NCOLS>: ArrayLength<T>, T: Copy,

Source§

type NROWS = NROWS

Source§

type NCOLS = NCOLS

Source§

impl<L, R, T> Matrix for Product<L, R>
where L: Matrix<Elem = T>, R: Matrix<Elem = T>, T: Add<T, Output = T> + Mul<T, Output = T> + Copy + Zero,

Source§

type NROWS = <L as Matrix>::NROWS

Source§

type NCOLS = <R as Matrix>::NCOLS

Source§

impl<M> Matrix for Transpose<M>
where M: Matrix,

Source§

type NROWS = <M as Matrix>::NCOLS

Source§

type NCOLS = <M as Matrix>::NROWS

Source§

impl<T, L, R> Matrix for Sum<L, R>
where L: Matrix<Elem = T>, R: Matrix<Elem = T>, T: Add<T, Output = T> + Copy,

Source§

type NROWS = <L as Matrix>::NROWS

Source§

type NCOLS = <L as Matrix>::NCOLS