145 SUBROUTINE zchkpt( DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR,
146 $ A, D, E, B, X, XACT, WORK, RWORK, NOUT )
154 INTEGER NN, NNS, NOUT
155 DOUBLE PRECISION THRESH
159 INTEGER NSVAL( * ), NVAL( * )
160 DOUBLE PRECISION D( * ), RWORK( * )
161 COMPLEX*16 A( * ), B( * ), E( * ), WORK( * ), X( * ),
168 DOUBLE PRECISION ONE, ZERO
169 parameter( one = 1.0d+0, zero = 0.0d+0 )
171 parameter( ntypes = 12 )
173 parameter( ntests = 7 )
177 CHARACTER DIST,
TYPE, UPLO
179 INTEGER I, IA, IMAT, IN, INFO, IRHS, IUPLO, IX, IZERO,
180 $ j, k, kl, ku, lda, mode, n, nerrs, nfail,
182 DOUBLE PRECISION AINVNM, ANORM, COND, DMAX, RCOND, RCONDC
186 INTEGER ISEED( 4 ), ISEEDY( 4 )
187 DOUBLE PRECISION RESULT( NTESTS )
192 DOUBLE PRECISION DGET06, DZASUM, ZLANHT
193 EXTERNAL idamax, dget06, dzasum, zlanht
202 INTRINSIC abs, dble, max
210 COMMON / infoc / infot, nunit, ok, lerr
211 COMMON / srnamc / srnamt
214 DATA iseedy / 0, 0, 0, 1 / , uplos /
'U',
'L' /
218 path( 1: 1 ) =
'Zomplex precision'
224 iseed( i ) = iseedy( i )
230 $
CALL zerrgt( path, nout )
243 DO 110 imat = 1, nimat
247 IF( n.GT.0 .AND. .NOT.dotype( imat ) )
252 CALL zlatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
255 zerot = imat.GE.8 .AND. imat.LE.10
262 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
263 $ anorm, kl, ku,
'B', a, 2, work, info )
268 CALL alaerh( path,
'ZLATMS', info, 0,
' ', n, n, kl,
269 $ ku, -1, imat, nfail, nerrs, nout )
278 d( i ) = dble( a( ia ) )
283 $ d( n ) = dble( a( ia ) )
289 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
293 CALL dlarnv( 2, iseed, n, d )
294 CALL zlarnv( 2, iseed, n-1, e )
299 d( 1 ) = abs( d( 1 ) )
301 d( 1 ) = abs( d( 1 ) ) + abs( e( 1 ) )
302 d( n ) = abs( d( n ) ) + abs( e( n-1 ) )
304 d( i ) = abs( d( i ) ) + abs( e( i ) ) +
311 ix = idamax( n, d, 1 )
313 CALL dscal( n, anorm / dmax, d, 1 )
314 CALL zdscal( n-1, anorm / dmax, e, 1 )
316 ELSE IF( izero.GT.0 )
THEN
321 IF( izero.EQ.1 )
THEN
322 d( 1 ) = dble( z( 2 ) )
325 ELSE IF( izero.EQ.n )
THEN
327 d( n ) = dble( z( 2 ) )
329 e( izero-1 ) = z( 1 )
330 d( izero ) = dble( z( 2 ) )
347 ELSE IF( imat.EQ.9 )
THEN
355 ELSE IF( imat.EQ.10 )
THEN
357 IF( izero.GT.1 )
THEN
358 z( 1 ) = e( izero-1 )
368 CALL dcopy( n, d, 1, d( n+1 ), 1 )
370 $
CALL zcopy( n-1, e, 1, e( n+1 ), 1 )
376 CALL zpttrf( n, d( n+1 ), e( n+1 ), info )
380 IF( info.NE.izero )
THEN
381 CALL alaerh( path,
'ZPTTRF', info, izero,
' ', n, n, -1,
382 $ -1, -1, imat, nfail, nerrs, nout )
391 CALL zptt01( n, d, e, d( n+1 ), e( n+1 ), work,
396 IF( result( 1 ).GE.thresh )
THEN
397 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
398 $
CALL alahd( nout, path )
399 WRITE( nout, fmt = 9999 )n, imat, 1, result( 1 )
408 anorm = zlanht(
'1', n, d, e )
419 CALL zpttrs(
'Lower', n, 1, d( n+1 ), e( n+1 ), x, lda,
421 ainvnm = max( ainvnm, dzasum( n, x, 1 ) )
423 rcondc = one / max( one, anorm*ainvnm )
432 CALL zlarnv( 2, iseed, n, xact( ix ) )
440 uplo = uplos( iuplo )
444 CALL zlaptm( uplo, n, nrhs, one, d, e, xact, lda,
450 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
451 CALL zpttrs( uplo, n, nrhs, d( n+1 ), e( n+1 ), x,
457 $
CALL alaerh( path,
'ZPTTRS', info, 0, uplo, n, n,
458 $ -1, -1, nrhs, imat, nfail, nerrs,
461 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
462 CALL zptt02( uplo, n, nrhs, d, e, x, lda, work, lda,
468 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
475 CALL zptrfs( uplo, n, nrhs, d, e, d( n+1 ), e( n+1 ),
476 $ b, lda, x, lda, rwork, rwork( nrhs+1 ),
477 $ work, rwork( 2*nrhs+1 ), info )
482 $
CALL alaerh( path,
'ZPTRFS', info, 0, uplo, n, n,
483 $ -1, -1, nrhs, imat, nfail, nerrs,
486 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
488 CALL zptt05( n, nrhs, d, e, b, lda, x, lda, xact, lda,
489 $ rwork, rwork( nrhs+1 ), result( 5 ) )
495 IF( result( k ).GE.thresh )
THEN
496 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
497 $
CALL alahd( nout, path )
498 WRITE( nout, fmt = 9998 )uplo, n, nrhs, imat,
514 CALL zptcon( n, d( n+1 ), e( n+1 ), anorm, rcond, rwork,
520 $
CALL alaerh( path,
'ZPTCON', info, 0,
' ', n, n, -1, -1,
521 $ -1, imat, nfail, nerrs, nout )
523 result( 7 ) = dget06( rcond, rcondc )
527 IF( result( 7 ).GE.thresh )
THEN
528 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
529 $
CALL alahd( nout, path )
530 WRITE( nout, fmt = 9999 )n, imat, 7, result( 7 )
539 CALL alasum( path, nout, nfail, nrun, nerrs )
541 9999
FORMAT(
' N =', i5,
', type ', i2,
', test ', i2,
', ratio = ',
543 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS =', i3,
544 $
', type ', i2,
', test ', i2,
', ratio = ', g12.5 )