Estimates the reciprocal of the condition number of a tridiagonal matrix using the factorization computed by ?gttrf.
FORTRAN 77:
call sgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, iwork, info )
call dgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, iwork, info )
call cgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, info )
call zgtcon( norm, n, dl, d, du, du2, ipiv, anorm, rcond, work, info )
FORTRAN 95:
call gtcon( dl, d, du, du2, ipiv, anorm, rcond [,norm] [,info] )
C:
lapack_int LAPACKE_sgtcon( char norm, lapack_int n, const float* dl, const float* d, const float* du, const float* du2, const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_dgtcon( char norm, lapack_int n, const double* dl, const double* d, const double* du, const double* du2, const lapack_int* ipiv, double anorm, double* rcond );
lapack_int LAPACKE_cgtcon( char norm, lapack_int n, const lapack_complex_float* dl, const lapack_complex_float* d, const lapack_complex_float* du, const lapack_complex_float* du2, const lapack_int* ipiv, float anorm, float* rcond );
lapack_int LAPACKE_zgtcon( char norm, lapack_int n, const lapack_complex_double* dl, const lapack_complex_double* d, const lapack_complex_double* du, const lapack_complex_double* du2, const lapack_int* ipiv, double anorm, double* rcond );
The routine estimates the reciprocal of the condition number of a real or complex tridiagonal matrix A in the 1-norm or infinity-norm:
κ1(A) = ||A||1||A-1||1
κ∞(A) = ||A||∞||A-1||∞
An estimate is obtained for ||A-1||, and the reciprocal of the condition number is computed as rcond = 1 / (||A|| ||A-1||).
Before calling this routine:
compute anorm (either ||A||1 = maxj Σi |aij| or ||A||∞ = maxi Σj |aij|)
call ?gttrf to compute the LU factorization of A.
The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.
norm |
CHARACTER*1. Must be '1' or 'O' or 'I'. If norm = '1' or 'O', then the routine estimates the condition number of matrix A in 1-norm. If norm = 'I', then the routine estimates the condition number of matrix A in infinity-norm. |
n |
INTEGER. The order of the matrix A; n ≥ 0. |
dl,d,du,du2 |
REAL for sgtcon DOUBLE PRECISION for dgtcon COMPLEX for cgtcon DOUBLE COMPLEX for zgtcon. Arrays: dl(n -1), d(n), du(n -1), du2(n -2). The array dl contains the (n - 1) multipliers that define the matrix L from the LU factorization of A as computed by ?gttrf. The array d contains the n diagonal elements of the upper triangular matrix U from the LU factorization of A. The array du contains the (n - 1) elements of the first superdiagonal of U. The array du2 contains the (n - 2) elements of the second superdiagonal of U. |
ipiv |
INTEGER. Array, DIMENSION (n). The array of pivot indices, as returned by ?gttrf. |
anorm |
REAL for single precision flavors. DOUBLE PRECISION for double precision flavors. The norm of the original matrix A (see Description). |
work |
REAL for sgtcon DOUBLE PRECISION for dgtcon COMPLEX for cgtcon DOUBLE COMPLEX for zgtcon. Workspace array, DIMENSION (2*n). |
iwork |
INTEGER. Workspace array, DIMENSION (n). Used for real flavors only. |
rcond |
REAL for single precision flavors. DOUBLE PRECISION for double precision flavors. An estimate of the reciprocal of the condition number. The routine sets rcond=0 if the estimate underflows; in this case the matrix is singular (to working precision). However, anytime rcond is small compared to 1.0, for the working precision, the matrix may be poorly conditioned or even singular. |
info |
INTEGER. If info = 0, the execution is successful. If info = -i, the i-th parameter had an illegal value. |
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.
Specific details for the routine gtcon interface are as follows:
dl |
Holds the vector of length (n-1). |
d |
Holds the vector of length n. |
du |
Holds the vector of length (n-1). |
du2 |
Holds the vector of length (n-2). |
ipiv |
Holds the vector of length n. |
norm |
Must be '1', 'O', or 'I'. The default value is '1'. |
The computed rcond is never less than r (the reciprocal of the true condition number) and in practice is nearly always less than 10r. A call to this routine involves solving a number of systems of linear equations A*x = b; the number is usually 4 or 5 and never more than 11. Each solution requires approximately 2n2 floating-point operations for real flavors and 8n2 for complex flavors.