1 *> \brief \b ZLA_GERCOND_X computes the infinity norm condition number of op(A)*diag(x) for general matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLA_GERCOND_X + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_gercond_x.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_gercond_x.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_gercond_x.f">
21 * DOUBLE PRECISION FUNCTION ZLA_GERCOND_X( TRANS, N, A, LDA, AF,
22 * LDAF, IPIV, X, INFO,
25 * .. Scalar Arguments ..
27 * INTEGER N, LDA, LDAF, INFO
29 * .. Array Arguments ..
31 * COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
32 * DOUBLE PRECISION RWORK( * )
41 *> ZLA_GERCOND_X computes the infinity norm condition number of
42 *> op(A) * diag(X) where X is a COMPLEX*16 vector.
50 *> TRANS is CHARACTER*1
51 *> Specifies the form of the system of equations:
52 *> = 'N': A * X = B (No transpose)
53 *> = 'T': A**T * X = B (Transpose)
54 *> = 'C': A**H * X = B (Conjugate Transpose = Transpose)
60 *> The number of linear equations, i.e., the order of the
66 *> A is COMPLEX*16 array, dimension (LDA,N)
67 *> On entry, the N-by-N matrix A.
73 *> The leading dimension of the array A. LDA >= max(1,N).
78 *> AF is COMPLEX*16 array, dimension (LDAF,N)
79 *> The factors L and U from the factorization
80 *> A = P*L*U as computed by ZGETRF.
86 *> The leading dimension of the array AF. LDAF >= max(1,N).
91 *> IPIV is INTEGER array, dimension (N)
92 *> The pivot indices from the factorization A = P*L*U
93 *> as computed by ZGETRF; row i of the matrix was interchanged
99 *> X is COMPLEX*16 array, dimension (N)
100 *> The vector X in the formula op(A) * diag(X).
106 *> = 0: Successful exit.
107 *> i > 0: The ith argument is invalid.
112 *> WORK is COMPLEX*16 array, dimension (2*N).
118 *> RWORK is DOUBLE PRECISION array, dimension (N).
125 *> \author Univ. of Tennessee
126 *> \author Univ. of California Berkeley
127 *> \author Univ. of Colorado Denver
130 *> \date September 2012
132 *> \ingroup complex16GEcomputational
134 * =====================================================================
135 DOUBLE PRECISION FUNCTION ZLA_GERCOND_X( TRANS, N, A, LDA, AF,
136 $ LDAF, IPIV, X, INFO,
139 * -- LAPACK computational routine (version 3.4.2) --
140 * -- LAPACK is a software package provided by Univ. of Tennessee, --
141 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
144 * .. Scalar Arguments ..
146 INTEGER N, LDA, LDAF, INFO
148 * .. Array Arguments ..
150 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
151 DOUBLE PRECISION RWORK( * )
154 * =====================================================================
156 * .. Local Scalars ..
159 DOUBLE PRECISION AINVNM, ANORM, TMP
166 * .. External Functions ..
170 * .. External Subroutines ..
171 EXTERNAL ZLACN2, ZGETRS, XERBLA
173 * .. Intrinsic Functions ..
174 INTRINSIC ABS, MAX, REAL, DIMAG
176 * .. Statement Functions ..
177 DOUBLE PRECISION CABS1
179 * .. Statement Function Definitions ..
180 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
182 * .. Executable Statements ..
184 ZLA_GERCOND_X = 0.0D+0
187 NOTRANS = LSAME( TRANS, 'N' )
188 IF ( .NOT. NOTRANS .AND. .NOT. LSAME( TRANS, 'T' ) .AND. .NOT.
189 $ LSAME( TRANS, 'C' ) ) THEN
191 ELSE IF( N.LT.0 ) THEN
193 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
195 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
199 CALL XERBLA( 'ZLA_GERCOND_X', -INFO )
203 * Compute norm of op(A)*op2(C).
210 TMP = TMP + CABS1( A( I, J ) * X( J ) )
213 ANORM = MAX( ANORM, TMP )
219 TMP = TMP + CABS1( A( J, I ) * X( J ) )
222 ANORM = MAX( ANORM, TMP )
226 * Quick return if possible.
229 ZLA_GERCOND_X = 1.0D+0
231 ELSE IF( ANORM .EQ. 0.0D+0 ) THEN
235 * Estimate the norm of inv(op(A)).
241 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
246 WORK( I ) = WORK( I ) * RWORK( I )
250 CALL ZGETRS( 'No transpose', N, 1, AF, LDAF, IPIV,
253 CALL ZGETRS( 'Conjugate transpose', N, 1, AF, LDAF, IPIV,
257 * Multiply by inv(X).
260 WORK( I ) = WORK( I ) / X( I )
264 * Multiply by inv(X**H).
267 WORK( I ) = WORK( I ) / X( I )
271 CALL ZGETRS( 'Conjugate transpose', N, 1, AF, LDAF, IPIV,
274 CALL ZGETRS( 'No transpose', N, 1, AF, LDAF, IPIV,
281 WORK( I ) = WORK( I ) * RWORK( I )
287 * Compute the estimate of the reciprocal condition number.
289 IF( AINVNM .NE. 0.0D+0 )
290 $ ZLA_GERCOND_X = 1.0D+0 / AINVNM