182 SUBROUTINE schkge( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NNS,
183 $ NSVAL, THRESH, TSTERR, NMAX, A, AFAC, AINV, B,
184 $ X, XACT, WORK, RWORK, IWORK, NOUT )
192 INTEGER NM, NMAX, NN, NNB, NNS, NOUT
197 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NSVAL( * ),
199 REAL A( * ), AFAC( * ), AINV( * ), B( * ),
200 $ RWORK( * ), WORK( * ), X( * ), XACT( * )
207 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
209 parameter( ntypes = 11 )
211 parameter( ntests = 8 )
213 parameter( ntran = 3 )
216 LOGICAL TRFCON, ZEROT
217 CHARACTER DIST, NORM, TRANS,
TYPE, XTYPE
219 INTEGER I, IM, IMAT, IN, INB, INFO, IOFF, IRHS, ITRAN,
220 $ izero, k, kl, ku, lda, lwork, m, mode, n, nb,
221 $ nerrs, nfail, nimat, nrhs, nrun, nt
222 REAL AINVNM, ANORM, ANORMI, ANORMO, CNDNUM, DUMMY,
223 $ RCOND, RCONDC, RCONDI, RCONDO
226 CHARACTER TRANSS( NTRAN )
227 INTEGER ISEED( 4 ), ISEEDY( 4 )
228 REAL RESULT( NTESTS )
232 EXTERNAL SGET06, SLANGE
249 COMMON / infoc / infot, nunit, ok, lerr
250 COMMON / srnamc / srnamt
253 DATA iseedy / 1988, 1989, 1990, 1991 / ,
254 $ transs /
'N',
'T',
'C' /
260 path( 1: 1 ) =
'Single precision'
266 iseed( i ) = iseedy( i )
273 $
CALL serrge( path, nout )
289 IF( m.LE.0 .OR. n.LE.0 )
292 DO 100 imat = 1, nimat
296 IF( .NOT.dotype( imat ) )
301 zerot = imat.GE.5 .AND. imat.LE.7
302 IF( zerot .AND. n.LT.imat-4 )
308 CALL slatb4( path, imat, m, n,
TYPE, kl, ku, anorm, mode,
312 CALL slatms( m, n, dist, iseed,
TYPE, rwork, mode,
313 $ cndnum, anorm, kl, ku,
'No packing', a, lda,
319 CALL alaerh( path,
'SLATMS', info, 0,
' ', m, n, -1,
320 $ -1, -1, imat, nfail, nerrs, nout )
330 ELSE IF( imat.EQ.6 )
THEN
333 izero = min( m, n ) / 2 + 1
335 ioff = ( izero-1 )*lda
341 CALL slaset(
'Full', m, n-izero+1, zero, zero,
362 CALL slacpy(
'Full', m, n, a, lda, afac, lda )
364 CALL sgetrf( m, n, afac, lda, iwork, info )
369 $
CALL alaerh( path,
'SGETRF', info, izero,
' ', m,
370 $ n, -1, -1, nb, imat, nfail, nerrs,
377 CALL slacpy(
'Full', m, n, afac, lda, ainv, lda )
378 CALL sget01( m, n, a, lda, ainv, lda, iwork, rwork,
386 IF( m.EQ.n .AND. info.EQ.0 )
THEN
387 CALL slacpy(
'Full', n, n, afac, lda, ainv, lda )
390 lwork = nmax*max( 3, nrhs )
391 CALL sgetri( n, ainv, lda, iwork, work, lwork,
397 $
CALL alaerh( path,
'SGETRI', info, 0,
' ', n, n,
398 $ -1, -1, nb, imat, nfail, nerrs,
405 CALL sget03( n, a, lda, ainv, lda, work, lda,
406 $ rwork, rcondo, result( 2 ) )
407 anormo = slange(
'O', m, n, a, lda, rwork )
411 anormi = slange(
'I', m, n, a, lda, rwork )
412 ainvnm = slange(
'I', n, n, ainv, lda, rwork )
413 IF( anormi.LE.zero .OR. ainvnm.LE.zero )
THEN
416 rcondi = ( one / anormi ) / ainvnm
424 anormo = slange(
'O', m, n, a, lda, rwork )
425 anormi = slange(
'I', m, n, a, lda, rwork )
434 IF( result( k ).GE.thresh )
THEN
435 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
436 $
CALL alahd( nout, path )
437 WRITE( nout, fmt = 9999 )m, n, nb, imat, k,
448 IF( inb.GT.1 .OR. m.NE.n )
457 DO 50 itran = 1, ntran
458 trans = transs( itran )
459 IF( itran.EQ.1 )
THEN
469 CALL slarhs( path, xtype,
' ', trans, n, n, kl,
470 $ ku, nrhs, a, lda, xact, lda, b,
474 CALL slacpy(
'Full', n, nrhs, b, lda, x, lda )
476 CALL sgetrs( trans, n, nrhs, afac, lda, iwork,
482 $
CALL alaerh( path,
'SGETRS', info, 0, trans,
483 $ n, n, -1, -1, nrhs, imat, nfail,
486 CALL slacpy(
'Full', n, nrhs, b, lda, work,
488 CALL sget02( trans, n, n, nrhs, a, lda, x, lda,
489 $ work, lda, rwork, result( 3 ) )
494 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
502 CALL sgerfs( trans, n, nrhs, a, lda, afac, lda,
503 $ iwork, b, lda, x, lda, rwork,
504 $ rwork( nrhs+1 ), work,
505 $ iwork( n+1 ), info )
510 $
CALL alaerh( path,
'SGERFS', info, 0, trans,
511 $ n, n, -1, -1, nrhs, imat, nfail,
514 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
516 CALL sget07( trans, n, nrhs, a, lda, b, lda, x,
517 $ lda, xact, lda, rwork, .true.,
518 $ rwork( nrhs+1 ), result( 6 ) )
524 IF( result( k ).GE.thresh )
THEN
525 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
526 $
CALL alahd( nout, path )
527 WRITE( nout, fmt = 9998 )trans, n, nrhs,
528 $ imat, k, result( k )
541 IF( itran.EQ.1 )
THEN
551 CALL sgecon( norm, n, afac, lda, anorm, rcond,
552 $ work, iwork( n+1 ), info )
557 $
CALL alaerh( path,
'SGECON', info, 0, norm, n,
558 $ n, -1, -1, -1, imat, nfail, nerrs,
565 result( 8 ) = sget06( rcond, rcondc )
570 IF( result( 8 ).GE.thresh )
THEN
571 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
572 $
CALL alahd( nout, path )
573 WRITE( nout, fmt = 9997 )norm, n, imat, 8,
586 CALL alasum( path, nout, nfail, nrun, nerrs )
588 9999
FORMAT(
' M = ', i5,
', N =', i5,
', NB =', i4,
', type ', i2,
589 $
', test(', i2,
') =', g12.5 )
590 9998
FORMAT(
' TRANS=''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
591 $ i2,
', test(', i2,
') =', g12.5 )
592 9997
FORMAT(
' NORM =''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
593 $
', test(', i2,
') =', g12.5 )
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine sget02(trans, m, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
SGET02
subroutine slarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
SLARHS
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
subroutine sgecon(norm, n, a, lda, anorm, rcond, work, iwork, info)
SGECON
subroutine sgerfs(trans, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork, info)
SGERFS
subroutine sgetrf(m, n, a, lda, ipiv, info)
SGETRF
subroutine sgetri(n, a, lda, ipiv, work, lwork, info)
SGETRI
subroutine sgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
SGETRS
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 schkge(dotype, nm, mval, nn, nval, nnb, nbval, nns, nsval, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, iwork, nout)
SCHKGE
subroutine serrge(path, nunit)
SERRGE
subroutine sget01(m, n, a, lda, afac, ldafac, ipiv, rwork, resid)
SGET01
subroutine sget03(n, a, lda, ainv, ldainv, work, ldwork, rwork, rcond, resid)
SGET03
subroutine sget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
SGET04
subroutine sget07(trans, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, chkferr, berr, reslts)
SGET07
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