169 SUBROUTINE zpprfs( UPLO, N, NRHS, AP, AFP, B, LDB, X, LDX, FERR,
170 $ BERR, WORK, RWORK, INFO )
178 INTEGER INFO, LDB, LDX, N, NRHS
181 DOUBLE PRECISION BERR( * ), FERR( * ), RWORK( * )
182 COMPLEX*16 AFP( * ), AP( * ), B( LDB, * ), WORK( * ),
190 parameter( itmax = 5 )
191 DOUBLE PRECISION ZERO
192 parameter( zero = 0.0d+0 )
194 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
196 parameter( two = 2.0d+0 )
197 DOUBLE PRECISION THREE
198 parameter( three = 3.0d+0 )
202 INTEGER COUNT, I, IK, J, K, KASE, KK, NZ
203 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
213 INTRINSIC abs, dble, dimag, max
217 DOUBLE PRECISION DLAMCH
218 EXTERNAL lsame, dlamch
221 DOUBLE PRECISION CABS1
224 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
231 upper = lsame( uplo,
'U' )
232 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
234 ELSE IF( n.LT.0 )
THEN
236 ELSE IF( nrhs.LT.0 )
THEN
238 ELSE IF( ldb.LT.max( 1, n ) )
THEN
240 ELSE IF( ldx.LT.max( 1, n ) )
THEN
244 CALL xerbla(
'ZPPRFS', -info )
250 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
261 eps = dlamch(
'Epsilon' )
262 safmin = dlamch(
'Safe minimum' )
278 CALL zcopy( n, b( 1, j ), 1, work, 1 )
279 CALL zhpmv( uplo, n, -cone, ap, x( 1, j ), 1, cone, work, 1 )
291 rwork( i ) = cabs1( b( i, j ) )
300 xk = cabs1( x( k, j ) )
303 rwork( i ) = rwork( i ) + cabs1( ap( ik ) )*xk
304 s = s + cabs1( ap( ik ) )*cabs1( x( i, j ) )
307 rwork( k ) = rwork( k ) + abs( dble( ap( kk+k-1 ) ) )*
314 xk = cabs1( x( k, j ) )
315 rwork( k ) = rwork( k ) + abs( dble( ap( kk ) ) )*xk
318 rwork( i ) = rwork( i ) + cabs1( ap( ik ) )*xk
319 s = s + cabs1( ap( ik ) )*cabs1( x( i, j ) )
322 rwork( k ) = rwork( k ) + s
328 IF( rwork( i ).GT.safe2 )
THEN
329 s = max( s, cabs1( work( i ) ) / rwork( i ) )
331 s = max( s, ( cabs1( work( i ) )+safe1 ) /
332 $ ( rwork( i )+safe1 ) )
343 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
344 $ count.LE.itmax )
THEN
348 CALL zpptrs( uplo, n, 1, afp, work, n, info )
349 CALL zaxpy( n, cone, work, 1, x( 1, j ), 1 )
378 IF( rwork( i ).GT.safe2 )
THEN
379 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i )
381 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i ) +
388 CALL zlacn2( n, work( n+1 ), work, ferr( j ), kase, isave )
394 CALL zpptrs( uplo, n, 1, afp, work, n, info )
396 work( i ) = rwork( i )*work( i )
398 ELSE IF( kase.EQ.2 )
THEN
403 work( i ) = rwork( i )*work( i )
405 CALL zpptrs( uplo, n, 1, afp, work, n, info )
414 lstres = max( lstres, cabs1( x( i, j ) ) )
417 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zhpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
ZHPMV
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine zpprfs(uplo, n, nrhs, ap, afp, b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZPPRFS
subroutine zpptrs(uplo, n, nrhs, ap, b, ldb, info)
ZPPTRS