3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZGTCON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgtcon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgtcon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgtcon.f">
21 * SUBROUTINE ZGTCON( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
24 * .. Scalar Arguments ..
27 * DOUBLE PRECISION ANORM, RCOND
29 * .. Array Arguments ..
31 * COMPLEX*16 D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
40 *> ZGTCON estimates the reciprocal of the condition number of a complex
41 *> tridiagonal matrix A using the LU factorization as computed by
44 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
45 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
53 *> NORM is CHARACTER*1
54 *> Specifies whether the 1-norm condition number or the
55 *> infinity-norm condition number is required:
56 *> = '1' or 'O': 1-norm;
57 *> = 'I': Infinity-norm.
63 *> The order of the matrix A. N >= 0.
68 *> DL is COMPLEX*16 array, dimension (N-1)
69 *> The (n-1) multipliers that define the matrix L from the
70 *> LU factorization of A as computed by ZGTTRF.
75 *> D is COMPLEX*16 array, dimension (N)
76 *> The n diagonal elements of the upper triangular matrix U from
77 *> the LU factorization of A.
82 *> DU is COMPLEX*16 array, dimension (N-1)
83 *> The (n-1) elements of the first superdiagonal of U.
88 *> DU2 is COMPLEX*16 array, dimension (N-2)
89 *> The (n-2) elements of the second superdiagonal of U.
94 *> IPIV is INTEGER array, dimension (N)
95 *> The pivot indices; for 1 <= i <= n, row i of the matrix was
96 *> interchanged with row IPIV(i). IPIV(i) will always be either
97 *> i or i+1; IPIV(i) = i indicates a row interchange was not
103 *> ANORM is DOUBLE PRECISION
104 *> If NORM = '1' or 'O', the 1-norm of the original matrix A.
105 *> If NORM = 'I', the infinity-norm of the original matrix A.
110 *> RCOND is DOUBLE PRECISION
111 *> The reciprocal of the condition number of the matrix A,
112 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
113 *> estimate of the 1-norm of inv(A) computed in this routine.
118 *> WORK is COMPLEX*16 array, dimension (2*N)
124 *> = 0: successful exit
125 *> < 0: if INFO = -i, the i-th argument had an illegal value
131 *> \author Univ. of Tennessee
132 *> \author Univ. of California Berkeley
133 *> \author Univ. of Colorado Denver
136 *> \date September 2012
138 *> \ingroup complex16GTcomputational
140 * =====================================================================
141 SUBROUTINE ZGTCON( NORM, N, DL, D, DU, DU2, IPIV, ANORM, RCOND,
144 * -- LAPACK computational routine (version 3.4.2) --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
149 * .. Scalar Arguments ..
152 DOUBLE PRECISION ANORM, RCOND
154 * .. Array Arguments ..
156 COMPLEX*16 D( * ), DL( * ), DU( * ), DU2( * ), WORK( * )
159 * =====================================================================
162 DOUBLE PRECISION ONE, ZERO
163 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
165 * .. Local Scalars ..
167 INTEGER I, KASE, KASE1
168 DOUBLE PRECISION AINVNM
173 * .. External Functions ..
177 * .. External Subroutines ..
178 EXTERNAL XERBLA, ZGTTRS, ZLACN2
180 * .. Intrinsic Functions ..
183 * .. Executable Statements ..
185 * Test the input arguments.
188 ONENRM = NORM.EQ.'1' .OR. LSAME( NORM, 'O' )
189 IF( .NOT.ONENRM .AND. .NOT.LSAME( NORM, 'I' ) ) THEN
191 ELSE IF( N.LT.0 ) THEN
193 ELSE IF( ANORM.LT.ZERO ) THEN
197 CALL XERBLA( 'ZGTCON', -INFO )
201 * Quick return if possible
207 ELSE IF( ANORM.EQ.ZERO ) THEN
211 * Check that D(1:N) is non-zero.
214 IF( D( I ).EQ.DCMPLX( ZERO ) )
226 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
228 IF( KASE.EQ.KASE1 ) THEN
230 * Multiply by inv(U)*inv(L).
232 CALL ZGTTRS( 'No transpose', N, 1, DL, D, DU, DU2, IPIV,
236 * Multiply by inv(L**H)*inv(U**H).
238 CALL ZGTTRS( 'Conjugate transpose', N, 1, DL, D, DU, DU2,
239 $ IPIV, WORK, N, INFO )
244 * Compute the estimate of the reciprocal condition number.
247 $ RCOND = ( ONE / AINVNM ) / ANORM