1 *> \brief \b DLA_SYRCOND estimates the Skeel condition number for a symmetric indefinite matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLA_SYRCOND + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dla_syrcond.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dla_syrcond.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dla_syrcond.f">
21 * DOUBLE PRECISION FUNCTION DLA_SYRCOND( UPLO, N, A, LDA, AF, LDAF,
22 * IPIV, CMODE, C, INFO, WORK,
25 * .. Scalar Arguments ..
27 * INTEGER N, LDA, LDAF, INFO, CMODE
30 * INTEGER IWORK( * ), IPIV( * )
31 * DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), WORK( * ), C( * )
40 *> DLA_SYRCOND estimates the Skeel condition number of op(A) * op2(C)
41 *> where op2 is determined by CMODE as follows
42 *> CMODE = 1 op2(C) = C
43 *> CMODE = 0 op2(C) = I
44 *> CMODE = -1 op2(C) = inv(C)
45 *> The Skeel condition number cond(A) = norminf( |inv(A)||A| )
46 *> is computed by computing scaling factors R such that
47 *> diag(R)*A*op2(C) is row equilibrated and computing the standard
48 *> infinity-norm condition number.
56 *> UPLO is CHARACTER*1
57 *> = 'U': Upper triangle of A is stored;
58 *> = 'L': Lower triangle of A is stored.
64 *> The number of linear equations, i.e., the order of the
70 *> A is DOUBLE PRECISION array, dimension (LDA,N)
71 *> On entry, the N-by-N matrix A.
77 *> The leading dimension of the array A. LDA >= max(1,N).
82 *> AF is DOUBLE PRECISION array, dimension (LDAF,N)
83 *> The block diagonal matrix D and the multipliers used to
84 *> obtain the factor U or L as computed by DSYTRF.
90 *> The leading dimension of the array AF. LDAF >= max(1,N).
95 *> IPIV is INTEGER array, dimension (N)
96 *> Details of the interchanges and the block structure of D
97 *> as determined by DSYTRF.
103 *> Determines op2(C) in the formula op(A) * op2(C) as follows:
104 *> CMODE = 1 op2(C) = C
105 *> CMODE = 0 op2(C) = I
106 *> CMODE = -1 op2(C) = inv(C)
111 *> C is DOUBLE PRECISION array, dimension (N)
112 *> The vector C in the formula op(A) * op2(C).
118 *> = 0: Successful exit.
119 *> i > 0: The ith argument is invalid.
124 *> WORK is DOUBLE PRECISION array, dimension (3*N).
130 *> IWORK is INTEGER array, dimension (N).
137 *> \author Univ. of Tennessee
138 *> \author Univ. of California Berkeley
139 *> \author Univ. of Colorado Denver
142 *> \date September 2012
144 *> \ingroup doubleSYcomputational
146 * =====================================================================
147 DOUBLE PRECISION FUNCTION DLA_SYRCOND( UPLO, N, A, LDA, AF, LDAF,
148 $ IPIV, CMODE, C, INFO, WORK,
151 * -- LAPACK computational routine (version 3.4.2) --
152 * -- LAPACK is a software package provided by Univ. of Tennessee, --
153 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
156 * .. Scalar Arguments ..
158 INTEGER N, LDA, LDAF, INFO, CMODE
161 INTEGER IWORK( * ), IPIV( * )
162 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), WORK( * ), C( * )
165 * =====================================================================
167 * .. Local Scalars ..
170 DOUBLE PRECISION AINVNM, SMLNUM, TMP
176 * .. External Functions ..
179 DOUBLE PRECISION DLAMCH
180 EXTERNAL LSAME, IDAMAX, DLAMCH
182 * .. External Subroutines ..
183 EXTERNAL DLACN2, DLATRS, DRSCL, XERBLA, DSYTRS
185 * .. Intrinsic Functions ..
188 * .. Executable Statements ..
195 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
197 ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
201 CALL XERBLA( 'DLA_SYRCOND', -INFO )
209 IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
211 * Compute the equilibration matrix R such that
212 * inv(R)*A*C has unit 1-norm.
217 IF ( CMODE .EQ. 1 ) THEN
219 TMP = TMP + ABS( A( J, I ) * C( J ) )
222 TMP = TMP + ABS( A( I, J ) * C( J ) )
224 ELSE IF ( CMODE .EQ. 0 ) THEN
226 TMP = TMP + ABS( A( J, I ) )
229 TMP = TMP + ABS( A( I, J ) )
233 TMP = TMP + ABS( A( J, I ) / C( J ) )
236 TMP = TMP + ABS( A( I, J ) / C( J ) )
244 IF ( CMODE .EQ. 1 ) THEN
246 TMP = TMP + ABS( A( I, J ) * C( J ) )
249 TMP = TMP + ABS( A( J, I ) * C( J ) )
251 ELSE IF ( CMODE .EQ. 0 ) THEN
253 TMP = TMP + ABS( A( I, J ) )
256 TMP = TMP + ABS( A( J, I ) )
260 TMP = TMP + ABS( A( I, J) / C( J ) )
263 TMP = TMP + ABS( A( J, I) / C( J ) )
270 * Estimate the norm of inv(op(A)).
272 SMLNUM = DLAMCH( 'Safe minimum' )
278 CALL DLACN2( N, WORK( N+1 ), WORK, IWORK, AINVNM, KASE, ISAVE )
285 WORK( I ) = WORK( I ) * WORK( 2*N+I )
289 CALL DSYTRS( 'U', N, 1, AF, LDAF, IPIV, WORK, N, INFO )
291 CALL DSYTRS( 'L', N, 1, AF, LDAF, IPIV, WORK, N, INFO )
294 * Multiply by inv(C).
296 IF ( CMODE .EQ. 1 ) THEN
298 WORK( I ) = WORK( I ) / C( I )
300 ELSE IF ( CMODE .EQ. -1 ) THEN
302 WORK( I ) = WORK( I ) * C( I )
307 * Multiply by inv(C**T).
309 IF ( CMODE .EQ. 1 ) THEN
311 WORK( I ) = WORK( I ) / C( I )
313 ELSE IF ( CMODE .EQ. -1 ) THEN
315 WORK( I ) = WORK( I ) * C( I )
320 CALL DSYTRS( 'U', N, 1, AF, LDAF, IPIV, WORK, N, INFO )
322 CALL DSYTRS( 'L', N, 1, AF, LDAF, IPIV, WORK, N, INFO )
328 WORK( I ) = WORK( I ) * WORK( 2*N+I )
335 * Compute the estimate of the reciprocal condition number.
337 IF( AINVNM .NE. 0.0D+0 )
338 $ DLA_SYRCOND = ( 1.0D+0 / AINVNM )