1 *> \brief \b CLA_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 CLA_HERCOND_X + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cla_hercond_x.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cla_hercond_x.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cla_hercond_x.f">
21 * REAL FUNCTION CLA_HERCOND_X( UPLO, N, A, LDA, AF, LDAF, IPIV, X,
24 * .. Scalar Arguments ..
26 * INTEGER N, LDA, LDAF, INFO
28 * .. Array Arguments ..
30 * COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
40 *> CLA_HERCOND_X computes the infinity norm condition number of
41 *> op(A) * diag(X) where X is a COMPLEX vector.
49 *> UPLO is CHARACTER*1
50 *> = 'U': Upper triangle of A is stored;
51 *> = 'L': Lower triangle of A is stored.
57 *> The number of linear equations, i.e., the order of the
63 *> A is COMPLEX array, dimension (LDA,N)
64 *> On entry, the N-by-N matrix A.
70 *> The leading dimension of the array A. LDA >= max(1,N).
75 *> AF is COMPLEX array, dimension (LDAF,N)
76 *> The block diagonal matrix D and the multipliers used to
77 *> obtain the factor U or L as computed by CHETRF.
83 *> The leading dimension of the array AF. LDAF >= max(1,N).
88 *> IPIV is INTEGER array, dimension (N)
89 *> Details of the interchanges and the block structure of D
90 *> as determined by CHETRF.
95 *> X is COMPLEX array, dimension (N)
96 *> The vector X in the formula op(A) * diag(X).
102 *> = 0: Successful exit.
103 *> i > 0: The ith argument is invalid.
108 *> WORK is COMPLEX array, dimension (2*N).
114 *> RWORK is REAL array, dimension (N).
121 *> \author Univ. of Tennessee
122 *> \author Univ. of California Berkeley
123 *> \author Univ. of Colorado Denver
126 *> \date September 2012
128 *> \ingroup complexHEcomputational
130 * =====================================================================
131 REAL FUNCTION CLA_HERCOND_X( UPLO, N, A, LDA, AF, LDAF, IPIV, X,
132 $ INFO, WORK, RWORK )
134 * -- LAPACK computational routine (version 3.4.2) --
135 * -- LAPACK is a software package provided by Univ. of Tennessee, --
136 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
139 * .. Scalar Arguments ..
141 INTEGER N, LDA, LDAF, INFO
143 * .. Array Arguments ..
145 COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
149 * =====================================================================
151 * .. Local Scalars ..
153 REAL AINVNM, ANORM, TMP
160 * .. External Functions ..
164 * .. External Subroutines ..
165 EXTERNAL CLACN2, CHETRS, XERBLA
167 * .. Intrinsic Functions ..
170 * .. Statement Functions ..
173 * .. Statement Function Definitions ..
174 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
176 * .. Executable Statements ..
178 CLA_HERCOND_X = 0.0E+0
181 UPPER = LSAME( UPLO, 'U' )
182 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
184 ELSE IF ( N.LT.0 ) THEN
186 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
188 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
192 CALL XERBLA( 'CLA_HERCOND_X', -INFO )
196 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
198 * Compute norm of op(A)*op2(C).
205 TMP = TMP + CABS1( A( J, I ) * X( J ) )
208 TMP = TMP + CABS1( A( I, J ) * X( J ) )
211 ANORM = MAX( ANORM, TMP )
217 TMP = TMP + CABS1( A( I, J ) * X( J ) )
220 TMP = TMP + CABS1( A( J, I ) * X( J ) )
223 ANORM = MAX( ANORM, TMP )
227 * Quick return if possible.
230 CLA_HERCOND_X = 1.0E+0
232 ELSE IF( ANORM .EQ. 0.0E+0 ) THEN
236 * Estimate the norm of inv(op(A)).
242 CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
249 WORK( I ) = WORK( I ) * RWORK( I )
253 CALL CHETRS( 'U', N, 1, AF, LDAF, IPIV,
256 CALL CHETRS( 'L', N, 1, AF, LDAF, IPIV,
260 * Multiply by inv(X).
263 WORK( I ) = WORK( I ) / X( I )
267 * Multiply by inv(X**H).
270 WORK( I ) = WORK( I ) / X( I )
274 CALL CHETRS( 'U', N, 1, AF, LDAF, IPIV,
277 CALL CHETRS( 'L', N, 1, AF, LDAF, IPIV,
284 WORK( I ) = WORK( I ) * RWORK( I )
290 * Compute the estimate of the reciprocal condition number.
292 IF( AINVNM .NE. 0.0E+0 )
293 $ CLA_HERCOND_X = 1.0E+0 / AINVNM