137 SUBROUTINE ctrcon( NORM, UPLO, DIAG, N, A, LDA, RCOND, WORK,
146 CHARACTER diag, norm, uplo
152 COMPLEX a( lda, * ), work( * )
159 parameter( one = 1.0e+0, zero = 0.0e+0 )
162 LOGICAL nounit, onenrm, upper
164 INTEGER ix, kase, kase1
165 REAL ainvnm, anorm, scale, smlnum, xnorm
181 INTRINSIC abs, aimag, max, real
187 cabs1( zdum ) = abs(
REAL( ZDUM ) ) + abs( aimag( zdum ) )
194 upper =
lsame( uplo,
'U' )
195 onenrm = norm.EQ.
'1' .OR.
lsame( norm,
'O' )
196 nounit =
lsame( diag,
'N' )
198 IF( .NOT.onenrm .AND. .NOT.
lsame( norm,
'I' ) )
THEN
200 ELSE IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
202 ELSE IF( .NOT.nounit .AND. .NOT.
lsame( diag,
'U' ) )
THEN
204 ELSE IF( n.LT.0 )
THEN
206 ELSE IF( lda.LT.max( 1, n ) )
THEN
210 CALL
xerbla(
'CTRCON', -info )
222 smlnum =
slamch(
'Safe minimum' )*
REAL( MAX( 1, N ) )
226 anorm =
clantr( norm, uplo, diag, n, n, a, lda, rwork )
230 IF( anorm.GT.zero )
THEN
243 CALL
clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
245 IF( kase.EQ.kase1 )
THEN
249 CALL
clatrs( uplo,
'No transpose', diag, normin, n, a,
250 $ lda, work, scale, rwork, info )
255 CALL
clatrs( uplo,
'Conjugate transpose', diag, normin,
256 $ n, a, lda, work, scale, rwork, info )
262 IF( scale.NE.one )
THEN
264 xnorm = cabs1( work( ix ) )
265 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
267 CALL
csrscl( n, scale, work, 1 )
275 $ rcond = ( one / anorm ) / ainvnm
subroutine xerbla(SRNAME, INFO)
XERBLA
integer function icamax(N, CX, INCX)
ICAMAX
subroutine csrscl(N, SA, SX, INCX)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
logical function lsame(CA, CB)
LSAME
subroutine clatrs(UPLO, TRANS, DIAG, NORMIN, N, A, LDA, X, SCALE, CNORM, INFO)
CLATRS solves a triangular system of equations with the scale factor set to prevent overflow...
real function slamch(CMACH)
SLAMCH
subroutine ctrcon(NORM, UPLO, DIAG, N, A, LDA, RCOND, WORK, RWORK, INFO)
CTRCON
real function clantr(NORM, UPLO, DIAG, M, N, A, LDA, WORK)
CLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix.
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...