|
|
◆ WDgesv()
| Function WDgesv |
( |
N As |
Long, |
|
|
A As |
Variant, |
|
|
B As |
Variant, |
|
|
Optional Nrhs As |
Long = 1 |
|
) |
| |
Solution to system of linear equations AX = B for a general matrix
- Purpose
- WDgesv computes the solution to a real system of linear equations where A is an N x N matrix 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 P is a permutation matrix, L is unit lower triangular, and U is upper triangular. 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] | A | (N x N) N x N 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
( 0.2 -0.11 -0.93 ) ( -0.3727 )
A = ( -0.32 0.81 0.37 ), B = ( 0.4319 )
( -0.8 -0.92 -0.29 ) ( -1.4247 )
|