1 *> \brief \b ZLA_GERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLA_GERCOND_C + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_gercond_c.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_gercond_c.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_gercond_c.f">
21 * DOUBLE PRECISION FUNCTION ZLA_GERCOND_C( TRANS, N, A, LDA, AF,
22 * LDAF, IPIV, C, CAPPLY,
25 * .. Scalar Aguments ..
28 * INTEGER N, LDA, LDAF, INFO
30 * .. Array Arguments ..
32 * COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * )
33 * DOUBLE PRECISION C( * ), RWORK( * )
42 *> ZLA_GERCOND_C computes the infinity norm condition number of
43 *> op(A) * inv(diag(C)) where C is a DOUBLE PRECISION 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
67 *> A is COMPLEX*16 array, dimension (LDA,N)
68 *> On entry, the N-by-N matrix A
74 *> The leading dimension of the array A. LDA >= max(1,N).
79 *> AF is COMPLEX*16 array, dimension (LDAF,N)
80 *> The factors L and U from the factorization
81 *> A = P*L*U as computed by ZGETRF.
87 *> The leading dimension of the array AF. LDAF >= max(1,N).
92 *> IPIV is INTEGER array, dimension (N)
93 *> The pivot indices from the factorization A = P*L*U
94 *> as computed by ZGETRF; row i of the matrix was interchanged
100 *> C is DOUBLE PRECISION array, dimension (N)
101 *> The vector C in the formula op(A) * inv(diag(C)).
107 *> If .TRUE. then access the vector C in the formula above.
113 *> = 0: Successful exit.
114 *> i > 0: The ith argument is invalid.
119 *> WORK is COMPLEX*16 array, dimension (2*N).
125 *> RWORK is DOUBLE PRECISION array, dimension (N).
132 *> \author Univ. of Tennessee
133 *> \author Univ. of California Berkeley
134 *> \author Univ. of Colorado Denver
137 *> \date September 2012
139 *> \ingroup complex16GEcomputational
141 * =====================================================================
142 DOUBLE PRECISION FUNCTION ZLA_GERCOND_C( TRANS, N, A, LDA, AF,
143 $ LDAF, IPIV, C, CAPPLY,
144 $ INFO, WORK, RWORK )
146 * -- LAPACK computational routine (version 3.4.2) --
147 * -- LAPACK is a software package provided by Univ. of Tennessee, --
148 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * .. Scalar Aguments ..
154 INTEGER N, LDA, LDAF, INFO
156 * .. Array Arguments ..
158 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * )
159 DOUBLE PRECISION C( * ), RWORK( * )
162 * =====================================================================
164 * .. Local Scalars ..
167 DOUBLE PRECISION AINVNM, ANORM, TMP
173 * .. External Functions ..
177 * .. External Subroutines ..
178 EXTERNAL ZLACN2, ZGETRS, XERBLA
180 * .. Intrinsic Functions ..
181 INTRINSIC ABS, MAX, REAL, DIMAG
183 * .. Statement Functions ..
184 DOUBLE PRECISION CABS1
186 * .. Statement Function Definitions ..
187 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
189 * .. Executable Statements ..
190 ZLA_GERCOND_C = 0.0D+0
193 NOTRANS = LSAME( TRANS, 'N' )
194 IF ( .NOT. NOTRANS .AND. .NOT. LSAME( TRANS, 'T' ) .AND. .NOT.
195 $ LSAME( TRANS, 'C' ) ) THEN
197 ELSE IF( N.LT.0 ) THEN
199 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
201 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
205 CALL XERBLA( 'ZLA_GERCOND_C', -INFO )
209 * Compute norm of op(A)*op2(C).
217 TMP = TMP + CABS1( A( I, J ) ) / C( J )
221 TMP = TMP + CABS1( A( I, J ) )
225 ANORM = MAX( ANORM, TMP )
232 TMP = TMP + CABS1( A( J, I ) ) / C( J )
236 TMP = TMP + CABS1( A( J, I ) )
240 ANORM = MAX( ANORM, TMP )
244 * Quick return if possible.
247 ZLA_GERCOND_C = 1.0D+0
249 ELSE IF( ANORM .EQ. 0.0D+0 ) THEN
253 * Estimate the norm of inv(op(A)).
259 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
266 WORK( I ) = WORK( I ) * RWORK( I )
270 CALL ZGETRS( 'No transpose', N, 1, AF, LDAF, IPIV,
273 CALL ZGETRS( 'Conjugate transpose', N, 1, AF, LDAF, IPIV,
277 * Multiply by inv(C).
281 WORK( I ) = WORK( I ) * C( I )
286 * Multiply by inv(C**H).
290 WORK( I ) = WORK( I ) * C( I )
295 CALL ZGETRS( 'Conjugate transpose', N, 1, AF, LDAF, IPIV,
298 CALL ZGETRS( 'No transpose', N, 1, AF, LDAF, IPIV,
305 WORK( I ) = WORK( I ) * RWORK( I )
311 * Compute the estimate of the reciprocal condition number.
313 IF( AINVNM .NE. 0.0D+0 )
314 $ ZLA_GERCOND_C = 1.0D+0 / AINVNM