172 SUBROUTINE zchkhe( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
173 $ thresh, tsterr, nmax, a, afac, ainv, b, x,
174 $ xact, work, rwork, iwork, nout )
183 INTEGER nmax, nn, nnb, nns, nout
184 DOUBLE PRECISION thresh
188 INTEGER iwork( * ), nbval( * ), nsval( * ), nval( * )
189 DOUBLE PRECISION rwork( * )
190 COMPLEX*16 a( * ), afac( * ), ainv( * ), b( * ),
191 $ work( * ), x( * ), xact( * )
197 DOUBLE PRECISION zero
198 parameter( zero = 0.0d+0 )
200 parameter( ntypes = 10 )
202 parameter( ntests = 9 )
205 LOGICAL trfcon, zerot
206 CHARACTER dist, type, uplo, xtype
208 INTEGER i, i1, i2, imat, in, inb, info, ioff, irhs,
209 $ iuplo, izero, j, k, kl, ku, lda, lwork, mode,
210 $ n, nb, nerrs, nfail, nimat, nrhs, nrun, nt
211 DOUBLE PRECISION anorm, cndnum, rcond, rcondc
215 INTEGER iseed( 4 ), iseedy( 4 )
216 DOUBLE PRECISION result( ntests )
237 common / infoc / infot, nunit, ok, lerr
238 common / srnamc / srnamt
241 DATA iseedy / 1988, 1989, 1990, 1991 /
242 DATA uplos /
'U',
'L' /
248 path( 1: 1 ) =
'Zomplex precision'
254 iseed( i ) = iseedy( i )
260 $ CALL
zerrhe( path, nout )
274 DO 170 imat = 1, nimat
278 IF( .NOT.dotype( imat ) )
283 zerot = imat.GE.3 .AND. imat.LE.6
284 IF( zerot .AND. n.LT.imat-2 )
290 uplo = uplos( iuplo )
295 CALL
zlatb4( path, imat, n, n, type, kl, ku, anorm, mode,
299 CALL
zlatms( n, n, dist, iseed, type, rwork, mode,
300 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
306 CALL
alaerh( path,
'ZLATMS', info, 0, uplo, n, n, -1,
307 $ -1, -1, imat, nfail, nerrs, nout )
317 ELSE IF( imat.EQ.4 )
THEN
327 IF( iuplo.EQ.1 )
THEN
328 ioff = ( izero-1 )*lda
329 DO 20 i = 1, izero - 1
339 DO 40 i = 1, izero - 1
350 IF( iuplo.EQ.1 )
THEN
380 CALL
zlaipd( n, a, lda+1, 0 )
391 CALL
zlacpy( uplo, n, n, a, lda, afac, lda )
392 lwork = max( 2, nb )*lda
394 CALL
zhetrf( uplo, n, afac, lda, iwork, ainv, lwork,
403 IF( iwork( k ).LT.0 )
THEN
404 IF( iwork( k ).NE.-k )
THEN
408 ELSE IF( iwork( k ).NE.k )
THEN
417 $ CALL
alaerh( path,
'ZHETRF', info, k, uplo, n, n,
418 $ -1, -1, nb, imat, nfail, nerrs, nout )
428 CALL
zhet01( uplo, n, a, lda, afac, lda, iwork, ainv,
429 $ lda, rwork, result( 1 ) )
435 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
436 CALL
zlacpy( uplo, n, n, afac, lda, ainv, lda )
438 lwork = (n+nb+1)*(nb+3)
439 CALL
zhetri2( uplo, n, ainv, lda, iwork, work,
445 $ CALL
alaerh( path,
'ZHETRI', info, -1, uplo, n,
446 $ n, -1, -1, -1, imat, nfail, nerrs,
449 CALL
zpot03( uplo, n, a, lda, ainv, lda, work, lda,
450 $ rwork, rcondc, result( 2 ) )
458 IF( result( k ).GE.thresh )
THEN
459 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
460 $ CALL
alahd( nout, path )
461 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
488 CALL
zlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
489 $ nrhs, a, lda, xact, lda, b, lda,
491 CALL
zlacpy(
'Full', n, nrhs, b, lda, x, lda )
494 CALL
zhetrs( uplo, n, nrhs, afac, lda, iwork, x,
500 $ CALL
alaerh( path,
'ZHETRS', info, 0, uplo, n,
501 $ n, -1, -1, nrhs, imat, nfail,
504 CALL
zlacpy(
'Full', n, nrhs, b, lda, work, lda )
505 CALL
zpot02( uplo, n, nrhs, a, lda, x, lda, work,
506 $ lda, rwork, result( 3 ) )
512 CALL
zlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
513 $ nrhs, a, lda, xact, lda, b, lda,
515 CALL
zlacpy(
'Full', n, nrhs, b, lda, x, lda )
518 CALL
zhetrs2( uplo, n, nrhs, afac, lda, iwork, x,
524 $ CALL
alaerh( path,
'ZHETRS2', info, 0, uplo, n,
525 $ n, -1, -1, nrhs, imat, nfail,
528 CALL
zlacpy(
'Full', n, nrhs, b, lda, work, lda )
529 CALL
zpot02( uplo, n, nrhs, a, lda, x, lda, work,
530 $ lda, rwork, result( 4 ) )
535 CALL
zget04( n, nrhs, x, lda, xact, lda, rcondc,
542 CALL
zherfs( uplo, n, nrhs, a, lda, afac, lda,
543 $ iwork, b, lda, x, lda, rwork,
544 $ rwork( nrhs+1 ), work,
545 $ rwork( 2*nrhs+1 ), info )
550 $ CALL
alaerh( path,
'ZHERFS', info, 0, uplo, n,
551 $ n, -1, -1, nrhs, imat, nfail,
554 CALL
zget04( n, nrhs, x, lda, xact, lda, rcondc,
556 CALL
zpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
557 $ xact, lda, rwork, rwork( nrhs+1 ),
564 IF( result( k ).GE.thresh )
THEN
565 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
566 $ CALL
alahd( nout, path )
567 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
568 $ imat, k, result( k )
579 anorm =
zlanhe(
'1', uplo, n, a, lda, rwork )
581 CALL
zhecon( uplo, n, afac, lda, iwork, anorm, rcond,
587 $ CALL
alaerh( path,
'ZHECON', info, 0, uplo, n, n,
588 $ -1, -1, -1, imat, nfail, nerrs, nout )
590 result( 9 ) =
dget06( rcond, rcondc )
595 IF( result( 9 ).GE.thresh )
THEN
596 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
597 $ CALL
alahd( nout, path )
598 WRITE( nout, fmt = 9997 )uplo, n, imat, 9,
610 CALL
alasum( path, nout, nfail, nrun, nerrs )
612 9999 format(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
613 $ i2,
', test ', i2,
', ratio =', g12.5 )
614 9998 format(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
615 $ i2,
', test(', i2,
') =', g12.5 )
616 9997 format(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
617 $
', test(', i2,
') =', g12.5 )