152 SUBROUTINE ddrvsy( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
153 $ a, afac, ainv, b, x, xact, work, rwork, iwork,
163 INTEGER nmax, nn, nout, nrhs
164 DOUBLE PRECISION thresh
168 INTEGER iwork( * ), nval( * )
169 DOUBLE PRECISION a( * ), afac( * ), ainv( * ), b( * ),
170 $ rwork( * ), work( * ), x( * ), xact( * )
176 DOUBLE PRECISION one, zero
177 parameter( one = 1.0d+0, zero = 0.0d+0 )
178 INTEGER ntypes, ntests
179 parameter( ntypes = 10, ntests = 6 )
181 parameter( nfact = 2 )
185 CHARACTER dist, fact, type, uplo, xtype
187 INTEGER i, i1, i2, ifact, imat, in, info, ioff, iuplo,
188 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
189 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt
190 DOUBLE PRECISION ainvnm, anorm, cndnum, rcond, rcondc
193 CHARACTER facts( nfact ), uplos( 2 )
194 INTEGER iseed( 4 ), iseedy( 4 )
195 DOUBLE PRECISION result( ntests )
212 common / infoc / infot, nunit, ok, lerr
213 common / srnamc / srnamt
219 DATA iseedy / 1988, 1989, 1990, 1991 /
220 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
226 path( 1: 1 ) =
'Double precision'
232 iseed( i ) = iseedy( i )
234 lwork = max( 2*nmax, nmax*nrhs )
239 $ CALL
derrvx( path, nout )
259 DO 170 imat = 1, nimat
263 IF( .NOT.dotype( imat ) )
268 zerot = imat.GE.3 .AND. imat.LE.6
269 IF( zerot .AND. n.LT.imat-2 )
275 uplo = uplos( iuplo )
280 CALL
dlatb4( path, imat, n, n, type, kl, ku, anorm, mode,
284 CALL
dlatms( n, n, dist, iseed, type, rwork, mode,
285 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
291 CALL
alaerh( path,
'DLATMS', info, 0, uplo, n, n, -1,
292 $ -1, -1, imat, nfail, nerrs, nout )
302 ELSE IF( imat.EQ.4 )
THEN
312 IF( iuplo.EQ.1 )
THEN
313 ioff = ( izero-1 )*lda
314 DO 20 i = 1, izero - 1
324 DO 40 i = 1, izero - 1
335 IF( iuplo.EQ.1 )
THEN
363 DO 150 ifact = 1, nfact
367 fact = facts( ifact )
377 ELSE IF( ifact.EQ.1 )
THEN
381 anorm =
dlansy(
'1', uplo, n, a, lda, rwork )
385 CALL
dlacpy( uplo, n, n, a, lda, afac, lda )
386 CALL
dsytrf( uplo, n, afac, lda, iwork, work,
391 CALL
dlacpy( uplo, n, n, afac, lda, ainv, lda )
392 lwork = (n+nb+1)*(nb+3)
393 CALL
dsytri2( uplo, n, ainv, lda, iwork, work,
395 ainvnm =
dlansy(
'1', uplo, n, ainv, lda, rwork )
399 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
402 rcondc = ( one / anorm ) / ainvnm
409 CALL
dlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
410 $ nrhs, a, lda, xact, lda, b, lda, iseed,
416 IF( ifact.EQ.2 )
THEN
417 CALL
dlacpy( uplo, n, n, a, lda, afac, lda )
418 CALL
dlacpy(
'Full', n, nrhs, b, lda, x, lda )
423 CALL
dsysv( uplo, n, nrhs, afac, lda, iwork, x,
424 $ lda, work, lwork, info )
432 IF( iwork( k ).LT.0 )
THEN
433 IF( iwork( k ).NE.-k )
THEN
437 ELSE IF( iwork( k ).NE.k )
THEN
446 CALL
alaerh( path,
'DSYSV ', info, k, uplo, n,
447 $ n, -1, -1, nrhs, imat, nfail,
450 ELSE IF( info.NE.0 )
THEN
457 CALL
dsyt01( uplo, n, a, lda, afac, lda, iwork,
458 $ ainv, lda, rwork, result( 1 ) )
462 CALL
dlacpy(
'Full', n, nrhs, b, lda, work, lda )
463 CALL
dpot02( uplo, n, nrhs, a, lda, x, lda, work,
464 $ lda, rwork, result( 2 ) )
468 CALL
dget04( n, nrhs, x, lda, xact, lda, rcondc,
476 IF( result( k ).GE.thresh )
THEN
477 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
478 $ CALL
aladhd( nout, path )
479 WRITE( nout, fmt = 9999 )
'DSYSV ', uplo, n,
480 $ imat, k, result( k )
491 $ CALL
dlaset( uplo, n, n, zero, zero, afac, lda )
492 CALL
dlaset(
'Full', n, nrhs, zero, zero, x, lda )
498 CALL
dsysvx( fact, uplo, n, nrhs, a, lda, afac, lda,
499 $ iwork, b, lda, x, lda, rcond, rwork,
500 $ rwork( nrhs+1 ), work, lwork,
501 $ iwork( n+1 ), info )
509 IF( iwork( k ).LT.0 )
THEN
510 IF( iwork( k ).NE.-k )
THEN
514 ELSE IF( iwork( k ).NE.k )
THEN
523 CALL
alaerh( path,
'DSYSVX', info, k, fact // uplo,
524 $ n, n, -1, -1, nrhs, imat, nfail,
530 IF( ifact.GE.2 )
THEN
535 CALL
dsyt01( uplo, n, a, lda, afac, lda, iwork,
536 $ ainv, lda, rwork( 2*nrhs+1 ),
545 CALL
dlacpy(
'Full', n, nrhs, b, lda, work, lda )
546 CALL
dpot02( uplo, n, nrhs, a, lda, x, lda, work,
547 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
551 CALL
dget04( n, nrhs, x, lda, xact, lda, rcondc,
556 CALL
dpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
557 $ xact, lda, rwork, rwork( nrhs+1 ),
566 result( 6 ) =
dget06( rcond, rcondc )
572 IF( result( k ).GE.thresh )
THEN
573 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
574 $ CALL
aladhd( nout, path )
575 WRITE( nout, fmt = 9998 )
'DSYSVX', fact, uplo,
576 $ n, imat, k, result( k )
590 CALL
alasvm( path, nout, nfail, nrun, nerrs )
592 9999 format( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
593 $
', test ', i2,
', ratio =', g12.5 )
594 9998 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
595 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )