[−][src]Trait gramit::mat::SquareMatrix
Associated Types
type VecType
The type used to represent the columns and rows of the matrix type.
Associated Constants
Loading content...Required methods
fn ones() -> Self
Produce a matrix whose elements are all 1's.
fn zeros() -> Self
Produce a matrix whose elements are all 0's.
fn identity() -> Self
Produce an identity matrix, i.e. a matrix with 1's on the main diagonal and 0's elsewhere.
fn transpose(&self) -> Self
Get the transpose of this matrix.
fn determinant(&self) -> f32
Get the determinant of this matrix.
fn inverse(&self) -> Self
Get the inverse of this matrix.
fn minor(&self, col: usize, row: usize) -> f32
Get the row
-col
minor of this matrix.
This is the determinant of the matrix produced by omitting the row
'th row and the
col
'th column of this matrix.
Panics
This function panics if either col
or row
is out of bounds of the matrix.
fn cofactor(&self, col: usize, row: usize) -> f32
Get the row
-col
cofactor of this matrix.
This is the row
-col
minor, multiplied by 1 or -1 depending on the parity of
row
+col
.
Panics
This function panics if either col
or row
is out of bounds of the matrix.
fn get_col(&self, i: usize) -> Self::VecType
fn get_row(&self, i: usize) -> Self::VecType
fn set_col(&mut self, i: usize, c: Self::VecType)
Set the i
'th column of this matrix to match the given vector.
Panics
This function panics if i
is out of bounds.
fn set_row(&mut self, i: usize, r: Self::VecType)
Set the i
'th row of this matrix to match the given vector.
Panics
This function panics if i
is out of bounds.