155 SUBROUTINE ddrvsp( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
156 $ a, afac, ainv, b, x, xact, work, rwork, iwork,
166 INTEGER nmax, nn, nout, nrhs
167 DOUBLE PRECISION thresh
171 INTEGER iwork( * ), nval( * )
172 DOUBLE PRECISION a( * ), afac( * ), ainv( * ), b( * ),
173 $ rwork( * ), work( * ), x( * ), xact( * )
179 DOUBLE PRECISION one, zero
180 parameter( one = 1.0d+0, zero = 0.0d+0 )
181 INTEGER ntypes, ntests
182 parameter( ntypes = 10, ntests = 6 )
184 parameter( nfact = 2 )
188 CHARACTER dist, fact, packit, type, uplo, xtype
190 INTEGER i, i1, i2, ifact, imat, in, info, ioff, iuplo,
191 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
192 $ nerrs, nfail, nimat, npp, nrun, nt
193 DOUBLE PRECISION ainvnm, anorm, cndnum, rcond, rcondc
196 CHARACTER facts( nfact )
197 INTEGER iseed( 4 ), iseedy( 4 )
198 DOUBLE PRECISION result( ntests )
215 common / infoc / infot, nunit, ok, lerr
216 common / srnamc / srnamt
222 DATA iseedy / 1988, 1989, 1990, 1991 /
223 DATA facts /
'F',
'N' /
229 path( 1: 1 ) =
'Double precision'
235 iseed( i ) = iseedy( i )
237 lwork = max( 2*nmax, nmax*nrhs )
242 $ CALL
derrvx( path, nout )
256 DO 170 imat = 1, nimat
260 IF( .NOT.dotype( imat ) )
265 zerot = imat.GE.3 .AND. imat.LE.6
266 IF( zerot .AND. n.LT.imat-2 )
272 IF( iuplo.EQ.1 )
THEN
283 CALL
dlatb4( path, imat, n, n, type, kl, ku, anorm, mode,
287 CALL
dlatms( n, n, dist, iseed, type, rwork, mode,
288 $ cndnum, anorm, kl, ku, packit, a, lda, work,
294 CALL
alaerh( path,
'DLATMS', 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 )*izero / 2
317 DO 20 i = 1, izero - 1
327 DO 40 i = 1, izero - 1
338 IF( iuplo.EQ.1 )
THEN
366 DO 150 ifact = 1, nfact
370 fact = facts( ifact )
380 ELSE IF( ifact.EQ.1 )
THEN
384 anorm =
dlansp(
'1', uplo, n, a, rwork )
388 CALL
dcopy( npp, a, 1, afac, 1 )
389 CALL
dsptrf( uplo, n, afac, iwork, info )
393 CALL
dcopy( npp, afac, 1, ainv, 1 )
394 CALL
dsptri( uplo, n, ainv, iwork, work, info )
395 ainvnm =
dlansp(
'1', uplo, n, ainv, 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
dcopy( npp, a, 1, afac, 1 )
418 CALL
dlacpy(
'Full', n, nrhs, b, lda, x, lda )
423 CALL
dspsv( uplo, n, nrhs, afac, iwork, x, lda,
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,
'DSPSV ', info, k, uplo, n,
447 $ n, -1, -1, nrhs, imat, nfail,
450 ELSE IF( info.NE.0 )
THEN
457 CALL
dspt01( uplo, n, a, afac, iwork, ainv, lda,
458 $ rwork, result( 1 ) )
462 CALL
dlacpy(
'Full', n, nrhs, b, lda, work, lda )
463 CALL
dppt02( uplo, n, nrhs, a, x, lda, work, lda,
464 $ 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 )
'DSPSV ', uplo, n,
480 $ imat, k, result( k )
490 IF( ifact.EQ.2 .AND. npp.GT.0 )
491 $ CALL
dlaset(
'Full', npp, 1, zero, zero, afac,
493 CALL
dlaset(
'Full', n, nrhs, zero, zero, x, lda )
499 CALL
dspsvx( fact, uplo, n, nrhs, a, afac, iwork, b,
500 $ lda, x, lda, rcond, rwork,
501 $ rwork( nrhs+1 ), work, iwork( n+1 ),
510 IF( iwork( k ).LT.0 )
THEN
511 IF( iwork( k ).NE.-k )
THEN
515 ELSE IF( iwork( k ).NE.k )
THEN
524 CALL
alaerh( path,
'DSPSVX', info, k, fact // uplo,
525 $ n, n, -1, -1, nrhs, imat, nfail,
531 IF( ifact.GE.2 )
THEN
536 CALL
dspt01( uplo, n, a, afac, iwork, ainv, lda,
537 $ rwork( 2*nrhs+1 ), result( 1 ) )
545 CALL
dlacpy(
'Full', n, nrhs, b, lda, work, lda )
546 CALL
dppt02( uplo, n, nrhs, a, x, lda, work, lda,
547 $ rwork( 2*nrhs+1 ), result( 2 ) )
551 CALL
dget04( n, nrhs, x, lda, xact, lda, rcondc,
556 CALL
dppt05( uplo, n, nrhs, a, 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 )
'DSPSVX', 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 )