|
|
◆ WDgbsv()
| Function WDgbsv |
( |
N As |
Long, |
|
|
Kl As |
Long, |
|
|
Ku As |
Long, |
|
|
Ab As |
Variant, |
|
|
B As |
Variant, |
|
|
Optional Nrhs As |
Long = 1 |
|
) |
| |
Solution to system of linear equations AX = B for a general band matrix
- Purpose
- WDgbsv computes the solution to a real system of linear equations where A is a band matrix of order N with Kl sub-diagonals and Ku super-diagonals, and X and B are N x Nrhs matrices.
The LU decomposition with partial pivoting and row interchanges is used to factor A as where L is a product of permutation and unit lower triangular matrices with Kl sub-diagonals, and U is upper triangular with Kl+Ku super-diagonals. The factored form of A is then used to solve the system of equations A * X = B.
- Returns
- N+2 x Nrhs
| Column 1 | Column 2 | . . . | Column Nrhs |
| Rows 1 to N | Solution matrix X |
| Row N+1 | Reciprocal condition number | 0 | . . . | 0 |
| Row N+2 | Return code | 0 | . . . | 0 |
Return code.
= 0: Successful exit.
= i > 0: The i-th diagonal element of the factor is zero. (Matrix A is singular)
- Parameters
-
| [in] | N | Number of linear equations, i.e., order of the matrix A. (N >= 1) |
| [in] | Kl | The number of subdiagonals within the band of A. (Kl >= 0) |
| [in] | Ku | The number of superdiagonals within the band of A. (Ku >= 0) |
| [in] | Ab | (Kl+1+Ku x N) N x N coefficient matrix A. (Band matrix form. See below for details) |
| [in] | B | (N x Nrhs) N x Nrhs right hand side matrix B. |
| [in] | Nrhs | (Optional)
Number of columns of right hand side matrix B. (Nrhs >= 1) (default = 1) |
- Further Details
- The band matrix form is illustrated by the following example, when N = 6, Kl = 2, Ku = 1:
* a12 a23 a34 a45 a56
a11 a22 a33 a44 a55 a66
a21 a32 a43 a54 a65 *
a31 a42 a53 a64 * *
Cells marked with * are not used by the routine.
- Reference
- LAPACK
- Example
- Solve the system of linear equations Ax = B and estimate the reciprocal of the condition number (RCond) of A, where
( 2.34 0.57 0 ) ( 0.7416 )
A = ( 0.65 1.98 -1.39 ), B = ( 0.7885 )
( 0 1.50 1.73 ) ( 1.0833 )
|