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

◆ ddrvvx()

subroutine ddrvvx ( integer  nsizes,
integer, dimension( * )  nn,
integer  ntypes,
logical, dimension( * )  dotype,
integer, dimension( 4 )  iseed,
double precision  thresh,
integer  niunit,
integer  nounit,
double precision, dimension( lda, * )  a,
integer  lda,
double precision, dimension( lda, * )  h,
double precision, dimension( * )  wr,
double precision, dimension( * )  wi,
double precision, dimension( * )  wr1,
double precision, dimension( * )  wi1,
double precision, dimension( ldvl, * )  vl,
integer  ldvl,
double precision, dimension( ldvr, * )  vr,
integer  ldvr,
double precision, dimension( ldlre, * )  lre,
integer  ldlre,
double precision, dimension( * )  rcondv,
double precision, dimension( * )  rcndv1,
double precision, dimension( * )  rcdvin,
double precision, dimension( * )  rconde,
double precision, dimension( * )  rcnde1,
double precision, dimension( * )  rcdein,
double precision, dimension( * )  scale,
double precision, dimension( * )  scale1,
double precision, dimension( 11 )  result,
double precision, dimension( * )  work,
integer  nwork,
integer, dimension( * )  iwork,
integer  info 
)

DDRVVX

Purpose:
    DDRVVX  checks the nonsymmetric eigenvalue problem expert driver
    DGEEVX.

    DDRVVX 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 DDRVVX 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 block diagonal matrix, with a 1x1 block for each
      real eigenvalue and a 2x2 block for each complex conjugate
      pair.  If eigenvalues j and j+1 are a complex conjugate pair,
      so WR(j) = WR(j+1) = wr and WI(j) = - WI(j+1) = wi, then the
      2 x 2 block corresponding to the pair will be:

              (  wr  wi  )
              ( -wi  wr  )

      Such a block multiplying an n x 2 matrix  ( ur ui ) on the
      right will be the same as multiplying  ur + i*ui  by  wr + i*wi.

    (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 signs.
         (ULP = (first number larger than 1) - 1 )
    (5)  A diagonal matrix with geometrically spaced entries
         1, ..., ULP  and random signs.
    (6)  A diagonal matrix with "clustered" entries 1, ULP, ..., ULP
         and random signs.

    (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 orthogonal and
         T has evenly spaced entries 1, ..., ULP with random signs
         on the diagonal and random O(1) entries in the upper
         triangle.

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

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

    (12) A matrix of the form  U' T U, where U is orthogonal and
         T has real or complex conjugate paired eigenvalues randomly
         chosen from ( ULP, 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 signs 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 signs 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 signs 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 real or complex conjugate paired
         eigenvalues randomly chosen from ( ULP, 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 (-1,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 DGEEVX 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 DGEEVX 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 DDRVVX to continue the same random number
          sequence.
[in]THRESH
          THRESH is DOUBLE PRECISION
          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 DOUBLE PRECISION 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 the arrays A and H.
          LDA >= max(NN,12), since 12 is the dimension of the largest
          matrix in the precomputed input file.
[out]H
          H is DOUBLE PRECISION array, dimension
                      (LDA, max(NN,12))
          Another copy of the test matrix A, modified by DGEEVX.
[out]WR
          WR is DOUBLE PRECISION array, dimension (max(NN))
[out]WI
          WI is DOUBLE PRECISION array, dimension (max(NN))

          The real and imaginary parts of the eigenvalues of A.
          On exit, WR + WI*i are the eigenvalues of the matrix in A.
[out]WR1
          WR1 is DOUBLE PRECISION array, dimension (max(NN,12))
[out]WI1
          WI1 is DOUBLE PRECISION array, dimension (max(NN,12))

          Like WR, WI, these arrays contain the eigenvalues of A,
          but those computed when DGEEVX only computes a partial
          eigendecomposition, i.e. not the eigenvalues and left
          and right eigenvectors.
[out]VL
          VL is DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (N)
          RCONDV holds the computed reciprocal condition numbers
          for eigenvectors.
[out]RCNDV1
          RCNDV1 is DOUBLE PRECISION array, dimension (N)
          RCNDV1 holds more computed reciprocal condition numbers
          for eigenvectors.
[out]RCDVIN
          RCDVIN is DOUBLE PRECISION array, dimension (N)
          When COMP = .TRUE. RCDVIN holds the precomputed reciprocal
          condition numbers for eigenvectors to be compared with
          RCONDV.
[out]RCONDE
          RCONDE is DOUBLE PRECISION array, dimension (N)
          RCONDE holds the computed reciprocal condition numbers
          for eigenvalues.
[out]RCNDE1
          RCNDE1 is DOUBLE PRECISION array, dimension (N)
          RCNDE1 holds more computed reciprocal condition numbers
          for eigenvalues.
[out]RCDEIN
          RCDEIN is DOUBLE PRECISION array, dimension (N)
          When COMP = .TRUE. RCDEIN holds the precomputed reciprocal
          condition numbers for eigenvalues to be compared with
          RCONDE.
[out]SCALE
          SCALE is DOUBLE PRECISION array, dimension (N)
          Holds information describing balancing of matrix.
[out]SCALE1
          SCALE1 is DOUBLE PRECISION array, dimension (N)
          Holds information describing balancing of matrix.
[out]RESULT
          RESULT is DOUBLE PRECISION 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 DOUBLE PRECISION 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]IWORK
          IWORK is INTEGER 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, DLATMR, SLATMS, SLATME or DGET23 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 516 of file ddrvvx.f.

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