1 *> \brief \b ZLA_HERPVGRW
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLA_HERPVGRW + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_herpvgrw.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_herpvgrw.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_herpvgrw.f">
21 * DOUBLE PRECISION FUNCTION ZLA_HERPVGRW( UPLO, N, INFO, A, LDA, AF,
24 * .. Scalar Arguments ..
26 * INTEGER N, INFO, LDA, LDAF
28 * .. Array Arguments ..
30 * COMPLEX*16 A( LDA, * ), AF( LDAF, * )
31 * DOUBLE PRECISION WORK( * )
41 *> ZLA_HERPVGRW computes the reciprocal pivot growth factor
42 *> norm(A)/norm(U). The "max absolute element" norm is used. If this is
43 *> much less than 1, the stability of the LU factorization of the
44 *> (equilibrated) matrix A could be poor. This also means that the
45 *> solution X, estimated condition numbers, and error bounds could be
54 *> UPLO is CHARACTER*1
55 *> = 'U': Upper triangle of A is stored;
56 *> = 'L': Lower triangle of A is stored.
62 *> The number of linear equations, i.e., the order of the
69 *> The value of INFO returned from ZHETRF, .i.e., the pivot in
70 *> column INFO is exactly 0.
75 *> A is COMPLEX*16 array, dimension (LDA,N)
76 *> On entry, the N-by-N matrix A.
82 *> The leading dimension of the array A. LDA >= max(1,N).
87 *> AF is COMPLEX*16 array, dimension (LDAF,N)
88 *> The block diagonal matrix D and the multipliers used to
89 *> obtain the factor U or L as computed by ZHETRF.
95 *> The leading dimension of the array AF. LDAF >= max(1,N).
100 *> IPIV is INTEGER array, dimension (N)
101 *> Details of the interchanges and the block structure of D
102 *> as determined by ZHETRF.
107 *> WORK is DOUBLE PRECISION array, dimension (2*N)
113 *> \author Univ. of Tennessee
114 *> \author Univ. of California Berkeley
115 *> \author Univ. of Colorado Denver
120 *> \ingroup complex16HEcomputational
122 * =====================================================================
123 DOUBLE PRECISION FUNCTION ZLA_HERPVGRW( UPLO, N, INFO, A, LDA, AF,
126 * -- LAPACK computational routine (version 3.6.1) --
127 * -- LAPACK is a software package provided by Univ. of Tennessee, --
128 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131 * .. Scalar Arguments ..
133 INTEGER N, INFO, LDA, LDAF
135 * .. Array Arguments ..
137 COMPLEX*16 A( LDA, * ), AF( LDAF, * )
138 DOUBLE PRECISION WORK( * )
141 * =====================================================================
143 * .. Local Scalars ..
144 INTEGER NCOLS, I, J, K, KP
145 DOUBLE PRECISION AMAX, UMAX, RPVGRW, TMP
149 * .. External Functions ..
150 EXTERNAL LSAME, ZLASET
152 * .. Intrinsic Functions ..
153 INTRINSIC ABS, REAL, DIMAG, MAX, MIN
155 * .. Statement Functions ..
156 DOUBLE PRECISION CABS1
158 * .. Statement Function Definitions ..
159 CABS1( ZDUM ) = ABS( DBLE ( ZDUM ) ) + ABS( DIMAG ( ZDUM ) )
161 * .. Executable Statements ..
163 UPPER = LSAME( 'Upper', UPLO )
164 IF ( INFO.EQ.0 ) THEN
179 * Find the max magnitude entry of each column of A. Compute the max
180 * for all N columns so we can apply the pivot permutation while
181 * looping below. Assume a full factorization is the common case.
186 WORK( N+I ) = MAX( CABS1( A( I,J ) ), WORK( N+I ) )
187 WORK( N+J ) = MAX( CABS1( A( I,J ) ), WORK( N+J ) )
193 WORK( N+I ) = MAX( CABS1( A( I, J ) ), WORK( N+I ) )
194 WORK( N+J ) = MAX( CABS1( A( I, J ) ), WORK( N+J ) )
199 * Now find the max magnitude entry of each column of U or L. Also
200 * permute the magnitudes of A above so they're in the same order as
203 * The iteration orders and permutations were copied from zsytrs.
204 * Calls to SSWAP would be severe overkill.
208 DO WHILE ( K .LT. NCOLS .AND. K.GT.0 )
209 IF ( IPIV( K ).GT.0 ) THEN
212 IF ( KP .NE. K ) THEN
214 WORK( N+K ) = WORK( N+KP )
218 WORK( K ) = MAX( CABS1( AF( I, K ) ), WORK( K ) )
225 WORK( N+K-1 ) = WORK( N+KP )
228 WORK( K ) = MAX( CABS1( AF( I, K ) ), WORK( K ) )
230 $ MAX( CABS1( AF( I, K-1 ) ), WORK( K-1 ) )
232 WORK( K ) = MAX( CABS1( AF( K, K ) ), WORK( K ) )
237 DO WHILE ( K .LE. N )
238 IF ( IPIV( K ).GT.0 ) THEN
240 IF ( KP .NE. K ) THEN
242 WORK( N+K ) = WORK( N+KP )
249 WORK( N+K ) = WORK( N+KP )
256 DO WHILE ( K .LE. NCOLS )
257 IF ( IPIV( K ).GT.0 ) THEN
260 IF ( KP .NE. K ) THEN
262 WORK( N+K ) = WORK( N+KP )
266 WORK( K ) = MAX( CABS1( AF( I, K ) ), WORK( K ) )
273 WORK( N+K+1 ) = WORK( N+KP )
276 WORK( K ) = MAX( CABS1( AF( I, K ) ), WORK( K ) )
278 $ MAX( CABS1( AF( I, K+1 ) ) , WORK( K+1 ) )
280 WORK(K) = MAX( CABS1( AF( K, K ) ), WORK( K ) )
285 DO WHILE ( K .GE. 1 )
286 IF ( IPIV( K ).GT.0 ) THEN
288 IF ( KP .NE. K ) THEN
290 WORK( N+K ) = WORK( N+KP )
297 WORK( N+K ) = WORK( N+KP )
304 * Compute the *inverse* of the max element growth factor. Dividing
305 * by zero would imply the largest entry of the factor's column is
306 * zero. Than can happen when either the column of A is zero or
307 * massive pivots made the factor underflow to zero. Neither counts
308 * as growth in itself, so simply ignore terms with zero
315 IF ( UMAX /= 0.0D+0 ) THEN
316 RPVGRW = MIN( AMAX / UMAX, RPVGRW )
323 IF ( UMAX /= 0.0D+0 ) THEN
324 RPVGRW = MIN( AMAX / UMAX, RPVGRW )
329 ZLA_HERPVGRW = RPVGRW