NAG Library Routine Document
F07JPF (ZPTSVX)
1 Purpose
F07JPF (ZPTSVX) uses the factorization
to compute the solution to a complex system of linear equations
where
A is an
n by
n Hermitian positive definite tridiagonal matrix and
X and
B are
n by
r matrices. Error bounds on the solution and a condition estimate are also provided.
2 Specification
SUBROUTINE F07JPF ( |
FACT, N, NRHS, D, E, DF, EF, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, RWORK, INFO) |
INTEGER |
N, NRHS, LDB, LDX, INFO |
REAL (KIND=nag_wp) |
D(*), DF(*), RCOND, FERR(NRHS), BERR(NRHS), RWORK(N) |
COMPLEX (KIND=nag_wp) |
E(*), EF(*), B(LDB,*), X(LDX,*), WORK(N) |
CHARACTER(1) |
FACT |
|
The routine may be called by its
LAPACK
name zptsvx.
3 Description
F07JPF (ZPTSVX) performs the following steps:
- If FACT='N', the matrix A is factorized as A=LDLH, where L is a unit lower bidiagonal matrix and D is diagonal. The factorization can also be regarded as having the form A=UHDU.
- If the leading i by 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 to calculate error bounds and backward error estimates for it.
4 References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996)
Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Higham N J (2002)
Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia
5 Parameters
- 1: FACT – CHARACTER(1)Input
On entry: specifies whether or not the factorized form of the matrix
A has been supplied.
- FACT='F'
- DF and EF contain the factorized form of the matrix A. DF and EF will not be modified.
- FACT='N'
- The matrix A will be copied to DF and EF and factorized.
Constraint:
FACT='F' or 'N'.
- 2: N – INTEGERInput
On entry: n, the order of the matrix A.
Constraint:
N≥0.
- 3: NRHS – INTEGERInput
On entry: r, the number of right-hand sides, i.e., the number of columns of the matrix B.
Constraint:
NRHS≥0.
- 4: D(*) – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
D
must be at least
max1,N.
On entry: the n diagonal elements of the tridiagonal matrix A.
- 5: E(*) – COMPLEX (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
E
must be at least
max1,N-1.
On entry: the n-1 subdiagonal elements of the tridiagonal matrix A.
- 6: DF(*) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the dimension of the array
DF
must be at least
max1,N.
On entry: if
FACT='F',
DF must contain the
n diagonal elements of the diagonal matrix
D from the
LDLH factorization of
A.
On exit: if
FACT='N',
DF contains the
n diagonal elements of the diagonal matrix
D from the
LDLH factorization of
A.
- 7: EF(*) – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the dimension of the array
EF
must be at least
max1,N-1.
On entry: if
FACT='F',
EF must contain the
n-1 subdiagonal elements of the unit bidiagonal factor
L from the
LDLH factorization of
A.
On exit: if
FACT='N',
EF contains the
n-1 subdiagonal elements of the unit bidiagonal factor
L from the
LDLH factorization of
A.
- 8: B(LDB,*) – COMPLEX (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
B
must be at least
max1,NRHS.
On entry: the n by r right-hand side matrix B.
- 9: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F07JPF (ZPTSVX) is called.
Constraint:
LDB≥max1,N.
- 10: X(LDX,*) – COMPLEX (KIND=nag_wp) arrayOutput
-
Note: the second dimension of the array
X
must be at least
max1,NRHS.
On exit: if INFO=0 or N+1, the n by r solution matrix X.
- 11: LDX – INTEGERInput
On entry: the first dimension of the array
X as declared in the (sub)program from which F07JPF (ZPTSVX) is called.
Constraint:
LDX≥max1,N.
- 12: RCOND – REAL (KIND=nag_wp)Output
On exit: the reciprocal condition number of the matrix
A. If
RCOND is less than the
machine precision (in particular, if
RCOND=0.0), the matrix is singular to working precision. This condition is indicated by a return code of
INFO=N+1.
- 13: FERR(NRHS) – REAL (KIND=nag_wp) arrayOutput
On exit: the forward error bound for each solution vector x^j (the jth column of the solution matrix X). If xj is the true solution corresponding to x^j, FERRj is an estimated upper bound for the magnitude of the largest element in (x^j-xj) divided by the magnitude of the largest element in x^j.
- 14: BERR(NRHS) – REAL (KIND=nag_wp) arrayOutput
On exit: the component-wise 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).
- 15: WORK(N) – COMPLEX (KIND=nag_wp) arrayWorkspace
- 16: RWORK(N) – REAL (KIND=nag_wp) arrayWorkspace
- 17: INFO – INTEGEROutput
On exit:
INFO=0 unless the routine detects an error (see
Section 6).
6 Error Indicators and Warnings
Errors or warnings detected by the routine:
- INFO<0
If INFO=-i, the ith argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
- INFO>0 and INFO≤N
If INFO=i and 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.0 is returned.
- INFO=N+1
The diagonal matrix
D 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.
7 Accuracy
For each right-hand side vector
b, the computed solution
x^ is the exact solution of a perturbed system of equations
A+Ex^=b, where
cn is a modest linear function of
n, and
ε is the
machine precision. See Section 10.1 of
Higham (2002) for further details.
If
x is the true solution, then the computed solution
x^ satisfies a forward error bound of the form
where
condA,x^,b
=
A-1
A
x^
+
b
∞/
x^∞
≤
condA
=
A-1
A
∞≤κ∞
A.
If
x^
is the
j
th column of
X
, then
wc
is returned in
BERRj
and a bound on
x
-
x^
∞
/
x^
∞
is returned in
FERRj
. See Section 4.4 of
Anderson et al. (1999) for further details.
8 Further Comments
The number of floating point operations required for the factorization, and for the estimation of the condition number of
A
is proportional to
n
. The number of floating point operations required for the solution of the equations, and for the estimation of the forward and backward error is proportional to
nr
, where
r
is the number of right-hand sides.
The condition estimation is based upon Equation (15.11) of
Higham (2002). For further details of the error estimation, see Section 4.4 of
Anderson et al. (1999).
The real analogue of this routine is
F07JBF (DPTSVX).
9 Example
This example solves the equations
where
A
is the Hermitian positive definite tridiagonal matrix
and
Error estimates for the solutions and an estimate of the reciprocal of the condition number of
A
are also output.
9.1 Program Text
Program Text (f07jpfe.f90)
9.2 Program Data
Program Data (f07jpfe.d)
9.3 Program Results
Program Results (f07jpfe.r)