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