|
|
◆ WZgtsv()
| Function WZgtsv |
( |
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 number representation in Excel format)
- Purpose
- WZgtsv 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 in Excel cells, complex number format in Excel (e.g. 2.5+1i) is used. Worksheet function Complex can be used to input complex numbers into cells.
- 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.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 )
|