174 SUBROUTINE zchksy_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
185 DOUBLE PRECISION THRESH
189 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
190 DOUBLE PRECISION RWORK( * )
191 COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ), E( * ),
192 $ work( * ), x( * ), xact( * )
198 DOUBLE PRECISION ZERO, ONE
199 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
200 DOUBLE PRECISION ONEHALF
201 parameter( onehalf = 0.5d+0 )
202 DOUBLE PRECISION EIGHT, SEVTEN
203 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
205 parameter( czero = ( 0.0d+0, 0.0d+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 DOUBLE PRECISION ALPHA, ANORM, CNDNUM, CONST, DTEMP, SING_MAX,
220 $ SING_MIN, RCOND, RCONDC
224 INTEGER ISEED( 4 ), ISEEDY( 4 )
225 DOUBLE PRECISION RESULT( NTESTS )
226 COMPLEX*16 BLOCK( 2, 2 ), ZDUMMY( 1 )
229 DOUBLE PRECISION DGET06, ZLANGE, ZLANSY
230 EXTERNAL DGET06, ZLANGE, ZLANSY
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 ) =
'Zomplex precision'
267 matpath( 1: 1 ) =
'Zomplex precision'
268 matpath( 2: 3 ) =
'SY'
274 iseed( i ) = iseedy( i )
280 $
CALL zerrsy( 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 zlatb4( matpath, imat, n, n,
TYPE, kl, ku, anorm,
328 $ mode, cndnum, dist )
333 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode,
334 $ cndnum, anorm, kl, ku, uplo, a, lda,
340 CALL alaerh( path,
'ZLATMS', 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 zlatsy( uplo, n, a, lda, iseed )
444 CALL zlacpy( uplo, n, n, a, lda, afac, lda )
451 lwork = max( 2, nb )*lda
453 CALL zsytrf_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,
'ZSYTRF_RK', info, k,
477 $ uplo, n, n, -1, -1, nb, imat,
478 $ nfail, nerrs, nout )
491 CALL zsyt01_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 zlacpy( uplo, n, n, afac, lda, ainv, lda )
509 lwork = (n+nb+1)*(nb+3)
510 CALL zsytri_3( uplo, n, ainv, lda, e, iwork, work,
516 $
CALL alaerh( path,
'ZSYTRI_3', info, -1,
517 $ uplo, n, n, -1, -1, -1, imat,
518 $ nfail, nerrs, nout )
523 CALL zsyt03( 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 dtemp = zlange(
'M', k-1, 1,
566 $ afac( ( k-1 )*lda+1 ), lda, rwork )
572 dtemp = zlange(
'M', k-2, 2,
573 $ afac( ( k-2 )*lda+1 ), lda, rwork )
580 dtemp = dtemp - const + thresh
581 IF( dtemp.GT.result( 3 ) )
582 $ result( 3 ) = dtemp
598 IF( iwork( k ).GT.zero )
THEN
603 dtemp = zlange(
'M', n-k, 1,
604 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
610 dtemp = zlange(
'M', n-k-1, 2,
611 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
618 dtemp = dtemp - const + thresh
619 IF( dtemp.GT.result( 3 ) )
620 $ result( 3 ) = dtemp
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 zgesvd(
'N',
'N', 2, 2, block, 2, rwork,
660 $ zdummy, 1, zdummy, 1,
661 $ work, 6, rwork( 3 ), info )
664 sing_max = rwork( 1 )
665 sing_min = rwork( 2 )
667 dtemp = sing_max / sing_min
671 dtemp = dtemp - const + thresh
672 IF( dtemp.GT.result( 4 ) )
673 $ result( 4 ) = dtemp
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 zgesvd(
'N',
'N', 2, 2, block, 2, rwork,
704 $ zdummy, 1, zdummy, 1,
705 $ work, 6, rwork(3), info )
707 sing_max = rwork( 1 )
708 sing_min = rwork( 2 )
710 dtemp = sing_max / sing_min
714 dtemp = dtemp - const + thresh
715 IF( dtemp.GT.result( 4 ) )
716 $ result( 4 ) = dtemp
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 zlarhs( matpath, xtype, uplo,
' ', n, n,
767 $ kl, ku, nrhs, a, lda, xact, lda,
768 $ b, lda, iseed, info )
769 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
772 CALL zsytrs_3( uplo, n, nrhs, afac, lda, e, iwork,
778 $
CALL alaerh( path,
'ZSYTRS_3', info, 0,
779 $ uplo, n, n, -1, -1, nrhs, imat,
780 $ nfail, nerrs, nout )
782 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
786 CALL zsyt02( uplo, n, nrhs, a, lda, x, lda, work,
787 $ lda, rwork, result( 5 ) )
792 CALL zget04( 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 = zlansy(
'1', uplo, n, a, lda, rwork )
819 CALL zsycon_3( uplo, n, afac, lda, e, iwork, anorm,
820 $ rcond, work, info )
825 $
CALL alaerh( path,
'ZSYCON_3', info, 0,
826 $ uplo, n, n, -1, -1, -1, imat,
827 $ nfail, nerrs, nout )
831 result( 7 ) = dget06( 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 )