 LAPACK  3.9.1 LAPACK: Linear Algebra PACKage

## ◆ cla_gbrcond_c()

 real function cla_gbrcond_c ( character TRANS, integer N, integer KL, integer KU, complex, dimension( ldab, * ) AB, integer LDAB, complex, dimension( ldafb, * ) AFB, integer LDAFB, integer, dimension( * ) IPIV, real, dimension( * ) C, logical CAPPLY, integer INFO, complex, dimension( * ) WORK, real, dimension( * ) RWORK )

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

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

Purpose:
```    CLA_GBRCOND_C Computes the infinity norm condition number of
op(A) * inv(diag(C)) where C is a REAL 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 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 array, dimension (LDAFB,N) Details of the LU factorization of the band matrix A, as computed by CGBTRF. 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 CGBTRF; row i of the matrix was interchanged with row IPIV(i).``` [in] C ``` C is REAL 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 array, dimension (2*N). Workspace.``` [out] RWORK ``` RWORK is REAL array, dimension (N). Workspace.```

Definition at line 158 of file cla_gbrcond_c.f.

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