153 SUBROUTINE sdrvsp( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
154 $ A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK,
163 INTEGER NMAX, NN, NOUT, NRHS
168 INTEGER IWORK( * ), NVAL( * )
169 REAL A( * ), AFAC( * ), AINV( * ), B( * ),
170 $ rwork( * ), work( * ), x( * ), xact( * )
177 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
178 INTEGER NTYPES, NTESTS
179 parameter( ntypes = 10, ntests = 6 )
181 parameter( nfact = 2 )
185 CHARACTER DIST, FACT, PACKIT,
TYPE, UPLO, XTYPE
187 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
188 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
189 $ nerrs, nfail, nimat, npp, nrun, nt
190 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC
193 CHARACTER FACTS( NFACT )
194 INTEGER ISEED( 4 ), ISEEDY( 4 )
195 REAL RESULT( NTESTS )
199 EXTERNAL SGET06, SLANSP
212 COMMON / infoc / infot, nunit, ok, lerr
213 COMMON / srnamc / srnamt
219 DATA iseedy / 1988, 1989, 1990, 1991 /
220 DATA facts /
'F',
'N' /
226 path( 1: 1 ) =
'Single precision'
232 iseed( i ) = iseedy( i )
234 lwork = max( 2*nmax, nmax*nrhs )
239 $
CALL serrvx( path, nout )
253 DO 170 imat = 1, nimat
257 IF( .NOT.dotype( imat ) )
262 zerot = imat.GE.3 .AND. imat.LE.6
263 IF( zerot .AND. n.LT.imat-2 )
269 IF( iuplo.EQ.1 )
THEN
280 CALL slatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
284 CALL slatms( n, n, dist, iseed,
TYPE, rwork, mode,
285 $ cndnum, anorm, kl, ku, packit, a, lda, work,
291 CALL alaerh( path,
'SLATMS', info, 0, uplo, n, n, -1,
292 $ -1, -1, imat, nfail, nerrs, nout )
302 ELSE IF( imat.EQ.4 )
THEN
312 IF( iuplo.EQ.1 )
THEN
313 ioff = ( izero-1 )*izero / 2
314 DO 20 i = 1, izero - 1
324 DO 40 i = 1, izero - 1
335 IF( iuplo.EQ.1 )
THEN
363 DO 150 ifact = 1, nfact
367 fact = facts( ifact )
377 ELSE IF( ifact.EQ.1 )
THEN
381 anorm = slansp(
'1', uplo, n, a, rwork )
385 CALL scopy( npp, a, 1, afac, 1 )
386 CALL ssptrf( uplo, n, afac, iwork, info )
390 CALL scopy( npp, afac, 1, ainv, 1 )
391 CALL ssptri( uplo, n, ainv, iwork, work, info )
392 ainvnm = slansp(
'1', uplo, n, ainv, rwork )
396 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
399 rcondc = ( one / anorm ) / ainvnm
406 CALL slarhs( path, xtype, uplo,
' ', n, n, kl, ku,
407 $ nrhs, a, lda, xact, lda, b, lda, iseed,
413 IF( ifact.EQ.2 )
THEN
414 CALL scopy( npp, a, 1, afac, 1 )
415 CALL slacpy(
'Full', n, nrhs, b, lda, x, lda )
420 CALL sspsv( uplo, n, nrhs, afac, iwork, x, lda,
429 IF( iwork( k ).LT.0 )
THEN
430 IF( iwork( k ).NE.-k )
THEN
434 ELSE IF( iwork( k ).NE.k )
THEN
443 CALL alaerh( path,
'SSPSV ', info, k, uplo, n,
444 $ n, -1, -1, nrhs, imat, nfail,
447 ELSE IF( info.NE.0 )
THEN
454 CALL sspt01( uplo, n, a, afac, iwork, ainv, lda,
455 $ rwork, result( 1 ) )
459 CALL slacpy(
'Full', n, nrhs, b, lda, work, lda )
460 CALL sppt02( uplo, n, nrhs, a, x, lda, work, lda,
461 $ rwork, result( 2 ) )
465 CALL sget04( 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 )
'SSPSV ', uplo, n,
477 $ imat, k, result( k )
487 IF( ifact.EQ.2 .AND. npp.GT.0 )
488 $
CALL slaset(
'Full', npp, 1, zero, zero, afac,
490 CALL slaset(
'Full', n, nrhs, zero, zero, x, lda )
496 CALL sspsvx( fact, uplo, n, nrhs, a, afac, iwork, b,
497 $ lda, x, lda, rcond, rwork,
498 $ rwork( nrhs+1 ), work, iwork( n+1 ),
507 IF( iwork( k ).LT.0 )
THEN
508 IF( iwork( k ).NE.-k )
THEN
512 ELSE IF( iwork( k ).NE.k )
THEN
521 CALL alaerh( path,
'SSPSVX', info, k, fact // uplo,
522 $ n, n, -1, -1, nrhs, imat, nfail,
528 IF( ifact.GE.2 )
THEN
533 CALL sspt01( uplo, n, a, afac, iwork, ainv, lda,
534 $ rwork( 2*nrhs+1 ), result( 1 ) )
542 CALL slacpy(
'Full', n, nrhs, b, lda, work, lda )
543 CALL sppt02( uplo, n, nrhs, a, x, lda, work, lda,
544 $ rwork( 2*nrhs+1 ), result( 2 ) )
548 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
553 CALL sppt05( uplo, n, nrhs, a, b, lda, x, lda,
554 $ xact, lda, rwork, rwork( nrhs+1 ),
563 result( 6 ) = sget06( rcond, rcondc )
569 IF( result( k ).GE.thresh )
THEN
570 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
571 $
CALL aladhd( nout, path )
572 WRITE( nout, fmt = 9998 )
'SSPSVX', fact, uplo,
573 $ n, imat, k, result( k )
587 CALL alasvm( path, nout, nfail, nrun, nerrs )
589 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
590 $
', test ', i2,
', ratio =', g12.5 )
591 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
592 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine slarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
SLARHS
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 sspsv(uplo, n, nrhs, ap, ipiv, b, ldb, info)
SSPSV computes the solution to system of linear equations A * X = B for OTHER matrices
subroutine sspsvx(fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)
SSPSVX computes the solution to system of linear equations A * X = B for OTHER matrices
subroutine ssptrf(uplo, n, ap, ipiv, info)
SSPTRF
subroutine ssptri(uplo, n, ap, ipiv, work, info)
SSPTRI
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
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 sdrvsp(dotype, nn, nval, nrhs, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, iwork, nout)
SDRVSP
subroutine serrvx(path, nunit)
SERRVX
subroutine sget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
SGET04
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 sppt02(uplo, n, nrhs, a, x, ldx, b, ldb, rwork, resid)
SPPT02
subroutine sppt05(uplo, n, nrhs, ap, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
SPPT05
subroutine sspt01(uplo, n, a, afac, ipiv, c, ldc, rwork, resid)
SSPT01