172 SUBROUTINE ztprfs( UPLO, TRANS, DIAG, N, NRHS, AP, B, LDB, X, LDX,
173 $ FERR, BERR, WORK, RWORK, INFO )
180 CHARACTER DIAG, TRANS, UPLO
181 INTEGER INFO, LDB, LDX, N, NRHS
184 DOUBLE PRECISION BERR( * ), FERR( * ), RWORK( * )
185 COMPLEX*16 AP( * ), B( LDB, * ), WORK( * ), X( LDX, * )
191 DOUBLE PRECISION ZERO
192 parameter( zero = 0.0d+0 )
194 parameter( one = ( 1.0d+0, 0.0d+0 ) )
197 LOGICAL NOTRAN, NOUNIT, UPPER
198 CHARACTER TRANSN, TRANST
199 INTEGER I, J, K, KASE, KC, NZ
200 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
210 INTRINSIC abs, dble, dimag, max
214 DOUBLE PRECISION DLAMCH
215 EXTERNAL lsame, dlamch
218 DOUBLE PRECISION CABS1
221 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
228 upper = lsame( uplo,
'U' )
229 notran = lsame( trans,
'N' )
230 nounit = lsame( diag,
'N' )
232 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
234 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
235 $ lsame( trans,
'C' ) )
THEN
237 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag,
'U' ) )
THEN
239 ELSE IF( n.LT.0 )
THEN
241 ELSE IF( nrhs.LT.0 )
THEN
243 ELSE IF( ldb.LT.max( 1, n ) )
THEN
245 ELSE IF( ldx.LT.max( 1, n ) )
THEN
249 CALL xerbla(
'ZTPRFS', -info )
255 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
274 eps = dlamch(
'Epsilon' )
275 safmin = dlamch(
'Safe minimum' )
286 CALL zcopy( n, x( 1, j ), 1, work, 1 )
287 CALL ztpmv( uplo, trans, diag, n, ap, work, 1 )
288 CALL zaxpy( n, -one, b( 1, j ), 1, work, 1 )
300 rwork( i ) = cabs1( b( i, j ) )
311 xk = cabs1( x( k, j ) )
313 rwork( i ) = rwork( i ) +
314 $ cabs1( ap( kc+i-1 ) )*xk
320 xk = cabs1( x( k, j ) )
322 rwork( i ) = rwork( i ) +
323 $ cabs1( ap( kc+i-1 ) )*xk
325 rwork( k ) = rwork( k ) + xk
333 xk = cabs1( x( k, j ) )
335 rwork( i ) = rwork( i ) +
336 $ cabs1( ap( kc+i-k ) )*xk
342 xk = cabs1( x( k, j ) )
344 rwork( i ) = rwork( i ) +
345 $ cabs1( ap( kc+i-k ) )*xk
347 rwork( k ) = rwork( k ) + xk
362 s = s + cabs1( ap( kc+i-1 ) )*cabs1( x( i, j ) )
364 rwork( k ) = rwork( k ) + s
369 s = cabs1( x( k, j ) )
371 s = s + cabs1( ap( kc+i-1 ) )*cabs1( x( i, j ) )
373 rwork( k ) = rwork( k ) + s
383 s = s + cabs1( ap( kc+i-k ) )*cabs1( x( i, j ) )
385 rwork( k ) = rwork( k ) + s
390 s = cabs1( x( k, j ) )
392 s = s + cabs1( ap( kc+i-k ) )*cabs1( x( i, j ) )
394 rwork( k ) = rwork( k ) + s
402 IF( rwork( i ).GT.safe2 )
THEN
403 s = max( s, cabs1( work( i ) ) / rwork( i ) )
405 s = max( s, ( cabs1( work( i ) )+safe1 ) /
406 $ ( rwork( i )+safe1 ) )
434 IF( rwork( i ).GT.safe2 )
THEN
435 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i )
437 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i ) +
444 CALL zlacn2( n, work( n+1 ), work, ferr( j ), kase, isave )
450 CALL ztpsv( uplo, transt, diag, n, ap, work, 1 )
452 work( i ) = rwork( i )*work( i )
459 work( i ) = rwork( i )*work( i )
461 CALL ztpsv( uplo, transn, diag, n, ap, work, 1 )
470 lstres = max( lstres, cabs1( x( i, j ) ) )
473 $ 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 zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine ztpmv(uplo, trans, diag, n, ap, x, incx)
ZTPMV
subroutine ztprfs(uplo, trans, diag, n, nrhs, ap, b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZTPRFS
subroutine ztpsv(uplo, trans, diag, n, ap, x, incx)
ZTPSV