171 SUBROUTINE cchksy_rook( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
172 $ thresh, tsterr, nmax, a, afac, ainv, b, x,
173 $ xact, work, rwork, iwork, nout )
182 INTEGER NMAX, NN, NNB, NNS, NOUT
187 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
189 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
190 $ work( * ), x( * ), xact( * )
197 parameter ( zero = 0.0e+0, one = 1.0e+0 )
199 parameter ( onehalf = 0.5e+0 )
201 parameter ( eight = 8.0e+0, sevten = 17.0e+0 )
203 parameter ( czero = ( 0.0e+0, 0.0e+0 ) )
205 parameter ( ntypes = 11 )
207 parameter ( ntests = 7 )
210 LOGICAL TRFCON, ZEROT
211 CHARACTER DIST,
TYPE, UPLO, XTYPE
212 CHARACTER*3 PATH, MATPATH
213 INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
214 $ itemp, itemp2, iuplo, izero, j, k, kl, ku, lda,
215 $ lwork, mode, n, nb, nerrs, nfail, nimat, nrhs,
217 REAL ALPHA, ANORM, CNDNUM, CONST, SING_MAX,
218 $ sing_min, rcond, rcondc, stemp
222 INTEGER ISEED( 4 ), ISEEDY( 4 )
223 REAL RESULT( ntests )
224 COMPLEX BLOCK( 2, 2 ), CDUMMY( 1 )
227 REAL CLANGE, CLANSY, SGET06
228 EXTERNAL clange, clansy, sget06
237 INTRINSIC max, min, sqrt
245 COMMON / infoc / infot, nunit, ok, lerr
246 COMMON / srnamc / srnamt
249 DATA iseedy / 1988, 1989, 1990, 1991 /
250 DATA uplos /
'U',
'L' /
256 alpha = ( one+sqrt( sevten ) ) / eight
260 path( 1: 1 ) =
'Complex precision'
265 matpath( 1: 1 ) =
'Complex precision'
266 matpath( 2: 3 ) =
'SY'
272 iseed( i ) = iseedy( i )
278 $
CALL cerrsy( path, nout )
300 DO 260 imat = 1, nimat
304 IF( .NOT.dotype( imat ) )
309 zerot = imat.GE.3 .AND. imat.LE.6
310 IF( zerot .AND. n.LT.imat-2 )
316 uplo = uplos( iuplo )
320 IF( imat.NE.ntypes )
THEN
325 CALL clatb4( matpath, imat, n, n,
TYPE, KL, KU, ANORM,
326 $ mode, cndnum, dist )
331 CALL clatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
332 $ cndnum, anorm, kl, ku, uplo, a, lda,
338 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
339 $ -1, -1, -1, imat, nfail, nerrs, nout )
353 ELSE IF( imat.EQ.4 )
THEN
363 IF( iuplo.EQ.1 )
THEN
364 ioff = ( izero-1 )*lda
365 DO 20 i = 1, izero - 1
375 DO 40 i = 1, izero - 1
385 IF( iuplo.EQ.1 )
THEN
421 CALL clatsy( uplo, n, a, lda, iseed )
442 CALL clacpy( uplo, n, n, a, lda, afac, lda )
449 lwork = max( 2, nb )*lda
450 srnamt =
'CSYTRF_ROOK'
460 IF( iwork( k ).LT.0 )
THEN
461 IF( iwork( k ).NE.-k )
THEN
465 ELSE IF( iwork( k ).NE.k )
THEN
474 $
CALL alaerh( path,
'CSYTRF_ROOK', info, k,
475 $ uplo, n, n, -1, -1, nb, imat,
476 $ nfail, nerrs, nout )
489 CALL csyt01_rook( uplo, n, a, lda, afac, lda, iwork,
490 $ ainv, lda, rwork, result( 1 ) )
499 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
500 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
501 srnamt =
'CSYTRI_ROOK'
508 $
CALL alaerh( path,
'CSYTRI_ROOK', info, -1,
509 $ uplo, n, n, -1, -1, -1, imat,
510 $ nfail, nerrs, nout )
515 CALL csyt03( uplo, n, a, lda, ainv, lda, work, lda,
516 $ rwork, rcondc, result( 2 ) )
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 = 9999 )uplo, n, nb, imat, k,
540 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) ) /
543 IF( iuplo.EQ.1 )
THEN
552 IF( iwork( k ).GT.zero )
THEN
557 stemp = clange(
'M', k-1, 1,
558 $ afac( ( k-1 )*lda+1 ), lda, rwork )
564 stemp = clange(
'M', k-2, 2,
565 $ afac( ( k-2 )*lda+1 ), lda, rwork )
572 stemp = stemp - const + thresh
573 IF( stemp.GT.result( 3 ) )
574 $ result( 3 ) = stemp
590 IF( iwork( k ).GT.zero )
THEN
595 stemp = clange(
'M', n-k, 1,
596 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
602 stemp = clange(
'M', n-k-1, 2,
603 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
610 stemp = stemp - const + thresh
611 IF( stemp.GT.result( 3 ) )
612 $ result( 3 ) = stemp
628 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) )*
629 $ ( ( one + alpha ) / ( one - alpha ) )
631 IF( iuplo.EQ.1 )
THEN
640 IF( iwork( k ).LT.zero )
THEN
646 block( 1, 1 ) = afac( ( k-2 )*lda+k-1 )
647 block( 1, 2 ) = afac( (k-1)*lda+k-1 )
648 block( 2, 1 ) = block( 1, 2 )
649 block( 2, 2 ) = afac( (k-1)*lda+k )
651 CALL cgesvd(
'N',
'N', 2, 2, block, 2, rwork,
652 $ cdummy, 1, cdummy, 1,
653 $ work, 6, rwork( 3 ), info )
656 sing_max = rwork( 1 )
657 sing_min = rwork( 2 )
659 stemp = sing_max / sing_min
663 stemp = stemp - const + thresh
664 IF( stemp.GT.result( 4 ) )
665 $ result( 4 ) = stemp
684 IF( iwork( k ).LT.zero )
THEN
690 block( 1, 1 ) = afac( ( k-1 )*lda+k )
691 block( 2, 1 ) = afac( ( k-1 )*lda+k+1 )
692 block( 1, 2 ) = block( 2, 1 )
693 block( 2, 2 ) = afac( k*lda+k+1 )
695 CALL cgesvd(
'N',
'N', 2, 2, block, 2, rwork,
696 $ cdummy, 1, cdummy, 1,
697 $ work, 6, rwork(3), info )
699 sing_max = rwork( 1 )
700 sing_min = rwork( 2 )
702 stemp = sing_max / sing_min
706 stemp = stemp - const + thresh
707 IF( stemp.GT.result( 4 ) )
708 $ result( 4 ) = stemp
723 IF( result( k ).GE.thresh )
THEN
724 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
725 $
CALL alahd( nout, path )
726 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
758 CALL clarhs( matpath, xtype, uplo,
' ', n, n,
759 $ kl, ku, nrhs, a, lda, xact, lda,
760 $ b, lda, iseed, info )
761 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
763 srnamt =
'CSYTRS_ROOK'
770 $
CALL alaerh( path,
'CSYTRS_ROOK', info, 0,
771 $ uplo, n, n, -1, -1, nrhs, imat,
772 $ nfail, nerrs, nout )
774 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
778 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
779 $ lda, rwork, result( 5 ) )
784 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
791 IF( result( k ).GE.thresh )
THEN
792 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
793 $
CALL alahd( nout, path )
794 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
795 $ imat, k, result( k )
809 anorm = clansy(
'1', uplo, n, a, lda, rwork )
810 srnamt =
'CSYCON_ROOK'
811 CALL csycon_rook( uplo, n, afac, lda, iwork, anorm,
812 $ rcond, work, info )
817 $
CALL alaerh( path,
'CSYCON_ROOK', info, 0,
818 $ uplo, n, n, -1, -1, -1, imat,
819 $ nfail, nerrs, nout )
823 result( 7 ) = sget06( rcond, rcondc )
828 IF( result( 7 ).GE.thresh )
THEN
829 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
830 $
CALL alahd( nout, path )
831 WRITE( nout, fmt = 9997 )uplo, n, imat, 7,
844 CALL alasum( path, nout, nfail, nrun, nerrs )
846 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
847 $ i2,
', test ', i2,
', ratio =', g12.5 )
848 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
849 $ i2,
', test(', i2,
') =', g12.5 )
850 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
851 $
', test(', i2,
') =', g12.5 )
subroutine csytri_rook(UPLO, N, A, LDA, IPIV, WORK, INFO)
CSYTRI_ROOK
subroutine alahd(IOUNIT, PATH)
ALAHD
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
subroutine clatsy(UPLO, N, X, LDX, ISEED)
CLATSY
subroutine clarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
CLARHS
subroutine csyt02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
CSYT02
subroutine cgesvd(JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, RWORK, INFO)
CGESVD computes the singular value decomposition (SVD) for GE matrices
subroutine cerrsy(PATH, NUNIT)
CERRSY
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
subroutine csytrs_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CSYTRS_ROOK
subroutine csyt03(UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK, RWORK, RCOND, RESID)
CSYT03
subroutine clatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
CLATMS
subroutine csytrf_rook(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
CSYTRF_ROOK
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
subroutine csycon_rook(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)
CSYCON_ROOK
subroutine clatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
CLATB4
subroutine cget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
CGET04
subroutine cchksy_rook(DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL, THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK, NOUT)
CCHKSY_ROOK
subroutine csyt01_rook(UPLO, N, A, LDA, AFAC, LDAFAC, IPIV, C, LDC, RWORK, RESID)
CSYT01_ROOK
subroutine alasum(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASUM