416 SUBROUTINE zchkhs( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
417 $ NOUNIT, A, LDA, H, T1, T2, U, LDU, Z, UZ, W1,
418 $ W3, EVECTL, EVECTR, EVECTY, EVECTX, UU, TAU,
419 $ WORK, NWORK, RWORK, IWORK, SELECT, RESULT,
427 INTEGER INFO, LDA, LDU, NOUNIT, NSIZES, NTYPES, NWORK
428 DOUBLE PRECISION THRESH
431 LOGICAL DOTYPE( * ), SELECT( * )
432 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
433 DOUBLE PRECISION RESULT( 16 ), RWORK( * )
434 COMPLEX*16 A( LDA, * ), EVECTL( LDU, * ),
435 $ evectr( ldu, * ), evectx( ldu, * ),
436 $ evecty( ldu, * ), h( lda, * ), t1( lda, * ),
437 $ t2( lda, * ), tau( * ), u( ldu, * ),
438 $ uu( ldu, * ), uz( ldu, * ), w1( * ), w3( * ),
439 $ work( * ), z( ldu, * )
445 DOUBLE PRECISION ZERO, ONE
446 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
447 COMPLEX*16 CZERO, CONE
448 PARAMETER ( CZERO = ( 0.0d+0, 0.0d+0 ),
449 $ cone = ( 1.0d+0, 0.0d+0 ) )
451 parameter( maxtyp = 21 )
455 INTEGER I, IHI, IINFO, ILO, IMODE, IN, ITYPE, J, JCOL,
456 $ JJ, JSIZE, JTYPE, K, MTYPES, N, N1, NERRS,
457 $ NMATS, NMAX, NTEST, NTESTT
458 DOUBLE PRECISION ANINV, ANORM, COND, CONDS, OVFL, RTOVFL, RTULP,
459 $ rtulpi, rtunfl, temp1, temp2, ulp, ulpinv, unfl
462 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),
463 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
465 DOUBLE PRECISION DUMMA( 4 )
466 COMPLEX*16 CDUMMA( 4 )
469 DOUBLE PRECISION DLAMCH
479 INTRINSIC abs, dble, max, min, sqrt
482 DATA ktype / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
483 DATA kmagn / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
485 DATA kmode / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
486 $ 1, 5, 5, 5, 4, 3, 1 /
487 DATA kconds / 3*0, 5*0, 4*1, 6*2, 3*0 /
499 nmax = max( nmax, nn( j ) )
506 IF( nsizes.LT.0 )
THEN
508 ELSE IF( badnn )
THEN
510 ELSE IF( ntypes.LT.0 )
THEN
512 ELSE IF( thresh.LT.zero )
THEN
514 ELSE IF( lda.LE.1 .OR. lda.LT.nmax )
THEN
516 ELSE IF( ldu.LE.1 .OR. ldu.LT.nmax )
THEN
518 ELSE IF( 4*nmax*nmax+2.GT.nwork )
THEN
523 CALL xerbla(
'ZCHKHS', -info )
529 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
534 unfl = dlamch(
'Safe minimum' )
535 ovfl = dlamch(
'Overflow' )
536 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
538 rtunfl = sqrt( unfl )
539 rtovfl = sqrt( ovfl )
548 DO 260 jsize = 1, nsizes
553 aninv = one / dble( n1 )
555 IF( nsizes.NE.1 )
THEN
556 mtypes = min( maxtyp, ntypes )
558 mtypes = min( maxtyp+1, ntypes )
561 DO 250 jtype = 1, mtypes
562 IF( .NOT.dotype( jtype ) )
570 ioldsd( j ) = iseed( j )
595 IF( mtypes.GT.maxtyp )
598 itype = ktype( jtype )
599 imode = kmode( jtype )
603 GO TO ( 40, 50, 60 )kmagn( jtype )
610 anorm = ( rtovfl*ulp )*aninv
614 anorm = rtunfl*n*ulpinv
619 CALL zlaset(
'Full', lda, n, czero, czero, a, lda )
625 IF( itype.EQ.1 )
THEN
630 ELSE IF( itype.EQ.2 )
THEN
635 a( jcol, jcol ) = anorm
638 ELSE IF( itype.EQ.3 )
THEN
643 a( jcol, jcol ) = anorm
645 $ a( jcol, jcol-1 ) = one
648 ELSE IF( itype.EQ.4 )
THEN
652 CALL zlatmr( n, n,
'D', iseed,
'N', work, imode, cond,
653 $ cone,
'T',
'N', work( n+1 ), 1, one,
654 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
655 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
657 ELSE IF( itype.EQ.5 )
THEN
661 CALL zlatms( n, n,
'D', iseed,
'H', rwork, imode, cond,
662 $ anorm, n, n,
'N', a, lda, work, iinfo )
664 ELSE IF( itype.EQ.6 )
THEN
668 IF( kconds( jtype ).EQ.1 )
THEN
670 ELSE IF( kconds( jtype ).EQ.2 )
THEN
676 CALL zlatme( n,
'D', iseed, work, imode, cond, cone,
677 $
'T',
'T',
'T', rwork, 4, conds, n, n, anorm,
678 $ a, lda, work( n+1 ), iinfo )
680 ELSE IF( itype.EQ.7 )
THEN
684 CALL zlatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
685 $
'T',
'N', work( n+1 ), 1, one,
686 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
687 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
689 ELSE IF( itype.EQ.8 )
THEN
693 CALL zlatmr( n, n,
'D', iseed,
'H', work, 6, one, cone,
694 $
'T',
'N', work( n+1 ), 1, one,
695 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
696 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
698 ELSE IF( itype.EQ.9 )
THEN
702 CALL zlatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
703 $
'T',
'N', work( n+1 ), 1, one,
704 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
705 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
707 ELSE IF( itype.EQ.10 )
THEN
711 CALL zlatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
712 $
'T',
'N', work( n+1 ), 1, one,
713 $ work( 2*n+1 ), 1, one,
'N', idumma, n, 0,
714 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
721 IF( iinfo.NE.0 )
THEN
722 WRITE( nounit, fmt = 9999 )
'Generator', iinfo, n, jtype,
732 CALL zlacpy(
' ', n, n, a, lda, h, lda )
738 CALL zgehrd( n, ilo, ihi, h, lda, work, work( n+1 ),
741 IF( iinfo.NE.0 )
THEN
743 WRITE( nounit, fmt = 9999 )
'ZGEHRD', iinfo, n, jtype,
752 u( i, j ) = h( i, j )
753 uu( i, j ) = h( i, j )
757 CALL zcopy( n-1, work, 1, tau, 1 )
758 CALL zunghr( n, ilo, ihi, u, ldu, work, work( n+1 ),
762 CALL zhst01( n, ilo, ihi, a, lda, h, lda, u, ldu, work,
763 $ nwork, rwork, result( 1 ) )
769 CALL zlacpy(
' ', n, n, h, lda, t2, lda )
773 CALL zhseqr(
'E',
'N', n, ilo, ihi, t2, lda, w3, uz, ldu,
774 $ work, nwork, iinfo )
775 IF( iinfo.NE.0 )
THEN
776 WRITE( nounit, fmt = 9999 )
'ZHSEQR(E)', iinfo, n, jtype,
778 IF( iinfo.LE.n+2 )
THEN
786 CALL zlacpy(
' ', n, n, h, lda, t2, lda )
788 CALL zhseqr(
'S',
'N', n, ilo, ihi, t2, lda, w1, uz, ldu,
789 $ work, nwork, iinfo )
790 IF( iinfo.NE.0 .AND. iinfo.LE.n+2 )
THEN
791 WRITE( nounit, fmt = 9999 )
'ZHSEQR(S)', iinfo, n, jtype,
799 CALL zlacpy(
' ', n, n, h, lda, t1, lda )
800 CALL zlacpy(
' ', n, n, u, ldu, uz, ldu )
802 CALL zhseqr(
'S',
'V', n, ilo, ihi, t1, lda, w1, uz, ldu,
803 $ work, nwork, iinfo )
804 IF( iinfo.NE.0 .AND. iinfo.LE.n+2 )
THEN
805 WRITE( nounit, fmt = 9999 )
'ZHSEQR(V)', iinfo, n, jtype,
813 CALL zgemm(
'C',
'N', n, n, n, cone, u, ldu, uz, ldu, czero,
820 CALL zhst01( n, ilo, ihi, h, lda, t1, lda, z, ldu, work,
821 $ nwork, rwork, result( 3 ) )
826 CALL zhst01( n, ilo, ihi, a, lda, t1, lda, uz, ldu, work,
827 $ nwork, rwork, result( 5 ) )
831 CALL zget10( n, n, t2, lda, t1, lda, work, rwork,
839 temp1 = max( temp1, abs( w1( j ) ), abs( w3( j ) ) )
840 temp2 = max( temp2, abs( w1( j )-w3( j ) ) )
843 result( 8 ) = temp2 / max( unfl, ulp*max( temp1, temp2 ) )
855 SELECT( j ) = .false.
860 CALL ztrevc(
'Right',
'All',
SELECT, n, t1, lda, cdumma,
861 $ ldu, evectr, ldu, n, in, work, rwork, iinfo )
862 IF( iinfo.NE.0 )
THEN
863 WRITE( nounit, fmt = 9999 )
'ZTREVC(R,A)', iinfo, n,
871 CALL zget22(
'N',
'N',
'N', n, t1, lda, evectr, ldu, w1,
872 $ work, rwork, dumma( 1 ) )
873 result( 9 ) = dumma( 1 )
874 IF( dumma( 2 ).GT.thresh )
THEN
875 WRITE( nounit, fmt = 9998 )
'Right',
'ZTREVC',
876 $ dumma( 2 ), n, jtype, ioldsd
882 CALL ztrevc(
'Right',
'Some',
SELECT, n, t1, lda, cdumma,
883 $ ldu, evectl, ldu, n, in, work, rwork, iinfo )
884 IF( iinfo.NE.0 )
THEN
885 WRITE( nounit, fmt = 9999 )
'ZTREVC(R,S)', iinfo, n,
894 IF(
SELECT( j ) )
THEN
896 IF( evectr( jj, j ).NE.evectl( jj, k ) )
THEN
906 $
WRITE( nounit, fmt = 9997 )
'Right',
'ZTREVC', n, jtype,
912 result( 10 ) = ulpinv
913 CALL ztrevc(
'Left',
'All',
SELECT, n, t1, lda, evectl, ldu,
914 $ cdumma, ldu, n, in, work, rwork, iinfo )
915 IF( iinfo.NE.0 )
THEN
916 WRITE( nounit, fmt = 9999 )
'ZTREVC(L,A)', iinfo, n,
924 CALL zget22(
'C',
'N',
'C', n, t1, lda, evectl, ldu, w1,
925 $ work, rwork, dumma( 3 ) )
926 result( 10 ) = dumma( 3 )
927 IF( dumma( 4 ).GT.thresh )
THEN
928 WRITE( nounit, fmt = 9998 )
'Left',
'ZTREVC', dumma( 4 ),
935 CALL ztrevc(
'Left',
'Some',
SELECT, n, t1, lda, evectr,
936 $ ldu, cdumma, ldu, n, in, work, rwork, iinfo )
937 IF( iinfo.NE.0 )
THEN
938 WRITE( nounit, fmt = 9999 )
'ZTREVC(L,S)', iinfo, n,
947 IF(
SELECT( j ) )
THEN
949 IF( evectl( jj, j ).NE.evectr( jj, k ) )
THEN
959 $
WRITE( nounit, fmt = 9997 )
'Left',
'ZTREVC', n, jtype,
965 result( 11 ) = ulpinv
970 CALL zhsein(
'Right',
'Qr',
'Ninitv',
SELECT, n, h, lda, w3,
971 $ cdumma, ldu, evectx, ldu, n1, in, work, rwork,
972 $ iwork, iwork, iinfo )
973 IF( iinfo.NE.0 )
THEN
974 WRITE( nounit, fmt = 9999 )
'ZHSEIN(R)', iinfo, n, jtype,
985 CALL zget22(
'N',
'N',
'N', n, h, lda, evectx, ldu, w3,
986 $ work, rwork, dumma( 1 ) )
987 IF( dumma( 1 ).LT.ulpinv )
988 $ result( 11 ) = dumma( 1 )*aninv
989 IF( dumma( 2 ).GT.thresh )
THEN
990 WRITE( nounit, fmt = 9998 )
'Right',
'ZHSEIN',
991 $ dumma( 2 ), n, jtype, ioldsd
998 result( 12 ) = ulpinv
1000 SELECT( j ) = .true.
1003 CALL zhsein(
'Left',
'Qr',
'Ninitv',
SELECT, n, h, lda, w3,
1004 $ evecty, ldu, cdumma, ldu, n1, in, work, rwork,
1005 $ iwork, iwork, iinfo )
1006 IF( iinfo.NE.0 )
THEN
1007 WRITE( nounit, fmt = 9999 )
'ZHSEIN(L)', iinfo, n, jtype,
1018 CALL zget22(
'C',
'N',
'C', n, h, lda, evecty, ldu, w3,
1019 $ work, rwork, dumma( 3 ) )
1020 IF( dumma( 3 ).LT.ulpinv )
1021 $ result( 12 ) = dumma( 3 )*aninv
1022 IF( dumma( 4 ).GT.thresh )
THEN
1023 WRITE( nounit, fmt = 9998 )
'Left',
'ZHSEIN',
1024 $ dumma( 4 ), n, jtype, ioldsd
1031 result( 13 ) = ulpinv
1033 CALL zunmhr(
'Left',
'No transpose', n, n, ilo, ihi, uu,
1034 $ ldu, tau, evectx, ldu, work, nwork, iinfo )
1035 IF( iinfo.NE.0 )
THEN
1036 WRITE( nounit, fmt = 9999 )
'ZUNMHR(L)', iinfo, n, jtype,
1047 CALL zget22(
'N',
'N',
'N', n, a, lda, evectx, ldu, w3,
1048 $ work, rwork, dumma( 1 ) )
1049 IF( dumma( 1 ).LT.ulpinv )
1050 $ result( 13 ) = dumma( 1 )*aninv
1056 result( 14 ) = ulpinv
1058 CALL zunmhr(
'Left',
'No transpose', n, n, ilo, ihi, uu,
1059 $ ldu, tau, evecty, ldu, work, nwork, iinfo )
1060 IF( iinfo.NE.0 )
THEN
1061 WRITE( nounit, fmt = 9999 )
'ZUNMHR(L)', iinfo, n, jtype,
1072 CALL zget22(
'C',
'N',
'C', n, a, lda, evecty, ldu, w3,
1073 $ work, rwork, dumma( 3 ) )
1074 IF( dumma( 3 ).LT.ulpinv )
1075 $ result( 14 ) = dumma( 3 )*aninv
1083 result( 15 ) = ulpinv
1085 CALL zlacpy(
' ', n, n, uz, ldu, evectr, ldu )
1087 CALL ztrevc3(
'Right',
'Back',
SELECT, n, t1, lda, cdumma,
1088 $ ldu, evectr, ldu, n, in, work, nwork, rwork,
1090 IF( iinfo.NE.0 )
THEN
1091 WRITE( nounit, fmt = 9999 )
'ZTREVC3(R,B)', iinfo, n,
1101 CALL zget22(
'N',
'N',
'N', n, a, lda, evectr, ldu, w1,
1102 $ work, rwork, dumma( 1 ) )
1103 result( 15 ) = dumma( 1 )
1104 IF( dumma( 2 ).GT.thresh )
THEN
1105 WRITE( nounit, fmt = 9998 )
'Right',
'ZTREVC3',
1106 $ dumma( 2 ), n, jtype, ioldsd
1112 result( 16 ) = ulpinv
1114 CALL zlacpy(
' ', n, n, uz, ldu, evectl, ldu )
1116 CALL ztrevc3(
'Left',
'Back',
SELECT, n, t1, lda, evectl,
1117 $ ldu, cdumma, ldu, n, in, work, nwork, rwork,
1119 IF( iinfo.NE.0 )
THEN
1120 WRITE( nounit, fmt = 9999 )
'ZTREVC3(L,B)', iinfo, n,
1130 CALL zget22(
'Conj',
'N',
'Conj', n, a, lda, evectl, ldu,
1131 $ w1, work, rwork, dumma( 3 ) )
1132 result( 16 ) = dumma( 3 )
1133 IF( dumma( 4 ).GT.thresh )
THEN
1134 WRITE( nounit, fmt = 9998 )
'Left',
'ZTREVC3', dumma( 4 ),
1142 ntestt = ntestt + ntest
1143 CALL dlafts(
'ZHS', n, n, jtype, ntest, result, ioldsd,
1144 $ thresh, nounit, nerrs )
1151 CALL dlasum(
'ZHS', nounit, nerrs, ntestt )
1155 9999
FORMAT(
' ZCHKHS: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
1156 $ i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
1157 9998
FORMAT(
' ZCHKHS: ', a,
' Eigenvectors from ', a,
' incorrectly ',
1158 $
'normalized.', /
' Bits of error=', 0p, g10.3,
',', 9x,
1159 $
'N=', i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
1161 9997
FORMAT(
' ZCHKHS: Selected ', a,
' Eigenvectors from ', a,
1162 $
' do not match other eigenvectors ', 9x,
'N=', i6,
1163 $
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
subroutine xerbla(srname, info)
subroutine dlafts(type, m, n, imat, ntests, result, iseed, thresh, iounit, ie)
DLAFTS
subroutine dlasum(type, iounit, ie, nrun)
DLASUM
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgehrd(n, ilo, ihi, a, lda, tau, work, lwork, info)
ZGEHRD
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zhsein(side, eigsrc, initv, select, n, h, ldh, w, vl, ldvl, vr, ldvr, mm, m, work, rwork, ifaill, ifailr, info)
ZHSEIN
subroutine zhseqr(job, compz, n, ilo, ihi, h, ldh, w, z, ldz, work, lwork, info)
ZHSEQR
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine ztrevc3(side, howmny, select, n, t, ldt, vl, ldvl, vr, ldvr, mm, m, work, lwork, rwork, lrwork, info)
ZTREVC3
subroutine ztrevc(side, howmny, select, n, t, ldt, vl, ldvl, vr, ldvr, mm, m, work, rwork, info)
ZTREVC
subroutine zunghr(n, ilo, ihi, a, lda, tau, work, lwork, info)
ZUNGHR
subroutine zunmhr(side, trans, m, n, ilo, ihi, a, lda, tau, c, ldc, work, lwork, info)
ZUNMHR
subroutine zchkhs(nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a, lda, h, t1, t2, u, ldu, z, uz, w1, w3, evectl, evectr, evecty, evectx, uu, tau, work, nwork, rwork, iwork, select, result, info)
ZCHKHS
subroutine zget10(m, n, a, lda, b, ldb, work, rwork, result)
ZGET10
subroutine zget22(transa, transe, transw, n, a, lda, e, lde, w, work, rwork, result)
ZGET22
subroutine zhst01(n, ilo, ihi, a, lda, h, ldh, q, ldq, work, lwork, rwork, result)
ZHST01
subroutine zlatme(n, dist, iseed, d, mode, cond, dmax, rsign, upper, sim, ds, modes, conds, kl, ku, anorm, a, lda, work, info)
ZLATME
subroutine zlatmr(m, n, dist, iseed, sym, d, mode, cond, dmax, rsign, grade, dl, model, condl, dr, moder, condr, pivtng, ipivot, kl, ku, sparse, anorm, pack, a, lda, iwork, info)
ZLATMR
subroutine zlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
ZLATMS