138 SUBROUTINE cdrvpt( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, D,
139 $ E, B, X, XACT, WORK, RWORK, NOUT )
147 INTEGER NN, NOUT, NRHS
153 REAL D( * ), RWORK( * )
154 COMPLEX A( * ), B( * ), E( * ), WORK( * ), X( * ),
162 parameter( one = 1.0e+0, zero = 0.0e+0 )
164 parameter( ntypes = 12 )
166 parameter( ntests = 6 )
170 CHARACTER DIST, FACT, TYPE
172 INTEGER I, IA, IFACT, IMAT, IN, INFO, IX, IZERO, J, K,
173 $ k1, kl, ku, lda, mode, n, nerrs, nfail, nimat,
175 REAL AINVNM, ANORM, COND, DMAX, RCOND, RCONDC
178 INTEGER ISEED( 4 ), ISEEDY( 4 )
179 REAL RESULT( NTESTS ), Z( 3 )
183 REAL CLANHT, SCASUM, SGET06
184 EXTERNAL isamax, clanht, scasum, sget06
193 INTRINSIC abs, cmplx, max
201 COMMON / infoc / infot, nunit, ok, lerr
202 COMMON / srnamc / srnamt
205 DATA iseedy / 0, 0, 0, 1 /
209 path( 1: 1 ) =
'Complex precision'
215 iseed( i ) = iseedy( i )
221 $
CALL cerrvx( path, nout )
234 DO 110 imat = 1, nimat
238 IF( n.GT.0 .AND. .NOT.dotype( imat ) )
243 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
246 zerot = imat.GE.8 .AND. imat.LE.10
253 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
254 $ anorm, kl, ku,
'B', a, 2, work, info )
259 CALL alaerh( path,
'CLATMS', info, 0,
' ', n, n, kl,
260 $ ku, -1, imat, nfail, nerrs, nout )
269 d( i ) = real( a( ia ) )
274 $ d( n ) = real( a( ia ) )
280 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
284 CALL slarnv( 2, iseed, n, d )
285 CALL clarnv( 2, iseed, n-1, e )
290 d( 1 ) = abs( d( 1 ) )
292 d( 1 ) = abs( d( 1 ) ) + abs( e( 1 ) )
293 d( n ) = abs( d( n ) ) + abs( e( n-1 ) )
295 d( i ) = abs( d( i ) ) + abs( e( i ) ) +
302 ix = isamax( n, d, 1 )
304 CALL sscal( n, anorm / dmax, d, 1 )
306 $
CALL csscal( n-1, anorm / dmax, e, 1 )
308 ELSE IF( izero.GT.0 )
THEN
313 IF( izero.EQ.1 )
THEN
317 ELSE IF( izero.EQ.n )
THEN
321 e( izero-1 ) = z( 1 )
336 z( 3 ) = real( e( 1 ) )
339 ELSE IF( imat.EQ.9 )
THEN
342 z( 1 ) = real( e( n-1 ) )
347 ELSE IF( imat.EQ.10 )
THEN
349 IF( izero.GT.1 )
THEN
350 z( 1 ) = real( e( izero-1 ) )
352 z( 3 ) = real( e( izero ) )
364 CALL clarnv( 2, iseed, n, xact( ix ) )
370 CALL claptm(
'Lower', n, nrhs, one, d, e, xact, lda, zero,
374 IF( ifact.EQ.1 )
THEN
388 ELSE IF( ifact.EQ.1 )
THEN
392 anorm = clanht(
'1', n, d, e )
394 CALL scopy( n, d, 1, d( n+1 ), 1 )
396 $
CALL ccopy( n-1, e, 1, e( n+1 ), 1 )
400 CALL cpttrf( n, d( n+1 ), e( n+1 ), info )
411 CALL cpttrs(
'Lower', n, 1, d( n+1 ), e( n+1 ), x,
413 ainvnm = max( ainvnm, scasum( n, x, 1 ) )
418 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
421 rcondc = ( one / anorm ) / ainvnm
425 IF( ifact.EQ.2 )
THEN
429 CALL scopy( n, d, 1, d( n+1 ), 1 )
431 $
CALL ccopy( n-1, e, 1, e( n+1 ), 1 )
432 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
437 CALL cptsv( n, nrhs, d( n+1 ), e( n+1 ), x, lda,
443 $
CALL alaerh( path,
'CPTSV ', info, izero,
' ', n,
444 $ n, 1, 1, nrhs, imat, nfail, nerrs,
447 IF( izero.EQ.0 )
THEN
452 CALL cptt01( n, d, e, d( n+1 ), e( n+1 ), work,
457 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
458 CALL cptt02(
'Lower', n, nrhs, d, e, x, lda, work,
463 CALL cget04( 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 )
'CPTSV ', n, imat, k,
485 IF( ifact.GT.1 )
THEN
497 CALL claset(
'Full', n, nrhs, cmplx( zero ),
498 $ cmplx( zero ), x, lda )
504 CALL cptsvx( fact, n, nrhs, d, e, d( n+1 ), e( n+1 ), b,
505 $ lda, x, lda, rcond, rwork, rwork( nrhs+1 ),
506 $ work, rwork( 2*nrhs+1 ), info )
511 $
CALL alaerh( path,
'CPTSVX', info, izero, fact, n, n,
512 $ 1, 1, nrhs, imat, nfail, nerrs, nout )
513 IF( izero.EQ.0 )
THEN
514 IF( ifact.EQ.2 )
THEN
520 CALL cptt01( n, d, e, d( n+1 ), e( n+1 ), work,
528 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
529 CALL cptt02(
'Lower', n, nrhs, d, e, x, lda, work,
534 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
539 CALL cptt05( n, nrhs, d, e, b, lda, x, lda, xact, lda,
540 $ rwork, rwork( nrhs+1 ), result( 4 ) )
547 result( 6 ) = sget06( rcond, rcondc )
553 IF( result( k ).GE.thresh )
THEN
554 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
555 $
CALL aladhd( nout, path )
556 WRITE( nout, fmt = 9998 )
'CPTSVX', fact, n, imat,
568 CALL alasvm( path, nout, nfail, nrun, nerrs )
570 9999
FORMAT( 1x, a,
', N =', i5,
', type ', i2,
', test ', i2,
571 $
', ratio = ', g12.5 )
572 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', N =', i5,
', type ', i2,
573 $
', 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 cdrvpt(dotype, nn, nval, nrhs, thresh, tsterr, a, d, e, b, x, xact, work, rwork, nout)
CDRVPT
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine claptm(uplo, n, nrhs, alpha, d, e, x, ldx, beta, b, ldb)
CLAPTM
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 cptt01(n, d, e, df, ef, work, resid)
CPTT01
subroutine cptt02(uplo, n, nrhs, d, e, x, ldx, b, ldb, resid)
CPTT02
subroutine cptt05(n, nrhs, d, e, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPTT05
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine slarnv(idist, iseed, n, x)
SLARNV returns a vector of random numbers from a uniform or normal distribution.
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 cptsv(n, nrhs, d, e, b, ldb, info)
CPTSV computes the solution to system of linear equations A * X = B for PT matrices
subroutine cptsvx(fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
CPTSVX computes the solution to system of linear equations A * X = B for PT matrices
subroutine cpttrf(n, d, e, info)
CPTTRF
subroutine cpttrs(uplo, n, nrhs, d, e, b, ldb, info)
CPTTRS
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine sscal(n, sa, sx, incx)
SSCAL