pub struct Matrix { /* private fields */ }Expand description
Matrix with fractions as elements.
Implementations§
Source§impl Matrix
impl Matrix
Sourcepub fn create(row: usize, col: usize, value: Fraction) -> Self
pub fn create(row: usize, col: usize, value: Fraction) -> Self
Create a row x col matrix with all identical elements.
Sourcepub fn is_symmetric(&self) -> bool
pub fn is_symmetric(&self) -> bool
Returns true if the matrix is symmetric.
Sourcepub fn is_diagonal(&self) -> bool
pub fn is_diagonal(&self) -> bool
Check if the matrix is diagonal matrix.
Sourcepub fn row_echelon_form(&self) -> Self
pub fn row_echelon_form(&self) -> Self
Transform this matrix to general row echelon form.
Sourcepub fn row_canonical_form(&self) -> Self
pub fn row_canonical_form(&self) -> Self
Transform this matrix to reduced row echelon form.
Sourcepub fn submatrix(&self, i: usize, j: usize) -> Self
pub fn submatrix(&self, i: usize, j: usize) -> Self
Return the matrix that removed the i-th row and j-th column, 0 <= i, j < n.
Sourcepub fn lu_decomposition(&self) -> (Self, Self)
pub fn lu_decomposition(&self) -> (Self, Self)
LU decomposition, use Doolittle algorithm.
Sourcepub fn expand_row(&mut self, matrix: Self) -> &Self
pub fn expand_row(&mut self, matrix: Self) -> &Self
Expand this matrix by rows.
Sourcepub fn expand_col(&mut self, matrix: Self) -> &Self
pub fn expand_col(&mut self, matrix: Self) -> &Self
Expand this matrix by columns.
Sourcepub fn e_row_swap(&mut self, i: usize, j: usize) -> &Self
pub fn e_row_swap(&mut self, i: usize, j: usize) -> &Self
Elementary Row Operations: Row Swap. (A[i] <=> A[j])
Sourcepub fn e_scalar_multiplication(&mut self, i: usize, k: Fraction) -> &Self
pub fn e_scalar_multiplication(&mut self, i: usize, k: Fraction) -> &Self
Elementary Row Operations: Scalar Multiplication. (A[i] *= k)
Trait Implementations§
Source§impl AddAssign<&Matrix> for Matrix
impl AddAssign<&Matrix> for Matrix
Source§fn add_assign(&mut self, rhs: &Matrix)
fn add_assign(&mut self, rhs: &Matrix)
Performs the
+= operation. Read moreSource§impl AddAssign for Matrix
impl AddAssign for Matrix
Source§fn add_assign(&mut self, rhs: Matrix)
fn add_assign(&mut self, rhs: Matrix)
Performs the
+= operation. Read moreSource§impl IntoIterator for Matrix
impl IntoIterator for Matrix
Source§impl MulAssign<Fraction> for Matrix
impl MulAssign<Fraction> for Matrix
Source§fn mul_assign(&mut self, rhs: Fraction)
fn mul_assign(&mut self, rhs: Fraction)
Performs the
*= operation. Read moreSource§impl MulAssign<i32> for Matrix
impl MulAssign<i32> for Matrix
Source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
Performs the
*= operation. Read moreSource§impl SubAssign<&Matrix> for Matrix
impl SubAssign<&Matrix> for Matrix
Source§fn sub_assign(&mut self, rhs: &Matrix)
fn sub_assign(&mut self, rhs: &Matrix)
Performs the
-= operation. Read moreSource§impl SubAssign for Matrix
impl SubAssign for Matrix
Source§fn sub_assign(&mut self, rhs: Matrix)
fn sub_assign(&mut self, rhs: Matrix)
Performs the
-= operation. Read moreimpl Eq for Matrix
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more