1 *> \brief \b ZLA_GBRCOND_X computes the infinity norm condition number of op(A)*diag(x) for general banded matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLA_GBRCOND_X + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_gbrcond_x.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_gbrcond_x.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_gbrcond_x.f">
21 * DOUBLE PRECISION FUNCTION ZLA_GBRCOND_X( TRANS, N, KL, KU, AB,
22 * LDAB, AFB, LDAFB, IPIV,
23 * X, INFO, WORK, RWORK )
25 * .. Scalar Arguments ..
27 * INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
29 * .. Array Arguments ..
31 * COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), WORK( * ),
33 * DOUBLE PRECISION RWORK( * )
42 *> ZLA_GBRCOND_X Computes the infinity norm condition number of
43 *> op(A) * diag(X) where X is a COMPLEX*16 vector.
51 *> TRANS is CHARACTER*1
52 *> Specifies the form of the system of equations:
53 *> = 'N': A * X = B (No transpose)
54 *> = 'T': A**T * X = B (Transpose)
55 *> = 'C': A**H * X = B (Conjugate Transpose = Transpose)
61 *> The number of linear equations, i.e., the order of the
68 *> The number of subdiagonals within the band of A. KL >= 0.
74 *> The number of superdiagonals within the band of A. KU >= 0.
79 *> AB is COMPLEX*16 array, dimension (LDAB,N)
80 *> On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
81 *> The j-th column of A is stored in the j-th column of the
82 *> array AB as follows:
83 *> AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
89 *> The leading dimension of the array AB. LDAB >= KL+KU+1.
94 *> AFB is COMPLEX*16 array, dimension (LDAFB,N)
95 *> Details of the LU factorization of the band matrix A, as
96 *> computed by ZGBTRF. U is stored as an upper triangular
97 *> band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
98 *> and the multipliers used during the factorization are stored
99 *> in rows KL+KU+2 to 2*KL+KU+1.
105 *> The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.
110 *> IPIV is INTEGER array, dimension (N)
111 *> The pivot indices from the factorization A = P*L*U
112 *> as computed by ZGBTRF; row i of the matrix was interchanged
118 *> X is COMPLEX*16 array, dimension (N)
119 *> The vector X in the formula op(A) * diag(X).
125 *> = 0: Successful exit.
126 *> i > 0: The ith argument is invalid.
131 *> WORK is COMPLEX*16 array, dimension (2*N).
137 *> RWORK is DOUBLE PRECISION array, dimension (N).
144 *> \author Univ. of Tennessee
145 *> \author Univ. of California Berkeley
146 *> \author Univ. of Colorado Denver
149 *> \date September 2012
151 *> \ingroup complex16GBcomputational
153 * =====================================================================
154 DOUBLE PRECISION FUNCTION ZLA_GBRCOND_X( TRANS, N, KL, KU, AB,
155 $ LDAB, AFB, LDAFB, IPIV,
156 $ X, INFO, WORK, RWORK )
158 * -- LAPACK computational routine (version 3.4.2) --
159 * -- LAPACK is a software package provided by Univ. of Tennessee, --
160 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
163 * .. Scalar Arguments ..
165 INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
167 * .. Array Arguments ..
169 COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), WORK( * ),
171 DOUBLE PRECISION RWORK( * )
174 * =====================================================================
176 * .. Local Scalars ..
179 DOUBLE PRECISION AINVNM, ANORM, TMP
185 * .. External Functions ..
189 * .. External Subroutines ..
190 EXTERNAL ZLACN2, ZGBTRS, XERBLA
192 * .. Intrinsic Functions ..
195 * .. Statement Functions ..
196 DOUBLE PRECISION CABS1
198 * .. Statement Function Definitions ..
199 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
201 * .. Executable Statements ..
203 ZLA_GBRCOND_X = 0.0D+0
206 NOTRANS = LSAME( TRANS, 'N' )
207 IF ( .NOT. NOTRANS .AND. .NOT. LSAME(TRANS, 'T') .AND. .NOT.
208 $ LSAME( TRANS, 'C' ) ) THEN
210 ELSE IF( N.LT.0 ) THEN
212 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN
214 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN
216 ELSE IF( LDAB.LT.KL+KU+1 ) THEN
218 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN
222 CALL XERBLA( 'ZLA_GBRCOND_X', -INFO )
226 * Compute norm of op(A)*op2(C).
234 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
235 TMP = TMP + CABS1( AB( KD+I-J, J) * X( J ) )
238 ANORM = MAX( ANORM, TMP )
243 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
244 TMP = TMP + CABS1( AB( KE-I+J, I ) * X( J ) )
247 ANORM = MAX( ANORM, TMP )
251 * Quick return if possible.
254 ZLA_GBRCOND_X = 1.0D+0
256 ELSE IF( ANORM .EQ. 0.0D+0 ) THEN
260 * Estimate the norm of inv(op(A)).
266 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
273 WORK( I ) = WORK( I ) * RWORK( I )
277 CALL ZGBTRS( 'No transpose', N, KL, KU, 1, AFB, LDAFB,
278 $ IPIV, WORK, N, INFO )
280 CALL ZGBTRS( 'Conjugate transpose', N, KL, KU, 1, AFB,
281 $ LDAFB, IPIV, WORK, N, INFO )
284 * Multiply by inv(X).
287 WORK( I ) = WORK( I ) / X( I )
291 * Multiply by inv(X**H).
294 WORK( I ) = WORK( I ) / X( I )
298 CALL ZGBTRS( 'Conjugate transpose', N, KL, KU, 1, AFB,
299 $ LDAFB, IPIV, WORK, N, INFO )
301 CALL ZGBTRS( 'No transpose', N, KL, KU, 1, AFB, LDAFB,
302 $ IPIV, WORK, N, INFO )
308 WORK( I ) = WORK( I ) * RWORK( I )
314 * Compute the estimate of the reciprocal condition number.
316 IF( AINVNM .NE. 0.0D+0 )
317 $ ZLA_GBRCOND_X = 1.0D+0 / AINVNM