pub enum FractionMatrixEnum {
Approx(FractionMatrixF64),
Exact(FractionMatrixExact),
CannotCombineExactAndApprox,
}Variants§
Trait Implementations§
Source§impl Clone for FractionMatrixEnum
impl Clone for FractionMatrixEnum
Source§impl Debug for FractionMatrixEnum
impl Debug for FractionMatrixEnum
Source§impl Display for FractionMatrixEnum
impl Display for FractionMatrixEnum
Source§impl EbiMatrix<FractionEnum> for FractionMatrixEnum
impl EbiMatrix<FractionEnum> for FractionMatrixEnum
Source§fn new(number_of_rows: usize, number_of_columns: usize) -> Self
fn new(number_of_rows: usize, number_of_columns: usize) -> Self
Creates a new matrix with each value initialised to zeroes.
Source§fn number_of_rows(&self) -> usize
fn number_of_rows(&self) -> usize
Returns the number of rows
Source§fn number_of_columns(&self) -> usize
fn number_of_columns(&self) -> usize
Returns the number of columns
Source§fn push_columns(&mut self, number_of_columns_to_add: usize)
fn push_columns(&mut self, number_of_columns_to_add: usize)
Adds a number of columns to the right side of the matrix.
The added columns will be filled with zeroes.
Source§fn push_rows(&mut self, number_of_rows_to_add: usize)
fn push_rows(&mut self, number_of_rows_to_add: usize)
Adds a number of rows to the bottom of the matrix.
The added rows will be filled with zeroes.
Source§fn pop_front_columns(&mut self, number_of_columns_to_remove: usize)
fn pop_front_columns(&mut self, number_of_columns_to_remove: usize)
Removes columsn from the left of the matrix.
Source§fn get(&self, row: usize, column: usize) -> Option<FractionEnum>
fn get(&self, row: usize, column: usize) -> Option<FractionEnum>
Gets a particular value of the matrix, if it exists.
Source§fn set(&mut self, row: usize, column: usize, value: FractionEnum)
fn set(&mut self, row: usize, column: usize, value: FractionEnum)
Sets a particular value of the matrix, if the row and column exist.
If row and column do not exist, behaviour is undefined, and may panic.
Prefer set_one and set_zero if possible.
Source§fn set_zero(&mut self, row: usize, column: usize)
fn set_zero(&mut self, row: usize, column: usize)
Sets a particular value of the matrix to zero, if the row and column exist.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn set_one(&mut self, row: usize, column: usize)
fn set_one(&mut self, row: usize, column: usize)
Sets a particular value of the matrix to one, if the row and column exist.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn is_one(&self, row: usize, column: usize) -> bool
fn is_one(&self, row: usize, column: usize) -> bool
Returns whether a value of the matrix is one.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn increase(&mut self, row: usize, column: usize, value: &FractionEnum)
fn increase(&mut self, row: usize, column: usize, value: &FractionEnum)
Increases a particular value of the matrix, if the row and column exist.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn decrease(&mut self, row: usize, column: usize, value: &FractionEnum)
fn decrease(&mut self, row: usize, column: usize, value: &FractionEnum)
Decreases a particular value of the matrix, if the row and column exist.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn set_row_zero(&mut self, row: usize)
fn set_row_zero(&mut self, row: usize)
Sets an entire row to zeroes.
If row does not exist, behaviour is undefined, and may panic.
Source§fn is_positive(&self, row: usize, column: usize) -> bool
fn is_positive(&self, row: usize, column: usize) -> bool
Returns whether a value of the matrix is larger than zero.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn is_negative(&self, row: usize, column: usize) -> bool
fn is_negative(&self, row: usize, column: usize) -> bool
Returns whether a value of the matrix is larger than zero.
If row and column do not exist, behaviour is undefined, and may panic.
Source§fn increase_size_to(&mut self, number_of_rows: usize, number_of_columns: usize)
fn increase_size_to(&mut self, number_of_rows: usize, number_of_columns: usize)
Add a number of rows and columns to the matrix, initialised to zeroes.
Does not decrease the size.
impl Eq for FractionMatrixEnum
Source§impl GaussJordan for FractionMatrixEnum
impl GaussJordan for FractionMatrixEnum
Source§fn gauss_jordan(&mut self)
fn gauss_jordan(&mut self)
Applies Gaussian elimination to obtain a matrix in row echelon form.
Source§fn gauss_jordan_reduced(self) -> Result<Self>
fn gauss_jordan_reduced(self) -> Result<Self>
Applies Gaussian elimination to obtain a matrix in reduced row echelon form.
Source§impl IdentityMinus for FractionMatrixEnum
impl IdentityMinus for FractionMatrixEnum
Source§fn identity_minus(&mut self)
fn identity_minus(&mut self)
For a given matrix M, computes I-M.
The matrix does not need to be squared.
Source§impl Inversion for FractionMatrixEnum
impl Inversion for FractionMatrixEnum
Source§impl MaybeExact for FractionMatrixEnum
impl MaybeExact for FractionMatrixEnum
type Approximate = FractionMatrixF64
type Exact = FractionMatrixExact
fn is_exact(&self) -> bool
Source§fn approx_ref(&self) -> Result<&Self::Approximate>
fn approx_ref(&self) -> Result<&Self::Approximate>
This is a low-level function to extract an approximate value. Will only succeed if the fraction is approximate.
Source§fn exact_ref(&self) -> Result<&FractionMatrixExact>
fn exact_ref(&self) -> Result<&FractionMatrixExact>
This is a low-level function to extract an exact value. Will only succeed if the fraction is exact.
Source§fn approx(self) -> Result<Self::Approximate>
fn approx(self) -> Result<Self::Approximate>
This is a low-level function to extract an approximate value. Will only succeed if the fraction is approximate.
Source§fn exact(self) -> Result<FractionMatrixExact>
fn exact(self) -> Result<FractionMatrixExact>
This is a low-level function to extract an exact value. Will only succeed if the fraction is exact.
Source§fn try_to_exact(
exact: <FractionMatrixEnum as MaybeExact>::Exact,
) -> Result<Self>
fn try_to_exact( exact: <FractionMatrixEnum as MaybeExact>::Exact, ) -> Result<Self>
Attempts to create an object, but will fail if the mode is approximate.
Source§fn try_to_approx(approx: Self::Approximate) -> Result<Self>
fn try_to_approx(approx: Self::Approximate) -> Result<Self>
Attempts to create an object, but will fail if the mode is exact.
Source§impl Mul for &FractionMatrixEnum
impl Mul for &FractionMatrixEnum
Source§impl Mul<&FractionMatrixEnum> for &Vec<FractionEnum>
impl Mul<&FractionMatrixEnum> for &Vec<FractionEnum>
Source§impl Mul<&Vec<FractionEnum>> for &FractionMatrixEnum
impl Mul<&Vec<FractionEnum>> for &FractionMatrixEnum
Source§impl PartialEq for FractionMatrixEnum
impl PartialEq for FractionMatrixEnum
impl StructuralPartialEq for FractionMatrixEnum
Auto Trait Implementations§
impl Forget for FractionMatrixEnum
impl Freeze for FractionMatrixEnum
impl Move for FractionMatrixEnum
impl RefUnwindSafe for FractionMatrixEnum
impl Send for FractionMatrixEnum
impl Sync for FractionMatrixEnum
impl Unpin for FractionMatrixEnum
impl UnsafeUnpin for FractionMatrixEnum
impl UnwindSafe for FractionMatrixEnum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more