|
|
◆ WDgtsv()
| Function WDgtsv |
( |
N As |
Long, |
|
|
Dl As |
Variant, |
|
|
D As |
Variant, |
|
|
Du As |
Variant, |
|
|
B As |
Variant, |
|
|
Optional Nrhs As |
Long = 1 |
|
) |
| |
Solution to system of linear equations AX = B for a general tridiagonal matrix
- Purpose
- WDgtsv solves the equation where A is an N x N tridiagonal matrix, by Gaussian elimination with partial pivoting.
Note that the equation A^T*X = B may be solved by interchanging the order of the arguments Du and Dl.
- 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] | Dl | (N-1) Sub-diagonal elements of coefficient matrix A. |
| [in] | D | (N) Diagonal elements of coefficient matrix A. |
| [in] | Du | (N-1) Super-diagonal elements of coefficient matrix A. |
| [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) |
- Reference
- LAPACK
- Example
- Solve the system of linear equations Ax = B and estimate the reciprocal of the condition number (RCond) of A, where A is a tridiagonal matrix and
( -0.58 1.14 0 ) ( -0.5960 )
A = ( -1.56 2.21 0.16 ), B = ( -0.6798 )
( 0 0.24 0.25 ) ( -0.0406 )
|