178 SUBROUTINE dtrrfs( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB,
180 $ LDX, FERR, BERR, WORK, IWORK, INFO )
187 CHARACTER DIAG, TRANS, UPLO
188 INTEGER INFO, LDA, LDB, LDX, N, NRHS
192 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), BERR( * ), FERR( * ),
193 $ work( * ), x( ldx, * )
199 DOUBLE PRECISION ZERO
200 PARAMETER ( ZERO = 0.0d+0 )
202 parameter( one = 1.0d+0 )
205 LOGICAL NOTRAN, NOUNIT, UPPER
207 INTEGER I, J, K, KASE, NZ
208 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,
437 CALL dtrsv( uplo, transt, diag, n, a, lda,
441 work( n+i ) = work( i )*work( n+i )
448 work( n+i ) = work( i )*work( n+i )
450 CALL dtrsv( uplo, trans, diag, n, a, lda, work( n+1 ),
460 lstres = max( lstres, abs( x( i, j ) ) )
463 $ ferr( j ) = ferr( j ) / lstres
subroutine dtrrfs(uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DTRRFS