130 SUBROUTINE ztpcon( NORM, UPLO, DIAG, N, AP, RCOND, WORK, RWORK,
139 CHARACTER diag, norm, uplo
141 DOUBLE PRECISION rcond
144 DOUBLE PRECISION rwork( * )
145 COMPLEX*16 ap( * ), work( * )
151 DOUBLE PRECISION one, zero
152 parameter( one = 1.0d+0, zero = 0.0d+0 )
155 LOGICAL nounit, onenrm, upper
157 INTEGER ix, kase, kase1
158 DOUBLE PRECISION ainvnm, anorm, scale, smlnum, xnorm
174 INTRINSIC abs, dble, dimag, max
177 DOUBLE PRECISION cabs1
180 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
187 upper =
lsame( uplo,
'U' )
188 onenrm = norm.EQ.
'1' .OR.
lsame( norm,
'O' )
189 nounit =
lsame( diag,
'N' )
191 IF( .NOT.onenrm .AND. .NOT.
lsame( norm,
'I' ) )
THEN
193 ELSE IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
195 ELSE IF( .NOT.nounit .AND. .NOT.
lsame( diag,
'U' ) )
THEN
197 ELSE IF( n.LT.0 )
THEN
201 CALL
xerbla(
'ZTPCON', -info )
213 smlnum =
dlamch(
'Safe minimum' )*dble( max( 1, n ) )
217 anorm =
zlantp( norm, uplo, diag, n, ap, rwork )
221 IF( anorm.GT.zero )
THEN
234 CALL
zlacn2( n, work( n+1 ), work, ainvnm, kase, isave )
236 IF( kase.EQ.kase1 )
THEN
240 CALL
zlatps( uplo,
'No transpose', diag, normin, n, ap,
241 $ work, scale, rwork, info )
246 CALL
zlatps( uplo,
'Conjugate transpose', diag, normin,
247 $ n, ap, work, scale, rwork, info )
253 IF( scale.NE.one )
THEN
255 xnorm = cabs1( work( ix ) )
256 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
258 CALL
zdrscl( n, scale, work, 1 )
266 $ rcond = ( one / anorm ) / ainvnm