1 *> \brief \b ZLA_GBRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general banded matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLA_GBRCOND_C + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_gbrcond_c.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_gbrcond_c.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_gbrcond_c.f">
21 * DOUBLE PRECISION FUNCTION ZLA_GBRCOND_C( TRANS, N, KL, KU, AB,
22 * LDAB, AFB, LDAFB, IPIV,
23 * C, CAPPLY, INFO, WORK,
26 * .. Scalar Arguments ..
29 * INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
31 * .. Array Arguments ..
33 * COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), WORK( * )
34 * DOUBLE PRECISION C( * ), RWORK( * )
43 *> ZLA_GBRCOND_C Computes the infinity norm condition number of
44 *> op(A) * inv(diag(C)) where C is a DOUBLE PRECISION vector.
52 *> TRANS is CHARACTER*1
53 *> Specifies the form of the system of equations:
54 *> = 'N': A * X = B (No transpose)
55 *> = 'T': A**T * X = B (Transpose)
56 *> = 'C': A**H * X = B (Conjugate Transpose = Transpose)
62 *> The number of linear equations, i.e., the order of the
69 *> The number of subdiagonals within the band of A. KL >= 0.
75 *> The number of superdiagonals within the band of A. KU >= 0.
80 *> AB is COMPLEX*16 array, dimension (LDAB,N)
81 *> On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
82 *> The j-th column of A is stored in the j-th column of the
83 *> array AB as follows:
84 *> AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
90 *> The leading dimension of the array AB. LDAB >= KL+KU+1.
95 *> AFB is COMPLEX*16 array, dimension (LDAFB,N)
96 *> Details of the LU factorization of the band matrix A, as
97 *> computed by ZGBTRF. U is stored as an upper triangular
98 *> band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
99 *> and the multipliers used during the factorization are stored
100 *> in rows KL+KU+2 to 2*KL+KU+1.
106 *> The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.
111 *> IPIV is INTEGER array, dimension (N)
112 *> The pivot indices from the factorization A = P*L*U
113 *> as computed by ZGBTRF; row i of the matrix was interchanged
119 *> C is DOUBLE PRECISION array, dimension (N)
120 *> The vector C in the formula op(A) * inv(diag(C)).
126 *> If .TRUE. then access the vector C in the formula above.
132 *> = 0: Successful exit.
133 *> i > 0: The ith argument is invalid.
138 *> WORK is COMPLEX*16 array, dimension (2*N).
144 *> RWORK is DOUBLE PRECISION array, dimension (N).
151 *> \author Univ. of Tennessee
152 *> \author Univ. of California Berkeley
153 *> \author Univ. of Colorado Denver
156 *> \date September 2012
158 *> \ingroup complex16GBcomputational
160 * =====================================================================
161 DOUBLE PRECISION FUNCTION ZLA_GBRCOND_C( TRANS, N, KL, KU, AB,
162 $ LDAB, AFB, LDAFB, IPIV,
163 $ C, CAPPLY, INFO, WORK,
166 * -- LAPACK computational routine (version 3.4.2) --
167 * -- LAPACK is a software package provided by Univ. of Tennessee, --
168 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
171 * .. Scalar Arguments ..
174 INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
176 * .. Array Arguments ..
178 COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), WORK( * )
179 DOUBLE PRECISION C( * ), RWORK( * )
182 * =====================================================================
184 * .. Local Scalars ..
187 DOUBLE PRECISION AINVNM, ANORM, TMP
193 * .. External Functions ..
197 * .. External Subroutines ..
198 EXTERNAL ZLACN2, ZGBTRS, XERBLA
200 * .. Intrinsic Functions ..
203 * .. Statement Functions ..
204 DOUBLE PRECISION CABS1
206 * .. Statement Function Definitions ..
207 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
209 * .. Executable Statements ..
210 ZLA_GBRCOND_C = 0.0D+0
213 NOTRANS = LSAME( TRANS, 'N' )
214 IF ( .NOT. NOTRANS .AND. .NOT. LSAME( TRANS, 'T' ) .AND. .NOT.
215 $ LSAME( TRANS, 'C' ) ) THEN
217 ELSE IF( N.LT.0 ) THEN
219 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN
221 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN
223 ELSE IF( LDAB.LT.KL+KU+1 ) THEN
225 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN
229 CALL XERBLA( 'ZLA_GBRCOND_C', -INFO )
233 * Compute norm of op(A)*op2(C).
242 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
243 TMP = TMP + CABS1( AB( KD+I-J, J ) ) / C( J )
246 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
247 TMP = TMP + CABS1( AB( KD+I-J, J ) )
251 ANORM = MAX( ANORM, TMP )
257 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
258 TMP = TMP + CABS1( AB( KE-I+J, I ) ) / C( J )
261 DO J = MAX( I-KL, 1 ), MIN( I+KU, N )
262 TMP = TMP + CABS1( AB( KE-I+J, I ) )
266 ANORM = MAX( ANORM, TMP )
270 * Quick return if possible.
273 ZLA_GBRCOND_C = 1.0D+0
275 ELSE IF( ANORM .EQ. 0.0D+0 ) THEN
279 * Estimate the norm of inv(op(A)).
285 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
292 WORK( I ) = WORK( I ) * RWORK( I )
296 CALL ZGBTRS( 'No transpose', N, KL, KU, 1, AFB, LDAFB,
297 $ IPIV, WORK, N, INFO )
299 CALL ZGBTRS( 'Conjugate transpose', N, KL, KU, 1, AFB,
300 $ LDAFB, IPIV, WORK, N, INFO )
303 * Multiply by inv(C).
307 WORK( I ) = WORK( I ) * C( I )
312 * Multiply by inv(C**H).
316 WORK( I ) = WORK( I ) * C( I )
321 CALL ZGBTRS( 'Conjugate transpose', N, KL, KU, 1, AFB,
322 $ LDAFB, IPIV, WORK, N, INFO )
324 CALL ZGBTRS( 'No transpose', N, KL, KU, 1, AFB, LDAFB,
325 $ IPIV, WORK, N, INFO )
331 WORK( I ) = WORK( I ) * RWORK( I )
337 * Compute the estimate of the reciprocal condition number.
339 IF( AINVNM .NE. 0.0D+0 )
340 $ ZLA_GBRCOND_C = 1.0D+0 / AINVNM