140 SUBROUTINE cdrvpt( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, D,
141 $ e, b, x, xact, work, rwork, nout )
150 INTEGER nn, nout, nrhs
156 REAL d( * ), rwork( * )
157 COMPLEX a( * ), b( * ), e( * ), work( * ), x( * ),
165 parameter( one = 1.0e+0, zero = 0.0e+0 )
167 parameter( ntypes = 12 )
169 parameter( ntests = 6 )
173 CHARACTER dist, fact, type
175 INTEGER i, ia, ifact, imat, in, info, ix, izero, j, k,
176 $ k1, kl, ku, lda, mode, n, nerrs, nfail, nimat,
178 REAL ainvnm, anorm, cond, dmax, rcond, rcondc
181 INTEGER iseed( 4 ), iseedy( 4 )
182 REAL result( ntests ), z( 3 )
196 INTRINSIC abs, cmplx, max
204 common / infoc / infot, nunit, ok, lerr
205 common / srnamc / srnamt
208 DATA iseedy / 0, 0, 0, 1 /
212 path( 1: 1 ) =
'Complex precision'
218 iseed( i ) = iseedy( i )
224 $ CALL
cerrvx( path, nout )
237 DO 110 imat = 1, nimat
241 IF( n.GT.0 .AND. .NOT.dotype( imat ) )
246 CALL
clatb4( path, imat, n, n, type, kl, ku, anorm, mode,
249 zerot = imat.GE.8 .AND. imat.LE.10
256 CALL
clatms( n, n, dist, iseed, type, rwork, mode, cond,
257 $ anorm, kl, ku,
'B', a, 2, work, info )
262 CALL
alaerh( path,
'CLATMS', info, 0,
' ', n, n, kl,
263 $ ku, -1, imat, nfail, nerrs, nout )
283 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
287 CALL
slarnv( 2, iseed, n, d )
288 CALL
clarnv( 2, iseed, n-1, e )
293 d( 1 ) = abs( d( 1 ) )
295 d( 1 ) = abs( d( 1 ) ) + abs( e( 1 ) )
296 d( n ) = abs( d( n ) ) + abs( e( n-1 ) )
298 d( i ) = abs( d( i ) ) + abs( e( i ) ) +
307 CALL
sscal( n, anorm / dmax, d, 1 )
309 $ CALL
csscal( n-1, anorm / dmax, e, 1 )
311 ELSE IF( izero.GT.0 )
THEN
316 IF( izero.EQ.1 )
THEN
320 ELSE IF( izero.EQ.n )
THEN
324 e( izero-1 ) = z( 1 )
342 ELSE IF( imat.EQ.9 )
THEN
350 ELSE IF( imat.EQ.10 )
THEN
352 IF( izero.GT.1 )
THEN
353 z( 1 ) = e( izero-1 )
367 CALL
clarnv( 2, iseed, n, xact( ix ) )
373 CALL
claptm(
'Lower', n, nrhs, one, d, e, xact, lda, zero,
377 IF( ifact.EQ.1 )
THEN
391 ELSE IF( ifact.EQ.1 )
THEN
395 anorm =
clanht(
'1', n, d, e )
397 CALL
scopy( n, d, 1, d( n+1 ), 1 )
399 $ CALL
ccopy( n-1, e, 1, e( n+1 ), 1 )
403 CALL
cpttrf( n, d( n+1 ), e( n+1 ), info )
414 CALL
cpttrs(
'Lower', n, 1, d( n+1 ), e( n+1 ), x,
416 ainvnm = max( ainvnm,
scasum( n, x, 1 ) )
421 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
424 rcondc = ( one / anorm ) / ainvnm
428 IF( ifact.EQ.2 )
THEN
432 CALL
scopy( n, d, 1, d( n+1 ), 1 )
434 $ CALL
ccopy( n-1, e, 1, e( n+1 ), 1 )
435 CALL
clacpy(
'Full', n, nrhs, b, lda, x, lda )
440 CALL
cptsv( n, nrhs, d( n+1 ), e( n+1 ), x, lda,
446 $ CALL
alaerh( path,
'CPTSV ', info, izero,
' ', n,
447 $ n, 1, 1, nrhs, imat, nfail, nerrs,
450 IF( izero.EQ.0 )
THEN
455 CALL
cptt01( n, d, e, d( n+1 ), e( n+1 ), work,
460 CALL
clacpy(
'Full', n, nrhs, b, lda, work, lda )
461 CALL
cptt02(
'Lower', n, nrhs, d, e, x, lda, work,
466 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
475 IF( result( k ).GE.thresh )
THEN
476 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
477 $ CALL
aladhd( nout, path )
478 WRITE( nout, fmt = 9999 )
'CPTSV ', n, imat, k,
488 IF( ifact.GT.1 )
THEN
500 CALL
claset(
'Full', n, nrhs, cmplx( zero ),
501 $ cmplx( zero ), x, lda )
507 CALL
cptsvx( fact, n, nrhs, d, e, d( n+1 ), e( n+1 ), b,
508 $ lda, x, lda, rcond, rwork, rwork( nrhs+1 ),
509 $ work, rwork( 2*nrhs+1 ), info )
514 $ CALL
alaerh( path,
'CPTSVX', info, izero, fact, n, n,
515 $ 1, 1, nrhs, imat, nfail, nerrs, nout )
516 IF( izero.EQ.0 )
THEN
517 IF( ifact.EQ.2 )
THEN
523 CALL
cptt01( n, d, e, d( n+1 ), e( n+1 ), work,
531 CALL
clacpy(
'Full', n, nrhs, b, lda, work, lda )
532 CALL
cptt02(
'Lower', n, nrhs, d, e, x, lda, work,
537 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
542 CALL
cptt05( n, nrhs, d, e, b, lda, x, lda, xact, lda,
543 $ rwork, rwork( nrhs+1 ), result( 4 ) )
550 result( 6 ) =
sget06( rcond, rcondc )
556 IF( result( k ).GE.thresh )
THEN
557 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
558 $ CALL
aladhd( nout, path )
559 WRITE( nout, fmt = 9998 )
'CPTSVX', fact, n, imat,
571 CALL
alasvm( path, nout, nfail, nrun, nerrs )
573 9999 format( 1x, a,
', N =', i5,
', type ', i2,
', test ', i2,
574 $
', ratio = ', g12.5 )
575 9998 format( 1x, a,
', FACT=''', a1,
''', N =', i5,
', type ', i2,
576 $
', test ', i2,
', ratio = ', g12.5 )