137 SUBROUTINE ddrvgt( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, AF,
138 $ B, X, XACT, WORK, RWORK, IWORK, NOUT )
146 INTEGER NN, NOUT, NRHS
147 DOUBLE PRECISION THRESH
151 INTEGER IWORK( * ), NVAL( * )
152 DOUBLE PRECISION A( * ), AF( * ), B( * ), RWORK( * ), WORK( * ),
159 DOUBLE PRECISION ONE, ZERO
160 parameter( one = 1.0d+0, zero = 0.0d+0 )
162 parameter( ntypes = 12 )
164 parameter( ntests = 6 )
167 LOGICAL TRFCON, ZEROT
168 CHARACTER DIST, FACT, TRANS, TYPE
170 INTEGER I, IFACT, IMAT, IN, INFO, ITRAN, IX, IZERO, J,
171 $ k, k1, kl, koff, ku, lda, m, mode, n, nerrs,
172 $ nfail, nimat, nrun, nt
173 DOUBLE PRECISION AINVNM, ANORM, ANORMI, ANORMO, COND, RCOND,
174 $ rcondc, rcondi, rcondo
177 CHARACTER TRANSS( 3 )
178 INTEGER ISEED( 4 ), ISEEDY( 4 )
179 DOUBLE PRECISION RESULT( NTESTS ), Z( 3 )
182 DOUBLE PRECISION DASUM, DGET06, DLANGT
183 EXTERNAL dasum, dget06, dlangt
200 COMMON / infoc / infot, nunit, ok, lerr
201 COMMON / srnamc / srnamt
204 DATA iseedy / 0, 0, 0, 1 / , transs /
'N',
'T',
209 path( 1: 1 ) =
'Double precision'
215 iseed( i ) = iseedy( i )
221 $
CALL derrvx( path, nout )
235 DO 130 imat = 1, nimat
239 IF( .NOT.dotype( imat ) )
244 CALL dlatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
247 zerot = imat.GE.8 .AND. imat.LE.10
252 koff = max( 2-ku, 3-max( 1, n ) )
254 CALL dlatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
255 $ anorm, kl, ku,
'Z', af( koff ), 3, work,
261 CALL alaerh( path,
'DLATMS', info, 0,
' ', n, n, kl,
262 $ ku, -1, imat, nfail, nerrs, nout )
268 CALL dcopy( n-1, af( 4 ), 3, a, 1 )
269 CALL dcopy( n-1, af( 3 ), 3, a( n+m+1 ), 1 )
271 CALL dcopy( n, af( 2 ), 3, a( m+1 ), 1 )
277 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
281 CALL dlarnv( 2, iseed, n+2*m, a )
283 $
CALL dscal( n+2*m, anorm, a, 1 )
284 ELSE IF( izero.GT.0 )
THEN
289 IF( izero.EQ.1 )
THEN
293 ELSE IF( izero.EQ.n )
THEN
297 a( 2*n-2+izero ) = z( 1 )
298 a( n-1+izero ) = z( 2 )
305 IF( .NOT.zerot )
THEN
307 ELSE IF( imat.EQ.8 )
THEN
315 ELSE IF( imat.EQ.9 )
THEN
323 DO 20 i = izero, n - 1
334 IF( ifact.EQ.1 )
THEN
349 ELSE IF( ifact.EQ.1 )
THEN
350 CALL dcopy( n+2*m, a, 1, af, 1 )
354 anormo = dlangt(
'1', n, a, a( m+1 ), a( n+m+1 ) )
355 anormi = dlangt(
'I', n, a, a( m+1 ), a( n+m+1 ) )
359 CALL dgttrf( n, af, af( m+1 ), af( n+m+1 ),
360 $ af( n+2*m+1 ), iwork, info )
371 CALL dgttrs(
'No transpose', n, 1, af, af( m+1 ),
372 $ af( n+m+1 ), af( n+2*m+1 ), iwork, x,
374 ainvnm = max( ainvnm, dasum( n, x, 1 ) )
379 IF( anormo.LE.zero .OR. ainvnm.LE.zero )
THEN
382 rcondo = ( one / anormo ) / ainvnm
394 CALL dgttrs(
'Transpose', n, 1, af, af( m+1 ),
395 $ af( n+m+1 ), af( n+2*m+1 ), iwork, x,
397 ainvnm = max( ainvnm, dasum( n, x, 1 ) )
402 IF( anormi.LE.zero .OR. ainvnm.LE.zero )
THEN
405 rcondi = ( one / anormi ) / ainvnm
410 trans = transs( itran )
411 IF( itran.EQ.1 )
THEN
421 CALL dlarnv( 2, iseed, n, xact( ix ) )
427 CALL dlagtm( trans, n, nrhs, one, a, a( m+1 ),
428 $ a( n+m+1 ), xact, lda, zero, b, lda )
430 IF( ifact.EQ.2 .AND. itran.EQ.1 )
THEN
437 CALL dcopy( n+2*m, a, 1, af, 1 )
438 CALL dlacpy(
'Full', n, nrhs, b, lda, x, lda )
441 CALL dgtsv( n, nrhs, af, af( m+1 ), af( n+m+1 ), x,
447 $
CALL alaerh( path,
'DGTSV ', info, izero,
' ',
448 $ n, n, 1, 1, nrhs, imat, nfail,
451 IF( izero.EQ.0 )
THEN
455 CALL dlacpy(
'Full', n, nrhs, b, lda, work,
457 CALL dgtt02( trans, n, nrhs, a, a( m+1 ),
458 $ a( n+m+1 ), x, lda, work, lda,
463 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
472 IF( result( k ).GE.thresh )
THEN
473 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
474 $
CALL aladhd( nout, path )
475 WRITE( nout, fmt = 9999 )
'DGTSV ', n, imat,
485 IF( ifact.GT.1 )
THEN
493 CALL dlaset(
'Full', n, nrhs, zero, zero, x, lda )
499 CALL dgtsvx( fact, trans, n, nrhs, a, a( m+1 ),
500 $ a( n+m+1 ), af, af( m+1 ), af( n+m+1 ),
501 $ af( n+2*m+1 ), iwork, b, lda, x, lda,
502 $ rcond, rwork, rwork( nrhs+1 ), work,
503 $ iwork( n+1 ), info )
508 $
CALL alaerh( path,
'DGTSVX', info, izero,
509 $ fact // trans, n, n, 1, 1, nrhs, imat,
510 $ nfail, nerrs, nout )
512 IF( ifact.GE.2 )
THEN
517 CALL dgtt01( n, a, a( m+1 ), a( n+m+1 ), af,
518 $ af( m+1 ), af( n+m+1 ), af( n+2*m+1 ),
519 $ iwork, work, lda, rwork, result( 1 ) )
530 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
531 CALL dgtt02( trans, n, nrhs, a, a( m+1 ),
532 $ a( n+m+1 ), x, lda, work, lda,
537 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
542 CALL dgtt05( trans, n, nrhs, a, a( m+1 ),
543 $ a( n+m+1 ), b, lda, x, lda, xact, lda,
544 $ rwork, rwork( nrhs+1 ), result( 4 ) )
552 IF( result( k ).GE.thresh )
THEN
553 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
554 $
CALL aladhd( nout, path )
555 WRITE( nout, fmt = 9998 )
'DGTSVX', fact, trans,
556 $ n, imat, k, result( k )
563 result( 6 ) = dget06( rcond, rcondc )
564 IF( result( 6 ).GE.thresh )
THEN
565 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
566 $
CALL aladhd( nout, path )
567 WRITE( nout, fmt = 9998 )
'DGTSVX', fact, trans, n,
568 $ imat, k, result( k )
571 nrun = nrun + nt - k1 + 2
580 CALL alasvm( path, nout, nfail, nrun, nerrs )
582 9999
FORMAT( 1x, a,
', N =', i5,
', type ', i2,
', test ', i2,
583 $
', ratio = ', g12.5 )
584 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', TRANS=''', a1,
''', N =',
585 $ i5,
', type ', i2,
', test ', i2,
', ratio = ', g12.5 )