Scythe-1.0.3
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, matrix_order PO3, matrix_style PS3, matrix_order PO4, matrix_style PS4>
Matrix<T,RO,RS> scythe::inv ( const Matrix< T, PO1, PS1 > &  A,
const Matrix< T, PO2, PS2 > &  L,
const Matrix< T, PO3, PS3 > &  U,
const Matrix< unsigned int, PO4, PS4 > &  perm_vec 
)

Calculates the inverse of a non-singular square matrix, given an LU decomposition.

This function returns the inverse of an arbitrary, non-singular, square matrix A when passed a permutation of an LU decomposition, such as that returned by lu_decomp(). A one-parameter version of this function exists that does not require the user to pre-decompose the system.

Parameters:
AThe Matrix to be inverted.
LA Lower triangular matrix resulting from decomposition.
UAn Upper triangular matrix resulting from decomposition.
perm_vecThe permutation vector recording the row-wise permutation of A actually decomposed by the algorithm.
See also:
inv (const Matrix<T, PO, PS>&)
invpd(const Matrix<T, PO, PS>&)
invpd(const Matrix<T, PO1, PS1>&, const Matrix<T, PO2, PS2>&)
lu_decomp(Matrix<T,PO1,PS1>, Matrix<T,PO2,Concrete>&, Matrix<T,PO3,Concrete>&, Matrix<unsigned int, PO4, Concrete>&)
Exceptions:
scythe_null_error(Level1)
scythe_dimension_error(Level 1)
scythe_conformation_error(Level 1)

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

Referenced by BFGS(), and scythe::rtmvnorm< RNGTYPE >::rtmvnorm().