NAG FL Interface
f07cgf (dgtcon)

1 Purpose

f07cgf estimates the reciprocal condition number of a real n by n tridiagonal matrix A , using the LU factorization returned by f07cdf.

2 Specification

Fortran Interface
Subroutine f07cgf ( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, iwork, info)
Integer, Intent (In) :: n, ipiv(*)
Integer, Intent (Out) :: iwork(n), info
Real (Kind=nag_wp), Intent (In) :: dl(*), d(*), du(*), du2(*), anorm
Real (Kind=nag_wp), Intent (Out) :: rcond, work(2*n)
Character (1), Intent (In) :: norm
C Header Interface
#include <nag.h>
void  f07cgf_ (const char *norm, const Integer *n, const double dl[], const double d[], const double du[], const double du2[], const Integer ipiv[], const double *anorm, double *rcond, double work[], Integer iwork[], Integer *info, const Charlen length_norm)
The routine may be called by the names f07cgf, nagf_lapacklin_dgtcon or its LAPACK name dgtcon.

3 Description

f07cgf should be preceded by a call to f07cdf, which uses Gaussian elimination with partial pivoting and row interchanges to factorize the matrix A as
A=PLU ,  
where P is a permutation matrix, L is unit lower triangular with at most one nonzero subdiagonal element in each column, and U is an upper triangular band matrix, with two superdiagonals. f07cgf then utilizes the factorization to estimate either A-11 or A-1 , from which the estimate of the reciprocal of the condition number of A , 1/κA is computed as either
1 / κ1 A = 1 / A1 A-11  
or
1 / κ A = 1 / A A-1 .  
1/κA is returned, rather than κA , since when A is singular κA is infinite.
Note that κA=κ1AT .

4 References

Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia

5 Arguments

1: norm Character(1) Input
On entry: specifies the norm to be used to estimate κA.
norm='1' or 'O'
Estimate κ1A.
norm='I'
Estimate κA.
Constraint: norm='1', 'O' or 'I'.
2: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n0.
3: dl* Real (Kind=nag_wp) array Input
Note: the dimension of the array dl must be at least max1,n-1.
On entry: must contain the n-1 multipliers that define the matrix L of the LU factorization of A.
4: d* Real (Kind=nag_wp) array Input
Note: the dimension of the array d must be at least max1,n.
On entry: must contain the n diagonal elements of the upper triangular matrix U from the LU factorization of A.
5: du* Real (Kind=nag_wp) array Input
Note: the dimension of the array du must be at least max1,n-1.
On entry: must contain the n-1 elements of the first superdiagonal of U.
6: du2* Real (Kind=nag_wp) array Input
Note: the dimension of the array du2 must be at least max1,n-2.
On entry: must contain the n-2 elements of the second superdiagonal of U.
7: ipiv* Integer array Input
Note: the dimension of the array ipiv must be at least max1,n.
On entry: must contain the n pivot indices that define the permutation matrix P. At the ith step, row i of the matrix was interchanged with row ipivi, and ipivi must always be either i or i+1, ipivi=i indicating that a row interchange was not performed.
8: anorm Real (Kind=nag_wp) Input
On entry: if norm='1' or 'O', the 1-norm of the original matrix A.
If norm='I', the -norm of the original matrix A.
anorm may be computed by calling f06rnf with the same value for the argument norm.
anorm must be computed either before calling f07cdf or else from a copy of the original matrix A (see Section 10).
Constraint: anorm0.0.
9: rcond Real (Kind=nag_wp) Output
On exit: contains an estimate of the reciprocal condition number.
10: work2×n Real (Kind=nag_wp) array Workspace
11: iworkn Integer array Workspace
12: info Integer Output
On exit: info=0 unless the routine detects an error (see Section 6).

6 Error Indicators and Warnings

info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

7 Accuracy

In practice the condition number estimator is very reliable, but it can underestimate the true condition number; see Section 15.3 of Higham (2002) for further details.

8 Parallelism and Performance

f07cgf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

The condition number estimation typically requires between four and five solves and never more than eleven solves, following the factorization. The total number of floating-point operations required to perform a solve is proportional to n .
The complex analogue of this routine is f07cuf.

10 Example

This example estimates the condition number in the 1-norm of the tridiagonal matrix A given by
A = 3.0 2.1 0.0 0.0 0.0 3.4 2.3 -1.0 0.0 0.0 0.0 3.6 -5.0 1.9 0.0 0.0 0.0 7.0 -0.9 8.0 0.0 0.0 0.0 -6.0 7.1 .  

10.1 Program Text

Program Text (f07cgfe.f90)

10.2 Program Data

Program Data (f07cgfe.d)

10.3 Program Results

Program Results (f07cgfe.r)