Struct numerical_linear_algebra::Matrix

source ·
pub struct Matrix<const M: usize, const N: usize> { /* private fields */ }

Implementations§

source§

impl<const M: usize, const N: usize> Matrix<M, N>

source

pub const ZEROS: Self = _

source

pub const fn new(data: [[Complex64; N]; M]) -> Self

source

pub fn from_column_vectors(columns: [Vector<M>; N]) -> Self

source

pub fn to_column_vectors(self) -> [Vector<M>; N]

source

pub fn iter(&self) -> impl Iterator<Item = &Complex64>

source

pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Complex64>

source

pub fn epsilon(&self) -> f64

source

pub fn swap_row(&mut self, i: usize, j: usize)

source

pub fn multiply_row_by_scalar(&mut self, i: usize, scalar: Complex64)

source

pub fn add_row_with_scalar(&mut self, i: usize, j: usize, scalar: Complex64)

source

pub fn transpose(&self) -> Matrix<N, M>

source

pub fn gaussian_elimination(self) -> (Matrix<M, N>, Matrix<M, M>, usize)

source

pub fn rank(&self) -> usize

source§

impl<const M: usize> Matrix<M, M>

source

pub fn diagonal(data: [Complex64; M]) -> Self

source

pub fn identity() -> Self

source

pub fn determinant(&self) -> Complex64

source

pub fn gauss_jordan_elimination(self) -> (Matrix<M, M>, Matrix<M, M>)

source

pub fn inverse(self) -> Option<Matrix<M, M>>

source

pub fn qr_decomposition(self) -> (Matrix<M, M>, Matrix<M, M>)

source

pub fn schur_form(self, iterations: usize) -> Matrix<M, M>

source

pub fn eigenvalues(&self, iterations: usize) -> [Complex64; M]

source

pub fn eigenvectors(&self, iterations: usize) -> [Vector<M>; M]

source§

impl<const N: usize> Matrix<N, 1>

source

pub fn dot(&self, rhs: &Vector<N>) -> Complex64

source

pub fn norm(&self, p: u32) -> f64

source

pub fn normalize(self) -> Self

source

pub fn project(self, rhs: Self) -> Self

source

pub fn gram_schimidt_process<const M: usize>( vectors: [Vector<N>; M], ) -> [Vector<N>; M]

Trait Implementations§

source§

impl<const M: usize, const N: usize> Add for Matrix<M, N>

source§

type Output = Matrix<M, N>

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl<const M: usize, const N: usize> AddAssign for Matrix<M, N>

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl<const M: usize, const N: usize> Clone for Matrix<M, N>

source§

fn clone(&self) -> Matrix<M, N>

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<const M: usize, const N: usize> Debug for Matrix<M, N>

source§

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

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

impl<const M: usize, const N: usize> Display for Matrix<M, N>

source§

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

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

impl<const M: usize, const N: usize> Index<[usize; 2]> for Matrix<M, N>

source§

type Output = Complex<f64>

The returned type after indexing.
source§

fn index(&self, [i, j]: [usize; 2]) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<const M: usize, const N: usize> IndexMut<[usize; 2]> for Matrix<M, N>

source§

fn index_mut(&mut self, index: [usize; 2]) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<const M: usize, const N: usize> Mul<Complex<f64>> for Matrix<M, N>

source§

type Output = Matrix<M, N>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<const M: usize, const N: usize> Mul<Matrix<M, N>> for Complex64

source§

type Output = Matrix<M, N>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Matrix<M, N>) -> Self::Output

Performs the * operation. Read more
source§

impl<const M: usize, const N: usize, const P: usize> Mul<Matrix<N, P>> for Matrix<M, N>

source§

type Output = Matrix<M, P>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Matrix<N, P>) -> Self::Output

Performs the * operation. Read more
source§

impl<const M: usize, const N: usize> MulAssign<Complex<f64>> for Matrix<M, N>

source§

fn mul_assign(&mut self, rhs: Complex64)

Performs the *= operation. Read more
source§

impl<const M: usize, const N: usize> PartialEq for Matrix<M, N>

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<const M: usize, const N: usize> Sub for Matrix<M, N>

source§

type Output = Matrix<M, N>

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl<const M: usize, const N: usize> SubAssign for Matrix<M, N>

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl<const M: usize, const N: usize> Sum for Matrix<M, N>

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.

Auto Trait Implementations§

§

impl<const M: usize, const N: usize> Freeze for Matrix<M, N>

§

impl<const M: usize, const N: usize> RefUnwindSafe for Matrix<M, N>

§

impl<const M: usize, const N: usize> Send for Matrix<M, N>

§

impl<const M: usize, const N: usize> Sync for Matrix<M, N>

§

impl<const M: usize, const N: usize> Unpin for Matrix<M, N>

§

impl<const M: usize, const N: usize> UnwindSafe for Matrix<M, N>

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, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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§

default 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.