174 SUBROUTINE dtpt05( UPLO, TRANS, DIAG, N, NRHS, AP, B, LDB, X, LDX,
175 $ xact, ldxact, ferr, berr, reslts )
183 CHARACTER DIAG, TRANS, UPLO
184 INTEGER LDB, LDX, LDXACT, N, NRHS
187 DOUBLE PRECISION AP( * ), B( ldb, * ), BERR( * ), FERR( * ),
188 $ reslts( * ), x( ldx, * ), xact( ldxact, * )
194 DOUBLE PRECISION ZERO, ONE
195 parameter ( zero = 0.0d+0, one = 1.0d+0 )
198 LOGICAL NOTRAN, UNIT, UPPER
199 INTEGER I, IFU, IMAX, J, JC, K
200 DOUBLE PRECISION AXBI, DIFF, EPS, ERRBND, OVFL, TMP, UNFL, XNORM
205 DOUBLE PRECISION DLAMCH
206 EXTERNAL lsame, idamax, dlamch
209 INTRINSIC abs, max, min
215 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
221 eps = dlamch(
'Epsilon' )
222 unfl = dlamch(
'Safe minimum' )
224 upper = lsame( uplo,
'U' )
225 notran = lsame( trans,
'N' )
226 unit = lsame( diag,
'U' )
234 imax = idamax( n, x( 1, j ), 1 )
235 xnorm = max( abs( x( imax, j ) ), unfl )
238 diff = max( diff, abs( x( i, j )-xact( i, j ) ) )
241 IF( xnorm.GT.one )
THEN
243 ELSE IF( diff.LE.ovfl*xnorm )
THEN
251 IF( diff / xnorm.LE.ferr( j ) )
THEN
252 errbnd = max( errbnd, ( diff / xnorm ) / ferr( j ) )
267 tmp = abs( b( i, k ) )
269 jc = ( ( i-1 )*i ) / 2
270 IF( .NOT.notran )
THEN
272 tmp = tmp + abs( ap( jc+j ) )*abs( x( j, k ) )
275 $ tmp = tmp + abs( x( i, k ) )
279 tmp = tmp + abs( x( i, k ) )
283 tmp = tmp + abs( ap( jc ) )*abs( x( j, k ) )
291 tmp = tmp + abs( ap( jc ) )*abs( x( j, k ) )
295 $ tmp = tmp + abs( x( i, k ) )
297 jc = ( i-1 )*( n-i ) + ( i*( i+1 ) ) / 2
299 $ tmp = tmp + abs( x( i, k ) )
301 tmp = tmp + abs( ap( jc+j-i ) )*abs( x( j, k ) )
308 axbi = min( axbi, tmp )
311 tmp = berr( k ) / ( ( n+1 )*eps+( n+1 )*unfl /
312 $ max( axbi, ( n+1 )*unfl ) )
316 reslts( 2 ) = max( reslts( 2 ), tmp )
subroutine dtpt05(UPLO, TRANS, DIAG, N, NRHS, AP, B, LDB, X, LDX, XACT, LDXACT, FERR, BERR, RESLTS)
DTPT05