170 $ THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X,
171 $ XACT, WORK, RWORK, IWORK, NOUT )
179 INTEGER NMAX, NN, NNB, NNS, NOUT
184 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
186 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
187 $ work( * ), x( * ), xact( * )
194 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
196 parameter( onehalf = 0.5e+0 )
198 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
200 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
202 parameter( ntypes = 11 )
204 parameter( ntests = 7 )
207 LOGICAL TRFCON, ZEROT
208 CHARACTER DIST,
TYPE, UPLO, XTYPE
209 CHARACTER*3 PATH, MATPATH
210 INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
211 $ iuplo, izero, j, k, kl, ku, lda, lwork, mode,
212 $ n, nb, nerrs, nfail, nimat, nrhs, nrun, nt
213 REAL ALPHA, ANORM, CNDNUM, CONST, SING_MAX,
214 $ SING_MIN, RCOND, RCONDC, STEMP
218 INTEGER ISEED( 4 ), ISEEDY( 4 )
219 REAL RESULT( NTESTS )
220 COMPLEX BLOCK( 2, 2 ), CDUMMY( 1 )
223 REAL CLANGE, CLANSY, SGET06
224 EXTERNAL CLANGE, CLANSY, SGET06
233 INTRINSIC max, min, sqrt
241 COMMON / infoc / infot, nunit, ok, lerr
242 COMMON / srnamc / srnamt
245 DATA iseedy / 1988, 1989, 1990, 1991 /
246 DATA uplos /
'U',
'L' /
252 alpha = ( one+sqrt( sevten ) ) / eight
256 path( 1: 1 ) =
'Complex precision'
261 matpath( 1: 1 ) =
'Complex precision'
262 matpath( 2: 3 ) =
'SY'
268 iseed( i ) = iseedy( i )
274 $
CALL cerrsy( path, nout )
296 DO 260 imat = 1, nimat
300 IF( .NOT.dotype( imat ) )
305 zerot = imat.GE.3 .AND. imat.LE.6
306 IF( zerot .AND. n.LT.imat-2 )
312 uplo = uplos( iuplo )
316 IF( imat.NE.ntypes )
THEN
321 CALL clatb4( matpath, imat, n, n,
TYPE, kl, ku, anorm,
322 $ mode, cndnum, dist )
327 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
328 $ cndnum, anorm, kl, ku, uplo, a, lda,
334 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
335 $ -1, -1, -1, imat, nfail, nerrs, nout )
349 ELSE IF( imat.EQ.4 )
THEN
359 IF( iuplo.EQ.1 )
THEN
360 ioff = ( izero-1 )*lda
361 DO 20 i = 1, izero - 1
371 DO 40 i = 1, izero - 1
381 IF( iuplo.EQ.1 )
THEN
417 CALL clatsy( uplo, n, a, lda, iseed )
438 CALL clacpy( uplo, n, n, a, lda, afac, lda )
445 lwork = max( 2, nb )*lda
446 srnamt =
'CSYTRF_ROOK'
456 IF( iwork( k ).LT.0 )
THEN
457 IF( iwork( k ).NE.-k )
THEN
461 ELSE IF( iwork( k ).NE.k )
THEN
470 $
CALL alaerh( path,
'CSYTRF_ROOK', info, k,
471 $ uplo, n, n, -1, -1, nb, imat,
472 $ nfail, nerrs, nout )
485 CALL csyt01_rook( uplo, n, a, lda, afac, lda, iwork,
486 $ ainv, lda, rwork, result( 1 ) )
495 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
496 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
497 srnamt =
'CSYTRI_ROOK'
504 $
CALL alaerh( path,
'CSYTRI_ROOK', info, -1,
505 $ uplo, n, n, -1, -1, -1, imat,
506 $ nfail, nerrs, nout )
511 CALL csyt03( uplo, n, a, lda, ainv, lda, work, lda,
512 $ rwork, rcondc, result( 2 ) )
520 IF( result( k ).GE.thresh )
THEN
521 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
522 $
CALL alahd( nout, path )
523 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
536 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) ) /
539 IF( iuplo.EQ.1 )
THEN
548 IF( iwork( k ).GT.zero )
THEN
553 stemp = clange(
'M', k-1, 1,
554 $ afac( ( k-1 )*lda+1 ), lda, rwork )
560 stemp = clange(
'M', k-2, 2,
561 $ afac( ( k-2 )*lda+1 ), lda, rwork )
568 stemp = stemp - const + thresh
569 IF( stemp.GT.result( 3 ) )
570 $ result( 3 ) = stemp
586 IF( iwork( k ).GT.zero )
THEN
591 stemp = clange(
'M', n-k, 1,
592 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
598 stemp = clange(
'M', n-k-1, 2,
599 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
606 stemp = stemp - const + thresh
607 IF( stemp.GT.result( 3 ) )
608 $ result( 3 ) = stemp
624 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) )*
625 $ ( ( one + alpha ) / ( one - alpha ) )
627 IF( iuplo.EQ.1 )
THEN
636 IF( iwork( k ).LT.zero )
THEN
642 block( 1, 1 ) = afac( ( k-2 )*lda+k-1 )
643 block( 1, 2 ) = afac( (k-1)*lda+k-1 )
644 block( 2, 1 ) = block( 1, 2 )
645 block( 2, 2 ) = afac( (k-1)*lda+k )
647 CALL cgesvd(
'N',
'N', 2, 2, block, 2, rwork,
648 $ cdummy, 1, cdummy, 1,
649 $ work, 6, rwork( 3 ), info )
652 sing_max = rwork( 1 )
653 sing_min = rwork( 2 )
655 stemp = sing_max / sing_min
659 stemp = stemp - const + thresh
660 IF( stemp.GT.result( 4 ) )
661 $ result( 4 ) = stemp
680 IF( iwork( k ).LT.zero )
THEN
686 block( 1, 1 ) = afac( ( k-1 )*lda+k )
687 block( 2, 1 ) = afac( ( k-1 )*lda+k+1 )
688 block( 1, 2 ) = block( 2, 1 )
689 block( 2, 2 ) = afac( k*lda+k+1 )
691 CALL cgesvd(
'N',
'N', 2, 2, block, 2, rwork,
692 $ cdummy, 1, cdummy, 1,
693 $ work, 6, rwork(3), info )
695 sing_max = rwork( 1 )
696 sing_min = rwork( 2 )
698 stemp = sing_max / sing_min
702 stemp = stemp - const + thresh
703 IF( stemp.GT.result( 4 ) )
704 $ result( 4 ) = stemp
719 IF( result( k ).GE.thresh )
THEN
720 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
721 $
CALL alahd( nout, path )
722 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
754 CALL clarhs( matpath, xtype, uplo,
' ', n, n,
755 $ kl, ku, nrhs, a, lda, xact, lda,
756 $ b, lda, iseed, info )
757 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
759 srnamt =
'CSYTRS_ROOK'
766 $
CALL alaerh( path,
'CSYTRS_ROOK', info, 0,
767 $ uplo, n, n, -1, -1, nrhs, imat,
768 $ nfail, nerrs, nout )
770 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
774 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
775 $ lda, rwork, result( 5 ) )
780 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
787 IF( result( k ).GE.thresh )
THEN
788 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
789 $
CALL alahd( nout, path )
790 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
791 $ imat, k, result( k )
805 anorm = clansy(
'1', uplo, n, a, lda, rwork )
806 srnamt =
'CSYCON_ROOK'
807 CALL csycon_rook( uplo, n, afac, lda, iwork, anorm,
808 $ rcond, work, info )
813 $
CALL alaerh( path,
'CSYCON_ROOK', info, 0,
814 $ uplo, n, n, -1, -1, -1, imat,
815 $ nfail, nerrs, nout )
819 result( 7 ) = sget06( rcond, rcondc )
824 IF( result( 7 ).GE.thresh )
THEN
825 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
826 $
CALL alahd( nout, path )
827 WRITE( nout, fmt = 9997 )uplo, n, imat, 7,
840 CALL alasum( path, nout, nfail, nrun, nerrs )
842 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
843 $ i2,
', test ', i2,
', ratio =', g12.5 )
844 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
845 $ i2,
', test(', i2,
') =', g12.5 )
846 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
847 $
', test(', i2,
') =', g12.5 )
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine clarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
CLARHS
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 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 cerrsy(path, nunit)
CERRSY
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine clatsy(uplo, n, x, ldx, iseed)
CLATSY
subroutine csyt01_rook(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CSYT01_ROOK
subroutine csyt02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CSYT02
subroutine csyt03(uplo, n, a, lda, ainv, ldainv, work, ldwork, rwork, rcond, resid)
CSYT03
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 csycon_rook(uplo, n, a, lda, ipiv, anorm, rcond, work, info)
CSYCON_ROOK
subroutine csytrf_rook(uplo, n, a, lda, ipiv, work, lwork, info)
CSYTRF_ROOK
subroutine csytri_rook(uplo, n, a, lda, ipiv, work, info)
CSYTRI_ROOK
subroutine csytrs_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CSYTRS_ROOK
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.