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_order PO5, matrix_style PS5>
Matrix<T, RO, RS> scythe::lu_solve ( const Matrix< T, PO1, PS1 > &  A,
const Matrix< T, PO2, PS2 > &  b,
const Matrix< T, PO3, PS3 > &  L,
const Matrix< T, PO4, PS4 > &  U,
const Matrix< unsigned int, PO5, PS5 > &  perm_vec 
)

Solve $Ax=b$ for x via forward and backward substitution, given the results of a LU decomposition.

This function solves the system of equations $Ax = b$ via forward and backward substitution and LU decomposition. A must be a non-singular square matrix for this method to work. This function requires the actual LU decomposition to be performed ahead of time; by lu_decomp() for example.

This function is intended for repeatedly solving systems of equations based on A. That is A stays constant while b varies.

Parameters:
ANon-singular square Matrix to decompose, passed by reference.
bColumn vector with as many rows as A.
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:
lu_solve (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>&)
chol_solve(const Matrix<T,PO1,PS1> &, const Matrix<T,PO2,PS2> &)
chol_solve(const Matrix<T,PO1,PS1> &, const Matrix<T,PO2,PS2> &, const Matrix<T,PO3,PS3> &)
Exceptions:
scythe_null_error(Level 1)
scythe_dimension_error(Level 1)
scythe_conformation_error(Level 1)

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

Referenced by nls_broyden().