|
|
◆ zptsvx()
| void zptsvx |
( |
char |
fact, |
|
|
int |
n, |
|
|
int |
nrhs, |
|
|
double |
d[], |
|
|
doublecomplex |
e[], |
|
|
double |
df[], |
|
|
doublecomplex |
ef[], |
|
|
int |
ldb, |
|
|
doublecomplex |
b[], |
|
|
int |
ldx, |
|
|
doublecomplex |
x[], |
|
|
double * |
rcond, |
|
|
double |
ferr[], |
|
|
double |
berr[], |
|
|
doublecomplex |
work[], |
|
|
double |
rwork[], |
|
|
int * |
info |
|
) |
| |
(Expert driver) Solution to system of linear equations AX = B for a Hermitian positive definite tridiagonal matrix
- Purpose
- This routine uses the factorization A = L*D*L^H to compute the solution to a complex system of linear equations where A is an n x n Hermitian positive definite tridiagonal matrix, and X and B are n x nrhs matrices.
Error bounds on the solution and a condition estimate are also provided.
- Description
- The following steps are performed:
- If fact = 'N', the matrix A is factored as A = L*D*L^H, where L is a unit lower bidiagonal matrix and D is diagonal. The factorization can also be regarded as having the form A = U^H*D*U.
- If the leading i x i principal minor is not positive definite, then the routine returns with info = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info = n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.
- The system of equations is solved for X using the factored form of A.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
- Parameters
-
| [in] | fact | Specifies whether or not the factored form of the matrix A is supplied on entry.
= 'F': df[] and ef[] contain the factored form of A. df[] and ef[] will not be modified.
= 'N': The matrix A will be copied to df[] and ef[] and factored. |
| [in] | n | Order of the matrix A. (n >= 0) (If n = 0, returns without computation) |
| [in] | nrhs | Number of right hand sides, i.e., number of columns of the matrix B. (nrhs >= 0) (If nrhs = 0, returns without computation) |
| [in] | d[] | Array d[ld] (ld >= n)
n diagonal elements of the Hermitian positive definite tridiagonal matrix A. |
| [in] | e[] | Array e[le] (le >= n - 1)
n-1 sub-diagonal elements of the Hermitian positive definite tridiagonal matrix A. |
| [in,out] | df[] | Array df[ldf] (ldf >= n)
[in] If fact = 'F', n diagonal elements of the diagonal matrix D from the L*D*L^H factorization of A, are to be stored.
[out] If fact = 'N', n diagonal elements of the diagonal matrix D from the L*D*L^H factorization of A, are returned. |
| [in,out] | ef[] | Array ef[lef] (lef >= n - 1)
[in] If fact = 'F', n-1 sub-diagonal elements of the unit bidiagonal factor L from the L*D*L^H factorization of A, are to be stored.
[out] If fact = 'N', n-1 sub-diagonal elements of the unit bidiagonal factor L from the L*D*L^H factorization of A, are returned. |
| [in] | ldb | Leading dimension of the two dimensional array b[][]. (ldb >= max(1, n)) |
| [in] | b[][] | Array b[lb][ldb] (lb >= nrhs)
n x nrhs right hand side matrix B. |
| [in] | ldx | Leading dimension of the two dimensional array x[][]. (ldx >= max(1, n)) |
| [out] | x[][] | Array x[lx][ldx] (lx >= nrhs)
If info = 0 or info = n+1, n x nrhs solution matrix X. |
| [out] | rcond | The reciprocal condition number of the matrix A. If rcond is less than the machine precision (in particular, if rcond=0), the matrix is singular to working precision. This condition is indicated by a return code of info > 0. |
| [out] | ferr[] | Array ferr[lferr] (lferr >= nrhs)
The forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If Xtrue is the true solution corresponding to X(j), ferr[j-1] is an estimated upper bound for the magnitude of the largest element in (X(j) - Xtrue) divided by the magnitude of the largest element in X(j). |
| [out] | berr[] | Array berr[lberr] (lberr >= nrhs)
The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution) |
| [out] | work[] | Array work[lwork] (lwork >= n)
Work array. |
| [out] | rwork[] | Array rwork[lrwork] (lrwork >= n)
Work array. |
| [out] | info | = 0: Successful exit
= -1: The argument fact had an illegal value (fact != 'F' nor 'N')
= -2: The argument n had an illegal value (n < 0)
= -3: The argument nrhs had an illegal value (nrhs < 0)
= -8: The argument ldb had an illegal value (ldb < max(1, n))
= -10: The argument ldx had an illegal value (ldx < max(1, n))
= i (0 < i <= n): The leading minor of order i of A is not positive definite, so the factorization could not be completed, and the solution has not been computed. rcond = 0 is returned.
= n+1: U is nonsingular, but rcond is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of rcond would suggest. |
- Reference
- LAPACK
|