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

◆ cla_gbrcond_x()

real function cla_gbrcond_x ( character trans,
integer n,
integer kl,
integer ku,
complex, dimension( ldab, * ) ab,
integer ldab,
complex, dimension( ldafb, * ) afb,
integer ldafb,
integer, dimension( * ) ipiv,
complex, dimension( * ) x,
integer info,
complex, dimension( * ) work,
real, dimension( * ) rwork )

CLA_GBRCOND_X computes the infinity norm condition number of op(A)*diag(x) for general banded matrices.

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

Purpose:
!>
!>    CLA_GBRCOND_X Computes the infinity norm condition number of
!>    op(A) * diag(X) where X is a COMPLEX 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]X
!>          X is COMPLEX array, dimension (N)
!>     The vector X in the formula op(A) * diag(X).
!> 
[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 149 of file cla_gbrcond_x.f.

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