189 SUBROUTINE dsyrfs( UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB,
190 $ X, LDX, FERR, BERR, WORK, IWORK, INFO )
198 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
201 INTEGER IPIV( * ), IWORK( * )
202 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
203 $ berr( * ), ferr( * ), work( * ), x( ldx, * )
210 parameter( itmax = 5 )
211 DOUBLE PRECISION ZERO
212 parameter( zero = 0.0d+0 )
214 parameter( one = 1.0d+0 )
216 parameter( two = 2.0d+0 )
217 DOUBLE PRECISION THREE
218 parameter( three = 3.0d+0 )
222 INTEGER COUNT, I, J, K, KASE, NZ
223 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
236 DOUBLE PRECISION DLAMCH
237 EXTERNAL lsame, dlamch
244 upper = lsame( uplo,
'U' )
245 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
247 ELSE IF( n.LT.0 )
THEN
249 ELSE IF( nrhs.LT.0 )
THEN
251 ELSE IF( lda.LT.max( 1, n ) )
THEN
253 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
255 ELSE IF( ldb.LT.max( 1, n ) )
THEN
257 ELSE IF( ldx.LT.max( 1, n ) )
THEN
261 CALL xerbla(
'DSYRFS', -info )
267 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
278 eps = dlamch(
'Epsilon' )
279 safmin = dlamch(
'Safe minimum' )
295 CALL dcopy( n, b( 1, j ), 1, work( n+1 ), 1 )
296 CALL dsymv( uplo, n, -one, a, lda, x( 1, j ), 1, one,
309 work( i ) = abs( b( i, j ) )
317 xk = abs( x( k, j ) )
319 work( i ) = work( i ) + abs( a( i, k ) )*xk
320 s = s + abs( a( i, k ) )*abs( x( i, j ) )
322 work( k ) = work( k ) + abs( a( k, k ) )*xk + s
327 xk = abs( x( k, j ) )
328 work( k ) = work( k ) + abs( a( k, k ) )*xk
330 work( i ) = work( i ) + abs( a( i, k ) )*xk
331 s = s + abs( a( i, k ) )*abs( x( i, j ) )
333 work( k ) = work( k ) + s
338 IF( work( i ).GT.safe2 )
THEN
339 s = max( s, abs( work( n+i ) ) / work( i ) )
341 s = max( s, ( abs( work( n+i ) )+safe1 ) /
342 $ ( work( i )+safe1 ) )
353 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
354 $ count.LE.itmax )
THEN
358 CALL dsytrs( uplo, n, 1, af, ldaf, ipiv, work( n+1 ), n,
360 CALL daxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
389 IF( work( i ).GT.safe2 )
THEN
390 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
392 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
398 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
405 CALL dsytrs( uplo, n, 1, af, ldaf, ipiv, work( n+1 ), n,
408 work( n+i ) = work( i )*work( n+i )
410 ELSE IF( kase.EQ.2 )
THEN
415 work( n+i ) = work( i )*work( n+i )
417 CALL dsytrs( uplo, n, 1, af, ldaf, ipiv, work( n+1 ), n,
427 lstres = max( lstres, abs( x( i, j ) ) )
430 $ 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 dsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
DSYMV
subroutine dsyrfs(uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DSYRFS
subroutine dsytrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
DSYTRS
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...