173 SUBROUTINE ctpt05( UPLO, TRANS, DIAG, N, NRHS, AP, B, LDB, X, LDX,
174 $ XACT, LDXACT, FERR, BERR, RESLTS )
181 CHARACTER DIAG, TRANS, UPLO
182 INTEGER LDB, LDX, LDXACT, N, NRHS
185 REAL BERR( * ), FERR( * ), RESLTS( * )
186 COMPLEX AP( * ), B( LDB, * ), X( LDX, * ),
194 parameter( zero = 0.0e+0, one = 1.0e+0 )
197 LOGICAL NOTRAN, UNIT, UPPER
198 INTEGER I, IFU, IMAX, J, JC, K
199 REAL AXBI, DIFF, EPS, ERRBND, OVFL, TMP, UNFL, XNORM
206 EXTERNAL lsame, icamax, slamch
209 INTRINSIC abs, aimag, max, min, real
215 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
221 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
227 eps = slamch(
'Epsilon' )
228 unfl = slamch(
'Safe minimum' )
230 upper = lsame( uplo,
'U' )
231 notran = lsame( trans,
'N' )
232 unit = lsame( diag,
'U' )
240 imax = icamax( n, x( 1, j ), 1 )
241 xnorm = max( cabs1( x( imax, j ) ), unfl )
244 diff = max( diff, cabs1( x( i, j )-xact( i, j ) ) )
247 IF( xnorm.GT.one )
THEN
249 ELSE IF( diff.LE.ovfl*xnorm )
THEN
257 IF( diff / xnorm.LE.ferr( j ) )
THEN
258 errbnd = max( errbnd, ( diff / xnorm ) / ferr( j ) )
273 tmp = cabs1( b( i, k ) )
275 jc = ( ( i-1 )*i ) / 2
276 IF( .NOT.notran )
THEN
278 tmp = tmp + cabs1( ap( jc+j ) )*cabs1( x( j, k ) )
281 $ tmp = tmp + cabs1( x( i, k ) )
285 tmp = tmp + cabs1( x( i, k ) )
289 tmp = tmp + cabs1( ap( jc ) )*cabs1( x( j, k ) )
297 tmp = tmp + cabs1( ap( jc ) )*cabs1( x( j, k ) )
301 $ tmp = tmp + cabs1( x( i, k ) )
303 jc = ( i-1 )*( n-i ) + ( i*( i+1 ) ) / 2
305 $ tmp = tmp + cabs1( x( i, k ) )
307 tmp = tmp + cabs1( ap( jc+j-i ) )*
315 axbi = min( axbi, tmp )
318 tmp = berr( k ) / ( ( n+1 )*eps+( n+1 )*unfl /
319 $ max( axbi, ( n+1 )*unfl ) )
323 reslts( 2 ) = max( reslts( 2 ), tmp )
subroutine ctpt05(uplo, trans, diag, n, nrhs, ap, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CTPT05