1 *> \brief \b CLA_SYRCOND_X computes the infinity norm condition number of op(A)*diag(x) for symmetric indefinite matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CLA_SYRCOND_X + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cla_syrcond_x.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cla_syrcond_x.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cla_syrcond_x.f">
21 * REAL FUNCTION CLA_SYRCOND_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_SYRCOND_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 CSYTRF.
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 CSYTRF.
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 complexSYcomputational
130 * =====================================================================
131 REAL FUNCTION CLA_SYRCOND_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
161 * .. External Functions ..
165 * .. External Subroutines ..
166 EXTERNAL CLACN2, CSYTRS, XERBLA
168 * .. Intrinsic Functions ..
171 * .. Statement Functions ..
174 * .. Statement Function Definitions ..
175 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
177 * .. Executable Statements ..
179 CLA_SYRCOND_X = 0.0E+0
182 UPPER = LSAME( UPLO, 'U' )
183 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
185 ELSE IF ( N.LT.0 ) THEN
187 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
189 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
193 CALL XERBLA( 'CLA_SYRCOND_X', -INFO )
197 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
199 * Compute norm of op(A)*op2(C).
206 TMP = TMP + CABS1( A( J, I ) * X( J ) )
209 TMP = TMP + CABS1( A( I, J ) * X( J ) )
212 ANORM = MAX( ANORM, TMP )
218 TMP = TMP + CABS1( A( I, J ) * X( J ) )
221 TMP = TMP + CABS1( A( J, I ) * X( J ) )
224 ANORM = MAX( ANORM, TMP )
228 * Quick return if possible.
231 CLA_SYRCOND_X = 1.0E+0
233 ELSE IF( ANORM .EQ. 0.0E+0 ) THEN
237 * Estimate the norm of inv(op(A)).
243 CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
250 WORK( I ) = WORK( I ) * RWORK( I )
254 CALL CSYTRS( 'U', N, 1, AF, LDAF, IPIV,
257 CALL CSYTRS( 'L', N, 1, AF, LDAF, IPIV,
261 * Multiply by inv(X).
264 WORK( I ) = WORK( I ) / X( I )
268 * Multiply by inv(X**T).
271 WORK( I ) = WORK( I ) / X( I )
275 CALL CSYTRS( 'U', N, 1, AF, LDAF, IPIV,
278 CALL CSYTRS( 'L', N, 1, AF, LDAF, IPIV,
285 WORK( I ) = WORK( I ) * RWORK( I )
291 * Compute the estimate of the reciprocal condition number.
293 IF( AINVNM .NE. 0.0E+0 )
294 $ CLA_SYRCOND_X = 1.0E+0 / AINVNM