178 SUBROUTINE strrfs( 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 REAL A( LDA, * ), B( LDB, * ), BERR( * ), FERR( * ),
193 $ work( * ), x( ldx, * )
200 PARAMETER ( ZERO = 0.0e+0 )
202 parameter( one = 1.0e+0 )
205 LOGICAL NOTRAN, NOUNIT, UPPER
207 INTEGER I, J, K, KASE, NZ
208 REAL EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
223 EXTERNAL lsame, slamch
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(
'STRRFS', -info )
259 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
276 eps = slamch(
'Epsilon' )
277 safmin = slamch(
'Safe minimum' )
278 safe1 = real( nz )*safmin
288 CALL scopy( n, x( 1, j ), 1, work( n+1 ), 1 )
289 CALL strmv( uplo, trans, diag, n, a, lda, work( n+1 ), 1 )
290 CALL saxpy( 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 ) ) + real( nz )*eps*work( i )
423 work( i ) = abs( work( n+i ) ) + real( nz )*eps*work( i )
430 CALL slacn2( n, work( 2*n+1 ), work( n+1 ), iwork,
438 CALL strsv( uplo, transt, diag, n, a, lda,
442 work( n+i ) = work( i )*work( n+i )
449 work( n+i ) = work( i )*work( n+i )
451 CALL strsv( uplo, trans, diag, n, a, lda, work( n+1 ),
461 lstres = max( lstres, abs( x( i, j ) ) )
464 $ ferr( j ) = ferr( j ) / lstres
subroutine strrfs(uplo, trans, diag, n, nrhs, a, lda, b, ldb, x, ldx, ferr, berr, work, iwork, info)
STRRFS