333 SUBROUTINE cget24( COMP, JTYPE, THRESH, ISEED, NOUNIT, N, A, LDA,
334 $ h, ht, w, wt, wtmp, vs, ldvs, vs1, rcdein,
335 $ rcdvin, nslct, islct, isrt, result, work,
336 $ lwork, rwork, bwork, info )
345 INTEGER INFO, ISRT, JTYPE, LDA, LDVS, LWORK, N, NOUNIT,
347 REAL RCDEIN, RCDVIN, THRESH
351 INTEGER ISEED( 4 ), ISLCT( * )
352 REAL RESULT( 17 ), RWORK( * )
353 COMPLEX A( lda, * ), H( lda, * ), HT( lda, * ),
354 $ vs( ldvs, * ), vs1( ldvs, * ), w( * ),
355 $ work( * ), wt( * ), wtmp( * )
362 parameter ( czero = ( 0.0e+0, 0.0e+0 ),
363 $ cone = ( 1.0e+0, 0.0e+0 ) )
365 parameter ( zero = 0.0e+0, one = 1.0e+0 )
367 parameter ( epsin = 5.9605e-8 )
371 INTEGER I, IINFO, ISORT, ITMP, J, KMIN, KNTEIG, RSUB,
373 REAL ANORM, EPS, RCNDE1, RCNDV1, RCONDE, RCONDV,
374 $ smlnum, tol, tolin, ulp, ulpinv, v, vricmp,
384 EXTERNAL cslect, clange, slamch
390 INTRINSIC abs, aimag, max, min, real
394 REAL SELWI( 20 ), SELWR( 20 )
397 INTEGER SELDIM, SELOPT
400 COMMON / sslct / selopt, seldim, selval, selwr, selwi
407 IF( thresh.LT.zero )
THEN
409 ELSE IF( nounit.LE.0 )
THEN
411 ELSE IF( n.LT.0 )
THEN
413 ELSE IF( lda.LT.1 .OR. lda.LT.n )
THEN
415 ELSE IF( ldvs.LT.1 .OR. ldvs.LT.n )
THEN
417 ELSE IF( lwork.LT.2*n )
THEN
422 CALL xerbla(
'CGET24', -info )
437 smlnum = slamch(
'Safe minimum' )
438 ulp = slamch(
'Precision' )
445 IF( isort.EQ.0 )
THEN
455 CALL clacpy(
'F', n, n, a, lda, h, lda )
456 CALL cgeesx(
'V', sort, cslect,
'N', n, h, lda, sdim, w, vs,
457 $ ldvs, rconde, rcondv, work, lwork, rwork, bwork,
459 IF( iinfo.NE.0 )
THEN
460 result( 1+rsub ) = ulpinv
461 IF( jtype.NE.22 )
THEN
462 WRITE( nounit, fmt = 9998 )
'CGEESX1', iinfo, n, jtype,
465 WRITE( nounit, fmt = 9999 )
'CGEESX1', iinfo, n,
471 IF( isort.EQ.0 )
THEN
472 CALL ccopy( n, w, 1, wtmp, 1 )
477 result( 1+rsub ) = zero
480 IF( h( i, j ).NE.czero )
481 $ result( 1+rsub ) = ulpinv
489 CALL clacpy(
' ', n, n, a, lda, vs1, ldvs )
493 CALL cgemm(
'No transpose',
'No transpose', n, n, n, cone, vs,
494 $ ldvs, h, lda, czero, ht, lda )
498 CALL cgemm(
'No transpose',
'Conjugate transpose', n, n, n,
499 $ -cone, ht, lda, vs, ldvs, cone, vs1, ldvs )
501 anorm = max( clange(
'1', n, n, a, lda, rwork ), smlnum )
502 wnorm = clange(
'1', n, n, vs1, ldvs, rwork )
504 IF( anorm.GT.wnorm )
THEN
505 result( 2+rsub ) = ( wnorm / anorm ) / ( n*ulp )
507 IF( anorm.LT.one )
THEN
508 result( 2+rsub ) = ( min( wnorm, n*anorm ) / anorm ) /
511 result( 2+rsub ) = min( wnorm / anorm,
REAL( N ) ) /
518 CALL cunt01(
'Columns', n, n, vs, ldvs, work, lwork, rwork,
523 result( 4+rsub ) = zero
525 IF( h( i, i ).NE.w( i ) )
526 $ result( 4+rsub ) = ulpinv
531 CALL clacpy(
'F', n, n, a, lda, ht, lda )
532 CALL cgeesx(
'N', sort, cslect,
'N', n, ht, lda, sdim, wt, vs,
533 $ ldvs, rconde, rcondv, work, lwork, rwork, bwork,
535 IF( iinfo.NE.0 )
THEN
536 result( 5+rsub ) = ulpinv
537 IF( jtype.NE.22 )
THEN
538 WRITE( nounit, fmt = 9998 )
'CGEESX2', iinfo, n, jtype,
541 WRITE( nounit, fmt = 9999 )
'CGEESX2', iinfo, n,
548 result( 5+rsub ) = zero
551 IF( h( i, j ).NE.ht( i, j ) )
552 $ result( 5+rsub ) = ulpinv
558 result( 6+rsub ) = zero
560 IF( w( i ).NE.wt( i ) )
561 $ result( 6+rsub ) = ulpinv
566 IF( isort.EQ.1 )
THEN
570 IF( cslect( w( i ) ) )
571 $ knteig = knteig + 1
573 IF( cslect( w( i+1 ) ) .AND.
574 $ ( .NOT.cslect( w( i ) ) ) )result( 13 ) = ulpinv
578 $ result( 13 ) = ulpinv
586 IF( lwork.GE.( n*( n+1 ) ) / 2 )
THEN
593 CALL clacpy(
'F', n, n, a, lda, ht, lda )
594 CALL cgeesx(
'V', sort, cslect,
'B', n, ht, lda, sdim1, wt,
595 $ vs1, ldvs, rconde, rcondv, work, lwork, rwork,
597 IF( iinfo.NE.0 )
THEN
598 result( 14 ) = ulpinv
599 result( 15 ) = ulpinv
600 IF( jtype.NE.22 )
THEN
601 WRITE( nounit, fmt = 9998 )
'CGEESX3', iinfo, n, jtype,
604 WRITE( nounit, fmt = 9999 )
'CGEESX3', iinfo, n,
614 IF( w( i ).NE.wt( i ) )
615 $ result( 10 ) = ulpinv
617 IF( h( i, j ).NE.ht( i, j ) )
618 $ result( 11 ) = ulpinv
619 IF( vs( i, j ).NE.vs1( i, j ) )
620 $ result( 12 ) = ulpinv
624 $ result( 13 ) = ulpinv
628 CALL clacpy(
'F', n, n, a, lda, ht, lda )
629 CALL cgeesx(
'N', sort, cslect,
'B', n, ht, lda, sdim1, wt,
630 $ vs1, ldvs, rcnde1, rcndv1, work, lwork, rwork,
632 IF( iinfo.NE.0 )
THEN
633 result( 14 ) = ulpinv
634 result( 15 ) = ulpinv
635 IF( jtype.NE.22 )
THEN
636 WRITE( nounit, fmt = 9998 )
'CGEESX4', iinfo, n, jtype,
639 WRITE( nounit, fmt = 9999 )
'CGEESX4', iinfo, n,
648 IF( rcnde1.NE.rconde )
649 $ result( 14 ) = ulpinv
650 IF( rcndv1.NE.rcondv )
651 $ result( 15 ) = ulpinv
656 IF( w( i ).NE.wt( i ) )
657 $ result( 10 ) = ulpinv
659 IF( h( i, j ).NE.ht( i, j ) )
660 $ result( 11 ) = ulpinv
661 IF( vs( i, j ).NE.vs1( i, j ) )
662 $ result( 12 ) = ulpinv
666 $ result( 13 ) = ulpinv
670 CALL clacpy(
'F', n, n, a, lda, ht, lda )
671 CALL cgeesx(
'V', sort, cslect,
'E', n, ht, lda, sdim1, wt,
672 $ vs1, ldvs, rcnde1, rcndv1, work, lwork, rwork,
674 IF( iinfo.NE.0 )
THEN
675 result( 14 ) = ulpinv
676 IF( jtype.NE.22 )
THEN
677 WRITE( nounit, fmt = 9998 )
'CGEESX5', iinfo, n, jtype,
680 WRITE( nounit, fmt = 9999 )
'CGEESX5', iinfo, n,
689 IF( rcnde1.NE.rconde )
690 $ result( 14 ) = ulpinv
695 IF( w( i ).NE.wt( i ) )
696 $ result( 10 ) = ulpinv
698 IF( h( i, j ).NE.ht( i, j ) )
699 $ result( 11 ) = ulpinv
700 IF( vs( i, j ).NE.vs1( i, j ) )
701 $ result( 12 ) = ulpinv
705 $ result( 13 ) = ulpinv
709 CALL clacpy(
'F', n, n, a, lda, ht, lda )
710 CALL cgeesx(
'N', sort, cslect,
'E', n, ht, lda, sdim1, wt,
711 $ vs1, ldvs, rcnde1, rcndv1, work, lwork, rwork,
713 IF( iinfo.NE.0 )
THEN
714 result( 14 ) = ulpinv
715 IF( jtype.NE.22 )
THEN
716 WRITE( nounit, fmt = 9998 )
'CGEESX6', iinfo, n, jtype,
719 WRITE( nounit, fmt = 9999 )
'CGEESX6', iinfo, n,
728 IF( rcnde1.NE.rconde )
729 $ result( 14 ) = ulpinv
734 IF( w( i ).NE.wt( i ) )
735 $ result( 10 ) = ulpinv
737 IF( h( i, j ).NE.ht( i, j ) )
738 $ result( 11 ) = ulpinv
739 IF( vs( i, j ).NE.vs1( i, j ) )
740 $ result( 12 ) = ulpinv
744 $ result( 13 ) = ulpinv
748 CALL clacpy(
'F', n, n, a, lda, ht, lda )
749 CALL cgeesx(
'V', sort, cslect,
'V', n, ht, lda, sdim1, wt,
750 $ vs1, ldvs, rcnde1, rcndv1, work, lwork, rwork,
752 IF( iinfo.NE.0 )
THEN
753 result( 15 ) = ulpinv
754 IF( jtype.NE.22 )
THEN
755 WRITE( nounit, fmt = 9998 )
'CGEESX7', iinfo, n, jtype,
758 WRITE( nounit, fmt = 9999 )
'CGEESX7', iinfo, n,
767 IF( rcndv1.NE.rcondv )
768 $ result( 15 ) = ulpinv
773 IF( w( i ).NE.wt( i ) )
774 $ result( 10 ) = ulpinv
776 IF( h( i, j ).NE.ht( i, j ) )
777 $ result( 11 ) = ulpinv
778 IF( vs( i, j ).NE.vs1( i, j ) )
779 $ result( 12 ) = ulpinv
783 $ result( 13 ) = ulpinv
787 CALL clacpy(
'F', n, n, a, lda, ht, lda )
788 CALL cgeesx(
'N', sort, cslect,
'V', n, ht, lda, sdim1, wt,
789 $ vs1, ldvs, rcnde1, rcndv1, work, lwork, rwork,
791 IF( iinfo.NE.0 )
THEN
792 result( 15 ) = ulpinv
793 IF( jtype.NE.22 )
THEN
794 WRITE( nounit, fmt = 9998 )
'CGEESX8', iinfo, n, jtype,
797 WRITE( nounit, fmt = 9999 )
'CGEESX8', iinfo, n,
806 IF( rcndv1.NE.rcondv )
807 $ result( 15 ) = ulpinv
812 IF( w( i ).NE.wt( i ) )
813 $ result( 10 ) = ulpinv
815 IF( h( i, j ).NE.ht( i, j ) )
816 $ result( 11 ) = ulpinv
817 IF( vs( i, j ).NE.vs1( i, j ) )
818 $ result( 12 ) = ulpinv
822 $ result( 13 ) = ulpinv
839 eps = max( ulp, epsin )
842 selval( i ) = .false.
843 selwr( i ) =
REAL( WTMP( I ) )
844 selwi( i ) = aimag( wtmp( i ) )
849 vrimin =
REAL( WTMP( I ) )
851 vrimin = aimag( wtmp( i ) )
855 vricmp =
REAL( WTMP( J ) )
857 vricmp = aimag( wtmp( j ) )
859 IF( vricmp.LT.vrimin )
THEN
865 wtmp( kmin ) = wtmp( i )
868 ipnt( i ) = ipnt( kmin )
872 selval( ipnt( islct( i ) ) ) = .true.
877 CALL clacpy(
'F', n, n, a, lda, ht, lda )
878 CALL cgeesx(
'N',
'S', cslect,
'B', n, ht, lda, sdim1, wt, vs1,
879 $ ldvs, rconde, rcondv, work, lwork, rwork, bwork,
881 IF( iinfo.NE.0 )
THEN
882 result( 16 ) = ulpinv
883 result( 17 ) = ulpinv
884 WRITE( nounit, fmt = 9999 )
'CGEESX9', iinfo, n, iseed( 1 )
892 anorm = clange(
'1', n, n, a, lda, rwork )
893 v = max(
REAL( n )*EPS*ANORM, SMLNUM )
896 IF( v.GT.rcondv )
THEN
901 IF( v.GT.rcdvin )
THEN
906 tol = max( tol, smlnum / eps )
907 tolin = max( tolin, smlnum / eps )
908 IF( eps*( rcdein-tolin ).GT.rconde+tol )
THEN
909 result( 16 ) = ulpinv
910 ELSE IF( rcdein-tolin.GT.rconde+tol )
THEN
911 result( 16 ) = ( rcdein-tolin ) / ( rconde+tol )
912 ELSE IF( rcdein+tolin.LT.eps*( rconde-tol ) )
THEN
913 result( 16 ) = ulpinv
914 ELSE IF( rcdein+tolin.LT.rconde-tol )
THEN
915 result( 16 ) = ( rconde-tol ) / ( rcdein+tolin )
923 IF( v.GT.rcondv*rconde )
THEN
928 IF( v.GT.rcdvin*rcdein )
THEN
933 tol = max( tol, smlnum / eps )
934 tolin = max( tolin, smlnum / eps )
935 IF( eps*( rcdvin-tolin ).GT.rcondv+tol )
THEN
936 result( 17 ) = ulpinv
937 ELSE IF( rcdvin-tolin.GT.rcondv+tol )
THEN
938 result( 17 ) = ( rcdvin-tolin ) / ( rcondv+tol )
939 ELSE IF( rcdvin+tolin.LT.eps*( rcondv-tol ) )
THEN
940 result( 17 ) = ulpinv
941 ELSE IF( rcdvin+tolin.LT.rcondv-tol )
THEN
942 result( 17 ) = ( rcondv-tol ) / ( rcdvin+tolin )
951 9999
FORMAT(
' CGET24: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
952 $ i6,
', INPUT EXAMPLE NUMBER = ', i4 )
953 9998
FORMAT(
' CGET24: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
954 $ i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
subroutine cget24(COMP, JTYPE, THRESH, ISEED, NOUNIT, N, A, LDA, H, HT, W, WT, WTMP, VS, LDVS, VS1, RCDEIN, RCDVIN, NSLCT, ISLCT, ISRT, RESULT, WORK, LWORK, RWORK, BWORK, INFO)
CGET24
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine cgeesx(JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, W, VS, LDVS, RCONDE, RCONDV, WORK, LWORK, RWORK, BWORK, INFO)
CGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE...
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
subroutine cunt01(ROWCOL, M, N, U, LDU, WORK, LWORK, RWORK, RESID)
CUNT01