153 SUBROUTINE zdrvsy( 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 = 11, 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' /
229 path( 1: 1 ) =
'Zomplex precision'
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 )
280 IF( imat.NE.ntypes )
THEN
285 CALL
zlatb4( path, imat, n, n, type, kl, ku, anorm,
286 $ mode, cndnum, dist )
289 CALL
zlatms( n, n, dist, iseed, type, rwork, mode,
290 $ cndnum, anorm, kl, ku, uplo, a, lda,
296 CALL
alaerh( path,
'ZLATMS', info, 0, uplo, n, n,
297 $ -1, -1, -1, imat, nfail, nerrs, nout )
307 ELSE IF( imat.EQ.4 )
THEN
317 IF( iuplo.EQ.1 )
THEN
318 ioff = ( izero-1 )*lda
319 DO 20 i = 1, izero - 1
329 DO 40 i = 1, izero - 1
339 IF( iuplo.EQ.1 )
THEN
373 CALL
zlatsy( uplo, n, a, lda, iseed )
376 DO 150 ifact = 1, nfact
380 fact = facts( ifact )
390 ELSE IF( ifact.EQ.1 )
THEN
394 anorm =
zlansy(
'1', uplo, n, a, lda, rwork )
398 CALL
zlacpy( uplo, n, n, a, lda, afac, lda )
399 CALL
zsytrf( uplo, n, afac, lda, iwork, work,
404 CALL
zlacpy( uplo, n, n, afac, lda, ainv, lda )
405 lwork = (n+nb+1)*(nb+3)
406 CALL
zsytri2( uplo, n, ainv, lda, iwork, work,
408 ainvnm =
zlansy(
'1', uplo, n, ainv, lda, rwork )
412 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
415 rcondc = ( one / anorm ) / ainvnm
422 CALL
zlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
423 $ nrhs, a, lda, xact, lda, b, lda, iseed,
429 IF( ifact.EQ.2 )
THEN
430 CALL
zlacpy( uplo, n, n, a, lda, afac, lda )
431 CALL
zlacpy(
'Full', n, nrhs, b, lda, x, lda )
436 CALL
zsysv( uplo, n, nrhs, afac, lda, iwork, x,
437 $ lda, work, lwork, info )
445 IF( iwork( k ).LT.0 )
THEN
446 IF( iwork( k ).NE.-k )
THEN
450 ELSE IF( iwork( k ).NE.k )
THEN
459 CALL
alaerh( path,
'ZSYSV ', info, k, uplo, n,
460 $ n, -1, -1, nrhs, imat, nfail,
463 ELSE IF( info.NE.0 )
THEN
470 CALL
zsyt01( uplo, n, a, lda, afac, lda, iwork,
471 $ ainv, lda, rwork, result( 1 ) )
475 CALL
zlacpy(
'Full', n, nrhs, b, lda, work, lda )
476 CALL
zsyt02( uplo, n, nrhs, a, lda, x, lda, work,
477 $ lda, rwork, result( 2 ) )
481 CALL
zget04( n, nrhs, x, lda, xact, lda, rcondc,
489 IF( result( k ).GE.thresh )
THEN
490 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
491 $ CALL
aladhd( nout, path )
492 WRITE( nout, fmt = 9999 )
'ZSYSV ', uplo, n,
493 $ imat, k, result( k )
504 $ CALL
zlaset( uplo, n, n, dcmplx( zero ),
505 $ dcmplx( zero ), afac, lda )
506 CALL
zlaset(
'Full', n, nrhs, dcmplx( zero ),
507 $ dcmplx( zero ), x, lda )
513 CALL
zsysvx( fact, uplo, n, nrhs, a, lda, afac, lda,
514 $ iwork, b, lda, x, lda, rcond, rwork,
515 $ rwork( nrhs+1 ), work, lwork,
516 $ rwork( 2*nrhs+1 ), info )
524 IF( iwork( k ).LT.0 )
THEN
525 IF( iwork( k ).NE.-k )
THEN
529 ELSE IF( iwork( k ).NE.k )
THEN
538 CALL
alaerh( path,
'ZSYSVX', info, k, fact // uplo,
539 $ n, n, -1, -1, nrhs, imat, nfail,
545 IF( ifact.GE.2 )
THEN
550 CALL
zsyt01( uplo, n, a, lda, afac, lda, iwork,
551 $ ainv, lda, rwork( 2*nrhs+1 ),
560 CALL
zlacpy(
'Full', n, nrhs, b, lda, work, lda )
561 CALL
zsyt02( uplo, n, nrhs, a, lda, x, lda, work,
562 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
566 CALL
zget04( n, nrhs, x, lda, xact, lda, rcondc,
571 CALL
zpot05( uplo, n, nrhs, a, lda, 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 )
'ZSYSVX', 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 )