|
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 for x via forward and backward substitution, given the results of a LU decomposition.
This function solves the system of equations 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:
-
A | Non-singular square Matrix to decompose, passed by reference. |
b | Column vector with as many rows as A. |
L | Lower triangular portion of LU decomposition of A. |
U | Upper triangular portion of LU decomposition of A. |
perm_vec | Permutation 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:
-
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().
|