3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DDRVVX( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
12 * NIUNIT, NOUNIT, A, LDA, H, WR, WI, WR1, WI1,
13 * VL, LDVL, VR, LDVR, LRE, LDLRE, RCONDV, RCNDV1,
14 * RCDVIN, RCONDE, RCNDE1, RCDEIN, SCALE, SCALE1,
15 * RESULT, WORK, NWORK, IWORK, INFO )
17 * .. Scalar Arguments ..
18 * INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NIUNIT, NOUNIT,
19 * $ NSIZES, NTYPES, NWORK
20 * DOUBLE PRECISION THRESH
22 * .. Array Arguments ..
24 * INTEGER ISEED( 4 ), IWORK( * ), NN( * )
25 * DOUBLE PRECISION A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),
26 * $ RCDEIN( * ), RCDVIN( * ), RCNDE1( * ),
27 * $ RCNDV1( * ), RCONDE( * ), RCONDV( * ),
28 * $ RESULT( 11 ), SCALE( * ), SCALE1( * ),
29 * $ VL( LDVL, * ), VR( LDVR, * ), WI( * ),
30 * $ WI1( * ), WORK( * ), WR( * ), WR1( * )
39 *> DDRVVX checks the nonsymmetric eigenvalue problem expert driver
42 *> DDRVVX uses both test matrices generated randomly depending on
43 *> data supplied in the calling sequence, as well as on data
44 *> read from an input file and including precomputed condition
45 *> numbers to which it compares the ones it computes.
47 *> When DDRVVX is called, a number of matrix "sizes" ("n's") and a
48 *> number of matrix "types" are specified in the calling sequence.
49 *> For each size ("n") and each type of matrix, one matrix will be
50 *> generated and used to test the nonsymmetric eigenroutines. For
51 *> each matrix, 9 tests will be performed:
53 *> (1) | A * VR - VR * W | / ( n |A| ulp )
55 *> Here VR is the matrix of unit right eigenvectors.
56 *> W is a block diagonal matrix, with a 1x1 block for each
57 *> real eigenvalue and a 2x2 block for each complex conjugate
58 *> pair. If eigenvalues j and j+1 are a complex conjugate pair,
59 *> so WR(j) = WR(j+1) = wr and WI(j) = - WI(j+1) = wi, then the
60 *> 2 x 2 block corresponding to the pair will be:
65 *> Such a block multiplying an n x 2 matrix ( ur ui ) on the
66 *> right will be the same as multiplying ur + i*ui by wr + i*wi.
68 *> (2) | A**H * VL - VL * W**H | / ( n |A| ulp )
70 *> Here VL is the matrix of unit left eigenvectors, A**H is the
71 *> conjugate transpose of A, and W is as above.
73 *> (3) | |VR(i)| - 1 | / ulp and largest component real
75 *> VR(i) denotes the i-th column of VR.
77 *> (4) | |VL(i)| - 1 | / ulp and largest component real
79 *> VL(i) denotes the i-th column of VL.
81 *> (5) W(full) = W(partial)
83 *> W(full) denotes the eigenvalues computed when VR, VL, RCONDV
84 *> and RCONDE are also computed, and W(partial) denotes the
85 *> eigenvalues computed when only some of VR, VL, RCONDV, and
86 *> RCONDE are computed.
88 *> (6) VR(full) = VR(partial)
90 *> VR(full) denotes the right eigenvectors computed when VL, RCONDV
91 *> and RCONDE are computed, and VR(partial) denotes the result
92 *> when only some of VL and RCONDV are computed.
94 *> (7) VL(full) = VL(partial)
96 *> VL(full) denotes the left eigenvectors computed when VR, RCONDV
97 *> and RCONDE are computed, and VL(partial) denotes the result
98 *> when only some of VR and RCONDV are computed.
100 *> (8) 0 if SCALE, ILO, IHI, ABNRM (full) =
101 *> SCALE, ILO, IHI, ABNRM (partial)
104 *> SCALE, ILO, IHI and ABNRM describe how the matrix is balanced.
105 *> (full) is when VR, VL, RCONDE and RCONDV are also computed, and
106 *> (partial) is when some are not computed.
108 *> (9) RCONDV(full) = RCONDV(partial)
110 *> RCONDV(full) denotes the reciprocal condition numbers of the
111 *> right eigenvectors computed when VR, VL and RCONDE are also
112 *> computed. RCONDV(partial) denotes the reciprocal condition
113 *> numbers when only some of VR, VL and RCONDE are computed.
115 *> The "sizes" are specified by an array NN(1:NSIZES); the value of
116 *> each element NN(j) specifies one size.
117 *> The "types" are specified by a logical array DOTYPE( 1:NTYPES );
118 *> if DOTYPE(j) is .TRUE., then matrix type "j" will be generated.
119 *> Currently, the list of possible types is:
121 *> (1) The zero matrix.
122 *> (2) The identity matrix.
123 *> (3) A (transposed) Jordan block, with 1's on the diagonal.
125 *> (4) A diagonal matrix with evenly spaced entries
126 *> 1, ..., ULP and random signs.
127 *> (ULP = (first number larger than 1) - 1 )
128 *> (5) A diagonal matrix with geometrically spaced entries
129 *> 1, ..., ULP and random signs.
130 *> (6) A diagonal matrix with "clustered" entries 1, ULP, ..., ULP
133 *> (7) Same as (4), but multiplied by a constant near
134 *> the overflow threshold
135 *> (8) Same as (4), but multiplied by a constant near
136 *> the underflow threshold
138 *> (9) A matrix of the form U' T U, where U is orthogonal and
139 *> T has evenly spaced entries 1, ..., ULP with random signs
140 *> on the diagonal and random O(1) entries in the upper
143 *> (10) A matrix of the form U' T U, where U is orthogonal and
144 *> T has geometrically spaced entries 1, ..., ULP with random
145 *> signs on the diagonal and random O(1) entries in the upper
148 *> (11) A matrix of the form U' T U, where U is orthogonal and
149 *> T has "clustered" entries 1, ULP,..., ULP with random
150 *> signs on the diagonal and random O(1) entries in the upper
153 *> (12) A matrix of the form U' T U, where U is orthogonal and
154 *> T has real or complex conjugate paired eigenvalues randomly
155 *> chosen from ( ULP, 1 ) and random O(1) entries in the upper
158 *> (13) A matrix of the form X' T X, where X has condition
159 *> SQRT( ULP ) and T has evenly spaced entries 1, ..., ULP
160 *> with random signs on the diagonal and random O(1) entries
161 *> in the upper triangle.
163 *> (14) A matrix of the form X' T X, where X has condition
164 *> SQRT( ULP ) and T has geometrically spaced entries
165 *> 1, ..., ULP with random signs on the diagonal and random
166 *> O(1) entries in the upper triangle.
168 *> (15) A matrix of the form X' T X, where X has condition
169 *> SQRT( ULP ) and T has "clustered" entries 1, ULP,..., ULP
170 *> with random signs on the diagonal and random O(1) entries
171 *> in the upper triangle.
173 *> (16) A matrix of the form X' T X, where X has condition
174 *> SQRT( ULP ) and T has real or complex conjugate paired
175 *> eigenvalues randomly chosen from ( ULP, 1 ) and random
176 *> O(1) entries in the upper triangle.
178 *> (17) Same as (16), but multiplied by a constant
179 *> near the overflow threshold
180 *> (18) Same as (16), but multiplied by a constant
181 *> near the underflow threshold
183 *> (19) Nonsymmetric matrix with random entries chosen from (-1,1).
184 *> If N is at least 4, all entries in first two rows and last
185 *> row, and first column and last two columns are zero.
186 *> (20) Same as (19), but multiplied by a constant
187 *> near the overflow threshold
188 *> (21) Same as (19), but multiplied by a constant
189 *> near the underflow threshold
191 *> In addition, an input file will be read from logical unit number
192 *> NIUNIT. The file contains matrices along with precomputed
193 *> eigenvalues and reciprocal condition numbers for the eigenvalues
194 *> and right eigenvectors. For these matrices, in addition to tests
195 *> (1) to (9) we will compute the following two tests:
197 *> (10) |RCONDV - RCDVIN| / cond(RCONDV)
199 *> RCONDV is the reciprocal right eigenvector condition number
200 *> computed by DGEEVX and RCDVIN (the precomputed true value)
201 *> is supplied as input. cond(RCONDV) is the condition number of
202 *> RCONDV, and takes errors in computing RCONDV into account, so
203 *> that the resulting quantity should be O(ULP). cond(RCONDV) is
204 *> essentially given by norm(A)/RCONDE.
206 *> (11) |RCONDE - RCDEIN| / cond(RCONDE)
208 *> RCONDE is the reciprocal eigenvalue condition number
209 *> computed by DGEEVX and RCDEIN (the precomputed true value)
210 *> is supplied as input. cond(RCONDE) is the condition number
211 *> of RCONDE, and takes errors in computing RCONDE into account,
212 *> so that the resulting quantity should be O(ULP). cond(RCONDE)
213 *> is essentially given by norm(A)/RCONDV.
222 *> The number of sizes of matrices to use. NSIZES must be at
223 *> least zero. If it is zero, no randomly generated matrices
224 *> are tested, but any test matrices read from NIUNIT will be
230 *> NN is INTEGER array, dimension (NSIZES)
231 *> An array containing the sizes to be used for the matrices.
232 *> Zero values will be skipped. The values must be at least
239 *> The number of elements in DOTYPE. NTYPES must be at least
240 *> zero. If it is zero, no randomly generated test matrices
241 *> are tested, but and test matrices read from NIUNIT will be
242 *> tested. If it is MAXTYP+1 and NSIZES is 1, then an
243 *> additional type, MAXTYP+1 is defined, which is to use
244 *> whatever matrix is in A. This is only useful if
245 *> DOTYPE(1:MAXTYP) is .FALSE. and DOTYPE(MAXTYP+1) is .TRUE. .
250 *> DOTYPE is LOGICAL array, dimension (NTYPES)
251 *> If DOTYPE(j) is .TRUE., then for each size in NN a
252 *> matrix of that size and of type j will be generated.
253 *> If NTYPES is smaller than the maximum number of types
254 *> defined (PARAMETER MAXTYP), then types NTYPES+1 through
255 *> MAXTYP will not be generated. If NTYPES is larger
256 *> than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES)
260 *> \param[in,out] ISEED
262 *> ISEED is INTEGER array, dimension (4)
263 *> On entry ISEED specifies the seed of the random number
264 *> generator. The array elements should be between 0 and 4095;
265 *> if not they will be reduced mod 4096. Also, ISEED(4) must
266 *> be odd. The random number generator uses a linear
267 *> congruential sequence limited to small integers, and so
268 *> should produce machine independent random numbers. The
269 *> values of ISEED are changed on exit, and can be used in the
270 *> next call to DDRVVX to continue the same random number
276 *> THRESH is DOUBLE PRECISION
277 *> A test will count as "failed" if the "error", computed as
278 *> described above, exceeds THRESH. Note that the error
279 *> is scaled to be O(1), so THRESH should be a reasonably
280 *> small multiple of 1, e.g., 10 or 100. In particular,
281 *> it should not depend on the precision (single vs. double)
282 *> or the size of the matrix. It must be at least zero.
288 *> The FORTRAN unit number for reading in the data file of
289 *> problems to solve.
295 *> The FORTRAN unit number for printing out error messages
296 *> (e.g., if a routine returns INFO not equal to 0.)
301 *> A is DOUBLE PRECISION array, dimension
303 *> Used to hold the matrix whose eigenvalues are to be
304 *> computed. On exit, A contains the last matrix actually used.
310 *> The leading dimension of the arrays A and H.
311 *> LDA >= max(NN,12), since 12 is the dimension of the largest
312 *> matrix in the precomputed input file.
317 *> H is DOUBLE PRECISION array, dimension
319 *> Another copy of the test matrix A, modified by DGEEVX.
324 *> WR is DOUBLE PRECISION array, dimension (max(NN))
329 *> WI is DOUBLE PRECISION array, dimension (max(NN))
331 *> The real and imaginary parts of the eigenvalues of A.
332 *> On exit, WR + WI*i are the eigenvalues of the matrix in A.
337 *> WR1 is DOUBLE PRECISION array, dimension (max(NN,12))
342 *> WI1 is DOUBLE PRECISION array, dimension (max(NN,12))
344 *> Like WR, WI, these arrays contain the eigenvalues of A,
345 *> but those computed when DGEEVX only computes a partial
346 *> eigendecomposition, i.e. not the eigenvalues and left
347 *> and right eigenvectors.
352 *> VL is DOUBLE PRECISION array, dimension
353 *> (LDVL, max(NN,12))
354 *> VL holds the computed left eigenvectors.
360 *> Leading dimension of VL. Must be at least max(1,max(NN,12)).
365 *> VR is DOUBLE PRECISION array, dimension
366 *> (LDVR, max(NN,12))
367 *> VR holds the computed right eigenvectors.
373 *> Leading dimension of VR. Must be at least max(1,max(NN,12)).
378 *> LRE is DOUBLE PRECISION array, dimension
379 *> (LDLRE, max(NN,12))
380 *> LRE holds the computed right or left eigenvectors.
386 *> Leading dimension of LRE. Must be at least max(1,max(NN,12))
389 *> \param[out] RCONDV
391 *> RCONDV is DOUBLE PRECISION array, dimension (N)
392 *> RCONDV holds the computed reciprocal condition numbers
396 *> \param[out] RCNDV1
398 *> RCNDV1 is DOUBLE PRECISION array, dimension (N)
399 *> RCNDV1 holds more computed reciprocal condition numbers
403 *> \param[out] RCDVIN
405 *> RCDVIN is DOUBLE PRECISION array, dimension (N)
406 *> When COMP = .TRUE. RCDVIN holds the precomputed reciprocal
407 *> condition numbers for eigenvectors to be compared with
411 *> \param[out] RCONDE
413 *> RCONDE is DOUBLE PRECISION array, dimension (N)
414 *> RCONDE holds the computed reciprocal condition numbers
418 *> \param[out] RCNDE1
420 *> RCNDE1 is DOUBLE PRECISION array, dimension (N)
421 *> RCNDE1 holds more computed reciprocal condition numbers
425 *> \param[out] RCDEIN
427 *> RCDEIN is DOUBLE PRECISION array, dimension (N)
428 *> When COMP = .TRUE. RCDEIN holds the precomputed reciprocal
429 *> condition numbers for eigenvalues to be compared with
435 *> SCALE is DOUBLE PRECISION array, dimension (N)
436 *> Holds information describing balancing of matrix.
439 *> \param[out] SCALE1
441 *> SCALE1 is DOUBLE PRECISION array, dimension (N)
442 *> Holds information describing balancing of matrix.
445 *> \param[out] RESULT
447 *> RESULT is DOUBLE PRECISION array, dimension (11)
448 *> The values computed by the seven tests described above.
449 *> The values are currently limited to 1/ulp, to avoid overflow.
454 *> WORK is DOUBLE PRECISION array, dimension (NWORK)
460 *> The number of entries in WORK. This must be at least
461 *> max(6*12+2*12**2,6*NN(j)+2*NN(j)**2) =
462 *> max( 360 ,6*NN(j)+2*NN(j)**2) for all j.
467 *> IWORK is INTEGER array, dimension (2*max(NN,12))
473 *> If 0, then successful exit.
474 *> If <0, then input parameter -INFO is incorrect.
475 *> If >0, DLATMR, SLATMS, SLATME or DGET23 returned an error
476 *> code, and INFO is its absolute value.
478 *>-----------------------------------------------------------------------
480 *> Some Local Variables and Parameters:
481 *> ---- ----- --------- --- ----------
483 *> ZERO, ONE Real 0 and 1.
484 *> MAXTYP The number of types defined.
485 *> NMAX Largest value in NN or 12.
486 *> NERRS The number of tests which have exceeded THRESH
488 *> IMODE Values to be passed to the matrix generators.
489 *> ANORM Norm of A; passed to matrix generators.
491 *> OVFL, UNFL Overflow and underflow thresholds.
492 *> ULP, ULPINV Finest relative precision and its inverse.
493 *> RTULP, RTULPI Square roots of the previous 4 values.
495 *> The following four arrays decode JTYPE:
496 *> KTYPE(j) The general type (1-10) for type "j".
497 *> KMODE(j) The MODE value to be passed to the matrix
498 *> generator for type "j".
499 *> KMAGN(j) The order of magnitude ( O(1),
500 *> O(overflow^(1/2) ), O(underflow^(1/2) )
501 *> KCONDS(j) Selectw whether CONDS is to be 1 or
502 *> 1/sqrt(ulp). (0 means irrelevant.)
508 *> \author Univ. of Tennessee
509 *> \author Univ. of California Berkeley
510 *> \author Univ. of Colorado Denver
515 *> \ingroup double_eig
517 * =====================================================================
518 SUBROUTINE DDRVVX( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
519 $ NIUNIT, NOUNIT, A, LDA, H, WR, WI, WR1, WI1,
520 $ VL, LDVL, VR, LDVR, LRE, LDLRE, RCONDV, RCNDV1,
521 $ RCDVIN, RCONDE, RCNDE1, RCDEIN, SCALE, SCALE1,
522 $ RESULT, WORK, NWORK, IWORK, INFO )
524 * -- LAPACK test routine (version 3.6.1) --
525 * -- LAPACK is a software package provided by Univ. of Tennessee, --
526 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
529 * .. Scalar Arguments ..
530 INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NIUNIT, NOUNIT,
531 $ NSIZES, NTYPES, NWORK
532 DOUBLE PRECISION THRESH
534 * .. Array Arguments ..
536 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
537 DOUBLE PRECISION A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),
538 $ RCDEIN( * ), RCDVIN( * ), RCNDE1( * ),
539 $ RCNDV1( * ), RCONDE( * ), RCONDV( * ),
540 $ RESULT( 11 ), SCALE( * ), SCALE1( * ),
541 $ VL( LDVL, * ), VR( LDVR, * ), WI( * ),
542 $ WI1( * ), WORK( * ), WR( * ), WR1( * )
545 * =====================================================================
548 DOUBLE PRECISION ZERO, ONE
549 PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 )
551 PARAMETER ( MAXTYP = 21 )
553 * .. Local Scalars ..
557 INTEGER I, IBAL, IINFO, IMODE, ITYPE, IWK, J, JCOL,
558 $ JSIZE, JTYPE, MTYPES, N, NERRS, NFAIL, NMAX,
559 $ NNWORK, NTEST, NTESTF, NTESTT
560 DOUBLE PRECISION ANORM, COND, CONDS, OVFL, RTULP, RTULPI, ULP,
564 CHARACTER ADUMMA( 1 ), BAL( 4 )
565 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),
566 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
569 * .. External Functions ..
570 DOUBLE PRECISION DLAMCH
573 * .. External Subroutines ..
574 EXTERNAL DGET23, DLABAD, DLASET, DLASUM, DLATME, DLATMR,
577 * .. Intrinsic Functions ..
578 INTRINSIC ABS, MAX, MIN, SQRT
580 * .. Data statements ..
581 DATA KTYPE / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
582 DATA KMAGN / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
584 DATA KMODE / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
585 $ 1, 5, 5, 5, 4, 3, 1 /
586 DATA KCONDS / 3*0, 5*0, 4*1, 6*2, 3*0 /
587 DATA BAL / 'N', 'P', 'S', 'B' /
589 * .. Executable Statements ..
591 PATH( 1: 1 ) = 'Double precision'
600 * Important constants
604 * 12 is the largest dimension in the input file of precomputed
609 NMAX = MAX( NMAX, NN( J ) )
616 IF( NSIZES.LT.0 ) THEN
618 ELSE IF( BADNN ) THEN
620 ELSE IF( NTYPES.LT.0 ) THEN
622 ELSE IF( THRESH.LT.ZERO ) THEN
624 ELSE IF( LDA.LT.1 .OR. LDA.LT.NMAX ) THEN
626 ELSE IF( LDVL.LT.1 .OR. LDVL.LT.NMAX ) THEN
628 ELSE IF( LDVR.LT.1 .OR. LDVR.LT.NMAX ) THEN
630 ELSE IF( LDLRE.LT.1 .OR. LDLRE.LT.NMAX ) THEN
632 ELSE IF( 6*NMAX+2*NMAX**2.GT.NWORK ) THEN
637 CALL XERBLA( 'DDRVVX', -INFO )
641 * If nothing to do check on NIUNIT
643 IF( NSIZES.EQ.0 .OR. NTYPES.EQ.0 )
646 * More Important constants
648 UNFL = DLAMCH( 'Safe minimum' )
650 CALL DLABAD( UNFL, OVFL )
651 ULP = DLAMCH( 'Precision' )
656 * Loop over sizes, types
660 DO 150 JSIZE = 1, NSIZES
662 IF( NSIZES.NE.1 ) THEN
663 MTYPES = MIN( MAXTYP, NTYPES )
665 MTYPES = MIN( MAXTYP+1, NTYPES )
668 DO 140 JTYPE = 1, MTYPES
669 IF( .NOT.DOTYPE( JTYPE ) )
672 * Save ISEED in case of an error.
675 IOLDSD( J ) = ISEED( J )
680 * Control parameters:
682 * KMAGN KCONDS KMODE KTYPE
683 * =1 O(1) 1 clustered 1 zero
684 * =2 large large clustered 2 identity
685 * =3 small exponential Jordan
686 * =4 arithmetic diagonal, (w/ eigenvalues)
687 * =5 random log symmetric, w/ eigenvalues
688 * =6 random general, w/ eigenvalues
690 * =8 random symmetric
692 * =10 random triangular
694 IF( MTYPES.GT.MAXTYP )
697 ITYPE = KTYPE( JTYPE )
698 IMODE = KMODE( JTYPE )
702 GO TO ( 30, 40, 50 )KMAGN( JTYPE )
718 CALL DLASET( 'Full', LDA, N, ZERO, ZERO, A, LDA )
722 * Special Matrices -- Identity & Jordan block
726 IF( ITYPE.EQ.1 ) THEN
729 ELSE IF( ITYPE.EQ.2 ) THEN
734 A( JCOL, JCOL ) = ANORM
737 ELSE IF( ITYPE.EQ.3 ) THEN
742 A( JCOL, JCOL ) = ANORM
744 $ A( JCOL, JCOL-1 ) = ONE
747 ELSE IF( ITYPE.EQ.4 ) THEN
749 * Diagonal Matrix, [Eigen]values Specified
751 CALL DLATMS( N, N, 'S', ISEED, 'S', WORK, IMODE, COND,
752 $ ANORM, 0, 0, 'N', A, LDA, WORK( N+1 ),
755 ELSE IF( ITYPE.EQ.5 ) THEN
757 * Symmetric, eigenvalues specified
759 CALL DLATMS( N, N, 'S', ISEED, 'S', WORK, IMODE, COND,
760 $ ANORM, N, N, 'N', A, LDA, WORK( N+1 ),
763 ELSE IF( ITYPE.EQ.6 ) THEN
765 * General, eigenvalues specified
767 IF( KCONDS( JTYPE ).EQ.1 ) THEN
769 ELSE IF( KCONDS( JTYPE ).EQ.2 ) THEN
776 CALL DLATME( N, 'S', ISEED, WORK, IMODE, COND, ONE,
777 $ ADUMMA, 'T', 'T', 'T', WORK( N+1 ), 4,
778 $ CONDS, N, N, ANORM, A, LDA, WORK( 2*N+1 ),
781 ELSE IF( ITYPE.EQ.7 ) THEN
783 * Diagonal, random eigenvalues
785 CALL DLATMR( N, N, 'S', ISEED, 'S', WORK, 6, ONE, ONE,
786 $ 'T', 'N', WORK( N+1 ), 1, ONE,
787 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, 0, 0,
788 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
790 ELSE IF( ITYPE.EQ.8 ) THEN
792 * Symmetric, random eigenvalues
794 CALL DLATMR( N, N, 'S', ISEED, 'S', WORK, 6, ONE, ONE,
795 $ 'T', 'N', WORK( N+1 ), 1, ONE,
796 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,
797 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
799 ELSE IF( ITYPE.EQ.9 ) THEN
801 * General, random eigenvalues
803 CALL DLATMR( N, N, 'S', ISEED, 'N', WORK, 6, ONE, ONE,
804 $ 'T', 'N', WORK( N+1 ), 1, ONE,
805 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,
806 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
808 CALL DLASET( 'Full', 2, N, ZERO, ZERO, A, LDA )
809 CALL DLASET( 'Full', N-3, 1, ZERO, ZERO, A( 3, 1 ),
811 CALL DLASET( 'Full', N-3, 2, ZERO, ZERO, A( 3, N-1 ),
813 CALL DLASET( 'Full', 1, N, ZERO, ZERO, A( N, 1 ),
817 ELSE IF( ITYPE.EQ.10 ) THEN
819 * Triangular, random eigenvalues
821 CALL DLATMR( N, N, 'S', ISEED, 'N', WORK, 6, ONE, ONE,
822 $ 'T', 'N', WORK( N+1 ), 1, ONE,
823 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, 0,
824 $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
831 IF( IINFO.NE.0 ) THEN
832 WRITE( NOUNIT, FMT = 9992 )'Generator', IINFO, N, JTYPE,
840 * Test for minimal and generous workspace
845 ELSE IF( IWK.EQ.2 ) THEN
848 NNWORK = 6*N + 2*N**2
850 NNWORK = MAX( NNWORK, 1 )
852 * Test for all balancing options
859 CALL DGET23( .FALSE., BALANC, JTYPE, THRESH, IOLDSD,
860 $ NOUNIT, N, A, LDA, H, WR, WI, WR1, WI1,
861 $ VL, LDVL, VR, LDVR, LRE, LDLRE, RCONDV,
862 $ RCNDV1, RCDVIN, RCONDE, RCNDE1, RCDEIN,
863 $ SCALE, SCALE1, RESULT, WORK, NNWORK,
866 * Check for RESULT(j) > THRESH
871 IF( RESULT( J ).GE.ZERO )
873 IF( RESULT( J ).GE.THRESH )
878 $ NTESTF = NTESTF + 1
879 IF( NTESTF.EQ.1 ) THEN
880 WRITE( NOUNIT, FMT = 9999 )PATH
881 WRITE( NOUNIT, FMT = 9998 )
882 WRITE( NOUNIT, FMT = 9997 )
883 WRITE( NOUNIT, FMT = 9996 )
884 WRITE( NOUNIT, FMT = 9995 )THRESH
889 IF( RESULT( J ).GE.THRESH ) THEN
890 WRITE( NOUNIT, FMT = 9994 )BALANC, N, IWK,
891 $ IOLDSD, JTYPE, J, RESULT( J )
895 NERRS = NERRS + NFAIL
896 NTESTT = NTESTT + NTEST
905 * Read in data from file to check accuracy of condition estimation.
906 * Assume input eigenvalues are sorted lexicographically (increasing
907 * by real part, then decreasing by imaginary part)
911 READ( NIUNIT, FMT = *, END = 220 )N
913 * Read input data until N=0
920 READ( NIUNIT, FMT = * )( A( I, J ), J = 1, N )
923 READ( NIUNIT, FMT = * )WR1( I ), WI1( I ), RCDEIN( I ),
926 CALL DGET23( .TRUE., 'N', 22, THRESH, ISEED, NOUNIT, N, A, LDA, H,
927 $ WR, WI, WR1, WI1, VL, LDVL, VR, LDVR, LRE, LDLRE,
928 $ RCONDV, RCNDV1, RCDVIN, RCONDE, RCNDE1, RCDEIN,
929 $ SCALE, SCALE1, RESULT, WORK, 6*N+2*N**2, IWORK,
932 * Check for RESULT(j) > THRESH
937 IF( RESULT( J ).GE.ZERO )
939 IF( RESULT( J ).GE.THRESH )
944 $ NTESTF = NTESTF + 1
945 IF( NTESTF.EQ.1 ) THEN
946 WRITE( NOUNIT, FMT = 9999 )PATH
947 WRITE( NOUNIT, FMT = 9998 )
948 WRITE( NOUNIT, FMT = 9997 )
949 WRITE( NOUNIT, FMT = 9996 )
950 WRITE( NOUNIT, FMT = 9995 )THRESH
955 IF( RESULT( J ).GE.THRESH ) THEN
956 WRITE( NOUNIT, FMT = 9993 )N, JTYPE, J, RESULT( J )
960 NERRS = NERRS + NFAIL
961 NTESTT = NTESTT + NTEST
967 CALL DLASUM( PATH, NOUNIT, NERRS, NTESTT )
969 9999 FORMAT( / 1X, A3, ' -- Real Eigenvalue-Eigenvector Decomposition',
970 $ ' Expert Driver', /
971 $ ' Matrix types (see DDRVVX for details): ' )
973 9998 FORMAT( / ' Special Matrices:', / ' 1=Zero matrix. ',
974 $ ' ', ' 5=Diagonal: geometr. spaced entries.',
975 $ / ' 2=Identity matrix. ', ' 6=Diagona',
976 $ 'l: clustered entries.', / ' 3=Transposed Jordan block. ',
977 $ ' ', ' 7=Diagonal: large, evenly spaced.', / ' ',
978 $ '4=Diagonal: evenly spaced entries. ', ' 8=Diagonal: s',
979 $ 'mall, evenly spaced.' )
980 9997 FORMAT( ' Dense, Non-Symmetric Matrices:', / ' 9=Well-cond., ev',
981 $ 'enly spaced eigenvals.', ' 14=Ill-cond., geomet. spaced e',
982 $ 'igenals.', / ' 10=Well-cond., geom. spaced eigenvals. ',
983 $ ' 15=Ill-conditioned, clustered e.vals.', / ' 11=Well-cond',
984 $ 'itioned, clustered e.vals. ', ' 16=Ill-cond., random comp',
985 $ 'lex ', / ' 12=Well-cond., random complex ', ' ',
986 $ ' 17=Ill-cond., large rand. complx ', / ' 13=Ill-condi',
987 $ 'tioned, evenly spaced. ', ' 18=Ill-cond., small rand.',
989 9996 FORMAT( ' 19=Matrix with random O(1) entries. ', ' 21=Matrix ',
990 $ 'with small random entries.', / ' 20=Matrix with large ran',
991 $ 'dom entries. ', ' 22=Matrix read from input file', / )
992 9995 FORMAT( ' Tests performed with test threshold =', F8.2,
993 $ / / ' 1 = | A VR - VR W | / ( n |A| ulp ) ',
994 $ / ' 2 = | transpose(A) VL - VL W | / ( n |A| ulp ) ',
995 $ / ' 3 = | |VR(i)| - 1 | / ulp ',
996 $ / ' 4 = | |VL(i)| - 1 | / ulp ',
997 $ / ' 5 = 0 if W same no matter if VR or VL computed,',
998 $ ' 1/ulp otherwise', /
999 $ ' 6 = 0 if VR same no matter what else computed,',
1000 $ ' 1/ulp otherwise', /
1001 $ ' 7 = 0 if VL same no matter what else computed,',
1002 $ ' 1/ulp otherwise', /
1003 $ ' 8 = 0 if RCONDV same no matter what else computed,',
1004 $ ' 1/ulp otherwise', /
1005 $ ' 9 = 0 if SCALE, ILO, IHI, ABNRM same no matter what else',
1006 $ ' computed, 1/ulp otherwise',
1007 $ / ' 10 = | RCONDV - RCONDV(precomputed) | / cond(RCONDV),',
1008 $ / ' 11 = | RCONDE - RCONDE(precomputed) | / cond(RCONDE),' )
1009 9994 FORMAT( ' BALANC=''', A1, ''',N=', I4, ',IWK=', I1, ', seed=',
1010 $ 4( I4, ',' ), ' type ', I2, ', test(', I2, ')=', G10.3 )
1011 9993 FORMAT( ' N=', I5, ', input example =', I3, ', test(', I2, ')=',
1013 9992 FORMAT( ' DDRVVX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
1014 $ I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ), I5, ')' )