161 SUBROUTINE sptrfs( N, NRHS, D, E, DF, EF, B, LDB, X, LDX, FERR,
169 INTEGER INFO, LDB, LDX, N, NRHS
172 REAL B( LDB, * ), BERR( * ), D( * ), DF( * ),
173 $ e( * ), ef( * ), ferr( * ), work( * ),
181 parameter( itmax = 5 )
183 parameter( zero = 0.0e+0 )
185 parameter( one = 1.0e+0 )
187 parameter( two = 2.0e+0 )
189 parameter( three = 3.0e+0 )
192 INTEGER COUNT, I, IX, J, NZ
193 REAL BI, CX, DX, EPS, EX, LSTRES, S, SAFE1, SAFE2,
205 EXTERNAL isamax, slamch
214 ELSE IF( nrhs.LT.0 )
THEN
216 ELSE IF( ldb.LT.max( 1, n ) )
THEN
218 ELSE IF( ldx.LT.max( 1, n ) )
THEN
222 CALL xerbla(
'SPTRFS', -info )
228 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
239 eps = slamch(
'Epsilon' )
240 safmin = slamch(
'Safe minimum' )
259 dx = d( 1 )*x( 1, j )
260 work( n+1 ) = bi - dx
261 work( 1 ) = abs( bi ) + abs( dx )
264 dx = d( 1 )*x( 1, j )
265 ex = e( 1 )*x( 2, j )
266 work( n+1 ) = bi - dx - ex
267 work( 1 ) = abs( bi ) + abs( dx ) + abs( ex )
270 cx = e( i-1 )*x( i-1, j )
271 dx = d( i )*x( i, j )
272 ex = e( i )*x( i+1, j )
273 work( n+i ) = bi - cx - dx - ex
274 work( i ) = abs( bi ) + abs( cx ) + abs( dx ) + abs( ex )
277 cx = e( n-1 )*x( n-1, j )
278 dx = d( n )*x( n, j )
279 work( n+n ) = bi - cx - dx
280 work( n ) = abs( bi ) + abs( cx ) + abs( dx )
294 IF( work( i ).GT.safe2 )
THEN
295 s = max( s, abs( work( n+i ) ) / work( i ) )
297 s = max( s, ( abs( work( n+i ) )+safe1 ) /
298 $ ( work( i )+safe1 ) )
309 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
310 $ count.LE.itmax )
THEN
314 CALL spttrs( n, 1, df, ef, work( n+1 ), n, info )
315 CALL saxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
340 IF( work( i ).GT.safe2 )
THEN
341 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
343 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
346 ix = isamax( n, work, 1 )
347 ferr( j ) = work( ix )
362 work( i ) = one + work( i-1 )*abs( ef( i-1 ) )
367 work( n ) = work( n ) / df( n )
368 DO 70 i = n - 1, 1, -1
369 work( i ) = work( i ) / df( i ) + work( i+1 )*abs( ef( i ) )
374 ix = isamax( n, work, 1 )
375 ferr( j ) = ferr( j )*abs( work( ix ) )
381 lstres = max( lstres, abs( x( i, j ) ) )
384 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine sptrfs(n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, info)
SPTRFS
subroutine spttrs(n, nrhs, d, e, b, ldb, info)
SPTTRS