LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dla_porpvgrw.f
Go to the documentation of this file.
1*> \brief \b DLA_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 DLA_PORPVGRW + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dla_porpvgrw.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dla_porpvgrw.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dla_porpvgrw.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* DOUBLE PRECISION FUNCTION DLA_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* DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), WORK( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*>
37*> DLA_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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DPOTRF.
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 DOUBLE PRECISION 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 DOUBLE PRECISION FUNCTION dla_porpvgrw( UPLO, NCOLS, A, LDA,
103 $ AF,
104 $ LDAF, WORK )
105*
106* -- LAPACK computational routine --
107* -- LAPACK is a software package provided by Univ. of Tennessee, --
108* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
109*
110* .. Scalar Arguments ..
111 CHARACTER*1 uplo
112 INTEGER ncols, lda, ldaf
113* ..
114* .. Array Arguments ..
115 DOUBLE PRECISION a( lda, * ), af( ldaf, * ), work( * )
116* ..
117*
118* =====================================================================
119*
120* .. Local Scalars ..
121 INTEGER i, j
122 DOUBLE PRECISION amax, umax, rpvgrw
123 LOGICAL upper
124* ..
125* .. Intrinsic Functions ..
126 INTRINSIC abs, max, min
127* ..
128* .. External Functions ..
129 EXTERNAL lsame
130 LOGICAL lsame
131* ..
132* .. Executable Statements ..
133*
134 upper = lsame( 'Upper', uplo )
135*
136* DPOTRF will have factored only the NCOLSxNCOLS leading submatrix,
137* so we restrict the growth search to that submatrix and use only
138* the first 2*NCOLS workspace entries.
139*
140 rpvgrw = 1.0d+0
141 DO i = 1, 2*ncols
142 work( i ) = 0.0d+0
143 END DO
144*
145* Find the max magnitude entry of each column.
146*
147 IF ( upper ) THEN
148 DO j = 1, ncols
149 DO i = 1, j
150 work( ncols+j ) =
151 $ max( abs( a( i, j ) ), work( ncols+j ) )
152 END DO
153 END DO
154 ELSE
155 DO j = 1, ncols
156 DO i = j, ncols
157 work( ncols+j ) =
158 $ max( abs( a( i, j ) ), work( ncols+j ) )
159 END DO
160 END DO
161 END IF
162*
163* Now find the max magnitude entry of each column of the factor in
164* AF. No pivoting, so no permutations.
165*
166 IF ( lsame( 'Upper', uplo ) ) THEN
167 DO j = 1, ncols
168 DO i = 1, j
169 work( j ) = max( abs( af( i, j ) ), work( j ) )
170 END DO
171 END DO
172 ELSE
173 DO j = 1, ncols
174 DO i = j, ncols
175 work( j ) = max( abs( af( i, j ) ), work( j ) )
176 END DO
177 END DO
178 END IF
179*
180* Compute the *inverse* of the max element growth factor. Dividing
181* by zero would imply the largest entry of the factor's column is
182* zero. Than can happen when either the column of A is zero or
183* massive pivots made the factor underflow to zero. Neither counts
184* as growth in itself, so simply ignore terms with zero
185* denominators.
186*
187 IF ( lsame( 'Upper', uplo ) ) THEN
188 DO i = 1, ncols
189 umax = work( i )
190 amax = work( ncols+i )
191 IF ( umax /= 0.0d+0 ) THEN
192 rpvgrw = min( amax / umax, rpvgrw )
193 END IF
194 END DO
195 ELSE
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 END IF
204
205 dla_porpvgrw = rpvgrw
206*
207* End of DLA_PORPVGRW
208*
209 END
double precision function dla_porpvgrw(uplo, ncols, a, lda, af, ldaf, work)
DLA_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