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