Trait LinearAlgebra

Source
pub trait LinearAlgebra<T> {
    // Required methods
    fn rows(&self) -> usize;
    fn cols(&self) -> usize;
    fn transpose(&self) -> Self
       where Self: Sized;
    fn trace(&self) -> T;
    fn norm2(&self) -> T;
    fn det(&self) -> T;
    fn inverse(&self) -> Option<Self>
       where Self: Sized;
    fn qr(&self) -> Option<(Self, Self)>
       where Self: Sized;

    // Provided method
    fn shape(&self) -> (usize, usize) { ... }
}
Expand description

Generic Trait for Matrix operations and Linear Algebra methods

Required Methods§

Source

fn rows(&self) -> usize

get the rows of the matrix

Source

fn cols(&self) -> usize

get the columns of the matrix

Source

fn transpose(&self) -> Self
where Self: Sized,

transpose dimentions of the matrix

Source

fn trace(&self) -> T

get the trace of the matrix

Source

fn norm2(&self) -> T

compute the euclidean norm of the matrix

Source

fn det(&self) -> T

compute the determinant of the matrix

Source

fn inverse(&self) -> Option<Self>
where Self: Sized,

compute the inverse of the matrix

Source

fn qr(&self) -> Option<(Self, Self)>
where Self: Sized,

compute the QR factorization of the matrix(if has inverse)

Provided Methods§

Source

fn shape(&self) -> (usize, usize)

get the overal shape of the matrix

Implementors§

Source§

impl<T: Float + Sum> LinearAlgebra<T> for M22<T>

Source§

impl<T: Float + Sum> LinearAlgebra<T> for M33<T>

Source§

impl<T: Float + Sum> LinearAlgebra<T> for M44<T>

Source§

impl<T: Float + Sum> LinearAlgebra<T> for M55<T>

Source§

impl<T: Float + Sum> LinearAlgebra<T> for M66<T>