170 SUBROUTINE dchksy_rook( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
171 $ thresh, tsterr, nmax, a, afac, ainv, b, x,
172 $ xact, work, rwork, iwork, nout )
181 INTEGER NMAX, NN, NNB, NNS, NOUT
182 DOUBLE PRECISION THRESH
186 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
187 DOUBLE PRECISION A( * ), AFAC( * ), AINV( * ), B( * ),
188 $ rwork( * ), work( * ), x( * ), xact( * )
194 DOUBLE PRECISION ZERO, ONE
195 parameter ( zero = 0.0d+0, one = 1.0d+0 )
196 DOUBLE PRECISION EIGHT, SEVTEN
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 DOUBLE PRECISION ALPHA, ANORM, CNDNUM, CONST, DTEMP, SING_MAX,
212 $ sing_min, rcond, rcondc
216 INTEGER IDUMMY( 1 ), ISEED( 4 ), ISEEDY( 4 )
217 DOUBLE PRECISION BLOCK( 2, 2 ), DDUMMY( 1 ), RESULT( ntests )
220 DOUBLE PRECISION DGET06, DLANGE, DLANSY
221 EXTERNAL dget06, dlange, dlansy
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 ) =
'Double precision'
258 matpath( 1: 1 ) =
'Double precision'
259 matpath( 2: 3 ) =
'SY'
265 iseed( i ) = iseedy( i )
271 $
CALL derrsy( 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 dlatb4( matpath, imat, n, n,
TYPE, KL, KU, ANORM,
317 $ mode, cndnum, dist )
322 CALL dlatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
323 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
329 CALL alaerh( path,
'DLATMS', 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 dlacpy( uplo, n, n, a, lda, afac, lda )
430 lwork = max( 2, nb )*lda
431 srnamt =
'DSYTRF_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,
'DSYTRF_ROOK', info, k,
456 $ uplo, n, n, -1, -1, nb, imat,
457 $ nfail, nerrs, nout )
470 CALL dsyt01_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 dlacpy( uplo, n, n, afac, lda, ainv, lda )
482 srnamt =
'DSYTRI_ROOK'
489 $
CALL alaerh( path,
'DSYTRI_ROOK', info, -1,
490 $ uplo, n, n, -1, -1, -1, imat,
491 $ nfail, nerrs, nout )
496 CALL dpot03( 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 dtemp = dlange(
'M', k-1, 1,
538 $ afac( ( k-1 )*lda+1 ), lda, rwork )
544 dtemp = dlange(
'M', k-2, 2,
545 $ afac( ( k-2 )*lda+1 ), lda, rwork )
552 dtemp = dtemp - const + thresh
553 IF( dtemp.GT.result( 3 ) )
554 $ result( 3 ) = dtemp
570 IF( iwork( k ).GT.zero )
THEN
575 dtemp = dlange(
'M', n-k, 1,
576 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
582 dtemp = dlange(
'M', n-k-1, 2,
583 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
590 dtemp = dtemp - const + thresh
591 IF( dtemp.GT.result( 3 ) )
592 $ result( 3 ) = dtemp
608 const = ( one+alpha ) / ( one-alpha )
609 CALL dlacpy( 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 dgesvd(
'N',
'N', 2, 2, block, 2, rwork,
632 $ ddummy, 1, ddummy, 1,
635 sing_max = rwork( 1 )
636 sing_min = rwork( 2 )
638 dtemp = sing_max / sing_min
642 dtemp = dtemp - const + thresh
643 IF( dtemp.GT.result( 4 ) )
644 $ result( 4 ) = dtemp
663 IF( iwork( k ).LT.zero )
THEN
669 block( 1, 1 ) = afac( ( k-1 )*lda+k )
670 block( 2, 1 ) = afac( ( k-1 )*lda+k+1 )
671 block( 1, 2 ) = block( 2, 1 )
672 block( 2, 2 ) = afac( k*lda+k+1 )
674 CALL dgesvd(
'N',
'N', 2, 2, block, 2, rwork,
675 $ ddummy, 1, ddummy, 1,
679 sing_max = rwork( 1 )
680 sing_min = rwork( 2 )
682 dtemp = sing_max / sing_min
686 dtemp = dtemp - const + thresh
687 IF( dtemp.GT.result( 4 ) )
688 $ result( 4 ) = dtemp
703 IF( result( k ).GE.thresh )
THEN
704 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
705 $
CALL alahd( nout, path )
706 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
738 CALL dlarhs( matpath, xtype, uplo,
' ', n, n,
739 $ kl, ku, nrhs, a, lda, xact, lda,
740 $ b, lda, iseed, info )
741 CALL dlacpy(
'Full', n, nrhs, b, lda, x, lda )
743 srnamt =
'DSYTRS_ROOK'
750 $
CALL alaerh( path,
'DSYTRS_ROOK', info, 0,
751 $ uplo, n, n, -1, -1, nrhs, imat,
752 $ nfail, nerrs, nout )
754 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
758 CALL dpot02( uplo, n, nrhs, a, lda, x, lda, work,
759 $ lda, rwork, result( 5 ) )
764 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
771 IF( result( k ).GE.thresh )
THEN
772 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
773 $
CALL alahd( nout, path )
774 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
775 $ imat, k, result( k )
789 anorm = dlansy(
'1', uplo, n, a, lda, rwork )
790 srnamt =
'DSYCON_ROOK'
791 CALL dsycon_rook( uplo, n, afac, lda, iwork, anorm,
792 $ rcond, work, iwork( n+1 ), info )
797 $
CALL alaerh( path,
'DSYCON_ROOK', info, 0,
798 $ uplo, n, n, -1, -1, -1, imat,
799 $ nfail, nerrs, nout )
803 result( 7 ) = dget06( rcond, rcondc )
808 IF( result( 7 ).GE.thresh )
THEN
809 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
810 $
CALL alahd( nout, path )
811 WRITE( nout, fmt = 9997 )uplo, n, imat, 7,
824 CALL alasum( path, nout, nfail, nrun, nerrs )
826 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
827 $ i2,
', test ', i2,
', ratio =', g12.5 )
828 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
829 $ i2,
', test(', i2,
') =', g12.5 )
830 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
831 $
', test(', i2,
') =', g12.5 )
subroutine dchksy_rook(DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL, THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK, NOUT)
DCHKSY_ROOK
subroutine dsyt01_rook(UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C, LDC, RWORK, RESID)
DSYT01_ROOK
subroutine alahd(IOUNIT, PATH)
ALAHD
subroutine dsytrs_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
DSYTRS_ROOK
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
subroutine dlarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
DLARHS
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dsytri_rook(UPLO, N, A, LDA, IPIV, WORK, INFO)
DSYTRI_ROOK
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
subroutine dsycon_rook(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)
DSYCON_ROOK
subroutine dpot03(UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK, RWORK, RCOND, RESID)
DPOT03
subroutine dlatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
DLATB4
subroutine dget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
DGET04
subroutine derrsy(PATH, NUNIT)
DERRSY
subroutine dlatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
DLATMS
subroutine dsytrf_rook(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
DSYTRF_ROOK
subroutine dgesvd(JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO)
DGESVD computes the singular value decomposition (SVD) for GE matrices
subroutine dpot02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
DPOT02
subroutine alasum(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASUM