NAG Library Routine Document
F07JBF (DPTSVX)
1 Purpose
F07JBF (DPTSVX) uses the factorization
to compute the solution to a real system of linear equations
where
is an
by
symmetric positive definite tridiagonal matrix and
and
are
by
matrices. Error bounds on the solution and a condition estimate are also provided.
2 Specification
SUBROUTINE F07JBF ( |
FACT, N, NRHS, D, E, DF, EF, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, INFO) |
INTEGER |
N, NRHS, LDB, LDX, INFO |
REAL (KIND=nag_wp) |
D(*), E(*), DF(*), EF(*), B(LDB,*), X(LDX,*), RCOND, FERR(NRHS), BERR(NRHS), WORK(2*N) |
CHARACTER(1) |
FACT |
|
The routine may be called by its
LAPACK
name dptsvx.
3 Description
F07JBF (DPTSVX) performs the following steps:
- If , the matrix is factorized as , where is a unit lower bidiagonal matrix and is diagonal. The factorization can also be regarded as having the form .
- If the leading by principal minor is not positive definite, then the routine returns with . Otherwise, the factored form of is used to estimate the condition number of the matrix . If the reciprocal of the condition number is less than machine precision, is returned as a warning, but the routine still goes on to solve for and compute error bounds as described below.
- The system of equations is solved for using the factored form of .
- 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
has been supplied.
- DF and EF contain the factorized form of the matrix . DF and EF will not be modified.
- The matrix will be copied to DF and EF and factorized.
Constraint:
or .
- 2: N – INTEGERInput
On entry: , the order of the matrix .
Constraint:
.
- 3: NRHS – INTEGERInput
On entry: , the number of right-hand sides, i.e., the number of columns of the matrix .
Constraint:
.
- 4: D() – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
D
must be at least
.
On entry: the diagonal elements of the tridiagonal matrix .
- 5: E() – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
E
must be at least
.
On entry: the subdiagonal elements of the tridiagonal matrix .
- 6: DF() – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the dimension of the array
DF
must be at least
.
On entry: if
,
DF must contain the
diagonal elements of the diagonal matrix
from the
factorization of
.
On exit: if
,
DF contains the
diagonal elements of the diagonal matrix
from the
factorization of
.
- 7: EF() – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the dimension of the array
EF
must be at least
.
On entry: if
,
EF must contain the
subdiagonal elements of the unit bidiagonal factor
from the
factorization of
.
On exit: if
,
EF contains the
subdiagonal elements of the unit bidiagonal factor
from the
factorization of
.
- 8: B(LDB,) – REAL (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
B
must be at least
.
On entry: the by right-hand side matrix .
- 9: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F07JBF (DPTSVX) is called.
Constraint:
.
- 10: X(LDX,) – REAL (KIND=nag_wp) arrayOutput
-
Note: the second dimension of the array
X
must be at least
.
On exit: if or , the by solution matrix .
- 11: LDX – INTEGERInput
On entry: the first dimension of the array
X as declared in the (sub)program from which F07JBF (DPTSVX) is called.
Constraint:
.
- 12: RCOND – REAL (KIND=nag_wp)Output
On exit: the reciprocal condition number of the matrix
. If
RCOND is less than the
machine precision (in particular, if
), the matrix is singular to working precision. This condition is indicated by a return code of
.
- 13: FERR(NRHS) – REAL (KIND=nag_wp) arrayOutput
On exit: the forward error bound for each solution vector (the th column of the solution matrix ). If is the true solution corresponding to , is an estimated upper bound for the magnitude of the largest element in () divided by the magnitude of the largest element in .
- 14: BERR(NRHS) – REAL (KIND=nag_wp) arrayOutput
On exit: the component-wise relative backward error of each solution vector (i.e., the smallest relative change in any element of or that makes an exact solution).
- 15: WORK() – REAL (KIND=nag_wp) arrayWorkspace
- 16: INFO – INTEGEROutput
On exit:
unless the routine detects an error (see
Section 6).
6 Error Indicators and Warnings
Errors or warnings detected by the routine:
If , the th argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
If and , the leading minor of order of is not positive definite, so the factorization could not be completed, and the solution has not been computed. is returned.
The diagonal matrix
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
, the computed solution
is the exact solution of a perturbed system of equations
, where
is a modest linear function of
, and
is the
machine precision. See Section 10.1 of
Higham (2002) for further details.
If
is the true solution, then the computed solution
satisfies a forward error bound of the form
where
.
If
is the
th column of
, then
is returned in
and a bound on
is returned in
. See Section 4.4 of
Anderson et al. (1999) for further details.
The number of floating point operations required for the factorization, and for the estimation of the condition number of is proportional to . 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 , where 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 complex analogue of this routine is
F07JPF (ZPTSVX).
9 Example
This example solves the equations
where
is the symmetric positive definite tridiagonal matrix
and
Error estimates for the solutions and an estimate of the reciprocal of the condition number of are also output.
9.1 Program Text
Program Text (f07jbfe.f90)
9.2 Program Data
Program Data (f07jbfe.d)
9.3 Program Results
Program Results (f07jbfe.r)