161 SUBROUTINE dptrfs( N, NRHS, D, E, DF, EF, B, LDB, X, LDX, FERR,
169 INTEGER INFO, LDB, LDX, N, NRHS
172 DOUBLE PRECISION B( LDB, * ), BERR( * ), D( * ), DF( * ),
173 $ e( * ), ef( * ), ferr( * ), work( * ),
181 parameter( itmax = 5 )
182 DOUBLE PRECISION ZERO
183 parameter( zero = 0.0d+0 )
185 parameter( one = 1.0d+0 )
187 parameter( two = 2.0d+0 )
188 DOUBLE PRECISION THREE
189 parameter( three = 3.0d+0 )
192 INTEGER COUNT, I, IX, J, NZ
193 DOUBLE PRECISION BI, CX, DX, EPS, EX, LSTRES, S, SAFE1, SAFE2,
204 DOUBLE PRECISION DLAMCH
205 EXTERNAL idamax, dlamch
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(
'DPTRFS', -info )
228 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
239 eps = dlamch(
'Epsilon' )
240 safmin = dlamch(
'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 dpttrs( n, 1, df, ef, work( n+1 ), n, info )
315 CALL daxpy( 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 = idamax( 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 = idamax( 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 daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dptrfs(n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, info)
DPTRFS
subroutine dpttrs(n, nrhs, d, e, b, ldb, info)
DPTTRS