167 SUBROUTINE dpprfs( UPLO, N, NRHS, AP, AFP, B, LDB, X, LDX,
169 $ BERR, WORK, IWORK, INFO )
177 INTEGER INFO, LDB, LDX, N, NRHS
181 DOUBLE PRECISION AFP( * ), AP( * ), B( LDB, * ), BERR( * ),
182 $ ferr( * ), work( * ), x( ldx, * )
189 PARAMETER ( ITMAX = 5 )
190 DOUBLE PRECISION ZERO
191 parameter( zero = 0.0d+0 )
193 parameter( one = 1.0d+0 )
195 parameter( two = 2.0d+0 )
196 DOUBLE PRECISION THREE
197 parameter( three = 3.0d+0 )
201 INTEGER COUNT, I, IK, J, K, KASE, KK, NZ
202 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
216 DOUBLE PRECISION DLAMCH
217 EXTERNAL lsame, dlamch
224 upper = lsame( uplo,
'U' )
225 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
227 ELSE IF( n.LT.0 )
THEN
229 ELSE IF( nrhs.LT.0 )
THEN
231 ELSE IF( ldb.LT.max( 1, n ) )
THEN
233 ELSE IF( ldx.LT.max( 1, n ) )
THEN
237 CALL xerbla(
'DPPRFS', -info )
243 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
254 eps = dlamch(
'Epsilon' )
255 safmin = dlamch(
'Safe minimum' )
271 CALL dcopy( n, b( 1, j ), 1, work( n+1 ), 1 )
272 CALL dspmv( uplo, n, -one, ap, x( 1, j ), 1, one,
286 work( i ) = abs( b( i, j ) )
295 xk = abs( x( k, j ) )
298 work( i ) = work( i ) + abs( ap( ik ) )*xk
299 s = s + abs( ap( ik ) )*abs( x( i, j ) )
302 work( k ) = work( k ) + abs( ap( kk+k-1 ) )*xk + s
308 xk = abs( x( k, j ) )
309 work( k ) = work( k ) + abs( ap( kk ) )*xk
312 work( i ) = work( i ) + abs( ap( ik ) )*xk
313 s = s + abs( ap( ik ) )*abs( x( i, j ) )
316 work( k ) = work( k ) + s
322 IF( work( i ).GT.safe2 )
THEN
323 s = max( s, abs( work( n+i ) ) / work( i ) )
325 s = max( s, ( abs( work( n+i ) )+safe1 ) /
326 $ ( work( i )+safe1 ) )
337 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
338 $ count.LE.itmax )
THEN
342 CALL dpptrs( uplo, n, 1, afp, work( n+1 ), n, info )
343 CALL daxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
372 IF( work( i ).GT.safe2 )
THEN
373 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
375 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
381 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork,
389 CALL dpptrs( uplo, n, 1, afp, work( n+1 ), n, info )
391 work( n+i ) = work( i )*work( n+i )
393 ELSE IF( kase.EQ.2 )
THEN
398 work( n+i ) = work( i )*work( n+i )
400 CALL dpptrs( uplo, n, 1, afp, work( n+1 ), n, info )
409 lstres = max( lstres, abs( x( i, j ) ) )
412 $ ferr( j ) = ferr( j ) / lstres
subroutine dpprfs(uplo, n, nrhs, ap, afp, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DPPRFS