[][src]Trait aljabar::SquareMatrix

pub trait SquareMatrix<Scalar, const N: usize>: Sized where
    Scalar: Clone,
    Self: Add<Self>,
    Self: Sub<Self>,
    Self: Mul<Self>,
    Self: Mul<Vector<Scalar, { N }>, Output = Vector<Scalar, { N }>>, 
{ fn determinant(&self) -> Scalar;
fn invert(self) -> Option<Self>;
fn diagonal(&self) -> Vector<Scalar, { N }>; }

Defines a matrix with an equal number of elements in either dimension.

Square matrices can be added, subtracted, and multiplied indiscriminately together. This is a type constraint; only Matrices that are square are able to be multiplied by matrices of the same size.

I believe that SquareMatrix should not have parameters, but associated types and constants do not play well with const generics.

Required methods

fn determinant(&self) -> Scalar

Returns the determinant of the Matrix.

fn invert(self) -> Option<Self>

Attempt to invert the matrix.

fn diagonal(&self) -> Vector<Scalar, { N }>

Return the diagonal of the matrix.

Loading content...

Implementors

impl<Scalar, const N: usize> SquareMatrix<Scalar, N> for Matrix<Scalar, { N }, { N }> where
    Scalar: Clone + One,
    Scalar: Add<Scalar, Output = Scalar> + Sub<Scalar, Output = Scalar>,
    Scalar: Mul<Scalar, Output = Scalar>,
    Self: Add<Self>,
    Self: Sub<Self>,
    Self: Mul<Self>,
    Self: Mul<Vector<Scalar, { N }>, Output = Vector<Scalar, { N }>>, 
[src]

Loading content...