Scythe-1.0.3
template<matrix_order PO1, matrix_style PS1, typename T , matrix_order PO2, matrix_order PO3, matrix_order PO4>
void scythe::lu_decomp ( Matrix< T, PO1, PS1 >  A,
Matrix< T, PO2, Concrete > &  L,
Matrix< T, PO3, Concrete > &  U,
Matrix< unsigned int, PO4, Concrete > &  perm_vec 
)

LU decomposition of a square matrix.

This function performs LU decomposition. That is, given a non-singular square matrix A and three matrix references, L, U, and perm_vec, lu_decomp fills the latter three matrices such that $LU = A$. This method does not actually calculate the LU decomposition of A, but of a row-wise permutation of A. This permutation is recorded in perm_vec.

Note:
Note that L, U, and perm_vec must be concrete. A is passed by value because the function modifies it during the decomposition. Users should generally avoid passing Matrix views as the first argument to this function because this results in modification to the Matrix being viewed.
Parameters:
ANon-singular square matrix to decompose.
LLower triangular portion of LU decomposition of A.
UUpper triangular portion of LU decomposition of A.
perm_vecPermutation vector recording the row-wise permutation of A actually decomposed by the algorithm.
See also:
cholesky (const Matrix<T, PO, PS>&)
lu_solve (const Matrix<T,PO1,PS1>&, const Matrix<T,PO2,PS2>&, const Matrix<T,PO3,PS3>&, const Matrix<T,PO4,PS4>&, const Matrix<unsigned int, PO5, PS5>&)
lu_solve (Matrix<T,PO1,PS1>, const Matrix<T,PO2,PS2>&)
Exceptions:
scythe_null_error(Level 1)
scythe_dimension_error(Level 1)
scythe_type_error(Level 2)

References scythe::Matrix_base< ORDER, STYLE >::isNull(), scythe::Matrix_base< ORDER, STYLE >::isSquare(), and SCYTHE_CHECK_10.