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

◆ 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.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 156 of file cla_gbrcond_c.f.

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