181 INTEGER nmax, nn, nnb, nns, nout
186 INTEGER iwork( * ), nbval( * ), nsval( * ), nval( * )
187 REAL a( * ), afac( * ), ainv( * ), b( * ),
188 $ rwork( * ), work( * ), x( * ), xact( * )
195 parameter ( zero = 0.0d+0, one = 1.0d+0 )
197 parameter ( eight = 8.0d+0, sevten = 17.0d+0 )
199 parameter ( ntypes = 10 )
201 parameter ( ntests = 7 )
204 LOGICAL trfcon, zerot
205 CHARACTER dist,
TYPE, uplo, xtype
206 CHARACTER*3 path, matpath
207 INTEGER i, i1, i2, imat, in, inb, info, ioff, irhs,
208 $ itemp, iuplo, izero, j, k, kl, ku, lda, lwork,
209 $ mode, n, nb, nerrs, nfail, nimat, nrhs, nrun,
211 REAL alpha, anorm, cndnum, const, sing_max,
212 $ sing_min, rcond, rcondc, stemp
216 INTEGER idummy( 1 ), iseed( 4 ), iseedy( 4 )
217 REAL block( 2, 2 ), result( ntests ), sdummy( 1 )
230 INTRINSIC max, min, sqrt
238 COMMON / infoc / infot, nunit, ok, lerr
239 COMMON / srnamc / srnamt
242 DATA iseedy / 1988, 1989, 1990, 1991 /
243 DATA uplos /
'U',
'L' /
249 alpha = ( one+sqrt( sevten ) ) / eight
253 path( 1: 1 ) =
'Single precision'
258 matpath( 1: 1 ) =
'Single precision'
259 matpath( 2: 3 ) =
'SY'
265 iseed( i ) = iseedy( i )
271 $
CALL serrsy( path, nout )
293 DO 260 imat = 1, nimat
297 IF( .NOT.dotype( imat ) )
302 zerot = imat.GE.3 .AND. imat.LE.6
303 IF( zerot .AND. n.LT.imat-2 )
309 uplo = uplos( iuplo )
316 CALL slatb4( matpath, imat, n, n,
TYPE, kl, ku, anorm,
317 $ mode, cndnum, dist )
322 CALL slatms( n, n, dist, iseed,
TYPE, rwork, mode,
323 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
329 CALL alaerh( path,
'SLATMS', info, 0, uplo, n, n, -1,
330 $ -1, -1, imat, nfail, nerrs, nout )
344 ELSE IF( imat.EQ.4 )
THEN
354 IF( iuplo.EQ.1 )
THEN
355 ioff = ( izero-1 )*lda
356 DO 20 i = 1, izero - 1
366 DO 40 i = 1, izero - 1
376 IF( iuplo.EQ.1 )
THEN
423 CALL slacpy( uplo, n, n, a, lda, afac, lda )
430 lwork = max( 2, nb )*lda
431 srnamt =
'SSYTRF_ROOK'
441 IF( iwork( k ).LT.0 )
THEN
442 IF( iwork( k ).NE.-k )
THEN
446 ELSE IF( iwork( k ).NE.k )
THEN
455 $
CALL alaerh( path,
'SSYTRF_ROOK', info, k,
456 $ uplo, n, n, -1, -1, nb, imat,
457 $ nfail, nerrs, nout )
470 CALL ssyt01_rook( uplo, n, a, lda, afac, lda, iwork,
471 $ ainv, lda, rwork, result( 1 ) )
480 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
481 CALL slacpy( uplo, n, n, afac, lda, ainv, lda )
482 srnamt =
'SSYTRI_ROOK'
489 $
CALL alaerh( path,
'SSYTRI_ROOK', info, -1,
490 $ uplo, n, n, -1, -1, -1, imat,
491 $ nfail, nerrs, nout )
496 CALL spot03( uplo, n, a, lda, ainv, lda, work, lda,
497 $ rwork, rcondc, result( 2 ) )
505 IF( result( k ).GE.thresh )
THEN
506 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
507 $
CALL alahd( nout, path )
508 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
521 const = one / ( one-alpha )
523 IF( iuplo.EQ.1 )
THEN
532 IF( iwork( k ).GT.zero )
THEN
537 stemp =
slange(
'M', k-1, 1,
538 $ afac( ( k-1 )*lda+1 ), lda, rwork )
544 stemp =
slange(
'M', k-2, 2,
545 $ afac( ( k-2 )*lda+1 ), lda, rwork )
552 stemp = stemp - const + thresh
553 IF( stemp.GT.result( 3 ) )
554 $ result( 3 ) = stemp
570 IF( iwork( k ).GT.zero )
THEN
575 stemp =
slange(
'M', n-k, 1,
576 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
582 stemp =
slange(
'M', n-k-1, 2,
583 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
590 stemp = stemp - const + thresh
591 IF( stemp.GT.result( 3 ) )
592 $ result( 3 ) = stemp
608 const = ( one+alpha ) / ( one-alpha )
609 CALL slacpy( uplo, n, n, afac, lda, ainv, lda )
611 IF( iuplo.EQ.1 )
THEN
620 IF( iwork( k ).LT.zero )
THEN
626 block( 1, 1 ) = afac( ( k-2 )*lda+k-1 )
627 block( 1, 2 ) = afac( (k-1)*lda+k-1 )
628 block( 2, 1 ) = block( 1, 2 )
629 block( 2, 2 ) = afac( (k-1)*lda+k )
631 CALL sgesvd(
'N',
'N', 2, 2, block, 2, rwork,
632 $ sdummy, 1, sdummy, 1,
636 sing_max = rwork( 1 )
637 sing_min = rwork( 2 )
639 stemp = sing_max / sing_min
643 stemp = stemp - const + thresh
644 IF( stemp.GT.result( 4 ) )
645 $ result( 4 ) = stemp
664 IF( iwork( k ).LT.zero )
THEN
670 block( 1, 1 ) = afac( ( k-1 )*lda+k )
671 block( 2, 1 ) = afac( ( k-1 )*lda+k+1 )
672 block( 1, 2 ) = block( 2, 1 )
673 block( 2, 2 ) = afac( k*lda+k+1 )
675 CALL sgesvd(
'N',
'N', 2, 2, block, 2, rwork,
676 $ sdummy, 1, sdummy, 1,
680 sing_max = rwork( 1 )
681 sing_min = rwork( 2 )
683 stemp = sing_max / sing_min
687 stemp = stemp - const + thresh
688 IF( stemp.GT.result( 4 ) )
689 $ result( 4 ) = stemp
704 IF( result( k ).GE.thresh )
THEN
705 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
706 $
CALL alahd( nout, path )
707 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
739 CALL slarhs( matpath, xtype, uplo,
' ', n, n,
740 $ kl, ku, nrhs, a, lda, xact, lda,
741 $ b, lda, iseed, info )
742 CALL slacpy(
'Full', n, nrhs, b, lda, x, lda )
744 srnamt =
'SSYTRS_ROOK'
751 $
CALL alaerh( path,
'SSYTRS_ROOK', info, 0,
752 $ uplo, n, n, -1, -1, nrhs, imat,
753 $ nfail, nerrs, nout )
755 CALL slacpy(
'Full', n, nrhs, b, lda, work, lda )
759 CALL spot02( uplo, n, nrhs, a, lda, x, lda, work,
760 $ lda, rwork, result( 5 ) )
765 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
772 IF( result( k ).GE.thresh )
THEN
773 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
774 $
CALL alahd( nout, path )
775 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
776 $ imat, k, result( k )
790 anorm =
slansy(
'1', uplo, n, a, lda, rwork )
791 srnamt =
'SSYCON_ROOK'
792 CALL ssycon_rook( uplo, n, afac, lda, iwork, anorm,
793 $ rcond, work, iwork( n+1 ), info )
798 $
CALL alaerh( path,
'SSYCON_ROOK', info, 0,
799 $ uplo, n, n, -1, -1, -1, imat,
800 $ nfail, nerrs, nout )
804 result( 7 ) =
sget06( rcond, rcondc )
809 IF( result( 7 ).GE.thresh )
THEN
810 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
811 $
CALL alahd( nout, path )
812 WRITE( nout, fmt = 9997 )uplo, n, imat, 7,
825 CALL alasum( path, nout, nfail, nrun, nerrs )
827 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
828 $ i2,
', test ', i2,
', ratio =', g12.5 )
829 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
830 $ i2,
', test(', i2,
') =', g12.5 )
831 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
832 $
', test(', i2,
') =', g12.5 )
subroutine alahd(IOUNIT, PATH)
ALAHD
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
subroutine slatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
SLATB4
subroutine ssytrf_rook(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
SSYTRF_ROOK
subroutine ssyt01_rook(UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C, LDC, RWORK, RESID)
SSYT01_ROOK
subroutine slarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
SLARHS
real function sget06(RCOND, RCONDC)
SGET06
subroutine ssycon_rook(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)
SSYCON_ROOK
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
subroutine ssytri_rook(UPLO, N, A, LDA, IPIV, WORK, INFO)
SSYTRI_ROOK
subroutine slacpy(UPLO, M, N, A, LDA, B, LDB)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
SLATMS
real function slange(NORM, M, N, A, LDA, WORK)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
subroutine sget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
SGET04
subroutine spot03(UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK, RWORK, RCOND, RESID)
SPOT03
subroutine ssytrs_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
SSYTRS_ROOK
subroutine serrsy(PATH, NUNIT)
SERRSY
subroutine sgesvd(JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO)
SGESVD computes the singular value decomposition (SVD) for GE matrices
subroutine spot02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
SPOT02
subroutine alasum(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASUM
real function slansy(NORM, UPLO, N, A, LDA, WORK)
SLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix.