180 SUBROUTINE dtrrfs( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB, X,
181 $ LDX, FERR, BERR, WORK, IWORK, INFO )
188 CHARACTER DIAG, TRANS, UPLO
189 INTEGER INFO, LDA, LDB, LDX, N, NRHS
193 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), BERR( * ), FERR( * ),
194 $ work( * ), x( ldx, * )
200 DOUBLE PRECISION ZERO
201 parameter( zero = 0.0d+0 )
203 parameter( one = 1.0d+0 )
206 LOGICAL NOTRAN, NOUNIT, UPPER
208 INTEGER I, J, K, KASE, NZ
209 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
222 DOUBLE PRECISION DLAMCH
223 EXTERNAL lsame, dlamch
230 upper = lsame( uplo,
'U' )
231 notran = lsame( trans,
'N' )
232 nounit = lsame( diag,
'N' )
234 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
236 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
237 $ lsame( trans,
'C' ) )
THEN
239 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag,
'U' ) )
THEN
241 ELSE IF( n.LT.0 )
THEN
243 ELSE IF( nrhs.LT.0 )
THEN
245 ELSE IF( lda.LT.max( 1, n ) )
THEN
247 ELSE IF( ldb.LT.max( 1, n ) )
THEN
249 ELSE IF( ldx.LT.max( 1, n ) )
THEN
253 CALL xerbla(
'DTRRFS', -info )
259 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
276 eps = dlamch(
'Epsilon' )
277 safmin = dlamch(
'Safe minimum' )
288 CALL dcopy( n, x( 1, j ), 1, work( n+1 ), 1 )
289 CALL dtrmv( uplo, trans, diag, n, a, lda, work( n+1 ), 1 )
290 CALL daxpy( n, -one, b( 1, j ), 1, work( n+1 ), 1 )
302 work( i ) = abs( b( i, j ) )
312 xk = abs( x( k, j ) )
314 work( i ) = work( i ) + abs( a( i, k ) )*xk
319 xk = abs( x( k, j ) )
321 work( i ) = work( i ) + abs( a( i, k ) )*xk
323 work( k ) = work( k ) + xk
329 xk = abs( x( k, j ) )
331 work( i ) = work( i ) + abs( a( i, k ) )*xk
336 xk = abs( x( k, j ) )
338 work( i ) = work( i ) + abs( a( i, k ) )*xk
340 work( k ) = work( k ) + xk
353 s = s + abs( a( i, k ) )*abs( x( i, j ) )
355 work( k ) = work( k ) + s
361 s = s + abs( a( i, k ) )*abs( x( i, j ) )
363 work( k ) = work( k ) + s
371 s = s + abs( a( i, k ) )*abs( x( i, j ) )
373 work( k ) = work( k ) + s
379 s = s + abs( a( i, k ) )*abs( x( i, j ) )
381 work( k ) = work( k ) + s
388 IF( work( i ).GT.safe2 )
THEN
389 s = max( s, abs( work( n+i ) ) / work( i ) )
391 s = max( s, ( abs( work( n+i ) )+safe1 ) /
392 $ ( work( i )+safe1 ) )
420 IF( work( i ).GT.safe2 )
THEN
421 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
423 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
429 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
436 CALL dtrsv( uplo, transt, diag, n, a, lda, work( n+1 ),
439 work( n+i ) = work( i )*work( n+i )
446 work( n+i ) = work( i )*work( n+i )
448 CALL dtrsv( uplo, trans, diag, n, a, lda, work( n+1 ),
458 lstres = max( lstres, abs( x( i, j ) ) )
461 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
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 dtrmv(uplo, trans, diag, n, a, lda, x, incx)
DTRMV
subroutine dtrrfs(uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DTRRFS
subroutine dtrsv(uplo, trans, diag, n, a, lda, x, incx)
DTRSV