Skip to main content

LU

Trait LU 

Source
pub trait LU<T, D0: Dim, D1: Dim> {
    // Required methods
    fn lu_write<L: Layout, Ll: Layout, Lu: Layout, Lp: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
        l: &mut Slice<T, (D0, D0), Ll>,
        u: &mut Slice<T, (D0, D1), Lu>,
        p: &mut Slice<T, (D0, D0), Lp>,
    );
    fn lu<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> (Array<T, (D0, D0)>, Array<T, (D0, D1)>, Array<T, (D0, D0)>);
    fn inv_write<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<(), InvError>;
    fn inv<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<Array<T, (D0, D1)>, InvError>;
    fn det<L: Layout>(&self, a: &mut Slice<T, (D0, D1), L>) -> T;
    fn cholesky<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<Array<T, (D0, D1)>, InvError>;
    fn cholesky_write<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<(), InvError>;
}
Expand description

LU decomposition and matrix inversion

Required Methods§

Source

fn lu_write<L: Layout, Ll: Layout, Lu: Layout, Lp: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, l: &mut Slice<T, (D0, D0), Ll>, u: &mut Slice<T, (D0, D1), Lu>, p: &mut Slice<T, (D0, D0), Lp>, )

Computes LU decomposition overwriting existing matrices

Source

fn lu<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> (Array<T, (D0, D0)>, Array<T, (D0, D1)>, Array<T, (D0, D0)>)

Computes LU decomposition with new allocated matrices: L, U, P (permutation matrix)

Source

fn inv_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<(), InvError>

Computes inverse overwriting the input matrix

Source

fn inv<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<Array<T, (D0, D1)>, InvError>

Computes inverse with new allocated matrix

Source

fn det<L: Layout>(&self, a: &mut Slice<T, (D0, D1), L>) -> T

Computes the determinant of a square matrix. Panics if the matrix is non-square.

Source

fn cholesky<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<Array<T, (D0, D1)>, InvError>

Computes the Cholesky decomposition, returning a lower-triangular matrix

Source

fn cholesky_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<(), InvError>

Computes the Cholesky decomposition in-place, overwriting the input matrix

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§