1 *> \brief \b ZLA_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLA_HERCOND_X + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_hercond_x.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_hercond_x.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_hercond_x.f">
21 * DOUBLE PRECISION FUNCTION ZLA_HERCOND_X( UPLO, 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_HERCOND_X computes the infinity norm condition number of
42 *> op(A) * diag(X) where X is a COMPLEX*16 vector.
50 *> UPLO is CHARACTER*1
51 *> = 'U': Upper triangle of A is stored;
52 *> = 'L': Lower triangle of A is stored.
58 *> The number of linear equations, i.e., the order of the
64 *> A is COMPLEX*16 array, dimension (LDA,N)
65 *> On entry, the N-by-N matrix A.
71 *> The leading dimension of the array A. LDA >= max(1,N).
76 *> AF is COMPLEX*16 array, dimension (LDAF,N)
77 *> The block diagonal matrix D and the multipliers used to
78 *> obtain the factor U or L as computed by ZHETRF.
84 *> The leading dimension of the array AF. LDAF >= max(1,N).
89 *> IPIV is INTEGER array, dimension (N)
90 *> Details of the interchanges and the block structure of D
91 *> as determined by CHETRF.
96 *> X is COMPLEX*16 array, dimension (N)
97 *> The vector X in the formula op(A) * diag(X).
103 *> = 0: Successful exit.
104 *> i > 0: The ith argument is invalid.
109 *> WORK is COMPLEX*16 array, dimension (2*N).
115 *> RWORK is DOUBLE PRECISION array, dimension (N).
122 *> \author Univ. of Tennessee
123 *> \author Univ. of California Berkeley
124 *> \author Univ. of Colorado Denver
127 *> \date September 2012
129 *> \ingroup complex16HEcomputational
131 * =====================================================================
132 DOUBLE PRECISION FUNCTION ZLA_HERCOND_X( UPLO, N, A, LDA, AF,
133 $ LDAF, IPIV, X, INFO,
136 * -- LAPACK computational routine (version 3.4.2) --
137 * -- LAPACK is a software package provided by Univ. of Tennessee, --
138 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
141 * .. Scalar Arguments ..
143 INTEGER N, LDA, LDAF, INFO
145 * .. Array Arguments ..
147 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
148 DOUBLE PRECISION RWORK( * )
151 * =====================================================================
153 * .. Local Scalars ..
155 DOUBLE PRECISION AINVNM, ANORM, TMP
162 * .. External Functions ..
166 * .. External Subroutines ..
167 EXTERNAL ZLACN2, ZHETRS, XERBLA
169 * .. Intrinsic Functions ..
172 * .. Statement Functions ..
173 DOUBLE PRECISION CABS1
175 * .. Statement Function Definitions ..
176 CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
178 * .. Executable Statements ..
180 ZLA_HERCOND_X = 0.0D+0
183 UPPER = LSAME( UPLO, 'U' )
184 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
186 ELSE IF ( N.LT.0 ) THEN
188 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
190 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
194 CALL XERBLA( 'ZLA_HERCOND_X', -INFO )
198 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
200 * Compute norm of op(A)*op2(C).
207 TMP = TMP + CABS1( A( J, I ) * X( J ) )
210 TMP = TMP + CABS1( A( I, J ) * X( J ) )
213 ANORM = MAX( ANORM, TMP )
219 TMP = TMP + CABS1( A( I, J ) * X( J ) )
222 TMP = TMP + CABS1( A( J, I ) * X( J ) )
225 ANORM = MAX( ANORM, TMP )
229 * Quick return if possible.
232 ZLA_HERCOND_X = 1.0D+0
234 ELSE IF( ANORM .EQ. 0.0D+0 ) THEN
238 * Estimate the norm of inv(op(A)).
244 CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
251 WORK( I ) = WORK( I ) * RWORK( I )
255 CALL ZHETRS( 'U', N, 1, AF, LDAF, IPIV,
258 CALL ZHETRS( 'L', N, 1, AF, LDAF, IPIV,
262 * Multiply by inv(X).
265 WORK( I ) = WORK( I ) / X( I )
269 * Multiply by inv(X**H).
272 WORK( I ) = WORK( I ) / X( I )
276 CALL ZHETRS( 'U', N, 1, AF, LDAF, IPIV,
279 CALL ZHETRS( 'L', N, 1, AF, LDAF, IPIV,
286 WORK( I ) = WORK( I ) * RWORK( I )
292 * Compute the estimate of the reciprocal condition number.
294 IF( AINVNM .NE. 0.0D+0 )
295 $ ZLA_HERCOND_X = 1.0D+0 / AINVNM