133 SUBROUTINE dtrcon( NORM, UPLO, DIAG, N, A, LDA, RCOND, WORK,
141 CHARACTER DIAG, NORM, UPLO
143 DOUBLE PRECISION RCOND
147 DOUBLE PRECISION A( LDA, * ), WORK( * )
153 DOUBLE PRECISION ONE, ZERO
154 parameter( one = 1.0d+0, zero = 0.0d+0 )
157 LOGICAL NOUNIT, ONENRM, UPPER
159 INTEGER IX, KASE, KASE1
160 DOUBLE PRECISION AINVNM, ANORM, SCALE, SMLNUM, XNORM
168 DOUBLE PRECISION DLAMCH, DLANTR
169 EXTERNAL lsame, idamax, dlamch, dlantr
175 INTRINSIC abs, dble, max
182 upper = lsame( uplo,
'U' )
183 onenrm = norm.EQ.
'1' .OR. lsame( norm,
'O' )
184 nounit = lsame( diag,
'N' )
186 IF( .NOT.onenrm .AND. .NOT.lsame( norm,
'I' ) )
THEN
188 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
190 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag,
'U' ) )
THEN
192 ELSE IF( n.LT.0 )
THEN
194 ELSE IF( lda.LT.max( 1, n ) )
THEN
198 CALL xerbla(
'DTRCON', -info )
210 smlnum = dlamch(
'Safe minimum' )*dble( max( 1, n ) )
214 anorm = dlantr( norm, uplo, diag, n, n, a, lda, work )
218 IF( anorm.GT.zero )
THEN
231 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase,
234 IF( kase.EQ.kase1 )
THEN
238 CALL dlatrs( uplo,
'No transpose', diag, normin, n, a,
239 $ lda, work, scale, work( 2*n+1 ), info )
244 CALL dlatrs( uplo,
'Transpose', diag, normin, n, a,
246 $ work, scale, work( 2*n+1 ), info )
252 IF( scale.NE.one )
THEN
253 ix = idamax( n, work, 1 )
254 xnorm = abs( work( ix ) )
255 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
257 CALL drscl( n, scale, work, 1 )
265 $ rcond = ( one / anorm ) / ainvnm
subroutine dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine dlatrs(uplo, trans, diag, normin, n, a, lda, x, scale, cnorm, info)
DLATRS solves a triangular system of equations with the scale factor set to prevent overflow.
subroutine drscl(n, sa, sx, incx)
DRSCL multiplies a vector by the reciprocal of a real scalar.
subroutine dtrcon(norm, uplo, diag, n, a, lda, rcond, work, iwork, info)
DTRCON