LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
zla_porcond_x.f
Go to the documentation of this file.
1*> \brief \b ZLA_PORCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian positive-definite matrices.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZLA_PORCOND_X + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_porcond_x.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_porcond_x.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_porcond_x.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* DOUBLE PRECISION FUNCTION ZLA_PORCOND_X( UPLO, N, A, LDA, AF,
20* LDAF, X, INFO, WORK,
21* RWORK )
22*
23* .. Scalar Arguments ..
24* CHARACTER UPLO
25* INTEGER N, LDA, LDAF, INFO
26* ..
27* .. Array Arguments ..
28* COMPLEX*16 A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
29* DOUBLE PRECISION RWORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> ZLA_PORCOND_X Computes the infinity norm condition number of
39*> op(A) * diag(X) where X is a COMPLEX*16 vector.
40*> \endverbatim
41*
42* Arguments:
43* ==========
44*
45*> \param[in] UPLO
46*> \verbatim
47*> UPLO is CHARACTER*1
48*> = 'U': Upper triangle of A is stored;
49*> = 'L': Lower triangle of A is stored.
50*> \endverbatim
51*>
52*> \param[in] N
53*> \verbatim
54*> N is INTEGER
55*> The number of linear equations, i.e., the order of the
56*> matrix A. N >= 0.
57*> \endverbatim
58*>
59*> \param[in] A
60*> \verbatim
61*> A is COMPLEX*16 array, dimension (LDA,N)
62*> On entry, the N-by-N matrix A.
63*> \endverbatim
64*>
65*> \param[in] LDA
66*> \verbatim
67*> LDA is INTEGER
68*> The leading dimension of the array A. LDA >= max(1,N).
69*> \endverbatim
70*>
71*> \param[in] AF
72*> \verbatim
73*> AF is COMPLEX*16 array, dimension (LDAF,N)
74*> The triangular factor U or L from the Cholesky factorization
75*> A = U**H*U or A = L*L**H, as computed by ZPOTRF.
76*> \endverbatim
77*>
78*> \param[in] LDAF
79*> \verbatim
80*> LDAF is INTEGER
81*> The leading dimension of the array AF. LDAF >= max(1,N).
82*> \endverbatim
83*>
84*> \param[in] X
85*> \verbatim
86*> X is COMPLEX*16 array, dimension (N)
87*> The vector X in the formula op(A) * diag(X).
88*> \endverbatim
89*>
90*> \param[out] INFO
91*> \verbatim
92*> INFO is INTEGER
93*> = 0: Successful exit.
94*> i > 0: The ith argument is invalid.
95*> \endverbatim
96*>
97*> \param[out] WORK
98*> \verbatim
99*> WORK is COMPLEX*16 array, dimension (2*N).
100*> Workspace.
101*> \endverbatim
102*>
103*> \param[out] RWORK
104*> \verbatim
105*> RWORK is DOUBLE PRECISION array, dimension (N).
106*> Workspace.
107*> \endverbatim
108*
109* Authors:
110* ========
111*
112*> \author Univ. of Tennessee
113*> \author Univ. of California Berkeley
114*> \author Univ. of Colorado Denver
115*> \author NAG Ltd.
116*
117*> \ingroup la_porcond
118*
119* =====================================================================
120 DOUBLE PRECISION FUNCTION zla_porcond_x( UPLO, N, A, LDA, AF,
121 $ LDAF, X, INFO, WORK,
122 $ RWORK )
123*
124* -- LAPACK computational routine --
125* -- LAPACK is a software package provided by Univ. of Tennessee, --
126* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
127*
128* .. Scalar Arguments ..
129 CHARACTER uplo
130 INTEGER n, lda, ldaf, info
131* ..
132* .. Array Arguments ..
133 COMPLEX*16 a( lda, * ), af( ldaf, * ), work( * ), x( * )
134 DOUBLE PRECISION rwork( * )
135* ..
136*
137* =====================================================================
138*
139* .. Local Scalars ..
140 INTEGER kase, i, j
141 DOUBLE PRECISION ainvnm, anorm, tmp
142 LOGICAL up, upper
143 COMPLEX*16 zdum
144* ..
145* .. Local Arrays ..
146 INTEGER isave( 3 )
147* ..
148* .. External Functions ..
149 LOGICAL lsame
150 EXTERNAL lsame
151* ..
152* .. External Subroutines ..
153 EXTERNAL zlacn2, zpotrs, xerbla
154* ..
155* .. Intrinsic Functions ..
156 INTRINSIC abs, max, real, dimag
157* ..
158* .. Statement Functions ..
159 DOUBLE PRECISION cabs1
160* ..
161* .. Statement Function Definitions ..
162 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
163* ..
164* .. Executable Statements ..
165*
166 zla_porcond_x = 0.0d+0
167*
168 info = 0
169 upper = lsame( uplo, 'U' )
170 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
171 info = -1
172 ELSE IF ( n.LT.0 ) THEN
173 info = -2
174 ELSE IF( lda.LT.max( 1, n ) ) THEN
175 info = -4
176 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
177 info = -6
178 END IF
179 IF( info.NE.0 ) THEN
180 CALL xerbla( 'ZLA_PORCOND_X', -info )
181 RETURN
182 END IF
183 up = .false.
184 IF ( lsame( uplo, 'U' ) ) up = .true.
185*
186* Compute norm of op(A)*op2(C).
187*
188 anorm = 0.0d+0
189 IF ( up ) THEN
190 DO i = 1, n
191 tmp = 0.0d+0
192 DO j = 1, i
193 tmp = tmp + cabs1( a( j, i ) * x( j ) )
194 END DO
195 DO j = i+1, n
196 tmp = tmp + cabs1( a( i, j ) * x( j ) )
197 END DO
198 rwork( i ) = tmp
199 anorm = max( anorm, tmp )
200 END DO
201 ELSE
202 DO i = 1, n
203 tmp = 0.0d+0
204 DO j = 1, i
205 tmp = tmp + cabs1( a( i, j ) * x( j ) )
206 END DO
207 DO j = i+1, n
208 tmp = tmp + cabs1( a( j, i ) * x( j ) )
209 END DO
210 rwork( i ) = tmp
211 anorm = max( anorm, tmp )
212 END DO
213 END IF
214*
215* Quick return if possible.
216*
217 IF( n.EQ.0 ) THEN
218 zla_porcond_x = 1.0d+0
219 RETURN
220 ELSE IF( anorm .EQ. 0.0d+0 ) THEN
221 RETURN
222 END IF
223*
224* Estimate the norm of inv(op(A)).
225*
226 ainvnm = 0.0d+0
227*
228 kase = 0
229 10 CONTINUE
230 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
231 IF( kase.NE.0 ) THEN
232 IF( kase.EQ.2 ) THEN
233*
234* Multiply by R.
235*
236 DO i = 1, n
237 work( i ) = work( i ) * rwork( i )
238 END DO
239*
240 IF ( up ) THEN
241 CALL zpotrs( 'U', n, 1, af, ldaf,
242 $ work, n, info )
243 ELSE
244 CALL zpotrs( 'L', n, 1, af, ldaf,
245 $ work, n, info )
246 ENDIF
247*
248* Multiply by inv(X).
249*
250 DO i = 1, n
251 work( i ) = work( i ) / x( i )
252 END DO
253 ELSE
254*
255* Multiply by inv(X**H).
256*
257 DO i = 1, n
258 work( i ) = work( i ) / x( i )
259 END DO
260*
261 IF ( up ) THEN
262 CALL zpotrs( 'U', n, 1, af, ldaf,
263 $ work, n, info )
264 ELSE
265 CALL zpotrs( 'L', n, 1, af, ldaf,
266 $ work, n, info )
267 END IF
268*
269* Multiply by R.
270*
271 DO i = 1, n
272 work( i ) = work( i ) * rwork( i )
273 END DO
274 END IF
275 GO TO 10
276 END IF
277*
278* Compute the estimate of the reciprocal condition number.
279*
280 IF( ainvnm .NE. 0.0d+0 )
281 $ zla_porcond_x = 1.0d+0 / ainvnm
282*
283 RETURN
284*
285* End of ZLA_PORCOND_X
286*
287 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
double precision function zla_porcond_x(uplo, n, a, lda, af, ldaf, x, info, work, rwork)
ZLA_PORCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian positive-def...
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition zlacn2.f:131
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
ZPOTRS
Definition zpotrs.f:108