Trait acgmath::SquareMatrix [] [src]

pub trait SquareMatrix where
    Self::Scalar: BaseFloat,
    Self: One,
    Self: Matrix<Column = Self::ColumnRow, Row = Self::ColumnRow, Transpose = Self>,
    Self: Mul<Self::ColumnRow, Output = Self::ColumnRow>,
    Self: Mul<Self, Output = Self>, 
{ type ColumnRow: VectorSpace<Scalar = Self::Scalar> + Array<Element = Self::Scalar>; fn from_value(value: Self::Scalar) -> Self; fn from_diagonal(diagonal: Self::ColumnRow) -> Self; fn transpose_self(&mut self); fn determinant(&self) -> Self::Scalar; fn diagonal(&self) -> Self::ColumnRow; fn invert(&self) -> Option<Self>; fn is_diagonal(&self) -> bool; fn is_symmetric(&self) -> bool; fn identity() -> Self { ... } fn trace(&self) -> Self::Scalar { ... } fn is_invertible(&self) -> bool { ... } fn is_identity(&self) -> bool { ... } }

A column-major major matrix where the rows and column vectors are of the same dimensions.

Associated Types

The row/column vector of the matrix.

This is used to constrain the column and rows to be of the same type in lieu of equality constraints being implemented for where clauses. Once those are added, this type will likely go away.

Required Methods

Create a new diagonal matrix using the supplied value.

Create a matrix from a non-uniform scale

Transpose this matrix in-place.

Take the determinant of this matrix.

Return a vector containing the diagonal of this matrix.

Invert this matrix, returning a new matrix. m.mul_m(m.invert()) is the identity matrix. Returns None if this matrix is not invertible (has a determinant of zero).

Test if this is a diagonal matrix. That is, every element outside of the diagonal is 0.

Test if this matrix is symmetric. That is, it is equal to its transpose.

Provided Methods

The identity matrix. Multiplying this matrix with another should have no effect.

Note that this is exactly the same as One::one. The term 'identity matrix' is more common though, so we provide this method as an alternative.

Return the trace of this matrix. That is, the sum of the diagonal.

Test if this matrix is invertible.

Test if this matrix is the identity matrix. That is, it is diagonal and every element in the diagonal is one.

Implementors