154 SUBROUTINE zdrvhp( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
155 $ 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, PACKIT,
TYPE, UPLO, XTYPE
189 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
190 $ izero, j, k, k1, kl, ku, lda, mode, n, nb,
191 $ nbmin, nerrs, nfail, nimat, npp, nrun, nt
192 DOUBLE PRECISION AINVNM, ANORM, CNDNUM, RCOND, RCONDC
195 CHARACTER FACTS( NFACT )
196 INTEGER ISEED( 4 ), ISEEDY( 4 )
197 DOUBLE PRECISION RESULT( NTESTS )
200 DOUBLE PRECISION DGET06, ZLANHP
201 EXTERNAL DGET06, ZLANHP
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 facts /
'F',
'N' /
235 iseed( i ) = iseedy( i )
241 $
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 IF( iuplo.EQ.1 )
THEN
289 CALL zlatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
293 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode,
294 $ cndnum, anorm, kl, ku, packit, a, lda, work,
300 CALL alaerh( path,
'ZLATMS', info, 0, uplo, n, n, -1,
301 $ -1, -1, imat, nfail, nerrs, nout )
311 ELSE IF( imat.EQ.4 )
THEN
321 IF( iuplo.EQ.1 )
THEN
322 ioff = ( izero-1 )*izero / 2
323 DO 20 i = 1, izero - 1
333 DO 40 i = 1, izero - 1
344 IF( iuplo.EQ.1 )
THEN
374 IF( iuplo.EQ.1 )
THEN
377 CALL zlaipd( n, a, n, -1 )
380 DO 150 ifact = 1, nfact
384 fact = facts( ifact )
394 ELSE IF( ifact.EQ.1 )
THEN
398 anorm = zlanhp(
'1', uplo, n, a, rwork )
402 CALL zcopy( npp, a, 1, afac, 1 )
403 CALL zhptrf( uplo, n, afac, iwork, info )
407 CALL zcopy( npp, afac, 1, ainv, 1 )
408 CALL zhptri( uplo, n, ainv, iwork, work, info )
409 ainvnm = zlanhp(
'1', uplo, n, ainv, rwork )
413 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
416 rcondc = ( one / anorm ) / ainvnm
423 CALL zlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
424 $ nrhs, a, lda, xact, lda, b, lda, iseed,
430 IF( ifact.EQ.2 )
THEN
431 CALL zcopy( npp, a, 1, afac, 1 )
432 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
437 CALL zhpsv( uplo, n, nrhs, afac, iwork, x, lda,
446 IF( iwork( k ).LT.0 )
THEN
447 IF( iwork( k ).NE.-k )
THEN
451 ELSE IF( iwork( k ).NE.k )
THEN
460 CALL alaerh( path,
'ZHPSV ', info, k, uplo, n,
461 $ n, -1, -1, nrhs, imat, nfail,
464 ELSE IF( info.NE.0 )
THEN
471 CALL zhpt01( uplo, n, a, afac, iwork, ainv, lda,
472 $ rwork, result( 1 ) )
476 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
477 CALL zppt02( uplo, n, nrhs, a, x, lda, work, lda,
478 $ rwork, result( 2 ) )
482 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
490 IF( result( k ).GE.thresh )
THEN
491 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
492 $
CALL aladhd( nout, path )
493 WRITE( nout, fmt = 9999 )
'ZHPSV ', uplo, n,
494 $ imat, k, result( k )
504 IF( ifact.EQ.2 .AND. npp.GT.0 )
505 $
CALL zlaset(
'Full', npp, 1, dcmplx( zero ),
506 $ dcmplx( zero ), afac, npp )
507 CALL zlaset(
'Full', n, nrhs, dcmplx( zero ),
508 $ dcmplx( zero ), x, lda )
514 CALL zhpsvx( fact, uplo, n, nrhs, a, afac, iwork, b,
515 $ lda, x, lda, rcond, rwork,
516 $ rwork( nrhs+1 ), work, rwork( 2*nrhs+1 ),
525 IF( iwork( k ).LT.0 )
THEN
526 IF( iwork( k ).NE.-k )
THEN
530 ELSE IF( iwork( k ).NE.k )
THEN
539 CALL alaerh( path,
'ZHPSVX', info, k, fact // uplo,
540 $ n, n, -1, -1, nrhs, imat, nfail,
546 IF( ifact.GE.2 )
THEN
551 CALL zhpt01( uplo, n, a, afac, iwork, ainv, lda,
552 $ rwork( 2*nrhs+1 ), result( 1 ) )
560 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
561 CALL zppt02( uplo, n, nrhs, a, x, lda, work, lda,
562 $ rwork( 2*nrhs+1 ), result( 2 ) )
566 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
571 CALL zppt05( uplo, n, nrhs, a, b, lda, x, lda,
572 $ xact, lda, rwork, rwork( nrhs+1 ),
581 result( 6 ) = dget06( rcond, rcondc )
587 IF( result( k ).GE.thresh )
THEN
588 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
589 $
CALL aladhd( nout, path )
590 WRITE( nout, fmt = 9998 )
'ZHPSVX', fact, uplo,
591 $ n, imat, k, result( k )
605 CALL alasvm( path, nout, nfail, nrun, nerrs )
607 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
608 $
', test ', i2,
', ratio =', g12.5 )
609 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
610 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )