137 SUBROUTINE zdrvgt( 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 RWORK( * )
153 COMPLEX*16 A( * ), AF( * ), B( * ), WORK( * ), X( * ),
160 DOUBLE PRECISION ONE, ZERO
161 parameter( one = 1.0d+0, zero = 0.0d+0 )
163 parameter( ntypes = 12 )
165 parameter( ntests = 6 )
168 LOGICAL TRFCON, ZEROT
169 CHARACTER DIST, FACT, TRANS, TYPE
171 INTEGER I, IFACT, IMAT, IN, INFO, ITRAN, IX, IZERO, J,
172 $ k, k1, kl, koff, ku, lda, m, mode, n, nerrs,
173 $ nfail, nimat, nrun, nt
174 DOUBLE PRECISION AINVNM, ANORM, ANORMI, ANORMO, COND, RCOND,
175 $ rcondc, rcondi, rcondo
178 CHARACTER TRANSS( 3 )
179 INTEGER ISEED( 4 ), ISEEDY( 4 )
180 DOUBLE PRECISION RESULT( NTESTS ), Z( 3 )
183 DOUBLE PRECISION DGET06, DZASUM, ZLANGT
184 EXTERNAL dget06, dzasum, zlangt
193 INTRINSIC dcmplx, max
201 COMMON / infoc / infot, nunit, ok, lerr
202 COMMON / srnamc / srnamt
205 DATA iseedy / 0, 0, 0, 1 / , transs /
'N',
'T',
210 path( 1: 1 ) =
'Zomplex precision'
216 iseed( i ) = iseedy( i )
222 $
CALL zerrvx( path, nout )
236 DO 130 imat = 1, nimat
240 IF( .NOT.dotype( imat ) )
245 CALL zlatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
248 zerot = imat.GE.8 .AND. imat.LE.10
253 koff = max( 2-ku, 3-max( 1, n ) )
255 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
256 $ anorm, kl, ku,
'Z', af( koff ), 3, work,
262 CALL alaerh( path,
'ZLATMS', info, 0,
' ', n, n, kl,
263 $ ku, -1, imat, nfail, nerrs, nout )
269 CALL zcopy( n-1, af( 4 ), 3, a, 1 )
270 CALL zcopy( n-1, af( 3 ), 3, a( n+m+1 ), 1 )
272 CALL zcopy( n, af( 2 ), 3, a( m+1 ), 1 )
278 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
282 CALL zlarnv( 2, iseed, n+2*m, a )
284 $
CALL zdscal( n+2*m, anorm, a, 1 )
285 ELSE IF( izero.GT.0 )
THEN
290 IF( izero.EQ.1 )
THEN
294 ELSE IF( izero.EQ.n )
THEN
298 a( 2*n-2+izero ) = z( 1 )
299 a( n-1+izero ) = z( 2 )
306 IF( .NOT.zerot )
THEN
308 ELSE IF( imat.EQ.8 )
THEN
310 z( 2 ) = dble( a( n ) )
313 z( 3 ) = dble( a( 1 ) )
316 ELSE IF( imat.EQ.9 )
THEN
318 z( 1 ) = dble( a( 3*n-2 ) )
319 z( 2 ) = dble( a( 2*n-1 ) )
324 DO 20 i = izero, n - 1
335 IF( ifact.EQ.1 )
THEN
350 ELSE IF( ifact.EQ.1 )
THEN
351 CALL zcopy( n+2*m, a, 1, af, 1 )
355 anormo = zlangt(
'1', n, a, a( m+1 ), a( n+m+1 ) )
356 anormi = zlangt(
'I', n, a, a( m+1 ), a( n+m+1 ) )
360 CALL zgttrf( n, af, af( m+1 ), af( n+m+1 ),
361 $ af( n+2*m+1 ), iwork, info )
372 CALL zgttrs(
'No transpose', n, 1, af, af( m+1 ),
373 $ af( n+m+1 ), af( n+2*m+1 ), iwork, x,
375 ainvnm = max( ainvnm, dzasum( n, x, 1 ) )
380 IF( anormo.LE.zero .OR. ainvnm.LE.zero )
THEN
383 rcondo = ( one / anormo ) / ainvnm
395 CALL zgttrs(
'Conjugate transpose', n, 1, af,
396 $ af( m+1 ), af( n+m+1 ), af( n+2*m+1 ),
397 $ iwork, x, lda, info )
398 ainvnm = max( ainvnm, dzasum( n, x, 1 ) )
403 IF( anormi.LE.zero .OR. ainvnm.LE.zero )
THEN
406 rcondi = ( one / anormi ) / ainvnm
411 trans = transs( itran )
412 IF( itran.EQ.1 )
THEN
422 CALL zlarnv( 2, iseed, n, xact( ix ) )
428 CALL zlagtm( trans, n, nrhs, one, a, a( m+1 ),
429 $ a( n+m+1 ), xact, lda, zero, b, lda )
431 IF( ifact.EQ.2 .AND. itran.EQ.1 )
THEN
438 CALL zcopy( n+2*m, a, 1, af, 1 )
439 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
442 CALL zgtsv( n, nrhs, af, af( m+1 ), af( n+m+1 ), x,
448 $
CALL alaerh( path,
'ZGTSV ', info, izero,
' ',
449 $ n, n, 1, 1, nrhs, imat, nfail,
452 IF( izero.EQ.0 )
THEN
456 CALL zlacpy(
'Full', n, nrhs, b, lda, work,
458 CALL zgtt02( trans, n, nrhs, a, a( m+1 ),
459 $ a( n+m+1 ), x, lda, work, lda,
464 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
473 IF( result( k ).GE.thresh )
THEN
474 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
475 $
CALL aladhd( nout, path )
476 WRITE( nout, fmt = 9999 )
'ZGTSV ', n, imat,
486 IF( ifact.GT.1 )
THEN
494 CALL zlaset(
'Full', n, nrhs, dcmplx( zero ),
495 $ dcmplx( zero ), x, lda )
501 CALL zgtsvx( fact, trans, n, nrhs, a, a( m+1 ),
502 $ a( n+m+1 ), af, af( m+1 ), af( n+m+1 ),
503 $ af( n+2*m+1 ), iwork, b, lda, x, lda,
504 $ rcond, rwork, rwork( nrhs+1 ), work,
505 $ rwork( 2*nrhs+1 ), info )
510 $
CALL alaerh( path,
'ZGTSVX', info, izero,
511 $ fact // trans, n, n, 1, 1, nrhs, imat,
512 $ nfail, nerrs, nout )
514 IF( ifact.GE.2 )
THEN
519 CALL zgtt01( n, a, a( m+1 ), a( n+m+1 ), af,
520 $ af( m+1 ), af( n+m+1 ), af( n+2*m+1 ),
521 $ iwork, work, lda, rwork, result( 1 ) )
532 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
533 CALL zgtt02( trans, n, nrhs, a, a( m+1 ),
534 $ a( n+m+1 ), x, lda, work, lda,
539 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
544 CALL zgtt05( trans, n, nrhs, a, a( m+1 ),
545 $ a( n+m+1 ), b, lda, x, lda, xact, lda,
546 $ rwork, rwork( nrhs+1 ), result( 4 ) )
554 IF( result( k ).GE.thresh )
THEN
555 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
556 $
CALL aladhd( nout, path )
557 WRITE( nout, fmt = 9998 )
'ZGTSVX', fact, trans,
558 $ n, imat, k, result( k )
565 result( 6 ) = dget06( rcond, rcondc )
566 IF( result( 6 ).GE.thresh )
THEN
567 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
568 $
CALL aladhd( nout, path )
569 WRITE( nout, fmt = 9998 )
'ZGTSVX', fact, trans, n,
570 $ imat, k, result( k )
573 nrun = nrun + nt - k1 + 2
582 CALL alasvm( path, nout, nfail, nrun, nerrs )
584 9999
FORMAT( 1x, a,
', N =', i5,
', type ', i2,
', test ', i2,
585 $
', ratio = ', g12.5 )
586 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', TRANS=''', a1,
''', N =',
587 $ i5,
', type ', i2,
', test ', i2,
', ratio = ', g12.5 )