375 SUBROUTINE cdrves( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
376 $ NOUNIT, A, LDA, H, HT, W, WT, VS, LDVS, RESULT,
377 $ WORK, NWORK, RWORK, IWORK, BWORK, INFO )
384 INTEGER INFO, LDA, LDVS, NOUNIT, NSIZES, NTYPES, NWORK
388 LOGICAL BWORK( * ), DOTYPE( * )
389 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
390 REAL RESULT( 13 ), RWORK( * )
391 COMPLEX A( LDA, * ), H( LDA, * ), HT( LDA, * ),
392 $ vs( ldvs, * ), w( * ), work( * ), wt( * )
399 PARAMETER ( CZERO = ( 0.0e+0, 0.0e+0 ) )
401 PARAMETER ( cone = ( 1.0e+0, 0.0e+0 ) )
403 parameter( zero = 0.0e+0, one = 1.0e+0 )
405 parameter( maxtyp = 21 )
411 INTEGER I, IINFO, IMODE, ISORT, ITYPE, IWK, J, JCOL,
412 $ jsize, jtype, knteig, lwork, mtypes, n,
413 $ nerrs, nfail, nmax, nnwork, ntest, ntestf,
415 REAL ANORM, COND, CONDS, OVFL, RTULP, RTULPI, ULP,
419 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),
420 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
426 REAL SELWI( 20 ), SELWR( 20 )
429 INTEGER SELDIM, SELOPT
432 COMMON / sslct / selopt, seldim, selval, selwr, selwi
437 EXTERNAL cslect, slamch
447 DATA ktype / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
448 DATA kmagn / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
450 DATA kmode / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
451 $ 1, 5, 5, 5, 4, 3, 1 /
452 DATA kconds / 3*0, 5*0, 4*1, 6*2, 3*0 /
456 path( 1: 1 ) =
'Complex precision'
471 nmax =
max( nmax, nn( j ) )
478 IF( nsizes.LT.0 )
THEN
480 ELSE IF( badnn )
THEN
482 ELSE IF( ntypes.LT.0 )
THEN
484 ELSE IF( thresh.LT.zero )
THEN
486 ELSE IF( nounit.LE.0 )
THEN
488 ELSE IF( lda.LT.1 .OR. lda.LT.nmax )
THEN
490 ELSE IF( ldvs.LT.1 .OR. ldvs.LT.nmax )
THEN
492 ELSE IF( 5*nmax+2*nmax**2.GT.nwork )
THEN
497 CALL xerbla(
'CDRVES', -info )
503 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
508 unfl = slamch(
'Safe minimum' )
511 ulp = slamch(
'Precision' )
520 DO 240 jsize = 1, nsizes
522 IF( nsizes.NE.1 )
THEN
523 mtypes =
min( maxtyp, ntypes )
525 mtypes =
min( maxtyp+1, ntypes )
528 DO 230 jtype = 1, mtypes
529 IF( .NOT.dotype( jtype ) )
535 ioldsd( j ) = iseed( j )
554 IF( mtypes.GT.maxtyp )
557 itype = ktype( jtype )
558 imode = kmode( jtype )
562 GO TO ( 30, 40, 50 )kmagn( jtype )
578 CALL claset(
'Full', lda, n, czero, czero, a, lda )
584 IF( itype.EQ.1 )
THEN
590 ELSE IF( itype.EQ.2 )
THEN
595 a( jcol, jcol ) =
cmplx( anorm )
598 ELSE IF( itype.EQ.3 )
THEN
603 a( jcol, jcol ) =
cmplx( anorm )
605 $ a( jcol, jcol-1 ) = cone
608 ELSE IF( itype.EQ.4 )
THEN
612 CALL clatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
613 $ anorm, 0, 0,
'N', a, lda, work( n+1 ),
616 ELSE IF( itype.EQ.5 )
THEN
620 CALL clatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
621 $ anorm, n, n,
'N', a, lda, work( n+1 ),
624 ELSE IF( itype.EQ.6 )
THEN
628 IF( kconds( jtype ).EQ.1 )
THEN
630 ELSE IF( kconds( jtype ).EQ.2 )
THEN
636 CALL clatme( n,
'D', iseed, work, imode, cond, cone,
637 $
'T',
'T',
'T', rwork, 4, conds, n, n, anorm,
638 $ a, lda, work( 2*n+1 ), iinfo )
640 ELSE IF( itype.EQ.7 )
THEN
644 CALL clatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
645 $
'T',
'N', work( n+1 ), 1, one,
646 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
647 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
649 ELSE IF( itype.EQ.8 )
THEN
653 CALL clatmr( n, n,
'D', iseed,
'H', work, 6, one, cone,
654 $
'T',
'N', work( n+1 ), 1, one,
655 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
656 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
658 ELSE IF( itype.EQ.9 )
THEN
662 CALL clatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
663 $
'T',
'N', work( n+1 ), 1, one,
664 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
665 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
667 CALL claset(
'Full', 2, n, czero, czero, a, lda )
668 CALL claset(
'Full', n-3, 1, czero, czero, a( 3, 1 ),
670 CALL claset(
'Full', n-3, 2, czero, czero,
672 CALL claset(
'Full', 1, n, czero, czero, a( n, 1 ),
676 ELSE IF( itype.EQ.10 )
THEN
680 CALL clatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
681 $
'T',
'N', work( n+1 ), 1, one,
682 $ work( 2*n+1 ), 1, one,
'N', idumma, n, 0,
683 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
690 IF( iinfo.NE.0 )
THEN
691 WRITE( nounit, fmt = 9992 )
'Generator', iinfo, n, jtype,
705 nnwork = 5*n + 2*n**2
707 nnwork =
max( nnwork, 1 )
718 IF( isort.EQ.0 )
THEN
728 CALL CLACPY( 'f
', N, N, A, LDA, H, LDA )
729 CALL CGEES( 'v
', SORT, CSLECT, N, H, LDA, SDIM, W, VS,
730 $ LDVS, WORK, NNWORK, RWORK, BWORK, IINFO )
731.NE.
IF( IINFO0 ) THEN
732 RESULT( 1+RSUB ) = ULPINV
733 WRITE( NOUNIT, FMT = 9992 )'cgees1
', IINFO, N,
741 RESULT( 1+RSUB ) = ZERO
744.NE.
IF( H( I, J )ZERO )
745 $ RESULT( 1+RSUB ) = ULPINV
751 LWORK = MAX( 1, 2*N*N )
752 CALL CHST01( N, 1, N, A, LDA, H, LDA, VS, LDVS, WORK,
753 $ LWORK, RWORK, RES )
754 RESULT( 2+RSUB ) = RES( 1 )
755 RESULT( 3+RSUB ) = RES( 2 )
759 RESULT( 4+RSUB ) = ZERO
761.NE.
IF( H( I, I )W( I ) )
762 $ RESULT( 4+RSUB ) = ULPINV
767 CALL CLACPY( 'f
', N, N, A, LDA, HT, LDA )
768 CALL CGEES( 'n
', SORT, CSLECT, N, HT, LDA, SDIM, WT,
769 $ VS, LDVS, WORK, NNWORK, RWORK, BWORK,
771.NE.
IF( IINFO0 ) THEN
772 RESULT( 5+RSUB ) = ULPINV
773 WRITE( NOUNIT, FMT = 9992 )'cgees2
', IINFO, N,
779 RESULT( 5+RSUB ) = ZERO
782.NE.
IF( H( I, J )HT( I, J ) )
783 $ RESULT( 5+RSUB ) = ULPINV
789 RESULT( 6+RSUB ) = ZERO
791.NE.
IF( W( I )WT( I ) )
792 $ RESULT( 6+RSUB ) = ULPINV
797.EQ.
IF( ISORT1 ) THEN
801 IF( CSLECT( W( I ) ) )
802 $ KNTEIG = KNTEIG + 1
804.AND.
IF( CSLECT( W( I+1 ) )
805.NOT.
$ ( CSLECT( W( I ) ) ) )RESULT( 13 )
810 $ RESULT( 13 ) = ULPINV
822.GE.
IF( RESULT( J )ZERO )
824.GE.
IF( RESULT( J )THRESH )
829 $ NTESTF = NTESTF + 1
830.EQ.
IF( NTESTF1 ) THEN
831 WRITE( NOUNIT, FMT = 9999 )PATH
832 WRITE( NOUNIT, FMT = 9998 )
833 WRITE( NOUNIT, FMT = 9997 )
834 WRITE( NOUNIT, FMT = 9996 )
835 WRITE( NOUNIT, FMT = 9995 )THRESH
836 WRITE( NOUNIT, FMT = 9994 )
841.GE.
IF( RESULT( J )THRESH ) THEN
842 WRITE( NOUNIT, FMT = 9993 )N, IWK, IOLDSD, JTYPE,
847 NERRS = NERRS + NFAIL
848 NTESTT = NTESTT + NTEST
856 CALL SLASUM( PATH, NOUNIT, NERRS, NTESTT )
858 9999 FORMAT( / 1X, A3, ' --
Complex Schur Form Decomposition Driver
',
859 $ / ' Matrix types (see CDRVES for details):
' )
861 9998 FORMAT( / ' Special Matrices:
', / ' 1=zero matrix.
',
862 $ ' ', ' 5=diagonal: geometr. spaced entries.
',
863 $ / ' 2=identity matrix.
', '',
864 $ 'l: clustered entries.
', / '',
865 $ ' ', ' 7=diagonal: large, evenly spaced.
', / ' ',
866 $ '4=diagonal: evenly spaced entries.
', ' 8=diagonal: s
',
867 $ 'mall, evenly spaced.
' )
868 9997 FORMAT( ' dense, non-symmetric matrices:
', / ' 9=well-cond., ev
',
869 $ 'enly spaced eigenvals.
', ' 14=ill-cond., geomet. spaced e
',
870 $ 'igenals.
', / ' 10=well-cond.,
geom. spaced eigenvals.
',
871 $ ' 15=ill-conditioned, clustered e.vals.
', / ' 11=well-cond
',
872 $ 'itioned, clustered e.vals.
', ' 16=ill-cond., random
comp',
873 $ 'lex
', A6, / ' 12=well-cond., random
complex ', A6, ' ',
874 $ ' 17=ill-cond., large rand. complx
', A4, / ' 13=ill-condi
',
875 $ 'tioned, evenly spaced.
', ' 18=ill-cond., small rand.
',
877 9996 FORMAT( ' 19=matrix with random o(1) entries.
', ' 21=matrix
',
878 $ 'with small random entries.
', / ' 20=matrix with large ran
',
879 $ 'dom entries.
', / )
880 9995 FORMAT( ' tests performed with test threshold =
', F8.2,
881 $ / ' ( a denotes a on input and t denotes a on output)
',
882 $ / / ' 1 = 0
if t in schur form(no sort),
',
883 $ ' 1/ulp otherwise
', /
884 $ ' 2 = | a - vs t transpose(vs) | / ( n |a| ulp ) (no sort)
',
885 $ / ' 3 = | i - vs transpose(vs) | / ( n ulp ) (no sort)
',
886 $ / ' 4 = 0
if w are eigenvalues of t(no sort),
',
887 $ ' 1/ulp otherwise
', /
888 $ ' 5 = 0
if t same no matter
if vs computed(no sort),
',
889 $ ' 1/ulp otherwise
', /
890 $ ' 6 = 0
if w same no matter
if vs computed(no sort)
',
891 $ ', 1/ulp otherwise
' )
892 9994 FORMAT( ' 7 = 0
if t in schur form(sort),
', ' 1/ulp otherwise
',
893 $ / ' 8 = | a - vs t transpose(vs) | / ( n |a| ulp ) (sort)
',
894 $ / ' 9 = | i - vs transpose(vs) | / ( n ulp ) (sort)
',
895 $ / ' 10 = 0
if w are eigenvalues of t(sort),
',
896 $ ' 1/ulp otherwise
', /
897 $ ' 11 = 0
if t same no matter
if vs computed(sort),
',
898 $ ' 1/ulp otherwise
', /
899 $ ' 12 = 0
if w same no matter
if vs computed(sort),
',
900 $ ' 1/ulp otherwise
', /
901 $ ' 13 = 0
if sorting successful, 1/ulp otherwise
', / )
902 9993 FORMAT( ' n=
', I5, ', iwk=
', I2, ',
seed=
', 4( I4, ',
' ),
903 $ ' type ', I2, ', test(
', I2, ')=
', G10.3 )
904 9992 FORMAT( ' cdrves:
', A, ' returned info=
', I6, '.
', / 9X, 'n=
',
905 $ I6, ', jtype=
', I6, ', iseed=(
', 3( I5, ',
' ), I5, ')
' )
subroutine clatmr(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)
CLATMR