|
|
◆ WZgtsv2()
| Function WZgtsv2 |
( |
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 complex tridiagonal matrix (complex numbers in pairs of cells)
- Purpose
- WZgtsv2 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.
To represent complex numbers, a real part and an imaginary part are stored in a pair of adjacent cells (a real part in a left cell, and an imaginary part in a right cell). The computed results are stored in the same way.
- Returns
- N+1 x 2Nrhs
| Column 1 | Column 2 | . . . | Column 2Nrhs |
| Rows 1 to N | Solution matrix X (a real part and an imaginary part are stored in a pair of adjacent columns (a real part is left and an imaginary part is right)) |
| Row N+1 | Reciprocal condition number | Return code | . . . | 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 x 2) Sub-diagonal elements of coefficient matrix A. |
| [in] | D | (N x 2) Diagonal elements of coefficient matrix A. |
| [in] | Du | (N-1 x 2) Super-diagonal elements of coefficient matrix A. |
| [in] | B | (N x 2Nrhs) 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.57-0.91i 0.56+0.92i 0 )
A = ( -1.45-0.81i 1.74-0.93i -0.19-0.16i )
( 0 0.28+0.09i 0.10+0.15i )
( -1.0924+1.0032i )
B = ( 1.8436+1.5703i )
( 0.2057+0.2156i )
|