Trait Matrix

Source
pub trait Matrix:
    ArithmeticallyOperable<Self>
    + Invertible
    + Parseable
    + Serializable {
    type T: ArithmeticallyOperable<Self::T>;

Show 14 methods // Required methods fn columns(&self) -> usize; fn rows(&self) -> usize; fn is_square(&self) -> bool; fn is_symmetric(&self) -> bool; fn get(&self, row: usize, column: usize) -> Result<&Self::T>; fn get_mut(&mut self, row: usize, column: usize) -> Result<&mut Self::T>; fn set(&mut self, row: usize, column: usize, value: Self::T) -> Result<()>; fn swap_rows(&mut self, row1: usize, row2: usize) -> Result<()>; fn transpose(&self) -> Self; fn gaussian_triangulation(&self) -> Result<Self>; fn lu_decomposition(&self) -> Result<(Self, Self)>; fn cholesky_decomposition(&self) -> Result<Self>; fn determinant_using_gauss(&self) -> Option<Self::T>; fn determinant_using_lu(&self) -> Option<Self::T>;
}

Required Associated Types§

Required Methods§

Source

fn columns(&self) -> usize

Will return the number of columns of the matrix

Source

fn rows(&self) -> usize

Will return the number of rows of the matrix

Source

fn is_square(&self) -> bool

Will return true if the matrix is squared, i.e., if rows == columns

Source

fn is_symmetric(&self) -> bool

Will return true if the matrix is symmetric, i.e., if A == A^T

Source

fn get(&self, row: usize, column: usize) -> Result<&Self::T>

Get a reference of an element of the matrix, or error if you provide wrong indexes

Source

fn get_mut(&mut self, row: usize, column: usize) -> Result<&mut Self::T>

Get a mutable reference of an element of the matrix, or error if you provide wrong indexes

Source

fn set(&mut self, row: usize, column: usize, value: Self::T) -> Result<()>

Set an element of the matrix, or error if you provide wrong indexes

Source

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

Swap two rows of the matrix, or error if you provide wrong indexes

Source

fn transpose(&self) -> Self

Return a new matrix being the transposed of the current one. It does not eliminate the current one

Source

fn gaussian_triangulation(&self) -> Result<Self>

Return a new matrix being the reduced gaussian inferior triangular of the current one. It does not eliminate the current one

Source

fn lu_decomposition(&self) -> Result<(Self, Self)>

Returns a tuple containing the matrices L and U of the LU decomposition, in order. It does not eliminate the current one

Source

fn cholesky_decomposition(&self) -> Result<Self>

Returns a matrix resulting from the Cholesky decomposition. It does not eliminate the current one

Source

fn determinant_using_gauss(&self) -> Option<Self::T>

Return the determinant or a None if the matrix is not squared

Source

fn determinant_using_lu(&self) -> Option<Self::T>

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§