143 SUBROUTINE dtbcon( NORM, UPLO, DIAG, N, KD, AB, LDAB, RCOND, WORK,
152 CHARACTER diag, norm, uplo
153 INTEGER info, kd, ldab, n
154 DOUBLE PRECISION rcond
158 DOUBLE PRECISION ab( ldab, * ), work( * )
164 DOUBLE PRECISION one, zero
165 parameter( one = 1.0d+0, zero = 0.0d+0 )
168 LOGICAL nounit, onenrm, upper
170 INTEGER ix, kase, kase1
171 DOUBLE PRECISION ainvnm, anorm, scale, smlnum, xnorm
186 INTRINSIC abs, dble, max
193 upper =
lsame( uplo,
'U' )
194 onenrm = norm.EQ.
'1' .OR.
lsame( norm,
'O' )
195 nounit =
lsame( diag,
'N' )
197 IF( .NOT.onenrm .AND. .NOT.
lsame( norm,
'I' ) )
THEN
199 ELSE IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
201 ELSE IF( .NOT.nounit .AND. .NOT.
lsame( diag,
'U' ) )
THEN
203 ELSE IF( n.LT.0 )
THEN
205 ELSE IF( kd.LT.0 )
THEN
207 ELSE IF( ldab.LT.kd+1 )
THEN
211 CALL
xerbla(
'DTBCON', -info )
223 smlnum =
dlamch(
'Safe minimum' )*dble( max( 1, n ) )
227 anorm =
dlantb( norm, uplo, diag, n, kd, ab, ldab, work )
231 IF( anorm.GT.zero )
THEN
244 CALL
dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
246 IF( kase.EQ.kase1 )
THEN
250 CALL
dlatbs( uplo,
'No transpose', diag, normin, n, kd,
251 $ ab, ldab, work, scale, work( 2*n+1 ), info )
256 CALL
dlatbs( uplo,
'Transpose', diag, normin, n, kd, ab,
257 $ ldab, work, scale, work( 2*n+1 ), info )
263 IF( scale.NE.one )
THEN
265 xnorm = abs( work( ix ) )
266 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
268 CALL
drscl( n, scale, work, 1 )
276 $ rcond = ( one / anorm ) / ainvnm