174 SUBROUTINE cchksy_rk( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
175 $ THRESH, TSTERR, NMAX, A, AFAC, E, AINV, B,
176 $ X, XACT, WORK, RWORK, IWORK, NOUT )
184 INTEGER NMAX, NN, NNB, NNS, NOUT
189 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
191 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ), E( * ),
192 $ work( * ), x( * ), xact( * )
199 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
201 parameter( onehalf = 0.5e+0 )
203 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
205 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
207 parameter( ntypes = 11 )
209 parameter( ntests = 7 )
212 LOGICAL TRFCON, ZEROT
213 CHARACTER DIST,
TYPE, UPLO, XTYPE
214 CHARACTER*3 PATH, MATPATH
215 INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
216 $ itemp, itemp2, iuplo, izero, j, k, kl, ku, lda,
217 $ lwork, mode, n, nb, nerrs, nfail, nimat, nrhs,
219 REAL ALPHA, ANORM, CNDNUM, CONST, SING_MAX,
220 $ SING_MIN, RCOND, RCONDC, STEMP
224 INTEGER ISEED( 4 ), ISEEDY( 4 )
225 REAL RESULT( NTESTS )
226 COMPLEX BLOCK( 2, 2 ), CDUMMY( 1 )
229 REAL CLANGE, CLANSY, SGET06
230 EXTERNAL CLANGE, CLANSY, SGET06
239 INTRINSIC max, min, sqrt
247 COMMON / infoc / infot, nunit, ok, lerr
248 COMMON / srnamc / srnamt
251 DATA iseedy / 1988, 1989, 1990, 1991 /
252 DATA uplos /
'U',
'L' /
258 alpha = ( one+sqrt( sevten ) ) / eight
262 path( 1: 1 ) =
'Complex precision'
267 matpath( 1: 1 ) =
'Complex precision'
268 matpath( 2: 3 ) =
'SY'
274 iseed( i ) = iseedy( i )
280 $
CALL cerrsy( path, nout )
302 DO 260 imat = 1, nimat
306 IF( .NOT.dotype( imat ) )
311 zerot = imat.GE.3 .AND. imat.LE.6
312 IF( zerot .AND. n.LT.imat-2 )
318 uplo = uplos( iuplo )
322 IF( imat.NE.ntypes )
THEN
327 CALL clatb4( matpath, imat, n, n,
TYPE, kl, ku, anorm,
328 $ mode, cndnum, dist )
333 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
334 $ cndnum, anorm, kl, ku, uplo, a, lda,
340 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
341 $ -1, -1, -1, imat, nfail, nerrs, nout )
355 ELSE IF( imat.EQ.4 )
THEN
365 IF( iuplo.EQ.1 )
THEN
366 ioff = ( izero-1 )*lda
367 DO 20 i = 1, izero - 1
377 DO 40 i = 1, izero - 1
387 IF( iuplo.EQ.1 )
THEN
423 CALL clatsy( uplo, n, a, lda, iseed )
444 CALL clacpy( uplo, n, n, a, lda, afac, lda )
451 lwork = max( 2, nb )*lda
453 CALL csytrf_rk( uplo, n, afac, lda, e, iwork, ainv,
462 IF( iwork( k ).LT.0 )
THEN
463 IF( iwork( k ).NE.-k )
THEN
467 ELSE IF( iwork( k ).NE.k )
THEN
476 $
CALL alaerh( path,
'CSYTRF_RK', info, k,
477 $ uplo, n, n, -1, -1, nb, imat,
478 $ nfail, nerrs, nout )
491 CALL csyt01_3( uplo, n, a, lda, afac, lda, e, iwork,
492 $ ainv, lda, rwork, result( 1 ) )
501 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
502 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
509 lwork = (n+nb+1)*(nb+3)
510 CALL csytri_3( uplo, n, ainv, lda, e, iwork, work,
516 $
CALL alaerh( path,
'CSYTRI_3', info, -1,
517 $ uplo, n, n, -1, -1, -1, imat,
518 $ nfail, nerrs, nout )
523 CALL csyt03( uplo, n, a, lda, ainv, lda, work, lda,
524 $ rwork, rcondc, result( 2 ) )
532 IF( result( k ).GE.thresh )
THEN
533 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
534 $
CALL alahd( nout, path )
535 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
548 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) ) /
551 IF( iuplo.EQ.1 )
THEN
560 IF( iwork( k ).GT.zero )
THEN
565 stemp = clange(
'M', k-1, 1,
566 $ afac( ( k-1 )*lda+1 ), lda, rwork )
572 stemp = clange(
'M', k-2, 2,
573 $ afac( ( k-2 )*lda+1 ), lda, rwork )
580 stemp = stemp - const + thresh
581 IF( stemp.GT.result( 3 ) )
582 $ result( 3 ) = stemp
598 IF( iwork( k ).GT.zero )
THEN
603 stemp = clange(
'M', n-k, 1,
604 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
610 stemp = clange(
'M', n-k-1, 2,
611 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
618 stemp = stemp - const + thresh
619 IF( stemp.GT.result( 3 ) )
620 $ result( 3 ) = stemp
636 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) )*
637 $ ( ( one + alpha ) / ( one - alpha ) )
639 IF( iuplo.EQ.1 )
THEN
648 IF( iwork( k ).LT.zero )
THEN
654 block( 1, 1 ) = afac( ( k-2 )*lda+k-1 )
655 block( 1, 2 ) = e( k )
656 block( 2, 1 ) = block( 1, 2 )
657 block( 2, 2 ) = afac( (k-1)*lda+k )
659 CALL cgesvd(
'N',
'N', 2, 2, block, 2, rwork,
660 $ cdummy, 1, cdummy, 1,
661 $ work, 6, rwork( 3 ), info )
664 sing_max = rwork( 1 )
665 sing_min = rwork( 2 )
667 stemp = sing_max / sing_min
671 stemp = stemp - const + thresh
672 IF( stemp.GT.result( 4 ) )
673 $ result( 4 ) = stemp
692 IF( iwork( k ).LT.zero )
THEN
698 block( 1, 1 ) = afac( ( k-1 )*lda+k )
699 block( 2, 1 ) = e( k )
700 block( 1, 2 ) = block( 2, 1 )
701 block( 2, 2 ) = afac( k*lda+k+1 )
703 CALL cgesvd(
'N',
'N', 2, 2, block, 2, rwork,
704 $ cdummy, 1, cdummy, 1,
705 $ work, 6, rwork(3), info )
707 sing_max = rwork( 1 )
708 sing_min = rwork( 2 )
710 stemp = sing_max / sing_min
714 stemp = stemp - const + thresh
715 IF( stemp.GT.result( 4 ) )
716 $ result( 4 ) = stemp
731 IF( result( k ).GE.thresh )
THEN
732 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
733 $
CALL alahd( nout, path )
734 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
766 CALL clarhs( matpath, xtype, uplo,
' ', n, n,
767 $ kl, ku, nrhs, a, lda, xact, lda,
768 $ b, lda, iseed, info )
769 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
772 CALL csytrs_3( uplo, n, nrhs, afac, lda, e, iwork,
778 $
CALL alaerh( path,
'CSYTRS_3', info, 0,
779 $ uplo, n, n, -1, -1, nrhs, imat,
780 $ nfail, nerrs, nout )
782 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
786 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
787 $ lda, rwork, result( 5 ) )
792 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
799 IF( result( k ).GE.thresh )
THEN
800 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
801 $
CALL alahd( nout, path )
802 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
803 $ imat, k, result( k )
817 anorm = clansy(
'1', uplo, n, a, lda, rwork )
819 CALL csycon_3( uplo, n, afac, lda, e, iwork, anorm,
820 $ rcond, work, info )
825 $
CALL alaerh( path,
'CSYCON_3', info, 0,
826 $ uplo, n, n, -1, -1, -1, imat,
827 $ nfail, nerrs, nout )
831 result( 7 ) = sget06( rcond, rcondc )
836 IF( result( 7 ).GE.thresh )
THEN
837 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
838 $
CALL alahd( nout, path )
839 WRITE( nout, fmt = 9997 )uplo, n, imat, 7,
852 CALL alasum( path, nout, nfail, nrun, nerrs )
854 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
855 $ i2,
', test ', i2,
', ratio =', g12.5 )
856 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
857 $ i2,
', test(', i2,
') =', g12.5 )
858 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
859 $
', 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_rk(dotype, nn, nval, nnb, nbval, nns, nsval, thresh, tsterr, nmax, a, afac, e, ainv, b, x, xact, work, rwork, iwork, nout)
CCHKSY_RK
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_3(uplo, n, a, lda, afac, ldafac, e, ipiv, c, ldc, rwork, resid)
CSYT01_3
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_3(uplo, n, a, lda, e, ipiv, anorm, rcond, work, info)
CSYCON_3
subroutine csytrf_rk(uplo, n, a, lda, e, ipiv, work, lwork, info)
CSYTRF_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch...
subroutine csytri_3(uplo, n, a, lda, e, ipiv, work, lwork, info)
CSYTRI_3
subroutine csytrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
CSYTRS_3
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.