182 SUBROUTINE strrfs( UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB, X,
183 $ ldx, ferr, berr, work, iwork, info )
191 CHARACTER DIAG, TRANS, UPLO
192 INTEGER INFO, LDA, LDB, LDX, N, NRHS
196 REAL A( lda, * ), B( ldb, * ), BERR( * ), FERR( * ),
197 $ work( * ), x( ldx, * )
204 parameter ( zero = 0.0e+0 )
206 parameter ( one = 1.0e+0 )
209 LOGICAL NOTRAN, NOUNIT, UPPER
211 INTEGER I, J, K, KASE, NZ
212 REAL EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
226 EXTERNAL lsame, slamch
233 upper = lsame( uplo,
'U' )
234 notran = lsame( trans,
'N' )
235 nounit = lsame( diag,
'N' )
237 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
239 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
240 $ lsame( trans,
'C' ) )
THEN
242 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag,
'U' ) )
THEN
244 ELSE IF( n.LT.0 )
THEN
246 ELSE IF( nrhs.LT.0 )
THEN
248 ELSE IF( lda.LT.max( 1, n ) )
THEN
250 ELSE IF( ldb.LT.max( 1, n ) )
THEN
252 ELSE IF( ldx.LT.max( 1, n ) )
THEN
256 CALL xerbla(
'STRRFS', -info )
262 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
279 eps = slamch(
'Epsilon' )
280 safmin = slamch(
'Safe minimum' )
291 CALL scopy( n, x( 1, j ), 1, work( n+1 ), 1 )
292 CALL strmv( uplo, trans, diag, n, a, lda, work( n+1 ), 1 )
293 CALL saxpy( n, -one, b( 1, j ), 1, work( n+1 ), 1 )
305 work( i ) = abs( b( i, j ) )
315 xk = abs( x( k, j ) )
317 work( i ) = work( i ) + abs( a( i, k ) )*xk
322 xk = abs( x( k, j ) )
324 work( i ) = work( i ) + abs( a( i, k ) )*xk
326 work( k ) = work( k ) + xk
332 xk = abs( x( k, j ) )
334 work( i ) = work( i ) + abs( a( i, k ) )*xk
339 xk = abs( x( k, j ) )
341 work( i ) = work( i ) + abs( a( i, k ) )*xk
343 work( k ) = work( k ) + xk
356 s = s + abs( a( i, k ) )*abs( x( i, j ) )
358 work( k ) = work( k ) + s
364 s = s + abs( a( i, k ) )*abs( x( i, j ) )
366 work( k ) = work( k ) + s
374 s = s + abs( a( i, k ) )*abs( x( i, j ) )
376 work( k ) = work( k ) + s
382 s = s + abs( a( i, k ) )*abs( x( i, j ) )
384 work( k ) = work( k ) + s
391 IF( work( i ).GT.safe2 )
THEN
392 s = max( s, abs( work( n+i ) ) / work( i ) )
394 s = max( s, ( abs( work( n+i ) )+safe1 ) /
395 $ ( work( i )+safe1 ) )
423 IF( work( i ).GT.safe2 )
THEN
424 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
426 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
432 CALL slacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
439 CALL strsv( uplo, transt, diag, n, a, lda, work( n+1 ),
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 xerbla(SRNAME, INFO)
XERBLA
subroutine strrfs(UPLO, TRANS, DIAG, N, NRHS, A, LDA, B, LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO)
STRRFS
subroutine strmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
STRMV
subroutine slacn2(N, V, X, ISGN, EST, KASE, ISAVE)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine strsv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
STRSV
subroutine saxpy(N, SA, SX, INCX, SY, INCY)
SAXPY
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY