153 SUBROUTINE zdrvhe( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
154 $ a, afac, ainv, b, x, xact, work, rwork, iwork,
164 INTEGER nmax, nn, nout, nrhs
165 DOUBLE PRECISION thresh
169 INTEGER iwork( * ), nval( * )
170 DOUBLE PRECISION rwork( * )
171 COMPLEX*16 a( * ), afac( * ), ainv( * ), b( * ),
172 $ work( * ), x( * ), xact( * )
178 DOUBLE PRECISION one, zero
179 parameter( one = 1.0d+0, zero = 0.0d+0 )
180 INTEGER ntypes, ntests
181 parameter( ntypes = 10, ntests = 6 )
183 parameter( nfact = 2 )
187 CHARACTER dist, fact, type, uplo, xtype
189 INTEGER i, i1, i2, ifact, imat, in, info, ioff, iuplo,
190 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
191 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt
192 DOUBLE PRECISION ainvnm, anorm, cndnum, rcond, rcondc
195 CHARACTER facts( nfact ), uplos( 2 )
196 INTEGER iseed( 4 ), iseedy( 4 )
197 DOUBLE PRECISION result( ntests )
215 common / infoc / infot, nunit, ok, lerr
216 common / srnamc / srnamt
219 INTRINSIC dcmplx, max, min
222 DATA iseedy / 1988, 1989, 1990, 1991 /
223 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
235 iseed( i ) = iseedy( i )
237 lwork = max( 2*nmax, nmax*nrhs )
242 $ CALL
zerrvx( path, nout )
262 DO 170 imat = 1, nimat
266 IF( .NOT.dotype( imat ) )
271 zerot = imat.GE.3 .AND. imat.LE.6
272 IF( zerot .AND. n.LT.imat-2 )
278 uplo = uplos( iuplo )
283 CALL
zlatb4( path, imat, n, n, type, kl, ku, anorm, mode,
287 CALL
zlatms( n, n, dist, iseed, type, rwork, mode,
288 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
294 CALL
alaerh( path,
'ZLATMS', info, 0, uplo, n, n, -1,
295 $ -1, -1, imat, nfail, nerrs, nout )
305 ELSE IF( imat.EQ.4 )
THEN
315 IF( iuplo.EQ.1 )
THEN
316 ioff = ( izero-1 )*lda
317 DO 20 i = 1, izero - 1
327 DO 40 i = 1, izero - 1
338 IF( iuplo.EQ.1 )
THEN
368 CALL
zlaipd( n, a, lda+1, 0 )
370 DO 150 ifact = 1, nfact
374 fact = facts( ifact )
384 ELSE IF( ifact.EQ.1 )
THEN
388 anorm =
zlanhe(
'1', uplo, n, a, lda, rwork )
392 CALL
zlacpy( uplo, n, n, a, lda, afac, lda )
393 CALL
zhetrf( uplo, n, afac, lda, iwork, work,
398 CALL
zlacpy( uplo, n, n, afac, lda, ainv, lda )
399 lwork = (n+nb+1)*(nb+3)
400 CALL
zhetri2( uplo, n, ainv, lda, iwork, work,
402 ainvnm =
zlanhe(
'1', uplo, n, ainv, lda, rwork )
406 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
409 rcondc = ( one / anorm ) / ainvnm
416 CALL
zlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
417 $ nrhs, a, lda, xact, lda, b, lda, iseed,
423 IF( ifact.EQ.2 )
THEN
424 CALL
zlacpy( uplo, n, n, a, lda, afac, lda )
425 CALL
zlacpy(
'Full', n, nrhs, b, lda, x, lda )
430 CALL
zhesv( uplo, n, nrhs, afac, lda, iwork, x,
431 $ lda, work, lwork, info )
439 IF( iwork( k ).LT.0 )
THEN
440 IF( iwork( k ).NE.-k )
THEN
444 ELSE IF( iwork( k ).NE.k )
THEN
453 CALL
alaerh( path,
'ZHESV ', info, k, uplo, n,
454 $ n, -1, -1, nrhs, imat, nfail,
457 ELSE IF( info.NE.0 )
THEN
464 CALL
zhet01( uplo, n, a, lda, afac, lda, iwork,
465 $ ainv, lda, rwork, result( 1 ) )
469 CALL
zlacpy(
'Full', n, nrhs, b, lda, work, lda )
470 CALL
zpot02( uplo, n, nrhs, a, lda, x, lda, work,
471 $ lda, rwork, result( 2 ) )
475 CALL
zget04( n, nrhs, x, lda, xact, lda, rcondc,
483 IF( result( k ).GE.thresh )
THEN
484 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
485 $ CALL
aladhd( nout, path )
486 WRITE( nout, fmt = 9999 )
'ZHESV ', uplo, n,
487 $ imat, k, result( k )
498 $ CALL
zlaset( uplo, n, n, dcmplx( zero ),
499 $ dcmplx( zero ), afac, lda )
500 CALL
zlaset(
'Full', n, nrhs, dcmplx( zero ),
501 $ dcmplx( zero ), x, lda )
507 CALL
zhesvx( fact, uplo, n, nrhs, a, lda, afac, lda,
508 $ iwork, b, lda, x, lda, rcond, rwork,
509 $ rwork( nrhs+1 ), work, lwork,
510 $ rwork( 2*nrhs+1 ), info )
518 IF( iwork( k ).LT.0 )
THEN
519 IF( iwork( k ).NE.-k )
THEN
523 ELSE IF( iwork( k ).NE.k )
THEN
532 CALL
alaerh( path,
'ZHESVX', info, k, fact // uplo,
533 $ n, n, -1, -1, nrhs, imat, nfail,
539 IF( ifact.GE.2 )
THEN
544 CALL
zhet01( uplo, n, a, lda, afac, lda, iwork,
545 $ ainv, lda, rwork( 2*nrhs+1 ),
554 CALL
zlacpy(
'Full', n, nrhs, b, lda, work, lda )
555 CALL
zpot02( uplo, n, nrhs, a, lda, x, lda, work,
556 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
560 CALL
zget04( n, nrhs, x, lda, xact, lda, rcondc,
565 CALL
zpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
566 $ xact, lda, rwork, rwork( nrhs+1 ),
575 result( 6 ) =
dget06( rcond, rcondc )
581 IF( result( k ).GE.thresh )
THEN
582 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
583 $ CALL
aladhd( nout, path )
584 WRITE( nout, fmt = 9998 )
'ZHESVX', fact, uplo,
585 $ n, imat, k, result( k )
599 CALL
alasvm( path, nout, nfail, nrun, nerrs )
601 9999 format( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
602 $
', test ', i2,
', ratio =', g12.5 )
603 9998 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
604 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )