LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zla_porpvgrw.f
Go to the documentation of this file.
1*> \brief \b ZLA_PORPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric or Hermitian positive-definite matrix.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZLA_PORPVGRW + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_porpvgrw.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_porpvgrw.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_porpvgrw.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* DOUBLE PRECISION FUNCTION ZLA_PORPVGRW( UPLO, NCOLS, A, LDA, AF,
20* LDAF, WORK )
21*
22* .. Scalar Arguments ..
23* CHARACTER*1 UPLO
24* INTEGER NCOLS, LDA, LDAF
25* ..
26* .. Array Arguments ..
27* COMPLEX*16 A( LDA, * ), AF( LDAF, * )
28* DOUBLE PRECISION WORK( * )
29* ..
30*
31*
32*> \par Purpose:
33* =============
34*>
35*> \verbatim
36*>
37*>
38*> ZLA_PORPVGRW computes the reciprocal pivot growth factor
39*> norm(A)/norm(U). The "max absolute element" norm is used. If this is
40*> much less than 1, the stability of the LU factorization of the
41*> (equilibrated) matrix A could be poor. This also means that the
42*> solution X, estimated condition numbers, and error bounds could be
43*> unreliable.
44*> \endverbatim
45*
46* Arguments:
47* ==========
48*
49*> \param[in] UPLO
50*> \verbatim
51*> UPLO is CHARACTER*1
52*> = 'U': Upper triangle of A is stored;
53*> = 'L': Lower triangle of A is stored.
54*> \endverbatim
55*>
56*> \param[in] NCOLS
57*> \verbatim
58*> NCOLS is INTEGER
59*> The number of columns of the matrix A. NCOLS >= 0.
60*> \endverbatim
61*>
62*> \param[in] A
63*> \verbatim
64*> A is COMPLEX*16 array, dimension (LDA,N)
65*> On entry, the N-by-N matrix A.
66*> \endverbatim
67*>
68*> \param[in] LDA
69*> \verbatim
70*> LDA is INTEGER
71*> The leading dimension of the array A. LDA >= max(1,N).
72*> \endverbatim
73*>
74*> \param[in] AF
75*> \verbatim
76*> AF is COMPLEX*16 array, dimension (LDAF,N)
77*> The triangular factor U or L from the Cholesky factorization
78*> A = U**T*U or A = L*L**T, as computed by ZPOTRF.
79*> \endverbatim
80*>
81*> \param[in] LDAF
82*> \verbatim
83*> LDAF is INTEGER
84*> The leading dimension of the array AF. LDAF >= max(1,N).
85*> \endverbatim
86*>
87*> \param[out] WORK
88*> \verbatim
89*> WORK is DOUBLE PRECISION array, dimension (2*N)
90*> \endverbatim
91*
92* Authors:
93* ========
94*
95*> \author Univ. of Tennessee
96*> \author Univ. of California Berkeley
97*> \author Univ. of Colorado Denver
98*> \author NAG Ltd.
99*
100*> \ingroup la_porpvgrw
101*
102* =====================================================================
103 DOUBLE PRECISION FUNCTION zla_porpvgrw( UPLO, NCOLS, A, LDA,
104 $ AF,
105 $ LDAF, WORK )
106*
107* -- LAPACK computational routine --
108* -- LAPACK is a software package provided by Univ. of Tennessee, --
109* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
110*
111* .. Scalar Arguments ..
112 CHARACTER*1 uplo
113 INTEGER ncols, lda, ldaf
114* ..
115* .. Array Arguments ..
116 COMPLEX*16 a( lda, * ), af( ldaf, * )
117 DOUBLE PRECISION work( * )
118* ..
119*
120* =====================================================================
121*
122* .. Local Scalars ..
123 INTEGER i, j
124 DOUBLE PRECISION amax, umax, rpvgrw
125 LOGICAL upper
126 COMPLEX*16 zdum
127* ..
128* .. External Functions ..
129 EXTERNAL lsame
130 LOGICAL lsame
131* ..
132* .. Intrinsic Functions ..
133 INTRINSIC abs, max, min, real, dimag
134* ..
135* .. Statement Functions ..
136 DOUBLE PRECISION cabs1
137* ..
138* .. Statement Function Definitions ..
139 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
140* ..
141* .. Executable Statements ..
142 upper = lsame( 'Upper', uplo )
143*
144* DPOTRF will have factored only the NCOLSxNCOLS leading submatrix,
145* so we restrict the growth search to that submatrix and use only
146* the first 2*NCOLS workspace entries.
147*
148 rpvgrw = 1.0d+0
149 DO i = 1, 2*ncols
150 work( i ) = 0.0d+0
151 END DO
152*
153* Find the max magnitude entry of each column.
154*
155 IF ( upper ) THEN
156 DO j = 1, ncols
157 DO i = 1, j
158 work( ncols+j ) =
159 $ max( cabs1( a( i, j ) ), work( ncols+j ) )
160 END DO
161 END DO
162 ELSE
163 DO j = 1, ncols
164 DO i = j, ncols
165 work( ncols+j ) =
166 $ max( cabs1( a( i, j ) ), work( ncols+j ) )
167 END DO
168 END DO
169 END IF
170*
171* Now find the max magnitude entry of each column of the factor in
172* AF. No pivoting, so no permutations.
173*
174 IF ( lsame( 'Upper', uplo ) ) THEN
175 DO j = 1, ncols
176 DO i = 1, j
177 work( j ) = max( cabs1( af( i, j ) ), work( j ) )
178 END DO
179 END DO
180 ELSE
181 DO j = 1, ncols
182 DO i = j, ncols
183 work( j ) = max( cabs1( af( i, j ) ), work( j ) )
184 END DO
185 END DO
186 END IF
187*
188* Compute the *inverse* of the max element growth factor. Dividing
189* by zero would imply the largest entry of the factor's column is
190* zero. Than can happen when either the column of A is zero or
191* massive pivots made the factor underflow to zero. Neither counts
192* as growth in itself, so simply ignore terms with zero
193* denominators.
194*
195 IF ( lsame( 'Upper', uplo ) ) THEN
196 DO i = 1, ncols
197 umax = work( i )
198 amax = work( ncols+i )
199 IF ( umax /= 0.0d+0 ) THEN
200 rpvgrw = min( amax / umax, rpvgrw )
201 END IF
202 END DO
203 ELSE
204 DO i = 1, ncols
205 umax = work( i )
206 amax = work( ncols+i )
207 IF ( umax /= 0.0d+0 ) THEN
208 rpvgrw = min( amax / umax, rpvgrw )
209 END IF
210 END DO
211 END IF
212
213 zla_porpvgrw = rpvgrw
214*
215* End of ZLA_PORPVGRW
216*
217 END
double precision function zla_porpvgrw(uplo, ncols, a, lda, af, ldaf, work)
ZLA_PORPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric or Hermitian...
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48