Struct MatrixF32

Source
pub struct MatrixF32 {
    pub content: Vec<Vec<f32>>,
    /* private fields */
}

Fields§

§content: Vec<Vec<f32>>

Implementations§

Source§

impl MatrixF32

Source

pub fn new(content: Vec<Vec<f32>>, tolerance: f32) -> Result<Self>

Source

pub fn tolerance(&self) -> f32

Trait Implementations§

Source§

impl CheckedAdd for MatrixF32

Source§

type Output = Result<MatrixF32, MathError>

Source§

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

Source§

impl CheckedMul for MatrixF32

Source§

type Output = Result<MatrixF32, MathError>

Source§

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

Source§

impl CheckedSub for MatrixF32

Source§

type Output = Result<MatrixF32, MathError>

Source§

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

Source§

impl Clone for MatrixF32

Source§

fn clone(&self) -> MatrixF32

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MatrixF32

Source§

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

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

impl Display for MatrixF32

Source§

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

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

impl FromStr for MatrixF32

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Performs the conversion from a string to the matrix, with default tolerance 1e-12

Source§

type Err = MathError

The associated error which can be returned from parsing.
Source§

impl Identity for MatrixF32

Source§

fn id(dimensions: usize, tolerance: f32) -> Self

Source§

impl Invertible for MatrixF32

Source§

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

Source§

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

Source§

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

Source§

impl Matrix for MatrixF32

Source§

type T = f32

Source§

fn columns(&self) -> usize

Will return the number of columns of the matrix
Source§

fn rows(&self) -> usize

Will return the number of rows of the matrix
Source§

fn is_square(&self) -> bool

Will return true if the matrix is squared, i.e., if rows == columns
Source§

fn is_symmetric(&self) -> bool

Will return true if the matrix is symmetric, i.e., if A == A^T
Source§

fn get(&self, row: usize, column: usize) -> Result<&Self::T>

Get a reference of an element of the matrix, or error if you provide wrong indexes
Source§

fn get_mut(&mut self, row: usize, column: usize) -> Result<&mut Self::T>

Get a mutable reference of an element of the matrix, or error if you provide wrong indexes
Source§

fn set(&mut self, row: usize, column: usize, value: Self::T) -> Result<()>

Set an element of the matrix, or error if you provide wrong indexes
Source§

fn swap_rows(&mut self, row1: usize, row2: usize) -> Result<()>

Swap two rows of the matrix, or error if you provide wrong indexes
Source§

fn transpose(&self) -> Self

Return a new matrix being the transposed of the current one. It does not eliminate the current one
Source§

fn gaussian_triangulation(&self) -> Result<Self>

Return a new matrix being the reduced gaussian inferior triangular of the current one. It does not eliminate the current one
Source§

fn lu_decomposition(&self) -> Result<(Self, Self)>

Returns a tuple containing the matrices L and U of the LU decomposition, in order. It does not eliminate the current one
Source§

fn determinant_using_gauss(&self) -> Option<Self::T>

Return the determinant or a None if the matrix is not squared
Source§

fn determinant_using_lu(&self) -> Option<Self::T>

Source§

fn cholesky_decomposition(&self) -> Result<Self>

Returns a matrix resulting from the Cholesky decomposition. It does not eliminate the current one
Source§

impl Parseable for MatrixF32

Source§

fn parse(input: &str, tolerance: f32) -> Result<Self>

Source§

impl PartialEq for MatrixF32

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serializable for MatrixF32

Source§

fn serialize(&self) -> String

Serialize the matrix, return it in the form {{a, b, c}, {d, e, f}, {g, h, i}}
Source§

impl TryFrom<&str> for MatrixF32

Source§

fn try_from(value: &str) -> Result<Self>

Performs the conversion from a string to the matrix, with default tolerance 1e-4

Source§

type Error = MathError

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

impl Zero for MatrixF32

Source§

fn zero(rows: usize, columns: usize, tolerance: f32) -> Self

Source§

fn is_zero(&self) -> bool

Source§

impl ArithmeticallyOperable<Result<MatrixF32, MathError>> for MatrixF32

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ArithmeticallyOperable<T> for T