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 (no sort),',
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,
')' )
subroutine dlabad(SMALL, LARGE)
DLABAD
subroutine dlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine ddrvsx(NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, NIUNIT, NOUNIT, A, LDA, H, HT, WR, WI, WRT, WIT, WRTMP, WITMP, VS, LDVS, VS1, RESULT, WORK, LWORK, IWORK, BWORK, INFO)
DDRVSX
subroutine dlasum(TYPE, IOUNIT, IE, NRUN)
DLASUM
subroutine dget24(COMP, JTYPE, THRESH, ISEED, NOUNIT, N, A, LDA, H, HT, WR, WI, WRT, WIT, WRTMP, WITMP, VS, LDVS, VS1, RCDEIN, RCDVIN, NSLCT, ISLCT, RESULT, WORK, LWORK, IWORK, BWORK, INFO)
DGET24
subroutine dlatmr(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)
DLATMR
subroutine dlatme(N, DIST, ISEED, D, MODE, COND, DMAX, EI, RSIGN, UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM, A, LDA, WORK, INFO)
DLATME
subroutine dlatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
DLATMS