LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ cdrvvx()

subroutine cdrvvx ( integer  nsizes,
integer, dimension( * )  nn,
integer  ntypes,
logical, dimension( * )  dotype,
integer, dimension( 4 )  iseed,
real  thresh,
integer  niunit,
integer  nounit,
complex, dimension( lda, * )  a,
integer  lda,
complex, dimension( lda, * )  h,
complex, dimension( * )  w,
complex, dimension( * )  w1,
complex, dimension( ldvl, * )  vl,
integer  ldvl,
complex, dimension( ldvr, * )  vr,
integer  ldvr,
complex, dimension( ldlre, * )  lre,
integer  ldlre,
real, dimension( * )  rcondv,
real, dimension( * )  rcndv1,
real, dimension( * )  rcdvin,
real, dimension( * )  rconde,
real, dimension( * )  rcnde1,
real, dimension( * )  rcdein,
real, dimension( * )  scale,
real, dimension( * )  scale1,
real, dimension( 11 )  result,
complex, dimension( * )  work,
integer  nwork,
real, dimension( * )  rwork,
integer  info 
)

CDRVVX

Purpose:
    CDRVVX  checks the nonsymmetric eigenvalue problem expert driver
    CGEEVX.

    CDRVVX uses both test matrices generated randomly depending on
    data supplied in the calling sequence, as well as on data
    read from an input file and including precomputed condition
    numbers to which it compares the ones it computes.

    When CDRVVX is called, a number of matrix "sizes" ("n's") and a
    number of matrix "types" are specified in the calling sequence.
    For each size ("n") and each type of matrix, one matrix will be
    generated and used to test the nonsymmetric eigenroutines.  For
    each matrix, 9 tests will be performed:

    (1)     | A * VR - VR * W | / ( n |A| ulp )

      Here VR is the matrix of unit right eigenvectors.
      W is a diagonal matrix with diagonal entries W(j).

    (2)     | A**H  * VL - VL * W**H | / ( n |A| ulp )

      Here VL is the matrix of unit left eigenvectors, A**H is the
      conjugate transpose of A, and W is as above.

    (3)     | |VR(i)| - 1 | / ulp and largest component real

      VR(i) denotes the i-th column of VR.

    (4)     | |VL(i)| - 1 | / ulp and largest component real

      VL(i) denotes the i-th column of VL.

    (5)     W(full) = W(partial)

      W(full) denotes the eigenvalues computed when VR, VL, RCONDV
      and RCONDE are also computed, and W(partial) denotes the
      eigenvalues computed when only some of VR, VL, RCONDV, and
      RCONDE are computed.

    (6)     VR(full) = VR(partial)

      VR(full) denotes the right eigenvectors computed when VL, RCONDV
      and RCONDE are computed, and VR(partial) denotes the result
      when only some of VL and RCONDV are computed.

    (7)     VL(full) = VL(partial)

      VL(full) denotes the left eigenvectors computed when VR, RCONDV
      and RCONDE are computed, and VL(partial) denotes the result
      when only some of VR and RCONDV are computed.

    (8)     0 if SCALE, ILO, IHI, ABNRM (full) =
                 SCALE, ILO, IHI, ABNRM (partial)
            1/ulp otherwise

      SCALE, ILO, IHI and ABNRM describe how the matrix is balanced.
      (full) is when VR, VL, RCONDE and RCONDV are also computed, and
      (partial) is when some are not computed.

    (9)     RCONDV(full) = RCONDV(partial)

      RCONDV(full) denotes the reciprocal condition numbers of the
      right eigenvectors computed when VR, VL and RCONDE are also
      computed. RCONDV(partial) denotes the reciprocal condition
      numbers when only some of VR, VL and RCONDE are computed.

    The "sizes" are specified by an array NN(1:NSIZES); the value of
    each element NN(j) specifies one size.
    The "types" are specified by a logical array DOTYPE( 1:NTYPES );
    if DOTYPE(j) is .TRUE., then matrix type "j" will be generated.
    Currently, the list of possible types is:

    (1)  The zero matrix.
    (2)  The identity matrix.
    (3)  A (transposed) Jordan block, with 1's on the diagonal.

    (4)  A diagonal matrix with evenly spaced entries
         1, ..., ULP  and random complex angles.
         (ULP = (first number larger than 1) - 1 )
    (5)  A diagonal matrix with geometrically spaced entries
         1, ..., ULP  and random complex angles.
    (6)  A diagonal matrix with "clustered" entries 1, ULP, ..., ULP
         and random complex angles.

    (7)  Same as (4), but multiplied by a constant near
         the overflow threshold
    (8)  Same as (4), but multiplied by a constant near
         the underflow threshold

    (9)  A matrix of the form  U' T U, where U is unitary and
         T has evenly spaced entries 1, ..., ULP with random complex
         angles on the diagonal and random O(1) entries in the upper
         triangle.

    (10) A matrix of the form  U' T U, where U is unitary and
         T has geometrically spaced entries 1, ..., ULP with random
         complex angles on the diagonal and random O(1) entries in
         the upper triangle.

    (11) A matrix of the form  U' T U, where U is unitary and
         T has "clustered" entries 1, ULP,..., ULP with random
         complex angles on the diagonal and random O(1) entries in
         the upper triangle.

    (12) A matrix of the form  U' T U, where U is unitary and
         T has complex eigenvalues randomly chosen from
         ULP < |z| < 1   and random O(1) entries in the upper
         triangle.

    (13) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has evenly spaced entries 1, ..., ULP
         with random complex angles on the diagonal and random O(1)
         entries in the upper triangle.

    (14) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has geometrically spaced entries
         1, ..., ULP with random complex angles on the diagonal
         and random O(1) entries in the upper triangle.

    (15) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has "clustered" entries 1, ULP,..., ULP
         with random complex angles on the diagonal and random O(1)
         entries in the upper triangle.

    (16) A matrix of the form  X' T X, where X has condition
         SQRT( ULP ) and T has complex eigenvalues randomly chosen
         from ULP < |z| < 1 and random O(1) entries in the upper
         triangle.

    (17) Same as (16), but multiplied by a constant
         near the overflow threshold
    (18) Same as (16), but multiplied by a constant
         near the underflow threshold

    (19) Nonsymmetric matrix with random entries chosen from |z| < 1
         If N is at least 4, all entries in first two rows and last
         row, and first column and last two columns are zero.
    (20) Same as (19), but multiplied by a constant
         near the overflow threshold
    (21) Same as (19), but multiplied by a constant
         near the underflow threshold

    In addition, an input file will be read from logical unit number
    NIUNIT. The file contains matrices along with precomputed
    eigenvalues and reciprocal condition numbers for the eigenvalues
    and right eigenvectors. For these matrices, in addition to tests
    (1) to (9) we will compute the following two tests:

   (10)  |RCONDV - RCDVIN| / cond(RCONDV)

      RCONDV is the reciprocal right eigenvector condition number
      computed by CGEEVX and RCDVIN (the precomputed true value)
      is supplied as input. cond(RCONDV) is the condition number of
      RCONDV, and takes errors in computing RCONDV into account, so
      that the resulting quantity should be O(ULP). cond(RCONDV) is
      essentially given by norm(A)/RCONDE.

   (11)  |RCONDE - RCDEIN| / cond(RCONDE)

      RCONDE is the reciprocal eigenvalue condition number
      computed by CGEEVX and RCDEIN (the precomputed true value)
      is supplied as input.  cond(RCONDE) is the condition number
      of RCONDE, and takes errors in computing RCONDE into account,
      so that the resulting quantity should be O(ULP). cond(RCONDE)
      is essentially given by norm(A)/RCONDV.
Parameters
[in]NSIZES
          NSIZES is INTEGER
          The number of sizes of matrices to use.  NSIZES must be at
          least zero. If it is zero, no randomly generated matrices
          are tested, but any test matrices read from NIUNIT will be
          tested.
[in]NN
          NN is INTEGER array, dimension (NSIZES)
          An array containing the sizes to be used for the matrices.
          Zero values will be skipped.  The values must be at least
          zero.
[in]NTYPES
          NTYPES is INTEGER
          The number of elements in DOTYPE. NTYPES must be at least
          zero. If it is zero, no randomly generated test matrices
          are tested, but and test matrices read from NIUNIT will be
          tested. If it is MAXTYP+1 and NSIZES is 1, then an
          additional type, MAXTYP+1 is defined, which is to use
          whatever matrix is in A.  This is only useful if
          DOTYPE(1:MAXTYP) is .FALSE. and DOTYPE(MAXTYP+1) is .TRUE. .
[in]DOTYPE
          DOTYPE is LOGICAL array, dimension (NTYPES)
          If DOTYPE(j) is .TRUE., then for each size in NN a
          matrix of that size and of type j will be generated.
          If NTYPES is smaller than the maximum number of types
          defined (PARAMETER MAXTYP), then types NTYPES+1 through
          MAXTYP will not be generated.  If NTYPES is larger
          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES)
          will be ignored.
[in,out]ISEED
          ISEED is INTEGER array, dimension (4)
          On entry ISEED specifies the seed of the random number
          generator. The array elements should be between 0 and 4095;
          if not they will be reduced mod 4096.  Also, ISEED(4) must
          be odd.  The random number generator uses a linear
          congruential sequence limited to small integers, and so
          should produce machine independent random numbers. The
          values of ISEED are changed on exit, and can be used in the
          next call to CDRVVX to continue the same random number
          sequence.
[in]THRESH
          THRESH is REAL
          A test will count as "failed" if the "error", computed as
          described above, exceeds THRESH.  Note that the error
          is scaled to be O(1), so THRESH should be a reasonably
          small multiple of 1, e.g., 10 or 100.  In particular,
          it should not depend on the precision (single vs. double)
          or the size of the matrix.  It must be at least zero.
[in]NIUNIT
          NIUNIT is INTEGER
          The FORTRAN unit number for reading in the data file of
          problems to solve.
[in]NOUNIT
          NOUNIT is INTEGER
          The FORTRAN unit number for printing out error messages
          (e.g., if a routine returns INFO not equal to 0.)
[out]A
          A is COMPLEX array, dimension (LDA, max(NN,12))
          Used to hold the matrix whose eigenvalues are to be
          computed.  On exit, A contains the last matrix actually used.
[in]LDA
          LDA is INTEGER
          The leading dimension of A, and H. LDA must be at
          least 1 and at least max( NN, 12 ). (12 is the
          dimension of the largest matrix on the precomputed
          input file.)
[out]H
          H is COMPLEX array, dimension (LDA, max(NN,12))
          Another copy of the test matrix A, modified by CGEEVX.
[out]W
          W is COMPLEX array, dimension (max(NN,12))
          Contains the eigenvalues of A.
[out]W1
          W1 is COMPLEX array, dimension (max(NN,12))
          Like W, this array contains the eigenvalues of A,
          but those computed when CGEEVX only computes a partial
          eigendecomposition, i.e. not the eigenvalues and left
          and right eigenvectors.
[out]VL
          VL is COMPLEX array, dimension (LDVL, max(NN,12))
          VL holds the computed left eigenvectors.
[in]LDVL
          LDVL is INTEGER
          Leading dimension of VL. Must be at least max(1,max(NN,12)).
[out]VR
          VR is COMPLEX array, dimension (LDVR, max(NN,12))
          VR holds the computed right eigenvectors.
[in]LDVR
          LDVR is INTEGER
          Leading dimension of VR. Must be at least max(1,max(NN,12)).
[out]LRE
          LRE is COMPLEX array, dimension (LDLRE, max(NN,12))
          LRE holds the computed right or left eigenvectors.
[in]LDLRE
          LDLRE is INTEGER
          Leading dimension of LRE. Must be at least max(1,max(NN,12))
[out]RCONDV
          RCONDV is REAL array, dimension (N)
          RCONDV holds the computed reciprocal condition numbers
          for eigenvectors.
[out]RCNDV1
          RCNDV1 is REAL array, dimension (N)
          RCNDV1 holds more computed reciprocal condition numbers
          for eigenvectors.
[in]RCDVIN
          RCDVIN is REAL array, dimension (N)
          When COMP = .TRUE. RCDVIN holds the precomputed reciprocal
          condition numbers for eigenvectors to be compared with
          RCONDV.
[out]RCONDE
          RCONDE is REAL array, dimension (N)
          RCONDE holds the computed reciprocal condition numbers
          for eigenvalues.
[out]RCNDE1
          RCNDE1 is REAL array, dimension (N)
          RCNDE1 holds more computed reciprocal condition numbers
          for eigenvalues.
[in]RCDEIN
          RCDEIN is REAL array, dimension (N)
          When COMP = .TRUE. RCDEIN holds the precomputed reciprocal
          condition numbers for eigenvalues to be compared with
          RCONDE.
[out]SCALE
          SCALE is REAL array, dimension (N)
          Holds information describing balancing of matrix.
[out]SCALE1
          SCALE1 is REAL array, dimension (N)
          Holds information describing balancing of matrix.
[out]RESULT
          RESULT is REAL array, dimension (11)
          The values computed by the seven tests described above.
          The values are currently limited to 1/ulp, to avoid
          overflow.
[out]WORK
          WORK is COMPLEX array, dimension (NWORK)
[in]NWORK
          NWORK is INTEGER
          The number of entries in WORK.  This must be at least
          max(6*12+2*12**2,6*NN(j)+2*NN(j)**2) =
          max(    360     ,6*NN(j)+2*NN(j)**2)    for all j.
[out]RWORK
          RWORK is REAL array, dimension (2*max(NN,12))
[out]INFO
          INFO is INTEGER
          If 0,  then successful exit.
          If <0, then input parameter -INFO is incorrect.
          If >0, CLATMR, CLATMS, CLATME or CGET23 returned an error
                 code, and INFO is its absolute value.

-----------------------------------------------------------------------

     Some Local Variables and Parameters:
     ---- ----- --------- --- ----------

     ZERO, ONE       Real 0 and 1.
     MAXTYP          The number of types defined.
     NMAX            Largest value in NN or 12.
     NERRS           The number of tests which have exceeded THRESH
     COND, CONDS,
     IMODE           Values to be passed to the matrix generators.
     ANORM           Norm of A; passed to matrix generators.

     OVFL, UNFL      Overflow and underflow thresholds.
     ULP, ULPINV     Finest relative precision and its inverse.
     RTULP, RTULPI   Square roots of the previous 4 values.

             The following four arrays decode JTYPE:
     KTYPE(j)        The general type (1-10) for type "j".
     KMODE(j)        The MODE value to be passed to the matrix
                     generator for type "j".
     KMAGN(j)        The order of magnitude ( O(1),
                     O(overflow^(1/2) ), O(underflow^(1/2) )
     KCONDS(j)       Selectw whether CONDS is to be 1 or
                     1/sqrt(ulp).  (0 means irrelevant.)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 491 of file cdrvvx.f.

496*
497* -- LAPACK test routine --
498* -- LAPACK is a software package provided by Univ. of Tennessee, --
499* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
500*
501* .. Scalar Arguments ..
502 INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NIUNIT, NOUNIT,
503 $ NSIZES, NTYPES, NWORK
504 REAL THRESH
505* ..
506* .. Array Arguments ..
507 LOGICAL DOTYPE( * )
508 INTEGER ISEED( 4 ), NN( * )
509 REAL RCDEIN( * ), RCDVIN( * ), RCNDE1( * ),
510 $ RCNDV1( * ), RCONDE( * ), RCONDV( * ),
511 $ RESULT( 11 ), RWORK( * ), SCALE( * ),
512 $ SCALE1( * )
513 COMPLEX A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),
514 $ VL( LDVL, * ), VR( LDVR, * ), W( * ), W1( * ),
515 $ WORK( * )
516* ..
517*
518* =====================================================================
519*
520* .. Parameters ..
521 COMPLEX CZERO
522 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
523 COMPLEX CONE
524 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
525 REAL ZERO, ONE
526 parameter( zero = 0.0e+0, one = 1.0e+0 )
527 INTEGER MAXTYP
528 parameter( maxtyp = 21 )
529* ..
530* .. Local Scalars ..
531 LOGICAL BADNN
532 CHARACTER BALANC
533 CHARACTER*3 PATH
534 INTEGER I, IBAL, IINFO, IMODE, ISRT, ITYPE, IWK, J,
535 $ JCOL, JSIZE, JTYPE, MTYPES, N, NERRS,
536 $ NFAIL, NMAX, NNWORK, NTEST, NTESTF, NTESTT
537 REAL ANORM, COND, CONDS, OVFL, RTULP, RTULPI, ULP,
538 $ ULPINV, UNFL, WI, WR
539* ..
540* .. Local Arrays ..
541 CHARACTER BAL( 4 )
542 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),
543 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
544 $ KTYPE( MAXTYP )
545* ..
546* .. External Functions ..
547 REAL SLAMCH
548 EXTERNAL slamch
549* ..
550* .. External Subroutines ..
551 EXTERNAL cget23, clatme, clatmr, clatms, claset, slasum,
552 $ xerbla
553* ..
554* .. Intrinsic Functions ..
555 INTRINSIC abs, cmplx, max, min, sqrt
556* ..
557* .. Data statements ..
558 DATA ktype / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
559 DATA kmagn / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
560 $ 3, 1, 2, 3 /
561 DATA kmode / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
562 $ 1, 5, 5, 5, 4, 3, 1 /
563 DATA kconds / 3*0, 5*0, 4*1, 6*2, 3*0 /
564 DATA bal / 'N', 'P', 'S', 'B' /
565* ..
566* .. Executable Statements ..
567*
568 path( 1: 1 ) = 'Complex precision'
569 path( 2: 3 ) = 'VX'
570*
571* Check for errors
572*
573 ntestt = 0
574 ntestf = 0
575 info = 0
576*
577* Important constants
578*
579 badnn = .false.
580*
581* 7 is the largest dimension in the input file of precomputed
582* problems
583*
584 nmax = 7
585 DO 10 j = 1, nsizes
586 nmax = max( nmax, nn( j ) )
587 IF( nn( j ).LT.0 )
588 $ badnn = .true.
589 10 CONTINUE
590*
591* Check for errors
592*
593 IF( nsizes.LT.0 ) THEN
594 info = -1
595 ELSE IF( badnn ) THEN
596 info = -2
597 ELSE IF( ntypes.LT.0 ) THEN
598 info = -3
599 ELSE IF( thresh.LT.zero ) THEN
600 info = -6
601 ELSE IF( lda.LT.1 .OR. lda.LT.nmax ) THEN
602 info = -10
603 ELSE IF( ldvl.LT.1 .OR. ldvl.LT.nmax ) THEN
604 info = -15
605 ELSE IF( ldvr.LT.1 .OR. ldvr.LT.nmax ) THEN
606 info = -17
607 ELSE IF( ldlre.LT.1 .OR. ldlre.LT.nmax ) THEN
608 info = -19
609 ELSE IF( 6*nmax+2*nmax**2.GT.nwork ) THEN
610 info = -30
611 END IF
612*
613 IF( info.NE.0 ) THEN
614 CALL xerbla( 'CDRVVX', -info )
615 RETURN
616 END IF
617*
618* If nothing to do check on NIUNIT
619*
620 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
621 $ GO TO 160
622*
623* More Important constants
624*
625 unfl = slamch( 'Safe minimum' )
626 ovfl = one / unfl
627 ulp = slamch( 'Precision' )
628 ulpinv = one / ulp
629 rtulp = sqrt( ulp )
630 rtulpi = one / rtulp
631*
632* Loop over sizes, types
633*
634 nerrs = 0
635*
636 DO 150 jsize = 1, nsizes
637 n = nn( jsize )
638 IF( nsizes.NE.1 ) THEN
639 mtypes = min( maxtyp, ntypes )
640 ELSE
641 mtypes = min( maxtyp+1, ntypes )
642 END IF
643*
644 DO 140 jtype = 1, mtypes
645 IF( .NOT.dotype( jtype ) )
646 $ GO TO 140
647*
648* Save ISEED in case of an error.
649*
650 DO 20 j = 1, 4
651 ioldsd( j ) = iseed( j )
652 20 CONTINUE
653*
654* Compute "A"
655*
656* Control parameters:
657*
658* KMAGN KCONDS KMODE KTYPE
659* =1 O(1) 1 clustered 1 zero
660* =2 large large clustered 2 identity
661* =3 small exponential Jordan
662* =4 arithmetic diagonal, (w/ eigenvalues)
663* =5 random log symmetric, w/ eigenvalues
664* =6 random general, w/ eigenvalues
665* =7 random diagonal
666* =8 random symmetric
667* =9 random general
668* =10 random triangular
669*
670 IF( mtypes.GT.maxtyp )
671 $ GO TO 90
672*
673 itype = ktype( jtype )
674 imode = kmode( jtype )
675*
676* Compute norm
677*
678 GO TO ( 30, 40, 50 )kmagn( jtype )
679*
680 30 CONTINUE
681 anorm = one
682 GO TO 60
683*
684 40 CONTINUE
685 anorm = ovfl*ulp
686 GO TO 60
687*
688 50 CONTINUE
689 anorm = unfl*ulpinv
690 GO TO 60
691*
692 60 CONTINUE
693*
694 CALL claset( 'Full', lda, n, czero, czero, a, lda )
695 iinfo = 0
696 cond = ulpinv
697*
698* Special Matrices -- Identity & Jordan block
699*
700* Zero
701*
702 IF( itype.EQ.1 ) THEN
703 iinfo = 0
704*
705 ELSE IF( itype.EQ.2 ) THEN
706*
707* Identity
708*
709 DO 70 jcol = 1, n
710 a( jcol, jcol ) = anorm
711 70 CONTINUE
712*
713 ELSE IF( itype.EQ.3 ) THEN
714*
715* Jordan Block
716*
717 DO 80 jcol = 1, n
718 a( jcol, jcol ) = anorm
719 IF( jcol.GT.1 )
720 $ a( jcol, jcol-1 ) = one
721 80 CONTINUE
722*
723 ELSE IF( itype.EQ.4 ) THEN
724*
725* Diagonal Matrix, [Eigen]values Specified
726*
727 CALL clatms( n, n, 'S', iseed, 'H', rwork, imode, cond,
728 $ anorm, 0, 0, 'N', a, lda, work( n+1 ),
729 $ iinfo )
730*
731 ELSE IF( itype.EQ.5 ) THEN
732*
733* Symmetric, eigenvalues specified
734*
735 CALL clatms( n, n, 'S', iseed, 'H', rwork, imode, cond,
736 $ anorm, n, n, 'N', a, lda, work( n+1 ),
737 $ iinfo )
738*
739 ELSE IF( itype.EQ.6 ) THEN
740*
741* General, eigenvalues specified
742*
743 IF( kconds( jtype ).EQ.1 ) THEN
744 conds = one
745 ELSE IF( kconds( jtype ).EQ.2 ) THEN
746 conds = rtulpi
747 ELSE
748 conds = zero
749 END IF
750*
751 CALL clatme( n, 'D', iseed, work, imode, cond, cone,
752 $ 'T', 'T', 'T', rwork, 4, conds, n, n, anorm,
753 $ a, lda, work( 2*n+1 ), iinfo )
754*
755 ELSE IF( itype.EQ.7 ) THEN
756*
757* Diagonal, random eigenvalues
758*
759 CALL clatmr( n, n, 'D', iseed, 'S', work, 6, one, cone,
760 $ 'T', 'N', work( n+1 ), 1, one,
761 $ work( 2*n+1 ), 1, one, 'N', idumma, 0, 0,
762 $ zero, anorm, 'NO', a, lda, idumma, iinfo )
763*
764 ELSE IF( itype.EQ.8 ) THEN
765*
766* Symmetric, random eigenvalues
767*
768 CALL clatmr( n, n, 'D', iseed, 'H', work, 6, one, cone,
769 $ 'T', 'N', work( n+1 ), 1, one,
770 $ work( 2*n+1 ), 1, one, 'N', idumma, n, n,
771 $ zero, anorm, 'NO', a, lda, idumma, iinfo )
772*
773 ELSE IF( itype.EQ.9 ) THEN
774*
775* General, random eigenvalues
776*
777 CALL clatmr( n, n, 'D', iseed, 'N', work, 6, one, cone,
778 $ 'T', 'N', work( n+1 ), 1, one,
779 $ work( 2*n+1 ), 1, one, 'N', idumma, n, n,
780 $ zero, anorm, 'NO', a, lda, idumma, iinfo )
781 IF( n.GE.4 ) THEN
782 CALL claset( 'Full', 2, n, czero, czero, a, lda )
783 CALL claset( 'Full', n-3, 1, czero, czero, a( 3, 1 ),
784 $ lda )
785 CALL claset( 'Full', n-3, 2, czero, czero,
786 $ a( 3, n-1 ), lda )
787 CALL claset( 'Full', 1, n, czero, czero, a( n, 1 ),
788 $ lda )
789 END IF
790*
791 ELSE IF( itype.EQ.10 ) THEN
792*
793* Triangular, random eigenvalues
794*
795 CALL clatmr( n, n, 'D', iseed, 'N', work, 6, one, cone,
796 $ 'T', 'N', work( n+1 ), 1, one,
797 $ work( 2*n+1 ), 1, one, 'N', idumma, n, 0,
798 $ zero, anorm, 'NO', a, lda, idumma, iinfo )
799*
800 ELSE
801*
802 iinfo = 1
803 END IF
804*
805 IF( iinfo.NE.0 ) THEN
806 WRITE( nounit, fmt = 9992 )'Generator', iinfo, n, jtype,
807 $ ioldsd
808 info = abs( iinfo )
809 RETURN
810 END IF
811*
812 90 CONTINUE
813*
814* Test for minimal and generous workspace
815*
816 DO 130 iwk = 1, 3
817 IF( iwk.EQ.1 ) THEN
818 nnwork = 2*n
819 ELSE IF( iwk.EQ.2 ) THEN
820 nnwork = 2*n + n**2
821 ELSE
822 nnwork = 6*n + 2*n**2
823 END IF
824 nnwork = max( nnwork, 1 )
825*
826* Test for all balancing options
827*
828 DO 120 ibal = 1, 4
829 balanc = bal( ibal )
830*
831* Perform tests
832*
833 CALL cget23( .false., 0, balanc, jtype, thresh,
834 $ ioldsd, nounit, n, a, lda, h, w, w1, vl,
835 $ ldvl, vr, ldvr, lre, ldlre, rcondv,
836 $ rcndv1, rcdvin, rconde, rcnde1, rcdein,
837 $ scale, scale1, result, work, nnwork,
838 $ rwork, info )
839*
840* Check for RESULT(j) > THRESH
841*
842 ntest = 0
843 nfail = 0
844 DO 100 j = 1, 9
845 IF( result( j ).GE.zero )
846 $ ntest = ntest + 1
847 IF( result( j ).GE.thresh )
848 $ nfail = nfail + 1
849 100 CONTINUE
850*
851 IF( nfail.GT.0 )
852 $ ntestf = ntestf + 1
853 IF( ntestf.EQ.1 ) THEN
854 WRITE( nounit, fmt = 9999 )path
855 WRITE( nounit, fmt = 9998 )
856 WRITE( nounit, fmt = 9997 )
857 WRITE( nounit, fmt = 9996 )
858 WRITE( nounit, fmt = 9995 )thresh
859 ntestf = 2
860 END IF
861*
862 DO 110 j = 1, 9
863 IF( result( j ).GE.thresh ) THEN
864 WRITE( nounit, fmt = 9994 )balanc, n, iwk,
865 $ ioldsd, jtype, j, result( j )
866 END IF
867 110 CONTINUE
868*
869 nerrs = nerrs + nfail
870 ntestt = ntestt + ntest
871*
872 120 CONTINUE
873 130 CONTINUE
874 140 CONTINUE
875 150 CONTINUE
876*
877 160 CONTINUE
878*
879* Read in data from file to check accuracy of condition estimation.
880* Assume input eigenvalues are sorted lexicographically (increasing
881* by real part, then decreasing by imaginary part)
882*
883 jtype = 0
884 170 CONTINUE
885 READ( niunit, fmt = *, END = 220 )N, isrt
886*
887* Read input data until N=0
888*
889 IF( n.EQ.0 )
890 $ GO TO 220
891 jtype = jtype + 1
892 iseed( 1 ) = jtype
893 DO 180 i = 1, n
894 READ( niunit, fmt = * )( a( i, j ), j = 1, n )
895 180 CONTINUE
896 DO 190 i = 1, n
897 READ( niunit, fmt = * )wr, wi, rcdein( i ), rcdvin( i )
898 w1( i ) = cmplx( wr, wi )
899 190 CONTINUE
900 CALL cget23( .true., isrt, 'N', 22, thresh, iseed, nounit, n, a,
901 $ lda, h, w, w1, vl, ldvl, vr, ldvr, lre, ldlre,
902 $ rcondv, rcndv1, rcdvin, rconde, rcnde1, rcdein,
903 $ scale, scale1, result, work, 6*n+2*n**2, rwork,
904 $ info )
905*
906* Check for RESULT(j) > THRESH
907*
908 ntest = 0
909 nfail = 0
910 DO 200 j = 1, 11
911 IF( result( j ).GE.zero )
912 $ ntest = ntest + 1
913 IF( result( j ).GE.thresh )
914 $ nfail = nfail + 1
915 200 CONTINUE
916*
917 IF( nfail.GT.0 )
918 $ ntestf = ntestf + 1
919 IF( ntestf.EQ.1 ) THEN
920 WRITE( nounit, fmt = 9999 )path
921 WRITE( nounit, fmt = 9998 )
922 WRITE( nounit, fmt = 9997 )
923 WRITE( nounit, fmt = 9996 )
924 WRITE( nounit, fmt = 9995 )thresh
925 ntestf = 2
926 END IF
927*
928 DO 210 j = 1, 11
929 IF( result( j ).GE.thresh ) THEN
930 WRITE( nounit, fmt = 9993 )n, jtype, j, result( j )
931 END IF
932 210 CONTINUE
933*
934 nerrs = nerrs + nfail
935 ntestt = ntestt + ntest
936 GO TO 170
937 220 CONTINUE
938*
939* Summary
940*
941 CALL slasum( path, nounit, nerrs, ntestt )
942*
943 9999 FORMAT( / 1x, a3, ' -- Complex Eigenvalue-Eigenvector ',
944 $ 'Decomposition Expert Driver',
945 $ / ' Matrix types (see CDRVVX for details): ' )
946*
947 9998 FORMAT( / ' Special Matrices:', / ' 1=Zero matrix. ',
948 $ ' ', ' 5=Diagonal: geometr. spaced entries.',
949 $ / ' 2=Identity matrix. ', ' 6=Diagona',
950 $ 'l: clustered entries.', / ' 3=Transposed Jordan block. ',
951 $ ' ', ' 7=Diagonal: large, evenly spaced.', / ' ',
952 $ '4=Diagonal: evenly spaced entries. ', ' 8=Diagonal: s',
953 $ 'mall, evenly spaced.' )
954 9997 FORMAT( ' Dense, Non-Symmetric Matrices:', / ' 9=Well-cond., ev',
955 $ 'enly spaced eigenvals.', ' 14=Ill-cond., geomet. spaced e',
956 $ 'igenals.', / ' 10=Well-cond., geom. spaced eigenvals. ',
957 $ ' 15=Ill-conditioned, clustered e.vals.', / ' 11=Well-cond',
958 $ 'itioned, clustered e.vals. ', ' 16=Ill-cond., random comp',
959 $ 'lex ', / ' 12=Well-cond., random complex ', ' ',
960 $ ' 17=Ill-cond., large rand. complx ', / ' 13=Ill-condi',
961 $ 'tioned, evenly spaced. ', ' 18=Ill-cond., small rand.',
962 $ ' complx ' )
963 9996 FORMAT( ' 19=Matrix with random O(1) entries. ', ' 21=Matrix ',
964 $ 'with small random entries.', / ' 20=Matrix with large ran',
965 $ 'dom entries. ', ' 22=Matrix read from input file', / )
966 9995 FORMAT( ' Tests performed with test threshold =', f8.2,
967 $ / / ' 1 = | A VR - VR W | / ( n |A| ulp ) ',
968 $ / ' 2 = | transpose(A) VL - VL W | / ( n |A| ulp ) ',
969 $ / ' 3 = | |VR(i)| - 1 | / ulp ',
970 $ / ' 4 = | |VL(i)| - 1 | / ulp ',
971 $ / ' 5 = 0 if W same no matter if VR or VL computed,',
972 $ ' 1/ulp otherwise', /
973 $ ' 6 = 0 if VR same no matter what else computed,',
974 $ ' 1/ulp otherwise', /
975 $ ' 7 = 0 if VL same no matter what else computed,',
976 $ ' 1/ulp otherwise', /
977 $ ' 8 = 0 if RCONDV same no matter what else computed,',
978 $ ' 1/ulp otherwise', /
979 $ ' 9 = 0 if SCALE, ILO, IHI, ABNRM same no matter what else',
980 $ ' computed, 1/ulp otherwise',
981 $ / ' 10 = | RCONDV - RCONDV(precomputed) | / cond(RCONDV),',
982 $ / ' 11 = | RCONDE - RCONDE(precomputed) | / cond(RCONDE),' )
983 9994 FORMAT( ' BALANC=''', a1, ''',N=', i4, ',IWK=', i1, ', seed=',
984 $ 4( i4, ',' ), ' type ', i2, ', test(', i2, ')=', g10.3 )
985 9993 FORMAT( ' N=', i5, ', input example =', i3, ', test(', i2, ')=',
986 $ g10.3 )
987 9992 FORMAT( ' CDRVVX: ', a, ' returned INFO=', i6, '.', / 9x, 'N=',
988 $ i6, ', JTYPE=', i6, ', ISEED=(', 3( i5, ',' ), i5, ')' )
989*
990 RETURN
991*
992* End of CDRVVX
993*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine cget23(comp, isrt, balanc, jtype, thresh, iseed, nounit, n, a, lda, h, w, w1, vl, ldvl, vr, ldvr, lre, ldlre, rcondv, rcndv1, rcdvin, rconde, rcnde1, rcdein, scale, scale1, result, work, lwork, rwork, info)
CGET23
Definition cget23.f:368
subroutine clatme(n, dist, iseed, d, mode, cond, dmax, rsign, upper, sim, ds, modes, conds, kl, ku, anorm, a, lda, work, info)
CLATME
Definition clatme.f:301
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
Definition clatmr.f:490
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
Definition clatms.f:332
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
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.
Definition claset.f:106
subroutine slasum(type, iounit, ie, nrun)
SLASUM
Definition slasum.f:41
Here is the call graph for this function:
Here is the caller graph for this function: