173 SUBROUTINE dchksy_rk( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
174 $ THRESH, TSTERR, NMAX, A, AFAC, E, AINV, B,
175 $ X, XACT, WORK, RWORK, IWORK, NOUT )
183 INTEGER NMAX, NN, NNB, NNS, NOUT
184 DOUBLE PRECISION THRESH
188 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
189 DOUBLE PRECISION A( * ), AFAC( * ), AINV( * ), B( * ), E( * ),
190 $ rwork( * ), work( * ), x( * ), xact( * )
196 DOUBLE PRECISION ZERO, ONE
197 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
198 DOUBLE PRECISION EIGHT, SEVTEN
199 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
201 parameter( ntypes = 10 )
203 parameter( ntests = 7 )
206 LOGICAL TRFCON, ZEROT
207 CHARACTER DIST,
TYPE, UPLO, XTYPE
208 CHARACTER*3 PATH, MATPATH
209 INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
210 $ itemp, iuplo, izero, j, k, kl, ku, lda, lwork,
211 $ mode, n, nb, nerrs, nfail, nimat, nrhs, nrun,
213 DOUBLE PRECISION ALPHA, ANORM, CNDNUM, CONST, DTEMP, SING_MAX,
214 $ SING_MIN, RCOND, RCONDC
218 INTEGER IDUMMY( 1 ), ISEED( 4 ), ISEEDY( 4 )
219 DOUBLE PRECISION BLOCK( 2, 2 ), DDUMMY( 1 ), RESULT( NTESTS )
222 DOUBLE PRECISION DGET06, DLANGE, DLANSY
223 EXTERNAL DGET06, DLANGE, DLANSY
232 INTRINSIC max, min, sqrt
240 COMMON / infoc / infot, nunit, ok, lerr
241 COMMON / srnamc / srnamt
244 DATA iseedy / 1988, 1989, 1990, 1991 /
245 DATA uplos /
'U',
'L' /
251 alpha = ( one+sqrt( sevten ) ) / eight
255 path( 1: 1 ) =
'Double precision'
260 matpath( 1: 1 ) =
'Double precision'
261 matpath( 2: 3 ) =
'SY'
267 iseed( i ) = iseedy( i )
273 $
CALL derrsy( path, nout )
295 DO 260 imat = 1, nimat
299 IF( .NOT.dotype( imat ) )
304 zerot = imat.GE.3 .AND. imat.LE.6
305 IF( zerot .AND. n.LT.imat-2 )
311 uplo = uplos( iuplo )
318 CALL dlatb4( matpath, imat, n, n,
TYPE, kl, ku, anorm,
319 $ mode, cndnum, dist )
324 CALL dlatms( n, n, dist, iseed,
TYPE, rwork, mode,
325 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
331 CALL alaerh( path,
'DLATMS', info, 0, uplo, n, n, -1,
332 $ -1, -1, imat, nfail, nerrs, nout )
346 ELSE IF( imat.EQ.4 )
THEN
356 IF( iuplo.EQ.1 )
THEN
357 ioff = ( izero-1 )*lda
358 DO 20 i = 1, izero - 1
368 DO 40 i = 1, izero - 1
378 IF( iuplo.EQ.1 )
THEN
425 CALL dlacpy( uplo, n, n, a, lda, afac, lda )
432 lwork = max( 2, nb )*lda
434 CALL dsytrf_rk( uplo, n, afac, lda, e, iwork, ainv,
443 IF( iwork( k ).LT.0 )
THEN
444 IF( iwork( k ).NE.-k )
THEN
448 ELSE IF( iwork( k ).NE.k )
THEN
457 $
CALL alaerh( path,
'DSYTRF_RK', info, k,
458 $ uplo, n, n, -1, -1, nb, imat,
459 $ nfail, nerrs, nout )
472 CALL dsyt01_3( uplo, n, a, lda, afac, lda, e, iwork,
473 $ ainv, lda, rwork, result( 1 ) )
482 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
483 CALL dlacpy( uplo, n, n, afac, lda, ainv, lda )
490 lwork = (n+nb+1)*(nb+3)
491 CALL dsytri_3( uplo, n, ainv, lda, e, iwork, work,
497 $
CALL alaerh( path,
'DSYTRI_3', info, -1,
498 $ uplo, n, n, -1, -1, -1, imat,
499 $ nfail, nerrs, nout )
504 CALL dpot03( uplo, n, a, lda, ainv, lda, work, lda,
505 $ rwork, rcondc, result( 2 ) )
513 IF( result( k ).GE.thresh )
THEN
514 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
515 $
CALL alahd( nout, path )
516 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
529 const = one / ( one-alpha )
531 IF( iuplo.EQ.1 )
THEN
540 IF( iwork( k ).GT.zero )
THEN
545 dtemp = dlange(
'M', k-1, 1,
546 $ afac( ( k-1 )*lda+1 ), lda, rwork )
552 dtemp = dlange(
'M', k-2, 2,
553 $ afac( ( k-2 )*lda+1 ), lda, rwork )
560 dtemp = dtemp - const + thresh
561 IF( dtemp.GT.result( 3 ) )
562 $ result( 3 ) = dtemp
578 IF( iwork( k ).GT.zero )
THEN
583 dtemp = dlange(
'M', n-k, 1,
584 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
590 dtemp = dlange(
'M', n-k-1, 2,
591 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
598 dtemp = dtemp - const + thresh
599 IF( dtemp.GT.result( 3 ) )
600 $ result( 3 ) = dtemp
615 const = ( one+alpha ) / ( one-alpha )
616 CALL dlacpy( uplo, n, n, afac, lda, ainv, lda )
618 IF( iuplo.EQ.1 )
THEN
627 IF( iwork( k ).LT.zero )
THEN
633 block( 1, 1 ) = afac( ( k-2 )*lda+k-1 )
634 block( 1, 2 ) = e( k )
635 block( 2, 1 ) = block( 1, 2 )
636 block( 2, 2 ) = afac( (k-1)*lda+k )
638 CALL dgesvd(
'N',
'N', 2, 2, block, 2, rwork,
639 $ ddummy, 1, ddummy, 1,
642 sing_max = rwork( 1 )
643 sing_min = rwork( 2 )
645 dtemp = sing_max / sing_min
649 dtemp = dtemp - const + thresh
650 IF( dtemp.GT.result( 4 ) )
651 $ result( 4 ) = dtemp
670 IF( iwork( k ).LT.zero )
THEN
676 block( 1, 1 ) = afac( ( k-1 )*lda+k )
677 block( 2, 1 ) = e( k )
678 block( 1, 2 ) = block( 2, 1 )
679 block( 2, 2 ) = afac( k*lda+k+1 )
681 CALL dgesvd(
'N',
'N', 2, 2, block, 2, rwork,
682 $ ddummy, 1, ddummy, 1,
686 sing_max = rwork( 1 )
687 sing_min = rwork( 2 )
689 dtemp = sing_max / sing_min
693 dtemp = dtemp - const + thresh
694 IF( dtemp.GT.result( 4 ) )
695 $ result( 4 ) = dtemp
710 IF( result( k ).GE.thresh )
THEN
711 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
712 $
CALL alahd( nout, path )
713 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
745 CALL dlarhs( matpath, xtype, uplo,
' ', n, n,
746 $ kl, ku, nrhs, a, lda, xact, lda,
747 $ b, lda, iseed, info )
748 CALL dlacpy(
'Full', n, nrhs, b, lda, x, lda )
751 CALL dsytrs_3( uplo, n, nrhs, afac, lda, e, iwork,
757 $
CALL alaerh( path,
'DSYTRS_3', info, 0,
758 $ uplo, n, n, -1, -1, nrhs, imat,
759 $ nfail, nerrs, nout )
761 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
765 CALL dpot02( uplo, n, nrhs, a, lda, x, lda, work,
766 $ lda, rwork, result( 5 ) )
771 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
778 IF( result( k ).GE.thresh )
THEN
779 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
780 $
CALL alahd( nout, path )
781 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
782 $ imat, k, result( k )
796 anorm = dlansy(
'1', uplo, n, a, lda, rwork )
798 CALL dsycon_3( uplo, n, afac, lda, e, iwork, anorm,
799 $ rcond, work, iwork( n+1 ), info )
804 $
CALL alaerh( path,
'DSYCON_3', info, 0,
805 $ uplo, n, n, -1, -1, -1, imat,
806 $ nfail, nerrs, nout )
810 result( 7 ) = dget06( rcond, rcondc )
815 IF( result( 7 ).GE.thresh )
THEN
816 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
817 $
CALL alahd( nout, path )
818 WRITE( nout, fmt = 9997 ) uplo, n, imat, 7,
831 CALL alasum( path, nout, nfail, nrun, nerrs )
833 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
834 $ i2,
', test ', i2,
', ratio =', g12.5 )
835 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
836 $ i2,
', test(', i2,
') =', g12.5 )
837 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
838 $
', test(', i2,
') =', g12.5 )
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine dlarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
DLARHS
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 dchksy_rk(dotype, nn, nval, nnb, nbval, nns, nsval, thresh, tsterr, nmax, a, afac, e, ainv, b, x, xact, work, rwork, iwork, nout)
DCHKSY_RK
subroutine derrsy(path, nunit)
DERRSY
subroutine dget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
DGET04
subroutine dlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
DLATB4
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
subroutine dpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
DPOT02
subroutine dpot03(uplo, n, a, lda, ainv, ldainv, work, ldwork, rwork, rcond, resid)
DPOT03
subroutine dsyt01_3(uplo, n, a, lda, afac, ldafac, e, ipiv, c, ldc, rwork, resid)
DSYT01_3
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 dsycon_3(uplo, n, a, lda, e, ipiv, anorm, rcond, work, iwork, info)
DSYCON_3
subroutine dsytrf_rk(uplo, n, a, lda, e, ipiv, work, lwork, info)
DSYTRF_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Ka...
subroutine dsytri_3(uplo, n, a, lda, e, ipiv, work, lwork, info)
DSYTRI_3
subroutine dsytrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
DSYTRS_3
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.