[][src]Struct opensrdk_linear_algebra::matrix::Matrix

pub struct Matrix<T = f64> where
    T: Number
{ /* fields omitted */ }

Implementations

impl Matrix<f64>[src]

pub fn diinv(self) -> Self[src]

Inverse

for diagonal matrix

impl Matrix<c64>[src]

pub fn diinv(self) -> Self[src]

Inverse

for diagonal matrix

impl Matrix<f64>[src]

pub fn dipowf(self, exp: f64) -> Self[src]

Pow integer

for diagonal matrix

impl Matrix<c64>[src]

pub fn dipowf(self, exp: f64) -> Self[src]

Pow integer

for diagonal matrix

impl Matrix<f64>[src]

pub fn dipowi(self, exp: i32) -> Self[src]

Pow integer

for diagonal matrix

impl Matrix<c64>[src]

pub fn dipowi(self, exp: i32) -> Self[src]

Pow integer

for diagonal matrix

impl Matrix[src]

pub fn geinv(self) -> Result<Matrix, String>[src]

Inverse

for square matrix

impl Matrix<c64>[src]

pub fn geinv(self) -> Result<Matrix<c64>, String>[src]

Inverse

for square matrix

impl Matrix[src]

pub fn gemm(
    self,
    lhs: &Matrix,
    rhs: &Matrix,
    alpha: f64,
    beta: f64
) -> Result<Matrix, String>
[src]

impl Matrix<c64>[src]

pub fn gemm(
    self,
    lhs: &Matrix<c64>,
    rhs: &Matrix<c64>,
    alpha: c64,
    beta: c64
) -> Result<Matrix<c64>, String>
[src]

impl Matrix[src]

pub fn gesvd(&self) -> Result<(Matrix, Matrix, Matrix), String>[src]

Singular Value Decomposition

https://en.wikipedia.org/wiki/Singular_value_decomposition

M = U * Sigma * V^T (u, sigma, vt)

impl Matrix[src]

impl Matrix<c64>[src]

impl Matrix[src]

pub fn getri(self, ipiv: &[i32]) -> Result<Matrix, String>[src]

Inverse

with matrix decomposed by getrf

impl Matrix<c64>[src]

pub fn getri(self, ipiv: &[i32]) -> Result<Matrix<c64>, String>[src]

Inverse

with matrix decomposed by getrf

impl Matrix[src]

pub fn getrs(&self, ipiv: &[i32], b_t: Matrix) -> Result<Matrix, String>[src]

Solve equation

with matrix decomposed by getrf Ax = b

impl Matrix<c64>[src]

pub fn getrs(
    &self,
    ipiv: &[i32],
    b_t: Matrix<c64>
) -> Result<Matrix<c64>, String>
[src]

Solve equation

with matrix decomposed by getrf Ax = b

impl Matrix<c64>[src]

pub fn adjoint(&self) -> Matrix<c64>[src]

impl Matrix[src]

pub fn diag<T>(vec: &[T]) -> Matrix<T> where
    T: Number
[src]

impl<T> Matrix<T> where
    T: Number
[src]

pub fn identity(n: usize) -> Self[src]

impl<T> Matrix<T> where
    T: Number
[src]

pub fn linear_prod(&self, rhs: &Matrix<T>) -> T[src]

pub fn hadamard_prod(self, rhs: &Matrix<T>) -> Matrix<T>[src]

impl<T> Matrix<T> where
    T: Number
[src]

pub fn t(&self) -> Matrix<T>[src]

impl<T> Matrix<T> where
    T: Number
[src]

pub fn tr(&self) -> T[src]

impl Matrix[src]

pub fn poinv(self) -> Result<Matrix, String>[src]

Inverse

for positive definite matrix

impl Matrix[src]

pub fn posv_cgm(
    vec_mul: impl Fn(&[f64]) -> Result<Vec<f64>, String>,
    b: Vec<f64>,
    iterations: usize
) -> Result<Vec<f64>, String>
[src]

impl Matrix[src]

pub fn potrf(self) -> Result<Matrix, String>[src]

Cholesky decomposition

for positive definite f64 matrix

https://en.wikipedia.org/wiki/Cholesky_decomposition

A = L * L^T

impl Matrix<c64>[src]

pub fn potrf(self) -> Result<Matrix<c64>, String>[src]

Cholesky decomposition

for positive definite c64 matrix

https://en.wikipedia.org/wiki/Cholesky_decomposition

A = L * L^*

impl Matrix[src]

pub fn potri(self) -> Result<Matrix, String>[src]

Inverse

with matrix decomposed by potrf

impl Matrix<c64>[src]

pub fn potri(self) -> Result<Matrix<c64>, String>[src]

Inverse

with matrix decomposed by potrf

impl Matrix[src]

pub fn potrs(&self, b_t: Matrix) -> Result<Matrix, String>[src]

Solve equation

with matrix decomposed by potrf Ax = b

impl Matrix<c64>[src]

pub fn potrs(&self, b_t: Matrix<c64>) -> Result<Matrix<c64>, String>[src]

Solve equation

with matrix decomposed by potrf Ax = b

impl Matrix[src]

pub fn sytrd(self) -> Result<(Matrix, SymmetricTridiagonalMatrix), String>[src]

Tridiagonalize

for symmetric matrix

pub fn sytrd_k(
    n: usize,
    k: usize,
    vec_mul: impl Fn(&[f64]) -> Result<Vec<f64>, String>,
    probe: Option<Vec<f64>>
) -> Result<(SymmetricTridiagonalMatrix, Matrix), String>
[src]

Lanczos algorithm

for symmetric matrix only k iteration

impl<T> Matrix<T> where
    T: Number
[src]

pub fn trdet(&self) -> T[src]

Determinant

for triangle matrix To apply this method to none triangle matrix, use LU decomposition or Cholesky decomposition.

impl<T> Matrix<T> where
    T: Number
[src]

pub fn new(rows: usize, cols: usize) -> Self[src]

pub fn from(rows: usize, elems: Vec<T>) -> Self[src]

pub fn row(v: Vec<T>) -> Self[src]

pub fn col(v: Vec<T>) -> Self[src]

pub fn same_size(&self, rhs: &Matrix<T>) -> bool[src]

pub fn rows(&self) -> usize[src]

pub fn cols(&self) -> usize[src]

pub fn elems(self) -> Vec<T>[src]

pub fn elems_ref(&self) -> &[T][src]

impl Matrix<f64>[src]

pub fn to_complex(&self) -> Matrix<c64>[src]

impl Matrix<c64>[src]

pub fn to_real(&self) -> Matrix<f64>[src]

Trait Implementations

impl<T: Number, '_> Add<&'_ Matrix<T>> for Matrix<T>[src]

type Output = Matrix<T>

The resulting type after applying the + operator.

impl<T: Number> Add<Matrix<T>> for Matrix<T>[src]

type Output = Matrix<T>

The resulting type after applying the + operator.

impl<T: Number, '_> Add<Matrix<T>> for &'_ Matrix<T>[src]

type Output = Matrix<T>

The resulting type after applying the + operator.

impl<T: Clone> Clone for Matrix<T> where
    T: Number
[src]

impl<T: Debug> Debug for Matrix<T> where
    T: Number
[src]

impl<T: Default> Default for Matrix<T> where
    T: Number
[src]

impl<T: Hash> Hash for Matrix<T> where
    T: Number
[src]

impl<T> Index<usize> for Matrix<T> where
    T: Number
[src]

type Output = [T]

The returned type after indexing.

impl<T> IndexMut<usize> for Matrix<T> where
    T: Number
[src]

impl<'_> Mul<&'_ Matrix<Complex<f64>>> for Matrix<c64>[src]

type Output = Matrix<c64>

The resulting type after applying the * operator.

impl<'_, '_> Mul<&'_ Matrix<Complex<f64>>> for &'_ Matrix<c64>[src]

type Output = Matrix<c64>

The resulting type after applying the * operator.

impl<'_> Mul<&'_ Matrix<f64>> for Matrix<f64>[src]

type Output = Matrix<f64>

The resulting type after applying the * operator.

impl<'_, '_> Mul<&'_ Matrix<f64>> for &'_ Matrix<f64>[src]

type Output = Matrix<f64>

The resulting type after applying the * operator.

impl Mul<Complex<f64>> for Matrix<c64>[src]

type Output = Matrix<c64>

The resulting type after applying the * operator.

impl Mul<Matrix<Complex<f64>>> for c64[src]

type Output = Matrix<c64>

The resulting type after applying the * operator.

impl Mul<Matrix<Complex<f64>>> for Matrix<c64>[src]

type Output = Matrix<c64>

The resulting type after applying the * operator.

impl<'_> Mul<Matrix<Complex<f64>>> for &'_ Matrix<c64>[src]

type Output = Matrix<c64>

The resulting type after applying the * operator.

impl Mul<Matrix<f64>> for f64[src]

type Output = Matrix<f64>

The resulting type after applying the * operator.

impl Mul<Matrix<f64>> for Matrix<f64>[src]

type Output = Matrix<f64>

The resulting type after applying the * operator.

impl<'_> Mul<Matrix<f64>> for &'_ Matrix<f64>[src]

type Output = Matrix<f64>

The resulting type after applying the * operator.

impl Mul<f64> for Matrix<f64>[src]

type Output = Matrix<f64>

The resulting type after applying the * operator.

impl<T: Number, '_> Sub<&'_ Matrix<T>> for Matrix<T>[src]

type Output = Matrix<T>

The resulting type after applying the - operator.

impl<T: Number> Sub<Matrix<T>> for Matrix<T>[src]

type Output = Matrix<T>

The resulting type after applying the - operator.

impl<T: Number, '_> Sub<Matrix<T>> for &'_ Matrix<T>[src]

type Output = Matrix<T>

The resulting type after applying the - operator.

impl<T> SubMatrix<T> for Matrix<T> where
    T: Number
[src]

impl<T, '_> SubMatrix<T> for &'_ Matrix<T> where
    T: Number
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Matrix<T> where
    T: RefUnwindSafe

impl<T> Send for Matrix<T>

impl<T> Sync for Matrix<T>

impl<T> Unpin for Matrix<T> where
    T: Unpin

impl<T> UnwindSafe for Matrix<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.