Matrix

Trait Matrix 

Source
pub trait Matrix<S>: Copy {
    type Rows;
    type Submatrix;

    // Required methods
    fn rows(self) -> Self::Rows;
    fn submatrix(self, i: usize, j: usize) -> Self::Submatrix;
    fn fill_zeros(submatrix: Self::Submatrix) -> Self
       where S: Zero;

    // Provided method
    fn minor<V, W>(self, i: usize, j: usize) -> S
       where S: Ring,
             V: Module<S>,
             W: Module<S>,
             Self::Submatrix: LinearMap<S, V, W> { ... }
}
Expand description

Additional matrix methods

Required Associated Types§

Required Methods§

Source

fn rows(self) -> Self::Rows

Returns the row-major matrix

Source

fn submatrix(self, i: usize, j: usize) -> Self::Submatrix

Returns the submatrix formed by removing the given (col,row)

Source

fn fill_zeros(submatrix: Self::Submatrix) -> Self
where S: Zero,

Returns the matrix formed by filling additional row and column with zeros

Provided Methods§

Source

fn minor<V, W>(self, i: usize, j: usize) -> S
where S: Ring, V: Module<S>, W: Module<S>, Self::Submatrix: LinearMap<S, V, W>,

Computes the determinant of the (i,j)-submatrix

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<S: Copy> Matrix<S> for Matrix3<S>

Source§

impl<S: Copy> Matrix<S> for Matrix4<S>