LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

◆ ztbcon()

subroutine ztbcon ( character norm,
character uplo,
character diag,
integer n,
integer kd,
complex*16, dimension( ldab, * ) ab,
integer ldab,
double precision rcond,
complex*16, dimension( * ) work,
double precision, dimension( * ) rwork,
integer info )

ZTBCON

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

Purpose:
!> !> ZTBCON estimates the reciprocal of the condition number of a !> triangular band matrix A, in either the 1-norm or the infinity-norm. !> !> The norm of A is computed and an estimate is obtained for !> norm(inv(A)), then the reciprocal of the condition number is !> computed as !> RCOND = 1 / ( norm(A) * norm(inv(A)) ). !>
Parameters
[in]NORM
!> NORM is CHARACTER*1 !> Specifies whether the 1-norm condition number or the !> infinity-norm condition number is required: !> = '1' or 'O': 1-norm; !> = 'I': Infinity-norm. !>
[in]UPLO
!> UPLO is CHARACTER*1 !> = 'U': A is upper triangular; !> = 'L': A is lower triangular. !>
[in]DIAG
!> DIAG is CHARACTER*1 !> = 'N': A is non-unit triangular; !> = 'U': A is unit triangular. !>
[in]N
!> N is INTEGER !> The order of the matrix A. N >= 0. !>
[in]KD
!> KD is INTEGER !> The number of superdiagonals or subdiagonals of the !> triangular band matrix A. KD >= 0. !>
[in]AB
!> AB is COMPLEX*16 array, dimension (LDAB,N) !> The upper or lower triangular band matrix A, stored in the !> first kd+1 rows of the array. The j-th column of A is stored !> in the j-th column of the array AB as follows: !> if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; !> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd). !> If DIAG = 'U', the diagonal elements of A are not referenced !> and are assumed to be 1. !>
[in]LDAB
!> LDAB is INTEGER !> The leading dimension of the array AB. LDAB >= KD+1. !>
[out]RCOND
!> RCOND is DOUBLE PRECISION !> The reciprocal of the condition number of the matrix A, !> computed as RCOND = 1/(norm(A) * norm(inv(A))). !>
[out]WORK
!> WORK is COMPLEX*16 array, dimension (2*N) !>
[out]RWORK
!> RWORK is DOUBLE PRECISION array, dimension (N) !>
[out]INFO
!> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value !>
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 139 of file ztbcon.f.

142*
143* -- LAPACK computational routine --
144* -- LAPACK is a software package provided by Univ. of Tennessee, --
145* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
146*
147* .. Scalar Arguments ..
148 CHARACTER DIAG, NORM, UPLO
149 INTEGER INFO, KD, LDAB, N
150 DOUBLE PRECISION RCOND
151* ..
152* .. Array Arguments ..
153 DOUBLE PRECISION RWORK( * )
154 COMPLEX*16 AB( LDAB, * ), WORK( * )
155* ..
156*
157* =====================================================================
158*
159* .. Parameters ..
160 DOUBLE PRECISION ONE, ZERO
161 parameter( one = 1.0d+0, zero = 0.0d+0 )
162* ..
163* .. Local Scalars ..
164 LOGICAL NOUNIT, ONENRM, UPPER
165 CHARACTER NORMIN
166 INTEGER IX, KASE, KASE1
167 DOUBLE PRECISION AINVNM, ANORM, SCALE, SMLNUM, XNORM
168 COMPLEX*16 ZDUM
169* ..
170* .. Local Arrays ..
171 INTEGER ISAVE( 3 )
172* ..
173* .. External Functions ..
174 LOGICAL LSAME
175 INTEGER IZAMAX
176 DOUBLE PRECISION DLAMCH, ZLANTB
177 EXTERNAL lsame, izamax, dlamch, zlantb
178* ..
179* .. External Subroutines ..
180 EXTERNAL xerbla, zdrscl, zlacn2, zlatbs
181* ..
182* .. Intrinsic Functions ..
183 INTRINSIC abs, dble, dimag, max
184* ..
185* .. Statement Functions ..
186 DOUBLE PRECISION CABS1
187* ..
188* .. Statement Function definitions ..
189 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
190* ..
191* .. Executable Statements ..
192*
193* Test the input parameters.
194*
195 info = 0
196 upper = lsame( uplo, 'U' )
197 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
198 nounit = lsame( diag, 'N' )
199*
200 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
201 info = -1
202 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
203 info = -2
204 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
205 info = -3
206 ELSE IF( n.LT.0 ) THEN
207 info = -4
208 ELSE IF( kd.LT.0 ) THEN
209 info = -5
210 ELSE IF( ldab.LT.kd+1 ) THEN
211 info = -7
212 END IF
213 IF( info.NE.0 ) THEN
214 CALL xerbla( 'ZTBCON', -info )
215 RETURN
216 END IF
217*
218* Quick return if possible
219*
220 IF( n.EQ.0 ) THEN
221 rcond = one
222 RETURN
223 END IF
224*
225 rcond = zero
226 smlnum = dlamch( 'Safe minimum' )*dble( max( n, 1 ) )
227*
228* Compute the 1-norm of the triangular matrix A or A**H.
229*
230 anorm = zlantb( norm, uplo, diag, n, kd, ab, ldab, rwork )
231*
232* Continue only if ANORM > 0.
233*
234 IF( anorm.GT.zero ) THEN
235*
236* Estimate the 1-norm of the inverse of A.
237*
238 ainvnm = zero
239 normin = 'N'
240 IF( onenrm ) THEN
241 kase1 = 1
242 ELSE
243 kase1 = 2
244 END IF
245 kase = 0
246 10 CONTINUE
247 CALL zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
248 IF( kase.NE.0 ) THEN
249 IF( kase.EQ.kase1 ) THEN
250*
251* Multiply by inv(A).
252*
253 CALL zlatbs( uplo, 'No transpose', diag, normin, n,
254 $ kd,
255 $ ab, ldab, work, scale, rwork, info )
256 ELSE
257*
258* Multiply by inv(A**H).
259*
260 CALL zlatbs( uplo, 'Conjugate transpose', diag,
261 $ normin,
262 $ n, kd, ab, ldab, work, scale, rwork, info )
263 END IF
264 normin = 'Y'
265*
266* Multiply by 1/SCALE if doing so will not cause overflow.
267*
268 IF( scale.NE.one ) THEN
269 ix = izamax( n, work, 1 )
270 xnorm = cabs1( work( ix ) )
271 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
272 $ GO TO 20
273 CALL zdrscl( n, scale, work, 1 )
274 END IF
275 GO TO 10
276 END IF
277*
278* Compute the estimate of the reciprocal condition number.
279*
280 IF( ainvnm.NE.zero )
281 $ rcond = ( one / anorm ) / ainvnm
282 END IF
283*
284 20 CONTINUE
285 RETURN
286*
287* End of ZTBCON
288*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function izamax(n, zx, incx)
IZAMAX
Definition izamax.f:71
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
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function zlantb(norm, uplo, diag, n, k, ab, ldab, work)
ZLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition zlantb.f:139
subroutine zlatbs(uplo, trans, diag, normin, n, kd, ab, ldab, x, scale, cnorm, info)
ZLATBS solves a triangular banded system of equations.
Definition zlatbs.f:242
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zdrscl(n, sa, sx, incx)
ZDRSCL multiplies a vector by the reciprocal of a real scalar.
Definition zdrscl.f:82
Here is the call graph for this function:
Here is the caller graph for this function: