177 SUBROUTINE dsprfs( UPLO, N, NRHS, AP, AFP, IPIV, B, LDB, X, LDX,
178 $ FERR, BERR, WORK, IWORK, INFO )
186 INTEGER INFO, LDB, LDX, N, NRHS
189 INTEGER IPIV( * ), IWORK( * )
190 DOUBLE PRECISION AFP( * ), AP( * ), B( LDB, * ), BERR( * ),
191 $ ferr( * ), work( * ), x( ldx, * )
198 parameter( itmax = 5 )
199 DOUBLE PRECISION ZERO
200 parameter( zero = 0.0d+0 )
202 parameter( one = 1.0d+0 )
204 parameter( two = 2.0d+0 )
205 DOUBLE PRECISION THREE
206 parameter( three = 3.0d+0 )
210 INTEGER COUNT, I, IK, J, K, KASE, KK, NZ
211 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
224 DOUBLE PRECISION DLAMCH
225 EXTERNAL lsame, dlamch
232 upper = lsame( uplo,
'U' )
233 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
235 ELSE IF( n.LT.0 )
THEN
237 ELSE IF( nrhs.LT.0 )
THEN
239 ELSE IF( ldb.LT.max( 1, n ) )
THEN
241 ELSE IF( ldx.LT.max( 1, n ) )
THEN
245 CALL xerbla(
'DSPRFS', -info )
251 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
262 eps = dlamch(
'Epsilon' )
263 safmin = dlamch(
'Safe minimum' )
279 CALL dcopy( n, b( 1, j ), 1, work( n+1 ), 1 )
280 CALL dspmv( uplo, n, -one, ap, x( 1, j ), 1, one, work( n+1 ),
293 work( i ) = abs( b( i, j ) )
302 xk = abs( x( k, j ) )
305 work( i ) = work( i ) + abs( ap( ik ) )*xk
306 s = s + abs( ap( ik ) )*abs( x( i, j ) )
309 work( k ) = work( k ) + abs( ap( kk+k-1 ) )*xk + s
315 xk = abs( x( k, j ) )
316 work( k ) = work( k ) + abs( ap( kk ) )*xk
319 work( i ) = work( i ) + abs( ap( ik ) )*xk
320 s = s + abs( ap( ik ) )*abs( x( i, j ) )
323 work( k ) = work( k ) + s
329 IF( work( i ).GT.safe2 )
THEN
330 s = max( s, abs( work( n+i ) ) / work( i ) )
332 s = max( s, ( abs( work( n+i ) )+safe1 ) /
333 $ ( work( i )+safe1 ) )
344 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
345 $ count.LE.itmax )
THEN
349 CALL dsptrs( uplo, n, 1, afp, ipiv, work( n+1 ), n, info )
350 CALL daxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
379 IF( work( i ).GT.safe2 )
THEN
380 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
382 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
388 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
395 CALL dsptrs( uplo, n, 1, afp, ipiv, work( n+1 ), n,
398 work( n+i ) = work( i )*work( n+i )
400 ELSE IF( kase.EQ.2 )
THEN
405 work( n+i ) = work( i )*work( n+i )
407 CALL dsptrs( uplo, n, 1, afp, ipiv, work( n+1 ), n,
417 lstres = max( lstres, abs( x( i, j ) ) )
420 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
DSPMV
subroutine dsprfs(uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DSPRFS
subroutine dsptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
DSPTRS
subroutine dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...