pub trait MatrixTrait<const ROWS: usize, const COLS: usize> {
    type TransposeType: MatrixTrait<COLS, ROWS>;

    // Required methods
    fn new() -> Option<Self>
       where Self: Sized;
    fn eye() -> Option<Self>
       where Self: Sized;
    fn from_vector(data: [[f64; COLS]; ROWS]) -> Option<Self>
       where Self: Sized;
    fn transpose(&self) -> Self::TransposeType;
    fn to_double(&self) -> Option<f64>;
    fn swap_rows(
        &mut self,
        row1: usize,
        row2: usize
    ) -> Result<(), &'static str>;
    fn sub_matrix<const NEW_ROWS: usize, const NEW_COLS: usize>(
        &self,
        row_start: usize,
        col_start: usize
    ) -> Result<Matrix<NEW_ROWS, NEW_COLS>, &'static str>;
}

Required Associated Types§

Required Methods§

source

fn new() -> Option<Self>
where Self: Sized,

Function that creates an matrix where all elements are equal to zero

source

fn eye() -> Option<Self>
where Self: Sized,

Function that creates an identity matrix

source

fn from_vector(data: [[f64; COLS]; ROWS]) -> Option<Self>
where Self: Sized,

Function that creates an heapless matrix from an array

source

fn transpose(&self) -> Self::TransposeType

Function that transposes a matrix

source

fn to_double(&self) -> Option<f64>

Function that converts a 1x1 matrix into a f64

source

fn swap_rows(&mut self, row1: usize, row2: usize) -> Result<(), &'static str>

source

fn sub_matrix<const NEW_ROWS: usize, const NEW_COLS: usize>( &self, row_start: usize, col_start: usize ) -> Result<Matrix<NEW_ROWS, NEW_COLS>, &'static str>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<const ROWS: usize, const COLS: usize> MatrixTrait<ROWS, COLS> for Matrix<ROWS, COLS>

§

type TransposeType = Matrix<COLS, ROWS>