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