LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zla_gbrcond_c()

double precision function zla_gbrcond_c ( character  trans,
integer  n,
integer  kl,
integer  ku,
complex*16, dimension( ldab, * )  ab,
integer  ldab,
complex*16, dimension( ldafb, * )  afb,
integer  ldafb,
integer, dimension( * )  ipiv,
double precision, dimension( * )  c,
logical  capply,
integer  info,
complex*16, dimension( * )  work,
double precision, dimension( * )  rwork 
)

ZLA_GBRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general banded matrices.

Download ZLA_GBRCOND_C + dependencies [TGZ] [ZIP] [TXT]

Purpose:
    ZLA_GBRCOND_C Computes the infinity norm condition number of
    op(A) * inv(diag(C)) where C is a DOUBLE PRECISION vector.
Parameters
[in]TRANS
          TRANS is CHARACTER*1
     Specifies the form of the system of equations:
       = 'N':  A * X = B     (No transpose)
       = 'T':  A**T * X = B  (Transpose)
       = 'C':  A**H * X = B  (Conjugate Transpose = Transpose)
[in]N
          N is INTEGER
     The number of linear equations, i.e., the order of the
     matrix A.  N >= 0.
[in]KL
          KL is INTEGER
     The number of subdiagonals within the band of A.  KL >= 0.
[in]KU
          KU is INTEGER
     The number of superdiagonals within the band of A.  KU >= 0.
[in]AB
          AB is COMPLEX*16 array, dimension (LDAB,N)
     On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
     The j-th column of A is stored in the j-th column of the
     array AB as follows:
     AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
[in]LDAB
          LDAB is INTEGER
     The leading dimension of the array AB.  LDAB >= KL+KU+1.
[in]AFB
          AFB is COMPLEX*16 array, dimension (LDAFB,N)
     Details of the LU factorization of the band matrix A, as
     computed by ZGBTRF.  U is stored as an upper triangular
     band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
     and the multipliers used during the factorization are stored
     in rows KL+KU+2 to 2*KL+KU+1.
[in]LDAFB
          LDAFB is INTEGER
     The leading dimension of the array AFB.  LDAFB >= 2*KL+KU+1.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
     The pivot indices from the factorization A = P*L*U
     as computed by ZGBTRF; row i of the matrix was interchanged
     with row IPIV(i).
[in]C
          C is DOUBLE PRECISION array, dimension (N)
     The vector C in the formula op(A) * inv(diag(C)).
[in]CAPPLY
          CAPPLY is LOGICAL
     If .TRUE. then access the vector C in the formula above.
[out]INFO
          INFO is INTEGER
       = 0:  Successful exit.
     i > 0:  The ith argument is invalid.
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*N).
     Workspace.
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension (N).
     Workspace.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 159 of file zla_gbrcond_c.f.

163*
164* -- LAPACK computational routine --
165* -- LAPACK is a software package provided by Univ. of Tennessee, --
166* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
167*
168* .. Scalar Arguments ..
169 CHARACTER TRANS
170 LOGICAL CAPPLY
171 INTEGER N, KL, KU, KD, KE, LDAB, LDAFB, INFO
172* ..
173* .. Array Arguments ..
174 INTEGER IPIV( * )
175 COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), WORK( * )
176 DOUBLE PRECISION C( * ), RWORK( * )
177*
178*
179* =====================================================================
180*
181* .. Local Scalars ..
182 LOGICAL NOTRANS
183 INTEGER KASE, I, J
184 DOUBLE PRECISION AINVNM, ANORM, TMP
185 COMPLEX*16 ZDUM
186* ..
187* .. Local Arrays ..
188 INTEGER ISAVE( 3 )
189* ..
190* .. External Functions ..
191 LOGICAL LSAME
192 EXTERNAL lsame
193* ..
194* .. External Subroutines ..
195 EXTERNAL zlacn2, zgbtrs, xerbla
196* ..
197* .. Intrinsic Functions ..
198 INTRINSIC abs, max
199* ..
200* .. Statement Functions ..
201 DOUBLE PRECISION CABS1
202* ..
203* .. Statement Function Definitions ..
204 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
205* ..
206* .. Executable Statements ..
207 zla_gbrcond_c = 0.0d+0
208*
209 info = 0
210 notrans = lsame( trans, 'N' )
211 IF ( .NOT. notrans .AND. .NOT. lsame( trans, 'T' ) .AND. .NOT.
212 $ lsame( trans, 'C' ) ) THEN
213 info = -1
214 ELSE IF( n.LT.0 ) THEN
215 info = -2
216 ELSE IF( kl.LT.0 .OR. kl.GT.n-1 ) THEN
217 info = -3
218 ELSE IF( ku.LT.0 .OR. ku.GT.n-1 ) THEN
219 info = -4
220 ELSE IF( ldab.LT.kl+ku+1 ) THEN
221 info = -6
222 ELSE IF( ldafb.LT.2*kl+ku+1 ) THEN
223 info = -8
224 END IF
225 IF( info.NE.0 ) THEN
226 CALL xerbla( 'ZLA_GBRCOND_C', -info )
227 RETURN
228 END IF
229*
230* Compute norm of op(A)*op2(C).
231*
232 anorm = 0.0d+0
233 kd = ku + 1
234 ke = kl + 1
235 IF ( notrans ) THEN
236 DO i = 1, n
237 tmp = 0.0d+0
238 IF ( capply ) THEN
239 DO j = max( i-kl, 1 ), min( i+ku, n )
240 tmp = tmp + cabs1( ab( kd+i-j, j ) ) / c( j )
241 END DO
242 ELSE
243 DO j = max( i-kl, 1 ), min( i+ku, n )
244 tmp = tmp + cabs1( ab( kd+i-j, j ) )
245 END DO
246 END IF
247 rwork( i ) = tmp
248 anorm = max( anorm, tmp )
249 END DO
250 ELSE
251 DO i = 1, n
252 tmp = 0.0d+0
253 IF ( capply ) THEN
254 DO j = max( i-kl, 1 ), min( i+ku, n )
255 tmp = tmp + cabs1( ab( ke-i+j, i ) ) / c( j )
256 END DO
257 ELSE
258 DO j = max( i-kl, 1 ), min( i+ku, n )
259 tmp = tmp + cabs1( ab( ke-i+j, i ) )
260 END DO
261 END IF
262 rwork( i ) = tmp
263 anorm = max( anorm, tmp )
264 END DO
265 END IF
266*
267* Quick return if possible.
268*
269 IF( n.EQ.0 ) THEN
270 zla_gbrcond_c = 1.0d+0
271 RETURN
272 ELSE IF( anorm .EQ. 0.0d+0 ) THEN
273 RETURN
274 END IF
275*
276* Estimate the norm of inv(op(A)).
277*
278 ainvnm = 0.0d+0
279*
280 kase = 0
281 10 CONTINUE
282 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
283 IF( kase.NE.0 ) THEN
284 IF( kase.EQ.2 ) THEN
285*
286* Multiply by R.
287*
288 DO i = 1, n
289 work( i ) = work( i ) * rwork( i )
290 END DO
291*
292 IF ( notrans ) THEN
293 CALL zgbtrs( 'No transpose', n, kl, ku, 1, afb, ldafb,
294 $ ipiv, work, n, info )
295 ELSE
296 CALL zgbtrs( 'Conjugate transpose', n, kl, ku, 1, afb,
297 $ ldafb, ipiv, work, n, info )
298 ENDIF
299*
300* Multiply by inv(C).
301*
302 IF ( capply ) THEN
303 DO i = 1, n
304 work( i ) = work( i ) * c( i )
305 END DO
306 END IF
307 ELSE
308*
309* Multiply by inv(C**H).
310*
311 IF ( capply ) THEN
312 DO i = 1, n
313 work( i ) = work( i ) * c( i )
314 END DO
315 END IF
316*
317 IF ( notrans ) THEN
318 CALL zgbtrs( 'Conjugate transpose', n, kl, ku, 1, afb,
319 $ ldafb, ipiv, work, n, info )
320 ELSE
321 CALL zgbtrs( 'No transpose', n, kl, ku, 1, afb, ldafb,
322 $ ipiv, work, n, info )
323 END IF
324*
325* Multiply by R.
326*
327 DO i = 1, n
328 work( i ) = work( i ) * rwork( i )
329 END DO
330 END IF
331 GO TO 10
332 END IF
333*
334* Compute the estimate of the reciprocal condition number.
335*
336 IF( ainvnm .NE. 0.0d+0 )
337 $ zla_gbrcond_c = 1.0d+0 / ainvnm
338*
339 RETURN
340*
341* End of ZLA_GBRCOND_C
342*
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:138
double precision function zla_gbrcond_c(trans, n, kl, ku, ab, ldab, afb, ldafb, ipiv, c, capply, info, work, rwork)
ZLA_GBRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general banded ma...
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:133
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: