philsupertramp/game-math
Loading...
Searching...
No Matches
Functions
LU.h File Reference
#include "../../Matrix.h"
#include <cmath>
#include <vector>

Go to the source code of this file.

Functions

std::pair< Matrix< double >, std::vector< unsigned int > > LU (const Matrix< double > &A)
 

Detailed Description

implements LU decomposition, places L and U in resulting matrix

$$ A = L \cdot U $$ $$ L = \begin{pmatrix} 1& 0& 0& ... \\ l_{2,1}& 1& 0& ... \\ l_{3,1}& l_{3,2}& 1, ... \\ ... \\ l_{m,1}& ... \end{pmatrix} $$ $$ U = \begin{pmatrix} 0& u_{1,2}& u_{1,3}& ...& u_{1,n}\\ 0& 0& u_{2,3}& ...& u_{2,n}\\ 0& ...& 0& u_{m-1, n}\\ 0& ...& 0 \end{pmatrix} $$ Result: $$L + U$$ LU decomposition

Requires:

Function Documentation

◆ LU()

std::pair< Matrix< double >, std::vector< unsigned int > > LU ( const Matrix< double > &  A)

LU-decomposition of A

Parameters
Amatrix to decompose
Returns
in-place decomposed matrix L+U
Examples
numerics/lin_alg/TestLU.cpp.