3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZGBCON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgbcon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgbcon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgbcon.f">
21 * SUBROUTINE ZGBCON( NORM, N, KL, KU, AB, LDAB, IPIV, ANORM, RCOND,
24 * .. Scalar Arguments ..
26 * INTEGER INFO, KL, KU, LDAB, N
27 * DOUBLE PRECISION ANORM, RCOND
29 * .. Array Arguments ..
31 * DOUBLE PRECISION RWORK( * )
32 * COMPLEX*16 AB( LDAB, * ), WORK( * )
41 *> ZGBCON estimates the reciprocal of the condition number of a complex
42 *> general band matrix A, in either the 1-norm or the infinity-norm,
43 *> using the LU factorization computed by ZGBTRF.
45 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
46 *> condition number is computed as
47 *> RCOND = 1 / ( norm(A) * norm(inv(A)) ).
55 *> NORM is CHARACTER*1
56 *> Specifies whether the 1-norm condition number or the
57 *> infinity-norm condition number is required:
58 *> = '1' or 'O': 1-norm;
59 *> = 'I': Infinity-norm.
65 *> The order of the matrix A. N >= 0.
71 *> The number of subdiagonals within the band of A. KL >= 0.
77 *> The number of superdiagonals within the band of A. KU >= 0.
82 *> AB is COMPLEX*16 array, dimension (LDAB,N)
83 *> Details of the LU factorization of the band matrix A, as
84 *> computed by ZGBTRF. U is stored as an upper triangular band
85 *> matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and
86 *> the multipliers used during the factorization are stored in
87 *> rows KL+KU+2 to 2*KL+KU+1.
93 *> The leading dimension of the array AB. LDAB >= 2*KL+KU+1.
98 *> IPIV is INTEGER array, dimension (N)
99 *> The pivot indices; for 1 <= i <= N, row i of the matrix was
100 *> interchanged with row IPIV(i).
105 *> ANORM is DOUBLE PRECISION
106 *> If NORM = '1' or 'O', the 1-norm of the original matrix A.
107 *> If NORM = 'I', the infinity-norm of the original matrix A.
112 *> RCOND is DOUBLE PRECISION
113 *> The reciprocal of the condition number of the matrix A,
114 *> computed as RCOND = 1/(norm(A) * norm(inv(A))).
119 *> WORK is COMPLEX*16 array, dimension (2*N)
124 *> RWORK is DOUBLE PRECISION array, dimension (N)
130 *> = 0: successful exit
131 *> < 0: if INFO = -i, the i-th argument had an illegal value
137 *> \author Univ. of Tennessee
138 *> \author Univ. of California Berkeley
139 *> \author Univ. of Colorado Denver
142 *> \date November 2011
144 *> \ingroup complex16GBcomputational
146 * =====================================================================
147 SUBROUTINE ZGBCON( NORM, N, KL, KU, AB, LDAB, IPIV, ANORM, RCOND,
148 $ WORK, RWORK, INFO )
150 * -- LAPACK computational routine (version 3.4.0) --
151 * -- LAPACK is a software package provided by Univ. of Tennessee, --
152 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
155 * .. Scalar Arguments ..
157 INTEGER INFO, KL, KU, LDAB, N
158 DOUBLE PRECISION ANORM, RCOND
160 * .. Array Arguments ..
162 DOUBLE PRECISION RWORK( * )
163 COMPLEX*16 AB( LDAB, * ), WORK( * )
166 * =====================================================================
169 DOUBLE PRECISION ONE, ZERO
170 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
172 * .. Local Scalars ..
173 LOGICAL LNOTI, ONENRM
175 INTEGER IX, J, JP, KASE, KASE1, KD, LM
176 DOUBLE PRECISION AINVNM, SCALE, SMLNUM
182 * .. External Functions ..
185 DOUBLE PRECISION DLAMCH
187 EXTERNAL LSAME, IZAMAX, DLAMCH, ZDOTC
189 * .. External Subroutines ..
190 EXTERNAL XERBLA, ZAXPY, ZDRSCL, ZLACN2, ZLATBS
192 * .. Intrinsic Functions ..
193 INTRINSIC ABS, DBLE, DIMAG, MIN
195 * .. Statement Functions ..
196 DOUBLE PRECISION CABS1
198 * .. Statement Function definitions ..
199 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
201 * .. Executable Statements ..
203 * Test the input parameters.
206 ONENRM = NORM.EQ.'1' .OR. LSAME( NORM, 'O' )
207 IF( .NOT.ONENRM .AND. .NOT.LSAME( NORM, 'I' ) ) THEN
209 ELSE IF( N.LT.0 ) THEN
211 ELSE IF( KL.LT.0 ) THEN
213 ELSE IF( KU.LT.0 ) THEN
215 ELSE IF( LDAB.LT.2*KL+KU+1 ) THEN
217 ELSE IF( ANORM.LT.ZERO ) THEN
221 CALL XERBLA( 'ZGBCON', -INFO )
225 * Quick return if possible
231 ELSE IF( ANORM.EQ.ZERO ) THEN
235 SMLNUM = DLAMCH( 'Safe minimum' )
237 * Estimate the norm of inv(A).
250 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
252 IF( KASE.EQ.KASE1 ) THEN
254 * Multiply by inv(L).
262 WORK( JP ) = WORK( J )
265 CALL ZAXPY( LM, -T, AB( KD+1, J ), 1, WORK( J+1 ), 1 )
269 * Multiply by inv(U).
271 CALL ZLATBS( 'Upper', 'No transpose', 'Non-unit', NORMIN, N,
272 $ KL+KU, AB, LDAB, WORK, SCALE, RWORK, INFO )
275 * Multiply by inv(U**H).
277 CALL ZLATBS( 'Upper', 'Conjugate transpose', 'Non-unit',
278 $ NORMIN, N, KL+KU, AB, LDAB, WORK, SCALE, RWORK,
281 * Multiply by inv(L**H).
284 DO 30 J = N - 1, 1, -1
286 WORK( J ) = WORK( J ) - ZDOTC( LM, AB( KD+1, J ), 1,
291 WORK( JP ) = WORK( J )
298 * Divide X by 1/SCALE if doing so will not cause overflow.
301 IF( SCALE.NE.ONE ) THEN
302 IX = IZAMAX( N, WORK, 1 )
303 IF( SCALE.LT.CABS1( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO )
305 CALL ZDRSCL( N, SCALE, WORK, 1 )
310 * Compute the estimate of the reciprocal condition number.
313 $ RCOND = ( ONE / AINVNM ) / ANORM