150 SUBROUTINE zdrvsy( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
151 $ A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK,
160 INTEGER NMAX, NN, NOUT, NRHS
161 DOUBLE PRECISION THRESH
165 INTEGER IWORK( * ), NVAL( * )
166 DOUBLE PRECISION RWORK( * )
167 COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ),
168 $ work( * ), x( * ), xact( * )
174 DOUBLE PRECISION ONE, ZERO
175 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+0 )
176 INTEGER NTYPES, NTESTS
177 parameter( ntypes = 11, ntests = 6 )
179 parameter( nfact = 2 )
183 CHARACTER DIST, FACT,
TYPE, UPLO, XTYPE
185 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
186 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
187 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt
188 DOUBLE PRECISION AINVNM, ANORM, CNDNUM, RCOND, RCONDC
191 CHARACTER FACTS( NFACT ), UPLOS( 2 )
192 INTEGER ISEED( 4 ), ISEEDY( 4 )
193 DOUBLE PRECISION RESULT( NTESTS )
196 DOUBLE PRECISION DGET06, ZLANSY
197 EXTERNAL DGET06, ZLANSY
211 COMMON / infoc / infot, nunit, ok, lerr
212 COMMON / srnamc / srnamt
215 INTRINSIC dcmplx, max, min
218 DATA iseedy / 1988, 1989, 1990, 1991 /
219 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
225 path( 1: 1 ) =
'Zomplex precision'
231 iseed( i ) = iseedy( i )
233 lwork = max( 2*nmax, nmax*nrhs )
238 $
CALL zerrvx( path, nout )
258 DO 170 imat = 1, nimat
262 IF( .NOT.dotype( imat ) )
267 zerot = imat.GE.3 .AND. imat.LE.6
268 IF( zerot .AND. n.LT.imat-2 )
274 uplo = uplos( iuplo )
276 IF( imat.NE.ntypes )
THEN
281 CALL zlatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
282 $ mode, cndnum, dist )
285 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode,
286 $ cndnum, anorm, kl, ku, uplo, a, lda,
292 CALL alaerh( path,
'ZLATMS', info, 0, uplo, n, n,
293 $ -1, -1, -1, imat, nfail, nerrs, nout )
303 ELSE IF( imat.EQ.4 )
THEN
313 IF( iuplo.EQ.1 )
THEN
314 ioff = ( izero-1 )*lda
315 DO 20 i = 1, izero - 1
325 DO 40 i = 1, izero - 1
335 IF( iuplo.EQ.1 )
THEN
369 CALL zlatsy( uplo, n, a, lda, iseed )
372 DO 150 ifact = 1, nfact
376 fact = facts( ifact )
386 ELSE IF( ifact.EQ.1 )
THEN
390 anorm = zlansy(
'1', uplo, n, a, lda, rwork )
394 CALL zlacpy( uplo, n, n, a, lda, afac, lda )
395 CALL zsytrf( uplo, n, afac, lda, iwork, work,
400 CALL zlacpy( uplo, n, n, afac, lda, ainv, lda )
401 lwork = (n+nb+1)*(nb+3)
402 CALL zsytri2( uplo, n, ainv, lda, iwork, work,
404 ainvnm = zlansy(
'1', uplo, n, ainv, lda, rwork )
408 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
411 rcondc = ( one / anorm ) / ainvnm
418 CALL zlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
419 $ nrhs, a, lda, xact, lda, b, lda, iseed,
425 IF( ifact.EQ.2 )
THEN
426 CALL zlacpy( uplo, n, n, a, lda, afac, lda )
427 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
432 CALL zsysv( uplo, n, nrhs, afac, lda, iwork, x,
433 $ lda, work, lwork, info )
441 IF( iwork( k ).LT.0 )
THEN
442 IF( iwork( k ).NE.-k )
THEN
446 ELSE IF( iwork( k ).NE.k )
THEN
455 CALL alaerh( path,
'ZSYSV ', info, k, uplo, n,
456 $ n, -1, -1, nrhs, imat, nfail,
459 ELSE IF( info.NE.0 )
THEN
466 CALL zsyt01( uplo, n, a, lda, afac, lda, iwork,
467 $ ainv, lda, rwork, result( 1 ) )
471 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
472 CALL zsyt02( uplo, n, nrhs, a, lda, x, lda, work,
473 $ lda, rwork, result( 2 ) )
477 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
485 IF( result( k ).GE.thresh )
THEN
486 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
487 $
CALL aladhd( nout, path )
488 WRITE( nout, fmt = 9999 )
'ZSYSV ', uplo, n,
489 $ imat, k, result( k )
500 $
CALL zlaset( uplo, n, n, dcmplx( zero ),
501 $ dcmplx( zero ), afac, lda )
502 CALL zlaset(
'Full', n, nrhs, dcmplx( zero ),
503 $ dcmplx( zero ), x, lda )
509 CALL zsysvx( fact, uplo, n, nrhs, a, lda, afac, lda,
510 $ iwork, b, lda, x, lda, rcond, rwork,
511 $ rwork( nrhs+1 ), work, lwork,
512 $ rwork( 2*nrhs+1 ), info )
520 IF( iwork( k ).LT.0 )
THEN
521 IF( iwork( k ).NE.-k )
THEN
525 ELSE IF( iwork( k ).NE.k )
THEN
534 CALL alaerh( path,
'ZSYSVX', info, k, fact // uplo,
535 $ n, n, -1, -1, nrhs, imat, nfail,
541 IF( ifact.GE.2 )
THEN
546 CALL zsyt01( uplo, n, a, lda, afac, lda, iwork,
547 $ ainv, lda, rwork( 2*nrhs+1 ),
556 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
557 CALL zsyt02( uplo, n, nrhs, a, lda, x, lda, work,
558 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
562 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
567 CALL zpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
568 $ xact, lda, rwork, rwork( nrhs+1 ),
577 result( 6 ) = dget06( rcond, rcondc )
583 IF( result( k ).GE.thresh )
THEN
584 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
585 $
CALL aladhd( nout, path )
586 WRITE( nout, fmt = 9998 )
'ZSYSVX', fact, uplo,
587 $ n, imat, k, result( k )
601 CALL alasvm( path, nout, nfail, nrun, nerrs )
603 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
604 $
', test ', i2,
', ratio =', g12.5 )
605 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
606 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )