137 SUBROUTINE cdrvgt( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, AF,
138 $ B, X, XACT, WORK, RWORK, IWORK, NOUT )
146 INTEGER NN, NOUT, NRHS
151 INTEGER IWORK( * ), NVAL( * )
153 COMPLEX A( * ), AF( * ), B( * ), WORK( * ), X( * ),
161 parameter( one = 1.0e+0, zero = 0.0e+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 REAL AINVNM, ANORM, ANORMI, ANORMO, COND, RCOND,
175 $ rcondc, rcondi, rcondo
178 CHARACTER TRANSS( 3 )
179 INTEGER ISEED( 4 ), ISEEDY( 4 )
180 REAL RESULT( NTESTS ), Z( 3 )
183 REAL CLANGT, SCASUM, SGET06
184 EXTERNAL clangt, scasum, sget06
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 ) =
'Complex precision'
216 iseed( i ) = iseedy( i )
222 $
CALL cerrvx( path, nout )
236 DO 130 imat = 1, nimat
240 IF( .NOT.dotype( imat ) )
245 CALL clatb4( 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 clatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
256 $ anorm, kl, ku,
'Z', af( koff ), 3, work,
262 CALL alaerh( path,
'CLATMS', info, 0,
' ', n, n, kl,
263 $ ku, -1, imat, nfail, nerrs, nout )
269 CALL ccopy( n-1, af( 4 ), 3, a, 1 )
270 CALL ccopy( n-1, af( 3 ), 3, a( n+m+1 ), 1 )
272 CALL ccopy( n, af( 2 ), 3, a( m+1 ), 1 )
278 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
282 CALL clarnv( 2, iseed, n+2*m, a )
284 $
CALL csscal( 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 ) = real( a( n ) )
313 z( 3 ) = real( a( 1 ) )
316 ELSE IF( imat.EQ.9 )
THEN
318 z( 1 ) = real( a( 3*n-2 ) )
319 z( 2 ) = real( 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 ccopy( n+2*m, a, 1, af, 1 )
355 anormo = clangt(
'1', n, a, a( m+1 ), a( n+m+1 ) )
356 anormi = clangt(
'I', n, a, a( m+1 ), a( n+m+1 ) )
360 CALL cgttrf( n, af, af( m+1 ), af( n+m+1 ),
361 $ af( n+2*m+1 ), iwork, info )
372 CALL cgttrs(
'No transpose', n, 1, af, af( m+1 ),
373 $ af( n+m+1 ), af( n+2*m+1 ), iwork, x,
375 ainvnm = max( ainvnm, scasum( n, x, 1 ) )
380 IF( anormo.LE.zero .OR. ainvnm.LE.zero )
THEN
383 rcondo = ( one / anormo ) / ainvnm
395 CALL cgttrs(
'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, scasum( 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 clarnv( 2, iseed, n, xact( ix ) )
428 CALL clagtm( 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 ccopy( n+2*m, a, 1, af, 1 )
439 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
442 CALL cgtsv( n, nrhs, af, af( m+1 ), af( n+m+1 ), x,
448 $
CALL alaerh( path,
'CGTSV ', info, izero,
' ',
449 $ n, n, 1, 1, nrhs, imat, nfail,
452 IF( izero.EQ.0 )
THEN
456 CALL clacpy(
'Full', n, nrhs, b, lda, work,
458 CALL cgtt02( trans, n, nrhs, a, a( m+1 ),
459 $ a( n+m+1 ), x, lda, work, lda,
464 CALL cget04( 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 )
'CGTSV ', n, imat,
486 IF( ifact.GT.1 )
THEN
494 CALL claset(
'Full', n, nrhs, cmplx( zero ),
495 $ cmplx( zero ), x, lda )
501 CALL cgtsvx( 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,
'CGTSVX', info, izero,
511 $ fact // trans, n, n, 1, 1, nrhs, imat,
512 $ nfail, nerrs, nout )
514 IF( ifact.GE.2 )
THEN
519 CALL cgtt01( 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 clacpy(
'Full', n, nrhs, b, lda, work, lda )
533 CALL cgtt02( trans, n, nrhs, a, a( m+1 ),
534 $ a( n+m+1 ), x, lda, work, lda,
539 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
544 CALL cgtt05( 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 )
'CGTSVX', fact, trans,
558 $ n, imat, k, result( k )
565 result( 6 ) = sget06( 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 )
'CGTSVX', 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 )
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine aladhd(iounit, path)
ALADHD
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine cdrvgt(dotype, nn, nval, nrhs, thresh, tsterr, a, af, b, x, xact, work, rwork, iwork, nout)
CDRVGT
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine cgtt01(n, dl, d, du, dlf, df, duf, du2, ipiv, work, ldwork, rwork, resid)
CGTT01
subroutine cgtt02(trans, n, nrhs, dl, d, du, x, ldx, b, ldb, resid)
CGTT02
subroutine cgtt05(trans, n, nrhs, dl, d, du, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CGTT05
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgtsv(n, nrhs, dl, d, du, b, ldb, info)
CGTSV computes the solution to system of linear equations A * X = B for GT matrices
subroutine cgtsvx(fact, trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
CGTSVX computes the solution to system of linear equations A * X = B for GT matrices
subroutine cgttrf(n, dl, d, du, du2, ipiv, info)
CGTTRF
subroutine cgttrs(trans, n, nrhs, dl, d, du, du2, ipiv, b, ldb, info)
CGTTRS
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine clagtm(trans, n, nrhs, alpha, dl, d, du, x, ldx, beta, b, ldb)
CLAGTM performs a matrix-matrix product of the form C = αAB+βC, where A is a tridiagonal matrix,...
subroutine clarnv(idist, iseed, n, x)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine csscal(n, sa, cx, incx)
CSSCAL