LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zla_gbrcond_x.f
Go to the documentation of this file.
1*> \brief \b ZLA_GBRCOND_X computes the infinity norm condition number of op(A)*diag(x) for general banded matrices.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZLA_GBRCOND_X + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_gbrcond_x.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_gbrcond_x.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_gbrcond_x.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* DOUBLE PRECISION FUNCTION ZLA_GBRCOND_X( TRANS, N, KL, KU, AB,
20* LDAB, AFB, LDAFB, IPIV,
21* X, INFO, WORK, RWORK )
22*
23* .. Scalar Arguments ..
24* CHARACTER TRANS
25* INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * )
29* COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), WORK( * ),
30* $ X( * )
31* DOUBLE PRECISION RWORK( * )
32*
33*
34*
35*> \par Purpose:
36* =============
37*>
38*> \verbatim
39*>
40*> ZLA_GBRCOND_X Computes the infinity norm condition number of
41*> op(A) * diag(X) where X is a COMPLEX*16 vector.
42*> \endverbatim
43*
44* Arguments:
45* ==========
46*
47*> \param[in] TRANS
48*> \verbatim
49*> TRANS is CHARACTER*1
50*> Specifies the form of the system of equations:
51*> = 'N': A * X = B (No transpose)
52*> = 'T': A**T * X = B (Transpose)
53*> = 'C': A**H * X = B (Conjugate Transpose = Transpose)
54*> \endverbatim
55*>
56*> \param[in] N
57*> \verbatim
58*> N is INTEGER
59*> The number of linear equations, i.e., the order of the
60*> matrix A. N >= 0.
61*> \endverbatim
62*>
63*> \param[in] KL
64*> \verbatim
65*> KL is INTEGER
66*> The number of subdiagonals within the band of A. KL >= 0.
67*> \endverbatim
68*>
69*> \param[in] KU
70*> \verbatim
71*> KU is INTEGER
72*> The number of superdiagonals within the band of A. KU >= 0.
73*> \endverbatim
74*>
75*> \param[in] AB
76*> \verbatim
77*> AB is COMPLEX*16 array, dimension (LDAB,N)
78*> On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
79*> The j-th column of A is stored in the j-th column of the
80*> array AB as follows:
81*> AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
82*> \endverbatim
83*>
84*> \param[in] LDAB
85*> \verbatim
86*> LDAB is INTEGER
87*> The leading dimension of the array AB. LDAB >= KL+KU+1.
88*> \endverbatim
89*>
90*> \param[in] AFB
91*> \verbatim
92*> AFB is COMPLEX*16 array, dimension (LDAFB,N)
93*> Details of the LU factorization of the band matrix A, as
94*> computed by ZGBTRF. U is stored as an upper triangular
95*> band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
96*> and the multipliers used during the factorization are stored
97*> in rows KL+KU+2 to 2*KL+KU+1.
98*> \endverbatim
99*>
100*> \param[in] LDAFB
101*> \verbatim
102*> LDAFB is INTEGER
103*> The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.
104*> \endverbatim
105*>
106*> \param[in] IPIV
107*> \verbatim
108*> IPIV is INTEGER array, dimension (N)
109*> The pivot indices from the factorization A = P*L*U
110*> as computed by ZGBTRF; row i of the matrix was interchanged
111*> with row IPIV(i).
112*> \endverbatim
113*>
114*> \param[in] X
115*> \verbatim
116*> X is COMPLEX*16 array, dimension (N)
117*> The vector X in the formula op(A) * diag(X).
118*> \endverbatim
119*>
120*> \param[out] INFO
121*> \verbatim
122*> INFO is INTEGER
123*> = 0: Successful exit.
124*> i > 0: The ith argument is invalid.
125*> \endverbatim
126*>
127*> \param[out] WORK
128*> \verbatim
129*> WORK is COMPLEX*16 array, dimension (2*N).
130*> Workspace.
131*> \endverbatim
132*>
133*> \param[out] RWORK
134*> \verbatim
135*> RWORK is DOUBLE PRECISION array, dimension (N).
136*> Workspace.
137*> \endverbatim
138*
139* Authors:
140* ========
141*
142*> \author Univ. of Tennessee
143*> \author Univ. of California Berkeley
144*> \author Univ. of Colorado Denver
145*> \author NAG Ltd.
146*
147*> \ingroup la_gbrcond
148*
149* =====================================================================
150 DOUBLE PRECISION FUNCTION zla_gbrcond_x( TRANS, N, KL, KU, AB,
151 $ LDAB, AFB, LDAFB, IPIV,
152 $ X, INFO, WORK, RWORK )
153*
154* -- LAPACK computational routine --
155* -- LAPACK is a software package provided by Univ. of Tennessee, --
156* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
157*
158* .. Scalar Arguments ..
159 CHARACTER trans
160 INTEGER n, kl, ku, kd, ke, ldab, ldafb, info
161* ..
162* .. Array Arguments ..
163 INTEGER ipiv( * )
164 COMPLEX*16 ab( ldab, * ), afb( ldafb, * ), work( * ),
165 $ x( * )
166 DOUBLE PRECISION rwork( * )
167*
168*
169* =====================================================================
170*
171* .. Local Scalars ..
172 LOGICAL notrans
173 INTEGER kase, i, j
174 DOUBLE PRECISION ainvnm, anorm, tmp
175 COMPLEX*16 zdum
176* ..
177* .. Local Arrays ..
178 INTEGER isave( 3 )
179* ..
180* .. External Functions ..
181 LOGICAL lsame
182 EXTERNAL lsame
183* ..
184* .. External Subroutines ..
185 EXTERNAL zlacn2, zgbtrs, xerbla
186* ..
187* .. Intrinsic Functions ..
188 INTRINSIC abs, max
189* ..
190* .. Statement Functions ..
191 DOUBLE PRECISION cabs1
192* ..
193* .. Statement Function Definitions ..
194 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
195* ..
196* .. Executable Statements ..
197*
198 zla_gbrcond_x = 0.0d+0
199*
200 info = 0
201 notrans = lsame( trans, 'N' )
202 IF ( .NOT. notrans .AND. .NOT. lsame(trans, 'T') .AND. .NOT.
203 $ lsame( trans, 'C' ) ) THEN
204 info = -1
205 ELSE IF( n.LT.0 ) THEN
206 info = -2
207 ELSE IF( kl.LT.0 .OR. kl.GT.n-1 ) THEN
208 info = -3
209 ELSE IF( ku.LT.0 .OR. ku.GT.n-1 ) THEN
210 info = -4
211 ELSE IF( ldab.LT.kl+ku+1 ) THEN
212 info = -6
213 ELSE IF( ldafb.LT.2*kl+ku+1 ) THEN
214 info = -8
215 END IF
216 IF( info.NE.0 ) THEN
217 CALL xerbla( 'ZLA_GBRCOND_X', -info )
218 RETURN
219 END IF
220*
221* Compute norm of op(A)*op2(C).
222*
223 kd = ku + 1
224 ke = kl + 1
225 anorm = 0.0d+0
226 IF ( notrans ) THEN
227 DO i = 1, n
228 tmp = 0.0d+0
229 DO j = max( i-kl, 1 ), min( i+ku, n )
230 tmp = tmp + cabs1( ab( kd+i-j, j) * x( j ) )
231 END DO
232 rwork( i ) = tmp
233 anorm = max( anorm, tmp )
234 END DO
235 ELSE
236 DO i = 1, n
237 tmp = 0.0d+0
238 DO j = max( i-kl, 1 ), min( i+ku, n )
239 tmp = tmp + cabs1( ab( ke-i+j, i ) * x( j ) )
240 END DO
241 rwork( i ) = tmp
242 anorm = max( anorm, tmp )
243 END DO
244 END IF
245*
246* Quick return if possible.
247*
248 IF( n.EQ.0 ) THEN
249 zla_gbrcond_x = 1.0d+0
250 RETURN
251 ELSE IF( anorm .EQ. 0.0d+0 ) THEN
252 RETURN
253 END IF
254*
255* Estimate the norm of inv(op(A)).
256*
257 ainvnm = 0.0d+0
258*
259 kase = 0
260 10 CONTINUE
261 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
262 IF( kase.NE.0 ) THEN
263 IF( kase.EQ.2 ) THEN
264*
265* Multiply by R.
266*
267 DO i = 1, n
268 work( i ) = work( i ) * rwork( i )
269 END DO
270*
271 IF ( notrans ) THEN
272 CALL zgbtrs( 'No transpose', n, kl, ku, 1, afb, ldafb,
273 $ ipiv, work, n, info )
274 ELSE
275 CALL zgbtrs( 'Conjugate transpose', n, kl, ku, 1, afb,
276 $ ldafb, ipiv, work, n, info )
277 ENDIF
278*
279* Multiply by inv(X).
280*
281 DO i = 1, n
282 work( i ) = work( i ) / x( i )
283 END DO
284 ELSE
285*
286* Multiply by inv(X**H).
287*
288 DO i = 1, n
289 work( i ) = work( i ) / x( i )
290 END DO
291*
292 IF ( notrans ) THEN
293 CALL zgbtrs( 'Conjugate transpose', n, kl, ku, 1, afb,
294 $ ldafb, ipiv, work, n, info )
295 ELSE
296 CALL zgbtrs( 'No transpose', n, kl, ku, 1, afb, ldafb,
297 $ ipiv, work, n, info )
298 END IF
299*
300* Multiply by R.
301*
302 DO i = 1, n
303 work( i ) = work( i ) * rwork( i )
304 END DO
305 END IF
306 GO TO 10
307 END IF
308*
309* Compute the estimate of the reciprocal condition number.
310*
311 IF( ainvnm .NE. 0.0d+0 )
312 $ zla_gbrcond_x = 1.0d+0 / ainvnm
313*
314 RETURN
315*
316* End of ZLA_GBRCOND_X
317*
318 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
ZGBTRS
Definition zgbtrs.f:137
double precision function zla_gbrcond_x(trans, n, kl, ku, ab, ldab, afb, ldafb, ipiv, x, info, work, rwork)
ZLA_GBRCOND_X computes the infinity norm condition number of op(A)*diag(x) for general banded matrice...
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