1 *> \brief \b DLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLA_SYRPVGRW + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dla_syrpvgrw.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dla_syrpvgrw.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dla_syrpvgrw.f">
21 * DOUBLE PRECISION FUNCTION DLA_SYRPVGRW( UPLO, N, INFO, A, LDA, AF,
24 * .. Scalar Arguments ..
26 * INTEGER N, INFO, LDA, LDAF
28 * .. Array Arguments ..
30 * DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), WORK( * )
40 *> DLA_SYRPVGRW computes the reciprocal pivot growth factor
41 *> norm(A)/norm(U). The "max absolute element" norm is used. If this is
42 *> much less than 1, the stability of the LU factorization of the
43 *> (equilibrated) matrix A could be poor. This also means that the
44 *> solution X, estimated condition numbers, and error bounds could be
53 *> UPLO is CHARACTER*1
54 *> = 'U': Upper triangle of A is stored;
55 *> = 'L': Lower triangle of A is stored.
61 *> The number of linear equations, i.e., the order of the
68 *> The value of INFO returned from DSYTRF, .i.e., the pivot in
69 *> column INFO is exactly 0.
74 *> A is DOUBLE PRECISION array, dimension (LDA,N)
75 *> On entry, the N-by-N matrix A.
81 *> The leading dimension of the array A. LDA >= max(1,N).
86 *> AF is DOUBLE PRECISION array, dimension (LDAF,N)
87 *> The block diagonal matrix D and the multipliers used to
88 *> obtain the factor U or L as computed by DSYTRF.
94 *> The leading dimension of the array AF. LDAF >= max(1,N).
99 *> IPIV is INTEGER array, dimension (N)
100 *> Details of the interchanges and the block structure of D
101 *> as determined by DSYTRF.
106 *> WORK is DOUBLE PRECISION array, dimension (2*N)
112 *> \author Univ. of Tennessee
113 *> \author Univ. of California Berkeley
114 *> \author Univ. of Colorado Denver
117 *> \date September 2012
119 *> \ingroup doubleSYcomputational
121 * =====================================================================
122 DOUBLE PRECISION FUNCTION DLA_SYRPVGRW( UPLO, N, INFO, A, LDA, AF,
125 * -- LAPACK computational routine (version 3.4.2) --
126 * -- LAPACK is a software package provided by Univ. of Tennessee, --
127 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
130 * .. Scalar Arguments ..
132 INTEGER N, INFO, LDA, LDAF
134 * .. Array Arguments ..
136 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), WORK( * )
139 * =====================================================================
141 * .. Local Scalars ..
142 INTEGER NCOLS, I, J, K, KP
143 DOUBLE PRECISION AMAX, UMAX, RPVGRW, TMP
146 * .. Intrinsic Functions ..
147 INTRINSIC ABS, MAX, MIN
149 * .. External Functions ..
153 * .. Executable Statements ..
155 UPPER = LSAME( 'Upper', UPLO )
156 IF ( INFO.EQ.0 ) THEN
171 * Find the max magnitude entry of each column of A. Compute the max
172 * for all N columns so we can apply the pivot permutation while
173 * looping below. Assume a full factorization is the common case.
178 WORK( N+I ) = MAX( ABS( A( I, J ) ), WORK( N+I ) )
179 WORK( N+J ) = MAX( ABS( A( I, J ) ), WORK( N+J ) )
185 WORK( N+I ) = MAX( ABS( A( I, J ) ), WORK( N+I ) )
186 WORK( N+J ) = MAX( ABS( A( I, J ) ), WORK( N+J ) )
191 * Now find the max magnitude entry of each column of U or L. Also
192 * permute the magnitudes of A above so they're in the same order as
195 * The iteration orders and permutations were copied from dsytrs.
196 * Calls to SSWAP would be severe overkill.
200 DO WHILE ( K .LT. NCOLS .AND. K.GT.0 )
201 IF ( IPIV( K ).GT.0 ) THEN
204 IF ( KP .NE. K ) THEN
206 WORK( N+K ) = WORK( N+KP )
210 WORK( K ) = MAX( ABS( AF( I, K ) ), WORK( K ) )
217 WORK( N+K-1 ) = WORK( N+KP )
220 WORK( K ) = MAX( ABS( AF( I, K ) ), WORK( K ) )
221 WORK( K-1 ) = MAX( ABS( AF( I, K-1 ) ), WORK( K-1 ) )
223 WORK( K ) = MAX( ABS( AF( K, K ) ), WORK( K ) )
228 DO WHILE ( K .LE. N )
229 IF ( IPIV( K ).GT.0 ) THEN
231 IF ( KP .NE. K ) THEN
233 WORK( N+K ) = WORK( N+KP )
240 WORK( N+K ) = WORK( N+KP )
247 DO WHILE ( K .LE. NCOLS )
248 IF ( IPIV( K ).GT.0 ) THEN
251 IF ( KP .NE. K ) THEN
253 WORK( N+K ) = WORK( N+KP )
257 WORK( K ) = MAX( ABS( AF( I, K ) ), WORK( K ) )
264 WORK( N+K+1 ) = WORK( N+KP )
267 WORK( K ) = MAX( ABS( AF( I, K ) ), WORK( K ) )
268 WORK( K+1 ) = MAX( ABS( AF(I, K+1 ) ), WORK( K+1 ) )
270 WORK( K ) = MAX( ABS( AF( K, K ) ), WORK( K ) )
275 DO WHILE ( K .GE. 1 )
276 IF ( IPIV( K ).GT.0 ) THEN
278 IF ( KP .NE. K ) THEN
280 WORK( N+K ) = WORK( N+KP )
287 WORK( N+K ) = WORK( N+KP )
294 * Compute the *inverse* of the max element growth factor. Dividing
295 * by zero would imply the largest entry of the factor's column is
296 * zero. Than can happen when either the column of A is zero or
297 * massive pivots made the factor underflow to zero. Neither counts
298 * as growth in itself, so simply ignore terms with zero
305 IF ( UMAX /= 0.0D+0 ) THEN
306 RPVGRW = MIN( AMAX / UMAX, RPVGRW )
313 IF ( UMAX /= 0.0D+0 ) THEN
314 RPVGRW = MIN( AMAX / UMAX, RPVGRW )
319 DLA_SYRPVGRW = RPVGRW