181 SUBROUTINE dporfs( UPLO, N, NRHS, A, LDA, AF, LDAF, B, LDB, X,
182 $ LDX, FERR, BERR, WORK, IWORK, INFO )
190 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
194 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
195 $ berr( * ), ferr( * ), work( * ), x( ldx, * )
202 parameter( itmax = 5 )
203 DOUBLE PRECISION ZERO
204 parameter( zero = 0.0d+0 )
206 parameter( one = 1.0d+0 )
208 parameter( two = 2.0d+0 )
209 DOUBLE PRECISION THREE
210 parameter( three = 3.0d+0 )
214 INTEGER COUNT, I, J, K, KASE, NZ
215 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
228 DOUBLE PRECISION DLAMCH
229 EXTERNAL lsame, dlamch
236 upper = lsame( uplo,
'U' )
237 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
239 ELSE IF( n.LT.0 )
THEN
241 ELSE IF( nrhs.LT.0 )
THEN
243 ELSE IF( lda.LT.max( 1, n ) )
THEN
245 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
247 ELSE IF( ldb.LT.max( 1, n ) )
THEN
249 ELSE IF( ldx.LT.max( 1, n ) )
THEN
253 CALL xerbla(
'DPORFS', -info )
259 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
270 eps = dlamch(
'Epsilon' )
271 safmin = dlamch(
'Safe minimum' )
287 CALL dcopy( n, b( 1, j ), 1, work( n+1 ), 1 )
288 CALL dsymv( uplo, n, -one, a, lda, x( 1, j ), 1, one,
301 work( i ) = abs( b( i, j ) )
309 xk = abs( x( k, j ) )
311 work( i ) = work( i ) + abs( a( i, k ) )*xk
312 s = s + abs( a( i, k ) )*abs( x( i, j ) )
314 work( k ) = work( k ) + abs( a( k, k ) )*xk + s
319 xk = abs( x( k, j ) )
320 work( k ) = work( k ) + abs( a( k, k ) )*xk
322 work( i ) = work( i ) + abs( a( i, k ) )*xk
323 s = s + abs( a( i, k ) )*abs( x( i, j ) )
325 work( k ) = work( k ) + s
330 IF( work( i ).GT.safe2 )
THEN
331 s = max( s, abs( work( n+i ) ) / work( i ) )
333 s = max( s, ( abs( work( n+i ) )+safe1 ) /
334 $ ( work( i )+safe1 ) )
345 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
346 $ count.LE.itmax )
THEN
350 CALL dpotrs( uplo, n, 1, af, ldaf, work( n+1 ), n, info )
351 CALL daxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
380 IF( work( i ).GT.safe2 )
THEN
381 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
383 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
389 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
396 CALL dpotrs( uplo, n, 1, af, ldaf, work( n+1 ), n, info )
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 dpotrs( uplo, n, 1, af, ldaf, work( n+1 ), n, info )
416 lstres = max( lstres, abs( x( i, j ) ) )
419 $ 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 dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine dporfs(uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DPORFS
subroutine dpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
DPOTRS