450 SUBROUTINE ddrvsx( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
451 $ NIUNIT, NOUNIT, A, LDA, H, HT, WR, WI, WRT,
452 $ WIT, WRTMP, WITMP, VS, LDVS, VS1, RESULT, WORK,
453 $ LWORK, IWORK, BWORK, INFO )
460 INTEGER INFO, LDA, LDVS, LWORK, NIUNIT, NOUNIT, NSIZES,
462 DOUBLE PRECISION THRESH
465 LOGICAL BWORK( * ), DOTYPE( * )
466 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
467 DOUBLE PRECISION A( LDA, * ), H( LDA, * ), HT( LDA, * ),
468 $ result( 17 ), vs( ldvs, * ), vs1( ldvs, * ),
469 $ wi( * ), wit( * ), witmp( * ), work( * ),
470 $ wr( * ), wrt( * ), wrtmp( * )
476 DOUBLE PRECISION ZERO, ONE
477 PARAMETER ( ZERO = 0.0d0, one = 1.0d0 )
479 parameter( maxtyp = 21 )
484 INTEGER I, IINFO, IMODE, ITYPE, IWK, J, JCOL, JSIZE,
485 $ jtype, mtypes, n, nerrs, nfail, nmax, nnwork,
486 $ nslct, ntest, ntestf, ntestt
487 DOUBLE PRECISION ANORM, COND, CONDS, OVFL, RCDEIN, RCDVIN,
488 $ RTULP, RTULPI, ULP, ULPINV, UNFL
491 CHARACTER ADUMMA( 1 )
492 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), ISLCT( 20 ),
493 $ KCONDS( MAXTYP ), KMAGN( MAXTYP ),
494 $ kmode( maxtyp ), ktype( maxtyp )
498 DOUBLE PRECISION SELWI( 20 ), SELWR( 20 )
501 INTEGER SELDIM, SELOPT
504 COMMON / sslct / selopt, seldim, selval, selwr, selwi
507 DOUBLE PRECISION DLAMCH
515 INTRINSIC abs,
max,
min, sqrt
518 DATA ktype / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
519 DATA kmagn / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
521 DATA kmode / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
522 $ 1, 5, 5, 5, 4, 3, 1 /
523 DATA kconds / 3*0, 5*0, 4*1, 6*2, 3*0 /
527 path( 1: 1 ) =
'Double precision'
545 nmax =
max( nmax, nn( j ) )
552 IF( nsizes.LT.0 )
THEN
554 ELSE IF( badnn )
THEN
556 ELSE IF( ntypes.LT.0 )
THEN
558 ELSE IF( thresh.LT.zero )
THEN
560 ELSE IF( niunit.LE.0 )
THEN
562 ELSE IF( nounit.LE.0 )
THEN
564 ELSE IF( lda.LT.1 .OR. lda.LT.nmax )
THEN
566 ELSE IF( ldvs.LT.1 .OR. ldvs.LT.nmax )
THEN
568 ELSE IF(
max( 3*nmax, 2*nmax**2 ).GT.lwork )
THEN
573 CALL xerbla(
'DDRVSX', -info )
579 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
584 unfl = dlamch(
'Safe minimum' )
587 ulp = dlamch(
'Precision' )
596 DO 140 jsize = 1, nsizes
598 IF( nsizes.NE.1 )
THEN
599 mtypes =
min( maxtyp, ntypes )
601 mtypes =
min( maxtyp+1, ntypes )
604 DO 130 jtype = 1, mtypes
605 IF( .NOT.dotype( jtype ) )
611 ioldsd( j ) = iseed( j )
630 IF( mtypes.GT.maxtyp )
633 itype = ktype( jtype )
634 imode = kmode( jtype )
638 GO TO ( 30, 40, 50 )kmagn( jtype )
654 CALL dlaset(
'Full', lda, n, zero, zero, a, lda )
662 IF( itype.EQ.1 )
THEN
665 ELSE IF( itype.EQ.2 )
THEN
670 a( jcol, jcol ) = anorm
673 ELSE IF( itype.EQ.3 )
THEN
678 a( jcol, jcol ) = anorm
680 $ a( jcol, jcol-1 ) = one
683 ELSE IF( itype.EQ.4 )
THEN
687 CALL dlatms( n, n,
'S', iseed,
'S', work, imode, cond,
688 $ anorm, 0, 0,
'N', a, lda, work( n+1 ),
691 ELSE IF( itype.EQ.5 )
THEN
695 CALL dlatms( n, n,
'S', iseed,
'S', work, imode, cond,
696 $ anorm, n, n,
'N', a, lda, work( n+1 ),
699 ELSE IF( itype.EQ.6 )
THEN
703 IF( kconds( jtype ).EQ.1 )
THEN
705 ELSE IF( kconds( jtype ).EQ.2 )
THEN
712 CALL dlatme( n,
'S', iseed, work, imode, cond, one,
713 $ adumma,
'T',
'T',
'T', work( n+1 ), 4,
714 $ conds, n, n, anorm, a, lda, work( 2*n+1 )
717 ELSE IF( itype.EQ.7 )
THEN
721 CALL dlatmr( n, n,
'S', iseed,
'S', work, 6, one, one,
722 $
'T',
'N', work( n+1 ), 1, one,
723 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
724 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
726 ELSE IF( itype.EQ.8 )
THEN
730 CALL dlatmr( n, n,
'S', iseed,
'S', work, 6, one, one,
731 $
'T',
'N', work( n+1 ), 1, one,
732 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
733 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
735 ELSE IF( itype.EQ.9 )
THEN
739 CALL dlatmr( n, n,
'S', iseed,
'N', work, 6, one, one,
740 $
'T',
'N', work( n+1 ), 1, one,
741 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n
742 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
744 CALL dlaset(
'Full', 2, n, zero, zero, a, lda )
745 CALL dlaset(
'Full', n-3, 1, zero, zero, a( 3, 1 ),
747 CALL dlaset(
'Full', n-3, 2, zero, zero, a( 3, n-1 ),
749 CALL dlaset(
'Full', 1, n, zero, zero, a( n, 1 ),
753 ELSE IF( itype.EQ.10 )
THEN
757 CALL dlatmr( n, n,
'S', iseed,
'N', work, 6, one, one,
758 $
'T',
'N', work( n+1 ), 1, one,
759 $ work( 2*n+1 ), 1, one,
'N', idumma, n, 0,
760 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
767 IF( iinfo.NE.0 )
THEN
768 WRITE( nounit, fmt = 9991 )
'Generator', iinfo, n, jtype,
782 nnwork =
max( 3*n, 2*n*n )
784 nnwork =
max( nnwork, 1 )
786 CALL dget24( .false., jtype, thresh, ioldsd, nounit, n,
787 $ a, lda, h, ht, wr, wi, wrt, wit, wrtmp,
788 $ witmp, vs, ldvs, vs1, rcdein, rcdvin, nslct,
789 $ islct, result, work, nnwork, iwork, bwork,
797 IF( result( j ).GE.zero )
799 IF( result( j ).GE.thresh )
804 $ ntestf = ntestf + 1
805 IF( ntestf.EQ.1 )
THEN
806 WRITE( nounit, fmt = 9999 )path
807 WRITE( nounit, fmt = 9998 )
808 WRITE( nounit, fmt = 9997 )
809 WRITE( nounit, fmt = 9996 )
810 WRITE( nounit, fmt = 9995 )thresh
811 WRITE( nounit, fmt = 9994 )
816 IF( result( j ).GE.thresh )
THEN
817 WRITE( nounit, fmt = 9993 )n, iwk, ioldsd, jtype,
822 nerrs = nerrs + nfail
823 ntestt = ntestt + ntest
836 READ( niunit, fmt = *,
END = 200 )N, nslct
842 $
READ( niunit, fmt = * )( islct( i ), i = 1, nslct )
844 READ( niunit, fmt = * )( a( i, j ), j = 1, n )
846 READ( niunit, fmt = * )rcdein, rcdvin
848 CALL dget24( .true., 22, thresh, iseed, nounit, n, a, lda, h, ht,
849 $ wr, wi, wrt, wit, wrtmp, witmp, vs, ldvs, vs1,
850 $ rcdein, rcdvin, nslct, islct, result, work, lwork,
851 $ iwork, bwork, info )
858 IF( result( j ).GE.zero )
860 IF( result( j ).GE.thresh )
865 $ ntestf = ntestf + 1
866 IF( ntestf.EQ.1 )
THEN
867 WRITE( nounit, fmt = 9999 )path
868 WRITE( nounit, fmt = 9998 )
869 WRITE( nounit, fmt = 9997 )
870 WRITE( nounit, fmt = 9996 )
871 WRITE( nounit, fmt = 9995 )thresh
872 WRITE( nounit, fmt = 9994 )
876 IF( result( j ).GE.thresh )
THEN
877 WRITE( nounit, fmt = 9992 )n, jtype, j, result( j )
881 nerrs = nerrs + nfail
882 ntestt = ntestt + ntest
888 CALL dlasum( path, nounit, nerrs, ntestt )
890 9999
FORMAT( / 1x, a3,
' -- Real Schur Form Decomposition Expert ',
891 $
'Driver', /
' Matrix types (see DDRVSX for details):' )
893 9998
FORMAT( /
' Special Matrices:', /
' 1=Zero matrix. ',
894 $
' ',
' 5=Diagonal: geometr. spaced entries.',
895 $ /
' 2=Identity matrix. ',
' 6=Diagona',
896 $
'l: clustered entries.', /
' 3=Transposed Jordan block. ',
897 $
' ',
' 7=Diagonal: large, evenly spaced.', /
' ',
898 $
'4=Diagonal: evenly spaced entries. ',
' 8=Diagonal: s',
899 $
'mall, evenly spaced.' )
900 9997
FORMAT(
' Dense, Non-Symmetric Matrices:', /
' 9=Well-cond., ev',
901 $
'enly spaced eigenvals.',
' 14=Ill-cond., geomet. spaced e',
902 $
'igenals.', /
' 10=Well-cond., geom. spaced eigenvals. ',
903 $
' 15=Ill-conditioned, clustered e.vals.', /
' 11=Well-cond',
904 $
'itioned, clustered e.vals. ',
' 16=Ill-cond., random comp',
905 $
'lex ', / ' 12=well-cond., random
complex ', ' ',
906 $ ' 17=ill-cond., large rand. complx
', / ' 13=ill-condi
',
907 $ 'tioned, evenly spaced.
', ' 18=ill-cond., small rand.
',
909 9996 FORMAT( ' 19=matrix with random o(1) entries.
', ' 21=matrix
',
910 $ 'with small random entries.
', / ' 20=matrix with large ran
',
911 $ 'dom entries.
', / )
912 9995 FORMAT( ' tests performed with test threshold =
', F8.2,
913 $ / ' ( a denotes a on input and t denotes a on output)
',
914 $ / / ' 1 = 0
if t in schur form(no sort),
',
915 $ ' 1/ulp otherwise
', /
916 $ ' 2 = | a - vs t transpose(vs) | / ( n |a| ulp ) (no sort)
',
917 $ / ' 3 = | i - vs transpose(vs) | / ( n ulp ) (no sort)
', /
918 $ ' 4 = 0
if wr+sqrt(-1)*wi are eigenvalues of t
',
919 $ ' 1/ulp otherwise
', /
920 $ ' 5 = 0
if t same no matter
if vs computed (no sort),
',
921 $ ' 1/ulp otherwise
', /
922 $ ' 6 = 0
if wr, wi same no matter
if vs computed(no sort)
',
923 $ ', 1/ulp otherwise
' )
924 9994 FORMAT( ' 7 = 0
if t in schur form(sort),
', ' 1/ulp otherwise
',
925 $ / ' 8 = | a - vs t transpose(vs) | / ( n |a| ulp ) (sort)
',
926 $ / ' 9 = | i - vs transpose(vs) | / ( n ulp ) (sort)
',
927 $ / ' 10 = 0
if wr+sqrt(-1)*wi are eigenvalues of t(sort),
',
928 $ ' 1/ulp otherwise
', /
929 $ ' 11 = 0
if t same no matter what
else computed(sort),
',
930 $ ' 1/ulp otherwise
', /
931 $ ' 12 = 0
if wr, wi same no matter what
else computed
',
932 $ '(sort), 1/ulp otherwise
', /
933 $ ' 13 = 0
if sorting successful, 1/ulp otherwise
',
934 $ / ' 14 = 0
if rconde same no matter what
else computed,
',
935 $ ' 1/ulp otherwise
', /
936 $ ' 15 = 0
if rcondv same no matter what
else computed,
',
937 $ ' 1/ulp otherwise
', /
938 $ ' 16 = | rconde - rconde(precomputed) | / cond(rconde),
',
939 $ / ' 17 = | rcondv - rcondv(precomputed) | / cond(rcondv),
' )
940 9993 FORMAT( ' n=
', I5, ', iwk=
', I2, ',
seed=
', 4( I4, ',
' ),
941 $ ' type ', I2, ', test(
', I2, ')=
', G10.3 )
942 9992 FORMAT( ' n=
', I5, ', input example =
', I3, ', test(
', I2, ')=
',
944 9991 FORMAT( ' ddrvsx:
', A, ' returned info=
', I6, '.
', / 9X, 'n=
',
945 $ I6, ', jtype=
', I6, ', iseed=(
', 3( I5, ',
' ), I5, ')
' )