1 *> \brief \b CLA_SYRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for symmetric indefinite matrices.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download CLA_SYRCOND_C + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cla_syrcond_c.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cla_syrcond_c.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cla_syrcond_c.f">
21 * REAL FUNCTION CLA_SYRCOND_C( UPLO, N, A, LDA, AF, LDAF, IPIV, C,
22 * CAPPLY, INFO, WORK, RWORK )
24 * .. Scalar Arguments ..
27 * INTEGER N, LDA, LDAF, INFO
29 * .. Array Arguments ..
31 * COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * )
32 * REAL C( * ), RWORK( * )
41 *> CLA_SYRCOND_C Computes the infinity norm condition number of
42 *> op(A) * inv(diag(C)) where C is a REAL 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 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 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 CSYTRF.
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 CSYTRF.
96 *> C is REAL array, dimension (N)
97 *> The vector C in the formula op(A) * inv(diag(C)).
103 *> If .TRUE. then access the vector C in the formula above.
109 *> = 0: Successful exit.
110 *> i > 0: The ith argument is invalid.
115 *> WORK is COMPLEX array, dimension (2*N).
121 *> RWORK is REAL array, dimension (N).
128 *> \author Univ. of Tennessee
129 *> \author Univ. of California Berkeley
130 *> \author Univ. of Colorado Denver
133 *> \date September 2012
135 *> \ingroup complexSYcomputational
137 * =====================================================================
138 REAL FUNCTION CLA_SYRCOND_C( UPLO, N, A, LDA, AF, LDAF, IPIV, C,
139 $ CAPPLY, INFO, WORK, RWORK )
141 * -- LAPACK computational routine (version 3.4.2) --
142 * -- LAPACK is a software package provided by Univ. of Tennessee, --
143 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
146 * .. Scalar Arguments ..
149 INTEGER N, LDA, LDAF, INFO
151 * .. Array Arguments ..
153 COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * )
154 REAL C( * ), RWORK( * )
157 * =====================================================================
159 * .. Local Scalars ..
161 REAL AINVNM, ANORM, TMP
169 * .. External Functions ..
173 * .. External Subroutines ..
174 EXTERNAL CLACN2, CSYTRS, XERBLA
176 * .. Intrinsic Functions ..
179 * .. Statement Functions ..
182 * .. Statement Function Definitions ..
183 CABS1( ZDUM ) = ABS( REAL( ZDUM ) ) + ABS( AIMAG( ZDUM ) )
185 * .. Executable Statements ..
187 CLA_SYRCOND_C = 0.0E+0
190 UPPER = LSAME( UPLO, 'U' )
191 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
193 ELSE IF( N.LT.0 ) THEN
195 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
197 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
201 CALL XERBLA( 'CLA_SYRCOND_C', -INFO )
205 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
207 * Compute norm of op(A)*op2(C).
215 TMP = TMP + CABS1( A( J, I ) ) / C( J )
218 TMP = TMP + CABS1( A( I, J ) ) / C( J )
222 TMP = TMP + CABS1( A( J, I ) )
225 TMP = TMP + CABS1( A( I, J ) )
229 ANORM = MAX( ANORM, TMP )
236 TMP = TMP + CABS1( A( I, J ) ) / C( J )
239 TMP = TMP + CABS1( A( J, I ) ) / C( J )
243 TMP = TMP + CABS1( A( I, J ) )
246 TMP = TMP + CABS1( A( J, I ) )
250 ANORM = MAX( ANORM, TMP )
254 * Quick return if possible.
257 CLA_SYRCOND_C = 1.0E+0
259 ELSE IF( ANORM .EQ. 0.0E+0 ) THEN
263 * Estimate the norm of inv(op(A)).
269 CALL CLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
276 WORK( I ) = WORK( I ) * RWORK( I )
280 CALL CSYTRS( 'U', N, 1, AF, LDAF, IPIV,
283 CALL CSYTRS( 'L', N, 1, AF, LDAF, IPIV,
287 * Multiply by inv(C).
291 WORK( I ) = WORK( I ) * C( I )
296 * Multiply by inv(C**T).
300 WORK( I ) = WORK( I ) * C( I )
305 CALL CSYTRS( 'U', N, 1, AF, LDAF, IPIV,
308 CALL CSYTRS( 'L', N, 1, AF, LDAF, IPIV,
315 WORK( I ) = WORK( I ) * RWORK( I )
321 * Compute the estimate of the reciprocal condition number.
323 IF( AINVNM .NE. 0.0E+0 )
324 $ CLA_SYRCOND_C = 1.0E+0 / AINVNM