Skip to main content

FractionMatrixEnum

Enum FractionMatrixEnum 

Source
pub enum FractionMatrixEnum {
    Approx(FractionMatrixF64),
    Exact(FractionMatrixExact),
    CannotCombineExactAndApprox,
}

Variants§

§

Approx(FractionMatrixF64)

§

Exact(FractionMatrixExact)

§

CannotCombineExactAndApprox

Trait Implementations§

Source§

impl Clone for FractionMatrixEnum

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FractionMatrixEnum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for FractionMatrixEnum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EbiMatrix<FractionEnum> for FractionMatrixEnum

Source§

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

Returns the number of rows
Source§

fn number_of_columns(&self) -> usize

Returns the number of columns
Source§

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)

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)

Removes columsn from the left of the matrix.
Source§

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)

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)

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)

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

Returns whether a value of the matrix is one. If row and column do not exist, behaviour is undefined, and may panic.
Source§

fn to_vec(self) -> Vec<Vec<FractionEnum>>

Returns a vector of the matrix
Source§

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)

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)

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

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

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)

Add a number of rows and columns to the matrix, initialised to zeroes. Does not decrease the size.
Source§

impl Eq for FractionMatrixEnum

Source§

impl GaussJordan for FractionMatrixEnum

Source§

fn gauss_jordan(&mut self)

Applies Gaussian elimination to obtain a matrix in row echelon form.
Source§

fn gauss_jordan_reduced(self) -> Result<Self>

Applies Gaussian elimination to obtain a matrix in reduced row echelon form.
Source§

impl IdentityMinus for FractionMatrixEnum

Source§

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

Source§

fn invert(self) -> Result<Self>
where Self: Sized,

Source§

impl MaybeExact for FractionMatrixEnum

Source§

type Approximate = FractionMatrixF64

Source§

type Exact = FractionMatrixExact

Source§

fn is_exact(&self) -> bool

Source§

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>

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>

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>

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>

Attempts to create an object, but will fail if the mode is approximate.
Source§

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

Source§

type Output = Result<FractionMatrixEnum, Error>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&FractionMatrixEnum> for &Vec<FractionEnum>

Source§

type Output = Result<Vec<FractionEnum>, Error>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &FractionMatrixEnum) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Vec<FractionEnum>> for &FractionMatrixEnum

Source§

type Output = Result<Vec<FractionEnum>, Error>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec<FractionEnum>) -> Self::Output

Performs the * operation. Read more
Source§

impl PartialEq for FractionMatrixEnum

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FractionMatrixEnum

Source§

impl TryFrom<Vec<Vec<FractionEnum>>> for FractionMatrixEnum

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<Vec<FractionEnum>>) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> ImaginaryInto<U> for T
where U: ImaginaryFrom<T>,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U