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
444 INTRINSIC abs, cmplx, max, min, sqrt
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' )
510 ulp = slamch(
'Precision' )
519 DO 240 jsize = 1, nsizes
521 IF( nsizes.NE.1 )
THEN
522 mtypes = min( maxtyp, ntypes )
524 mtypes = min( maxtyp+1, ntypes )
527 DO 230 jtype = 1, mtypes
528 IF( .NOT.dotype( jtype ) )
534 ioldsd( j ) = iseed( j )
553 IF( mtypes.GT.maxtyp )
556 itype = ktype( jtype )
557 imode = kmode( jtype )
561 GO TO ( 30, 40, 50 )kmagn( jtype )
577 CALL claset(
'Full', lda, n, czero, czero, a, lda )
583 IF( itype.EQ.1 )
THEN
589 ELSE IF( itype.EQ.2 )
THEN
594 a( jcol, jcol ) = cmplx( anorm )
597 ELSE IF( itype.EQ.3 )
THEN
602 a( jcol, jcol ) = cmplx( anorm )
604 $ a( jcol, jcol-1 ) = cone
607 ELSE IF( itype.EQ.4 )
THEN
611 CALL clatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
612 $ anorm, 0, 0,
'N', a, lda, work( n+1 ),
615 ELSE IF( itype.EQ.5 )
THEN
619 CALL clatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
620 $ anorm, n, n,
'N', a, lda, work( n+1 ),
623 ELSE IF( itype.EQ.6 )
THEN
627 IF( kconds( jtype ).EQ.1 )
THEN
629 ELSE IF( kconds( jtype ).EQ.2 )
THEN
635 CALL clatme( n,
'D', iseed, work, imode, cond, cone,
636 $
'T',
'T',
'T', rwork, 4, conds, n, n, anorm,
637 $ a, lda, work( 2*n+1 ), iinfo )
639 ELSE IF( itype.EQ.7 )
THEN
643 CALL clatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
644 $
'T',
'N', work( n+1 ), 1, one,
645 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
646 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
648 ELSE IF( itype.EQ.8 )
THEN
652 CALL clatmr( n, n,
'D', iseed,
'H', work, 6, one, cone,
653 $
'T',
'N', work( n+1 ), 1, one,
654 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
655 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
657 ELSE IF( itype.EQ.9 )
THEN
661 CALL clatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
662 $
'T',
'N', work( n+1 ), 1, one,
663 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
664 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
666 CALL claset(
'Full', 2, n, czero, czero, a, lda )
667 CALL claset(
'Full', n-3, 1, czero, czero, a( 3, 1 ),
669 CALL claset(
'Full', n-3, 2, czero, czero,
671 CALL claset(
'Full', 1, n, czero, czero, a( n, 1 ),
675 ELSE IF( itype.EQ.10 )
THEN
679 CALL clatmr( n, n,
'D', iseed,
'N', work, 6, one, cone,
680 $
'T',
'N', work( n+1 ), 1, one,
681 $ work( 2*n+1 ), 1, one,
'N', idumma, n, 0,
682 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
689 IF( iinfo.NE.0 )
THEN
690 WRITE( nounit, fmt = 9992 )
'Generator', iinfo, n, jtype,
704 nnwork = 5*n + 2*n**2
706 nnwork = max( nnwork, 1 )
717 IF( isort.EQ.0 )
THEN
727 CALL clacpy(
'F', n, n, a, lda, h, lda )
728 CALL cgees(
'V', sort, cslect, n, h, lda, sdim, w, vs,
729 $ ldvs, work, nnwork, rwork, bwork, iinfo )
730 IF( iinfo.NE.0 )
THEN
731 result( 1+rsub ) = ulpinv
732 WRITE( nounit, fmt = 9992 )
'CGEES1', iinfo, n,
740 result( 1+rsub ) = zero
743 IF( h( i, j ).NE.zero )
744 $ result( 1+rsub ) = ulpinv
750 lwork = max( 1, 2*n*n )
751 CALL chst01( n, 1, n, a, lda, h, lda, vs, ldvs, work,
752 $ lwork, rwork, res )
753 result( 2+rsub ) = res( 1 )
754 result( 3+rsub ) = res( 2 )
758 result( 4+rsub ) = zero
760 IF( h( i, i ).NE.w( i ) )
761 $ result( 4+rsub ) = ulpinv
766 CALL clacpy(
'F', n, n, a, lda, ht, lda )
767 CALL cgees(
'N', sort, cslect, n, ht, lda, sdim, wt,
768 $ vs, ldvs, work, nnwork, rwork, bwork,
770 IF( iinfo.NE.0 )
THEN
771 result( 5+rsub ) = ulpinv
772 WRITE( nounit, fmt = 9992 )
'CGEES2', iinfo, n,
778 result( 5+rsub ) = zero
781 IF( h( i, j ).NE.ht( i, j ) )
782 $ result( 5+rsub ) = ulpinv
788 result( 6+rsub ) = zero
790 IF( w( i ).NE.wt( i ) )
791 $ result( 6+rsub ) = ulpinv
796 IF( isort.EQ.1 )
THEN
800 IF( cslect( w( i ) ) )
801 $ knteig = knteig + 1
803 IF( cslect( w( i+1 ) ) .AND.
804 $ ( .NOT.cslect( w( i ) ) ) )result( 13 )
809 $ result( 13 ) = ulpinv
821 IF( result( j ).GE.zero )
823 IF( result( j ).GE.thresh )
828 $ ntestf = ntestf + 1
829 IF( ntestf.EQ.1 )
THEN
830 WRITE( nounit, fmt = 9999 )path
831 WRITE( nounit, fmt = 9998 )
832 WRITE( nounit, fmt = 9997 )
833 WRITE( nounit, fmt = 9996 )
834 WRITE( nounit, fmt = 9995 )thresh
835 WRITE( nounit, fmt = 9994 )
840 IF( result( j ).GE.thresh )
THEN
841 WRITE( nounit, fmt = 9993 )n, iwk, ioldsd, jtype,
846 nerrs = nerrs + nfail
847 ntestt = ntestt + ntest
855 CALL slasum( path, nounit, nerrs, ntestt )
857 9999
FORMAT( / 1x, a3,
' -- Complex Schur Form Decomposition Driver',
858 $ /
' Matrix types (see CDRVES for details): ' )
860 9998
FORMAT( /
' Special Matrices:', /
' 1=Zero matrix. ',
861 $
' ',
' 5=Diagonal: geometr. spaced entries.',
862 $ /
' 2=Identity matrix. ',
' 6=Diagona',
863 $
'l: clustered entries.', /
' 3=Transposed Jordan block. ',
864 $
' ',
' 7=Diagonal: large, evenly spaced.', /
' ',
865 $
'4=Diagonal: evenly spaced entries. ',
' 8=Diagonal: s',
866 $
'mall, evenly spaced.' )
867 9997
FORMAT(
' Dense, Non-Symmetric Matrices:', /
' 9=Well-cond., ev',
868 $
'enly spaced eigenvals.',
' 14=Ill-cond., geomet. spaced e',
869 $
'igenals.', /
' 10=Well-cond., geom. spaced eigenvals. ',
870 $
' 15=Ill-conditioned, clustered e.vals.', /
' 11=Well-cond',
871 $
'itioned, clustered e.vals. ',
' 16=Ill-cond., random comp',
872 $
'lex ', a6, /
' 12=Well-cond., random complex ', a6,
' ',
873 $
' 17=Ill-cond., large rand. complx ', a4, /
' 13=Ill-condi',
874 $
'tioned, evenly spaced. ',
' 18=Ill-cond., small rand.',
876 9996
FORMAT(
' 19=Matrix with random O(1) entries. ',
' 21=Matrix ',
877 $
'with small random entries.', /
' 20=Matrix with large ran',
878 $
'dom entries. ', / )
879 9995
FORMAT(
' Tests performed with test threshold =', f8.2,
880 $ /
' ( A denotes A on input and T denotes A on output)',
881 $ / /
' 1 = 0 if T in Schur form (no sort), ',
882 $
' 1/ulp otherwise', /
883 $
' 2 = | A - VS T transpose(VS) | / ( n |A| ulp ) (no sort)',
884 $ /
' 3 = | I - VS transpose(VS) | / ( n ulp ) (no sort) ',
885 $ /
' 4 = 0 if W are eigenvalues of T (no sort),',
886 $
' 1/ulp otherwise', /
887 $
' 5 = 0 if T same no matter if VS computed (no sort),',
888 $
' 1/ulp otherwise', /
889 $
' 6 = 0 if W same no matter if VS computed (no sort)',
890 $
', 1/ulp otherwise' )
891 9994
FORMAT(
' 7 = 0 if T in Schur form (sort), ',
' 1/ulp otherwise',
892 $ /
' 8 = | A - VS T transpose(VS) | / ( n |A| ulp ) (sort)',
893 $ /
' 9 = | I - VS transpose(VS) | / ( n ulp ) (sort) ',
894 $ /
' 10 = 0 if W are eigenvalues of T (sort),',
895 $
' 1/ulp otherwise', /
896 $
' 11 = 0 if T same no matter if VS computed (sort),',
897 $
' 1/ulp otherwise', /
898 $
' 12 = 0 if W same no matter if VS computed (sort),',
899 $
' 1/ulp otherwise', /
900 $
' 13 = 0 if sorting successful, 1/ulp otherwise', / )
901 9993
FORMAT(
' N=', i5,
', IWK=', i2,
', seed=', 4( i4,
',' ),
902 $
' type ', i2,
', test(', i2,
')=', g10.3 )
903 9992
FORMAT(
' CDRVES: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
904 $ i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
subroutine xerbla(srname, info)
subroutine cdrves(nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a, lda, h, ht, w, wt, vs, ldvs, result, work, nwork, rwork, iwork, bwork, info)
CDRVES
subroutine chst01(n, ilo, ihi, a, lda, h, ldh, q, ldq, work, lwork, rwork, result)
CHST01
subroutine clatme(n, dist, iseed, d, mode, cond, dmax, rsign, upper, sim, ds, modes, conds, kl, ku, anorm, a, lda, work, info)
CLATME
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
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine cgees(jobvs, sort, select, n, a, lda, sdim, w, vs, ldvs, work, lwork, rwork, bwork, info)
CGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE m...
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine slasum(type, iounit, ie, nrun)
SLASUM