Public Member Functions |
| BandLUDecomposition (MatReal_I &A, const Int mm1, const Int mm2) |
| The constructor which does the LU decomposition.
|
MatReal & | getL () |
| Gets the lower triangular matrix.
|
MatReal & | getU () |
| Gets the upper triangular matrix.
|
void | solve (VecReal_I &b, VecReal_O &x) |
| Given a right-hand side vector b[0..n-1] , solves the band-diagonal linear equation A * x = b .
|
Real | det () const |
| Returns the determinant of the matrix A.
|
Static Public Member Functions |
static void | sanityCheck () |
| Performs a sanity check test with sample data.
|
Static Private Member Functions |
static void | SWAP (Real &x, Real &y) |
Private Attributes |
Int | nn |
| The full matrix size.
|
Int | m1 |
| The size of subdiagonal.
|
Int | m2 |
| The size of superdiagonal.
|
MatReal | L |
| The lower triangular matrix (stored compactly).
|
MatReal | U |
| The upper triangular matrix (stored compactly).
|
VecInt | indx |
| The row permutation index effected by the partial pivoting.
|
Real | d |
| +/-1 whether the number of row interchanges was even or odd
|
BandLUDecomposition implements a method for solving linear equations A * x = b
for a band-diagonal matrix A
using LU decomposition.
A
is band-diagonal with m1
rows below the diagonal and m2
rows above. The input vector is x[0..n-1]
and the output vector is b[0..n-1]
.
The LU factorization refers to the factorization of A
, with proper row and/or column orderings or permutations, into two factors -- a lower triangular matrix L
and an upper triangular matrix U
such that A = L U
.
The array A[0..n-1][0..m1+m2]
stores A
as follows: The diagonal elements are in A[0..n-1][m1]
. Subdiagonal elements are in A[j ..n-1][0..m1-1]
with j > 0
appropriate to the number of elements on each subdiagonal. Superdiagonal elements are in A[0..j ][m1+1..m1+m2]
with j < n-1
appropriate to the number of elements on each superdiagonal.
The implementation is based on the routines bandet1
and bansol1
in Wilkinson, J.H., and Reinsch, C. 1971, Linear Algebra, vol. II of Handbook for Automatic Computation (New York: Springer), Chapter I/6. The C++ code is based on bandec.h
[9], Section 2.4.2 Band-Diagonal Systems (pp. 58--61).
Definition at line 33 of file bandSol.h.