144 SUBROUTINE schkpt( DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR,
145 $ A, D, E, B, X, XACT, WORK, RWORK, NOUT )
153 INTEGER NN, NNS, NOUT
158 INTEGER NSVAL( * ), NVAL( * )
159 REAL A( * ), B( * ), D( * ), E( * ), RWORK( * ),
160 $ work( * ), x( * ), xact( * )
167 parameter( one = 1.0e+0, zero = 0.0e+0 )
169 parameter( ntypes = 12 )
171 parameter( ntests = 7 )
177 INTEGER I, IA, IMAT, IN, INFO, IRHS, IX, IZERO, J, K,
178 $ kl, ku, lda, mode, n, nerrs, nfail, nimat,
180 REAL AINVNM, ANORM, COND, DMAX, RCOND, RCONDC
183 INTEGER ISEED( 4 ), ISEEDY( 4 )
184 REAL RESULT( NTESTS ), Z( 3 )
188 REAL SASUM, SGET06, SLANST
189 EXTERNAL isamax, sasum, sget06, slanst
206 COMMON / infoc / infot, nunit, ok, lerr
207 COMMON / srnamc / srnamt
210 DATA iseedy / 0, 0, 0, 1 /
214 path( 1: 1 ) =
'Single precision'
220 iseed( i ) = iseedy( i )
226 $
CALL serrgt( path, nout )
239 DO 100 imat = 1, nimat
243 IF( n.GT.0 .AND. .NOT.dotype( imat ) )
248 CALL slatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
251 zerot = imat.GE.8 .AND. imat.LE.10
258 CALL slatms( n, n, dist, iseed,
TYPE, rwork, mode, cond,
259 $ anorm, kl, ku,
'B', a, 2, work, info )
264 CALL alaerh( path,
'SLATMS', info, 0,
' ', n, n, kl,
265 $ ku, -1, imat, nfail, nerrs, nout )
285 IF( .NOT.zerot .OR. .NOT.dotype( 7 ) )
THEN
289 CALL slarnv( 2, iseed, n, d )
290 CALL slarnv( 2, iseed, n-1, e )
295 d( 1 ) = abs( d( 1 ) )
297 d( 1 ) = abs( d( 1 ) ) + abs( e( 1 ) )
298 d( n ) = abs( d( n ) ) + abs( e( n-1 ) )
300 d( i ) = abs( d( i ) ) + abs( e( i ) ) +
307 ix = isamax( n, d, 1 )
309 CALL sscal( n, anorm / dmax, d, 1 )
310 CALL sscal( n-1, anorm / dmax, e, 1 )
312 ELSE IF( izero.GT.0 )
THEN
317 IF( izero.EQ.1 )
THEN
321 ELSE IF( izero.EQ.n )
THEN
325 e( izero-1 ) = z( 1 )
343 ELSE IF( imat.EQ.9 )
THEN
351 ELSE IF( imat.EQ.10 )
THEN
353 IF( izero.GT.1 )
THEN
354 z( 1 ) = e( izero-1 )
364 CALL scopy( n, d, 1, d( n+1 ), 1 )
366 $
CALL scopy( n-1, e, 1, e( n+1 ), 1 )
372 CALL spttrf( n, d( n+1 ), e( n+1 ), info )
376 IF( info.NE.izero )
THEN
377 CALL alaerh( path,
'SPTTRF', info, izero,
' ', n, n, -1,
378 $ -1, -1, imat, nfail, nerrs, nout )
387 CALL sptt01( n, d, e, d( n+1 ), e( n+1 ), work,
392 IF( result( 1 ).GE.thresh )
THEN
393 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
394 $
CALL alahd( nout, path )
395 WRITE( nout, fmt = 9999 )n, imat, 1, result( 1 )
404 anorm = slanst(
'1', n, d, e )
415 CALL spttrs( n, 1, d( n+1 ), e( n+1 ), x, lda, info )
416 ainvnm = max( ainvnm, sasum( n, x, 1 ) )
418 rcondc = one / max( one, anorm*ainvnm )
427 CALL slarnv( 2, iseed, n, xact( ix ) )
433 CALL slaptm( n, nrhs, one, d, e, xact, lda, zero, b,
439 CALL slacpy(
'Full', n, nrhs, b, lda, x, lda )
440 CALL spttrs( n, nrhs, d( n+1 ), e( n+1 ), x, lda, info )
445 $
CALL alaerh( path,
'SPTTRS', info, 0,
' ', n, n, -1,
446 $ -1, nrhs, imat, nfail, nerrs, nout )
448 CALL slacpy(
'Full', n, nrhs, b, lda, work, lda )
449 CALL sptt02( n, nrhs, d, e, x, lda, work, lda,
455 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
462 CALL sptrfs( n, nrhs, d, e, d( n+1 ), e( n+1 ), b, lda,
463 $ x, lda, rwork, rwork( nrhs+1 ), work, info )
468 $
CALL alaerh( path,
'SPTRFS', info, 0,
' ', n, n, -1,
469 $ -1, nrhs, imat, nfail, nerrs, nout )
471 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
473 CALL sptt05( n, nrhs, d, e, b, lda, x, lda, xact, lda,
474 $ rwork, rwork( nrhs+1 ), result( 5 ) )
480 IF( result( k ).GE.thresh )
THEN
481 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
482 $
CALL alahd( nout, path )
483 WRITE( nout, fmt = 9998 )n, nrhs, imat, k,
497 CALL sptcon( n, d( n+1 ), e( n+1 ), anorm, rcond, rwork,
503 $
CALL alaerh( path,
'SPTCON', info, 0,
' ', n, n, -1, -1,
504 $ -1, imat, nfail, nerrs, nout )
506 result( 7 ) = sget06( rcond, rcondc )
510 IF( result( 7 ).GE.thresh )
THEN
511 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
512 $
CALL alahd( nout, path )
513 WRITE( nout, fmt = 9999 )n, imat, 7, result( 7 )
522 CALL alasum( path, nout, nfail, nrun, nerrs )
524 9999
FORMAT(
' N =', i5,
', type ', i2,
', test ', i2,
', ratio = ',
526 9998
FORMAT(
' N =', i5,
', NRHS=', i3,
', type ', i2,
', test(', i2,
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
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 sptcon(n, d, e, anorm, rcond, work, info)
SPTCON
subroutine sptrfs(n, nrhs, d, e, df, ef, b, ldb, x, ldx, ferr, berr, work, info)
SPTRFS
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 schkpt(dotype, nn, nval, nns, nsval, thresh, tsterr, a, d, e, b, x, xact, work, rwork, nout)
SCHKPT
subroutine serrgt(path, nunit)
SERRGT
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