138 SUBROUTINE sdrvpt( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, D,
139 $ E, B, X, XACT, WORK, RWORK, NOUT )
147 INTEGER NN, NOUT, NRHS
153 REAL A( * ), B( * ), D( * ), E( * ), RWORK( * ),
154 $ work( * ), x( * ), xact( * )
161 parameter( one = 1.0e+0, zero = 0.0e+0 )
163 parameter( ntypes = 12 )
165 parameter( ntests = 6 )
169 CHARACTER DIST, FACT, TYPE
171 INTEGER I, IA, IFACT, IMAT, IN, INFO, IX, IZERO, J, K,
172 $ k1, kl, ku, lda, mode, n, nerrs, nfail, nimat,
174 REAL AINVNM, ANORM, COND, DMAX, RCOND, RCONDC
177 INTEGER ISEED( 4 ), ISEEDY( 4 )
178 REAL RESULT( NTESTS ), Z( 3 )
182 REAL SASUM, SGET06, SLANST
183 EXTERNAL isamax, sasum, sget06, slanst
200 COMMON / infoc / infot, nunit, ok, lerr
201 COMMON / srnamc / srnamt
204 DATA iseedy / 0, 0, 0, 1 /
208 path( 1: 1 ) =
'Single precision'
214 iseed( i ) = iseedy( i )
220 $
CALL serrvx( path, nout )
233 DO 110 imat = 1, nimat
237 IF( n.GT.0 .AND. .NOT.dotype( imat ) )
242 CALL slatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
245 zerot = imat.GE.8 .AND. imat.LE.10
252 CALL slatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
253 $ anorm, kl, ku,
'B', a, 2, work, info )
258 CALL alaerh( path,
'SLATMS', info, 0,
' ', n, n, kl,
259 $ ku, -1, imat, nfail, nerrs, nout )
279 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
283 CALL slarnv( 2, iseed, n, d )
284 CALL slarnv( 2, iseed, n-1, e )
289 d( 1 ) = abs( d( 1 ) )
291 d( 1 ) = abs( d( 1 ) ) + abs( e( 1 ) )
292 d( n ) = abs( d( n ) ) + abs( e( n-1 ) )
294 d( i ) = abs( d( i ) ) + abs( e( i ) ) +
301 ix = isamax( n, d, 1 )
303 CALL sscal( n, anorm / dmax, d, 1 )
305 $
CALL sscal( n-1, anorm / dmax, e, 1 )
307 ELSE IF( izero.GT.0 )
THEN
312 IF( izero.EQ.1 )
THEN
316 ELSE IF( izero.EQ.n )
THEN
320 e( izero-1 ) = z( 1 )
338 ELSE IF( imat.EQ.9 )
THEN
346 ELSE IF( imat.EQ.10 )
THEN
348 IF( izero.GT.1 )
THEN
349 z( 1 ) = e( izero-1 )
363 CALL slarnv( 2, iseed, n, xact( ix ) )
369 CALL slaptm( n, nrhs, one, d, e, xact, lda, zero, b, lda )
372 IF( ifact.EQ.1 )
THEN
386 ELSE IF( ifact.EQ.1 )
THEN
390 anorm = slanst(
'1', n, d, e )
392 CALL scopy( n, d, 1, d( n+1 ), 1 )
394 $
CALL scopy( n-1, e, 1, e( n+1 ), 1 )
398 CALL spttrf( n, d( n+1 ), e( n+1 ), info )
409 CALL spttrs( n, 1, d( n+1 ), e( n+1 ), x, lda,
411 ainvnm = max( ainvnm, sasum( n, x, 1 ) )
416 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
419 rcondc = ( one / anorm ) / ainvnm
423 IF( ifact.EQ.2 )
THEN
427 CALL scopy( n, d, 1, d( n+1 ), 1 )
429 $
CALL scopy( n-1, e, 1, e( n+1 ), 1 )
430 CALL slacpy(
'Full', n, nrhs, b, lda, x, lda )
435 CALL sptsv( n, nrhs, d( n+1 ), e( n+1 ), x, lda,
441 $
CALL alaerh( path,
'SPTSV ', info, izero,
' ', n,
442 $ n, 1, 1, nrhs, imat, nfail, nerrs,
445 IF( izero.EQ.0 )
THEN
450 CALL sptt01( n, d, e, d( n+1 ), e( n+1 ), work,
455 CALL slacpy(
'Full', n, nrhs, b, lda, work, lda )
456 CALL sptt02( n, nrhs, d, e, x, lda, work, lda,
461 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
470 IF( result( k ).GE.thresh )
THEN
471 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
472 $
CALL aladhd( nout, path )
473 WRITE( nout, fmt = 9999 )
'SPTSV ', n, imat, k,
483 IF( ifact.GT.1 )
THEN
495 CALL slaset(
'Full', n, nrhs, zero, zero, x, lda )
501 CALL sptsvx( fact, n, nrhs, d, e, d( n+1 ), e( n+1 ), b,
502 $ lda, x, lda, rcond, rwork, rwork( nrhs+1 ),
508 $
CALL alaerh( path,
'SPTSVX', info, izero, fact, n, n,
509 $ 1, 1, nrhs, imat, nfail, nerrs, nout )
510 IF( izero.EQ.0 )
THEN
511 IF( ifact.EQ.2 )
THEN
517 CALL sptt01( n, d, e, d( n+1 ), e( n+1 ), work,
525 CALL slacpy(
'Full', n, nrhs, b, lda, work, lda )
526 CALL sptt02( n, nrhs, d, e, x, lda, work, lda,
531 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
536 CALL sptt05( n, nrhs, d, e, b, lda, x, lda, xact, lda,
537 $ rwork, rwork( nrhs+1 ), result( 4 ) )
544 result( 6 ) = sget06( rcond, rcondc )
550 IF( result( k ).GE.thresh )
THEN
551 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
552 $
CALL aladhd( nout, path )
553 WRITE( nout, fmt = 9998 )
'SPTSVX', fact, n, imat,
565 CALL alasvm( path, nout, nfail, nrun, nerrs )
567 9999
FORMAT( 1x, a,
', N =', i5,
', type ', i2,
', test ', i2,
568 $
', ratio = ', g12.5 )
569 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', N =', i5,
', type ', i2,
570 $
', 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 scopy(n, sx, incx, sy, incy)
SCOPY
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY 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 slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine sptsv(n, nrhs, d, e, b, ldb, info)
SPTSV computes the solution to system of linear equations A * X = B for PT matrices
subroutine sptsvx(fact, n, nrhs, d, e, df, ef, b, ldb, x, ldx, rcond, ferr, berr, work, info)
SPTSVX computes the solution to system of linear equations A * X = B for PT matrices
subroutine spttrf(n, d, e, info)
SPTTRF
subroutine spttrs(n, nrhs, d, e, b, ldb, info)
SPTTRS
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sdrvpt(dotype, nn, nval, nrhs, thresh, tsterr, a, d, e, b, x, xact, work, rwork, nout)
SDRVPT
subroutine serrvx(path, nunit)
SERRVX
subroutine sget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
SGET04
subroutine slaptm(n, nrhs, alpha, d, e, x, ldx, beta, b, ldb)
SLAPTM
subroutine slatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
SLATB4
subroutine slatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
SLATMS
subroutine sptt01(n, d, e, df, ef, work, resid)
SPTT01
subroutine sptt02(n, nrhs, d, e, x, ldx, b, ldb, resid)
SPTT02
subroutine sptt05(n, nrhs, d, e, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
SPTT05