Trait heapless_matrix::matrix_trait::MatrixTrait
source · 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§
type TransposeType: MatrixTrait<COLS, ROWS>
Required Methods§
sourcefn new() -> Option<Self>where
Self: Sized,
fn new() -> Option<Self>where
Self: Sized,
Function that creates an matrix where all elements are equal to zero
sourcefn from_vector(data: [[f64; COLS]; ROWS]) -> Option<Self>where
Self: Sized,
fn from_vector(data: [[f64; COLS]; ROWS]) -> Option<Self>where
Self: Sized,
Function that creates an heapless matrix from an array
sourcefn transpose(&self) -> Self::TransposeType
fn transpose(&self) -> Self::TransposeType
Function that transposes a matrix
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>
Object Safety§
This trait is not object safe.