|
|
◆ WDtrtrs()
| Function WDtrtrs |
( |
Uplo As |
String, |
|
|
N As |
Long, |
|
|
A As |
Variant, |
|
|
B As |
Variant, |
|
|
Optional Trans As |
String = "N", |
|
|
Optional Nrhs As |
Long = 1 |
|
) |
| |
Solution to system of linear equations AX = B or ATX = B for a triangular matrix
- Purpose
- WDtrtrs solves a triangular system of the form where A is a triangular matrix of order N and B is an N x Nrhs matrix. A check is made to verify that A is nonsingular.
- 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] | Uplo | = "U": A is upper triangular matrix.
= "L": A is lower triangular matrix. |
| [in] | N | Number of linear equations, i.e., order of the matrix A. (N >= 1) |
| [in] | A | (N x N) N x N coefficient matrix A. (If Uplo = 0, the lower triangular part will be used. If Uplo = 1, the upper triangular part will be used) |
| [in] | B | (N x Nrhs) N x Nrhs right hand side matrix B. |
| [in] | Trans | (Optional)
Specifies the form of the system of equations. (default = "N")
= "N": A * X = B. (no transpose)
= "T": A^T * X = B. (transpose) |
| [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 triangular matrix and
( -1.13 0 0 ) ( 0.0452 )
A = ( 0.26 -1.98 0 ), B = ( -0.4856 )
( -0.96 0.30 -2.32 ) ( 1.2472 )
|