ddrgev.c
Go to the documentation of this file.
00001 /* ddrgev.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static integer c__1 = 1;
00019 static integer c__0 = 0;
00020 static doublereal c_b17 = 0.;
00021 static integer c__2 = 2;
00022 static doublereal c_b23 = 1.;
00023 static integer c__3 = 3;
00024 static integer c__4 = 4;
00025 static logical c_true = TRUE_;
00026 static logical c_false = FALSE_;
00027 
00028 /* Subroutine */ int ddrgev_(integer *nsizes, integer *nn, integer *ntypes, 
00029         logical *dotype, integer *iseed, doublereal *thresh, integer *nounit, 
00030         doublereal *a, integer *lda, doublereal *b, doublereal *s, doublereal 
00031         *t, doublereal *q, integer *ldq, doublereal *z__, doublereal *qe, 
00032         integer *ldqe, doublereal *alphar, doublereal *alphai, doublereal *
00033         beta, doublereal *alphr1, doublereal *alphi1, doublereal *beta1, 
00034         doublereal *work, integer *lwork, doublereal *result, integer *info)
00035 {
00036     /* Initialized data */
00037 
00038     static integer kclass[26] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,
00039             2,2,2,3 };
00040     static integer kbmagn[26] = { 1,1,1,1,1,1,1,1,3,2,3,2,2,3,1,1,1,1,1,1,1,3,
00041             2,3,2,1 };
00042     static integer ktrian[26] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
00043             1,1,1,1 };
00044     static integer iasign[26] = { 0,0,0,0,0,0,2,0,2,2,0,0,2,2,2,0,2,0,0,0,2,2,
00045             2,2,2,0 };
00046     static integer ibsign[26] = { 0,0,0,0,0,0,0,2,0,0,2,2,0,0,2,0,2,0,0,0,0,0,
00047             0,0,0,0 };
00048     static integer kz1[6] = { 0,1,2,1,3,3 };
00049     static integer kz2[6] = { 0,0,1,2,1,1 };
00050     static integer kadd[6] = { 0,0,0,0,3,2 };
00051     static integer katype[26] = { 0,1,0,1,2,3,4,1,4,4,1,1,4,4,4,2,4,5,8,7,9,4,
00052             4,4,4,0 };
00053     static integer kbtype[26] = { 0,0,1,1,2,-3,1,4,1,1,4,4,1,1,-4,2,-4,8,8,8,
00054             8,8,8,8,8,0 };
00055     static integer kazero[26] = { 1,1,1,1,1,1,2,1,2,2,1,1,2,2,3,1,3,5,5,5,5,3,
00056             3,3,3,1 };
00057     static integer kbzero[26] = { 1,1,1,1,1,1,1,2,1,1,2,2,1,1,4,1,4,6,6,6,6,4,
00058             4,4,4,1 };
00059     static integer kamagn[26] = { 1,1,1,1,1,1,1,1,2,3,2,3,2,3,1,1,1,1,1,1,1,2,
00060             3,3,2,1 };
00061 
00062     /* Format strings */
00063     static char fmt_9999[] = "(\002 DDRGEV: \002,a,\002 returned INFO=\002,i"
00064             "6,\002.\002,/3x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00065             "(\002,4(i4,\002,\002),i5,\002)\002)";
00066     static char fmt_9998[] = "(\002 DDRGEV: \002,a,\002 Eigenvectors from"
00067             " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00068             "error=\002,0p,g10.3,\002,\002,3x,\002N=\002,i4,\002, JTYPE=\002,"
00069             "i3,\002, ISEED=(\002,4(i4,\002,\002),i5,\002)\002)";
00070     static char fmt_9997[] = "(/1x,a3,\002 -- Real Generalized eigenvalue pr"
00071             "oblem driver\002)";
00072     static char fmt_9996[] = "(\002 Matrix types (see DDRGEV for details):"
00073             " \002)";
00074     static char fmt_9995[] = "(\002 Special Matrices:\002,23x,\002(J'=transp"
00075             "osed Jordan block)\002,/\002   1=(0,0)  2=(I,0)  3=(0,I)  4=(I,I"
00076             ")  5=(J',J')  \002,\0026=(diag(J',I), diag(I,J'))\002,/\002 Diag"
00077             "onal Matrices:  ( \002,\002D=diag(0,1,2,...) )\002,/\002   7=(D,"
00078             "I)   9=(large*D, small*I\002,\002)  11=(large*I, small*D)  13=(l"
00079             "arge*D, large*I)\002,/\002   8=(I,D)  10=(small*D, large*I)  12="
00080             "(small*I, large*D) \002,\002 14=(small*D, small*I)\002,/\002  15"
00081             "=(D, reversed D)\002)";
00082     static char fmt_9994[] = "(\002 Matrices Rotated by Random \002,a,\002 M"
00083             "atrices U, V:\002,/\002  16=Transposed Jordan Blocks            "
00084             " 19=geometric \002,\002alpha, beta=0,1\002,/\002  17=arithm. alp"
00085             "ha&beta             \002,\002      20=arithmetic alpha, beta=0,"
00086             "1\002,/\002  18=clustered \002,\002alpha, beta=0,1            21"
00087             "=random alpha, beta=0,1\002,/\002 Large & Small Matrices:\002,"
00088             "/\002  22=(large, small)   \002,\00223=(small,large)    24=(smal"
00089             "l,small)    25=(large,large)\002,/\002  26=random O(1) matrices"
00090             ".\002)";
00091     static char fmt_9993[] = "(/\002 Tests performed:    \002,/\002 1 = max "
00092             "| ( b A - a B )'*l | / const.,\002,/\002 2 = | |VR(i)| - 1 | / u"
00093             "lp,\002,/\002 3 = max | ( b A - a B )*r | / const.\002,/\002 4 ="
00094             " | |VL(i)| - 1 | / ulp,\002,/\002 5 = 0 if W same no matter if r"
00095             " or l computed,\002,/\002 6 = 0 if l same no matter if l compute"
00096             "d,\002,/\002 7 = 0 if r same no matter if r computed,\002,/1x)";
00097     static char fmt_9992[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00098             ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00099             ",0p,f8.2)";
00100     static char fmt_9991[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00101             ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00102             ",1p,d10.3)";
00103 
00104     /* System generated locals */
00105     integer a_dim1, a_offset, b_dim1, b_offset, q_dim1, q_offset, qe_dim1, 
00106             qe_offset, s_dim1, s_offset, t_dim1, t_offset, z_dim1, z_offset, 
00107             i__1, i__2, i__3, i__4;
00108     doublereal d__1;
00109 
00110     /* Builtin functions */
00111     double d_sign(doublereal *, doublereal *);
00112     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00113 
00114     /* Local variables */
00115     integer i__, j, n, n1, jc, in, jr;
00116     doublereal ulp;
00117     integer iadd, ierr, nmax;
00118     logical badnn;
00119     extern /* Subroutine */ int dget52_(logical *, integer *, doublereal *, 
00120             integer *, doublereal *, integer *, doublereal *, integer *, 
00121             doublereal *, doublereal *, doublereal *, doublereal *, 
00122             doublereal *), dggev_(char *, char *, integer *, doublereal *, 
00123             integer *, doublereal *, integer *, doublereal *, doublereal *, 
00124             doublereal *, doublereal *, integer *, doublereal *, integer *, 
00125             doublereal *, integer *, integer *);
00126     doublereal rmagn[4];
00127     integer nmats, jsize, nerrs, jtype;
00128     extern /* Subroutine */ int dlatm4_(integer *, integer *, integer *, 
00129             integer *, integer *, doublereal *, doublereal *, doublereal *, 
00130             integer *, integer *, doublereal *, integer *), dorm2r_(char *, 
00131             char *, integer *, integer *, integer *, doublereal *, integer *, 
00132             doublereal *, doublereal *, integer *, doublereal *, integer *), dlabad_(doublereal *, doublereal *);
00133     extern doublereal dlamch_(char *);
00134     extern /* Subroutine */ int dlarfg_(integer *, doublereal *, doublereal *, 
00135              integer *, doublereal *);
00136     extern doublereal dlarnd_(integer *, integer *);
00137     doublereal safmin;
00138     integer ioldsd[4];
00139     doublereal safmax;
00140     extern integer ilaenv_(integer *, char *, char *, integer *, integer *, 
00141             integer *, integer *);
00142     extern /* Subroutine */ int dlacpy_(char *, integer *, integer *, 
00143             doublereal *, integer *, doublereal *, integer *), 
00144             alasvm_(char *, integer *, integer *, integer *, integer *), dlaset_(char *, integer *, integer *, doublereal *, 
00145             doublereal *, doublereal *, integer *), xerbla_(char *, 
00146             integer *);
00147     integer minwrk, maxwrk;
00148     doublereal ulpinv;
00149     integer mtypes, ntestt;
00150 
00151     /* Fortran I/O blocks */
00152     static cilist io___38 = { 0, 0, 0, fmt_9999, 0 };
00153     static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00154     static cilist io___41 = { 0, 0, 0, fmt_9998, 0 };
00155     static cilist io___42 = { 0, 0, 0, fmt_9998, 0 };
00156     static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00157     static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00158     static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00159     static cilist io___46 = { 0, 0, 0, fmt_9997, 0 };
00160     static cilist io___47 = { 0, 0, 0, fmt_9996, 0 };
00161     static cilist io___48 = { 0, 0, 0, fmt_9995, 0 };
00162     static cilist io___49 = { 0, 0, 0, fmt_9994, 0 };
00163     static cilist io___50 = { 0, 0, 0, fmt_9993, 0 };
00164     static cilist io___51 = { 0, 0, 0, fmt_9992, 0 };
00165     static cilist io___52 = { 0, 0, 0, fmt_9991, 0 };
00166 
00167 
00168 
00169 /*  -- LAPACK test routine (version 3.1) -- */
00170 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00171 /*     November 2006 */
00172 
00173 /*     .. Scalar Arguments .. */
00174 /*     .. */
00175 /*     .. Array Arguments .. */
00176 /*     .. */
00177 
00178 /*  Purpose */
00179 /*  ======= */
00180 
00181 /*  DDRGEV checks the nonsymmetric generalized eigenvalue problem driver */
00182 /*  routine DGGEV. */
00183 
00184 /*  DGGEV computes for a pair of n-by-n nonsymmetric matrices (A,B) the */
00185 /*  generalized eigenvalues and, optionally, the left and right */
00186 /*  eigenvectors. */
00187 
00188 /*  A generalized eigenvalue for a pair of matrices (A,B) is a scalar w */
00189 /*  or a ratio  alpha/beta = w, such that A - w*B is singular.  It is */
00190 /*  usually represented as the pair (alpha,beta), as there is reasonalbe */
00191 /*  interpretation for beta=0, and even for both being zero. */
00192 
00193 /*  A right generalized eigenvector corresponding to a generalized */
00194 /*  eigenvalue  w  for a pair of matrices (A,B) is a vector r  such that */
00195 /*  (A - wB) * r = 0.  A left generalized eigenvector is a vector l such */
00196 /*  that l**H * (A - wB) = 0, where l**H is the conjugate-transpose of l. */
00197 
00198 /*  When DDRGEV is called, a number of matrix "sizes" ("n's") and a */
00199 /*  number of matrix "types" are specified.  For each size ("n") */
00200 /*  and each type of matrix, a pair of matrices (A, B) will be generated */
00201 /*  and used for testing.  For each matrix pair, the following tests */
00202 /*  will be performed and compared with the threshhold THRESH. */
00203 
00204 /*  Results from DGGEV: */
00205 
00206 /*  (1)  max over all left eigenvalue/-vector pairs (alpha/beta,l) of */
00207 
00208 /*       | VL**H * (beta A - alpha B) |/( ulp max(|beta A|, |alpha B|) ) */
00209 
00210 /*       where VL**H is the conjugate-transpose of VL. */
00211 
00212 /*  (2)  | |VL(i)| - 1 | / ulp and whether largest component real */
00213 
00214 /*       VL(i) denotes the i-th column of VL. */
00215 
00216 /*  (3)  max over all left eigenvalue/-vector pairs (alpha/beta,r) of */
00217 
00218 /*       | (beta A - alpha B) * VR | / ( ulp max(|beta A|, |alpha B|) ) */
00219 
00220 /*  (4)  | |VR(i)| - 1 | / ulp and whether largest component real */
00221 
00222 /*       VR(i) denotes the i-th column of VR. */
00223 
00224 /*  (5)  W(full) = W(partial) */
00225 /*       W(full) denotes the eigenvalues computed when both l and r */
00226 /*       are also computed, and W(partial) denotes the eigenvalues */
00227 /*       computed when only W, only W and r, or only W and l are */
00228 /*       computed. */
00229 
00230 /*  (6)  VL(full) = VL(partial) */
00231 /*       VL(full) denotes the left eigenvectors computed when both l */
00232 /*       and r are computed, and VL(partial) denotes the result */
00233 /*       when only l is computed. */
00234 
00235 /*  (7)  VR(full) = VR(partial) */
00236 /*       VR(full) denotes the right eigenvectors computed when both l */
00237 /*       and r are also computed, and VR(partial) denotes the result */
00238 /*       when only l is computed. */
00239 
00240 
00241 /*  Test Matrices */
00242 /*  ---- -------- */
00243 
00244 /*  The sizes of the test matrices are specified by an array */
00245 /*  NN(1:NSIZES); the value of each element NN(j) specifies one size. */
00246 /*  The "types" are specified by a logical array DOTYPE( 1:NTYPES ); if */
00247 /*  DOTYPE(j) is .TRUE., then matrix type "j" will be generated. */
00248 /*  Currently, the list of possible types is: */
00249 
00250 /*  (1)  ( 0, 0 )         (a pair of zero matrices) */
00251 
00252 /*  (2)  ( I, 0 )         (an identity and a zero matrix) */
00253 
00254 /*  (3)  ( 0, I )         (an identity and a zero matrix) */
00255 
00256 /*  (4)  ( I, I )         (a pair of identity matrices) */
00257 
00258 /*          t   t */
00259 /*  (5)  ( J , J  )       (a pair of transposed Jordan blocks) */
00260 
00261 /*                                      t                ( I   0  ) */
00262 /*  (6)  ( X, Y )         where  X = ( J   0  )  and Y = (      t ) */
00263 /*                                   ( 0   I  )          ( 0   J  ) */
00264 /*                        and I is a k x k identity and J a (k+1)x(k+1) */
00265 /*                        Jordan block; k=(N-1)/2 */
00266 
00267 /*  (7)  ( D, I )         where D is diag( 0, 1,..., N-1 ) (a diagonal */
00268 /*                        matrix with those diagonal entries.) */
00269 /*  (8)  ( I, D ) */
00270 
00271 /*  (9)  ( big*D, small*I ) where "big" is near overflow and small=1/big */
00272 
00273 /*  (10) ( small*D, big*I ) */
00274 
00275 /*  (11) ( big*I, small*D ) */
00276 
00277 /*  (12) ( small*I, big*D ) */
00278 
00279 /*  (13) ( big*D, big*I ) */
00280 
00281 /*  (14) ( small*D, small*I ) */
00282 
00283 /*  (15) ( D1, D2 )        where D1 is diag( 0, 0, 1, ..., N-3, 0 ) and */
00284 /*                         D2 is diag( 0, N-3, N-4,..., 1, 0, 0 ) */
00285 /*            t   t */
00286 /*  (16) Q ( J , J ) Z     where Q and Z are random orthogonal matrices. */
00287 
00288 /*  (17) Q ( T1, T2 ) Z    where T1 and T2 are upper triangular matrices */
00289 /*                         with random O(1) entries above the diagonal */
00290 /*                         and diagonal entries diag(T1) = */
00291 /*                         ( 0, 0, 1, ..., N-3, 0 ) and diag(T2) = */
00292 /*                         ( 0, N-3, N-4,..., 1, 0, 0 ) */
00293 
00294 /*  (18) Q ( T1, T2 ) Z    diag(T1) = ( 0, 0, 1, 1, s, ..., s, 0 ) */
00295 /*                         diag(T2) = ( 0, 1, 0, 1,..., 1, 0 ) */
00296 /*                         s = machine precision. */
00297 
00298 /*  (19) Q ( T1, T2 ) Z    diag(T1)=( 0,0,1,1, 1-d, ..., 1-(N-5)*d=s, 0 ) */
00299 /*                         diag(T2) = ( 0, 1, 0, 1, ..., 1, 0 ) */
00300 
00301 /*                                                         N-5 */
00302 /*  (20) Q ( T1, T2 ) Z    diag(T1)=( 0, 0, 1, 1, a, ..., a   =s, 0 ) */
00303 /*                         diag(T2) = ( 0, 1, 0, 1, ..., 1, 0, 0 ) */
00304 
00305 /*  (21) Q ( T1, T2 ) Z    diag(T1)=( 0, 0, 1, r1, r2, ..., r(N-4), 0 ) */
00306 /*                         diag(T2) = ( 0, 1, 0, 1, ..., 1, 0, 0 ) */
00307 /*                         where r1,..., r(N-4) are random. */
00308 
00309 /*  (22) Q ( big*T1, small*T2 ) Z    diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00310 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00311 
00312 /*  (23) Q ( small*T1, big*T2 ) Z    diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00313 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00314 
00315 /*  (24) Q ( small*T1, small*T2 ) Z  diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00316 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00317 
00318 /*  (25) Q ( big*T1, big*T2 ) Z      diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00319 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00320 
00321 /*  (26) Q ( T1, T2 ) Z     where T1 and T2 are random upper-triangular */
00322 /*                          matrices. */
00323 
00324 
00325 /*  Arguments */
00326 /*  ========= */
00327 
00328 /*  NSIZES  (input) INTEGER */
00329 /*          The number of sizes of matrices to use.  If it is zero, */
00330 /*          DDRGES does nothing.  NSIZES >= 0. */
00331 
00332 /*  NN      (input) INTEGER array, dimension (NSIZES) */
00333 /*          An array containing the sizes to be used for the matrices. */
00334 /*          Zero values will be skipped.  NN >= 0. */
00335 
00336 /*  NTYPES  (input) INTEGER */
00337 /*          The number of elements in DOTYPE.   If it is zero, DDRGES */
00338 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00339 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00340 /*          defined, which is to use whatever matrix is in A.  This */
00341 /*          is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00342 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00343 
00344 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00345 /*          If DOTYPE(j) is .TRUE., then for each size in NN a */
00346 /*          matrix of that size and of type j will be generated. */
00347 /*          If NTYPES is smaller than the maximum number of types */
00348 /*          defined (PARAMETER MAXTYP), then types NTYPES+1 through */
00349 /*          MAXTYP will not be generated. If NTYPES is larger */
00350 /*          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) */
00351 /*          will be ignored. */
00352 
00353 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00354 /*          On entry ISEED specifies the seed of the random number */
00355 /*          generator. The array elements should be between 0 and 4095; */
00356 /*          if not they will be reduced mod 4096. Also, ISEED(4) must */
00357 /*          be odd.  The random number generator uses a linear */
00358 /*          congruential sequence limited to small integers, and so */
00359 /*          should produce machine independent random numbers. The */
00360 /*          values of ISEED are changed on exit, and can be used in the */
00361 /*          next call to DDRGES to continue the same random number */
00362 /*          sequence. */
00363 
00364 /*  THRESH  (input) DOUBLE PRECISION */
00365 /*          A test will count as "failed" if the "error", computed as */
00366 /*          described above, exceeds THRESH.  Note that the error is */
00367 /*          scaled to be O(1), so THRESH should be a reasonably small */
00368 /*          multiple of 1, e.g., 10 or 100.  In particular, it should */
00369 /*          not depend on the precision (single vs. double) or the size */
00370 /*          of the matrix.  It must be at least zero. */
00371 
00372 /*  NOUNIT  (input) INTEGER */
00373 /*          The FORTRAN unit number for printing out error messages */
00374 /*          (e.g., if a routine returns IERR not equal to 0.) */
00375 
00376 /*  A       (input/workspace) DOUBLE PRECISION array, */
00377 /*                                       dimension(LDA, max(NN)) */
00378 /*          Used to hold the original A matrix.  Used as input only */
00379 /*          if NTYPES=MAXTYP+1, DOTYPE(1:MAXTYP)=.FALSE., and */
00380 /*          DOTYPE(MAXTYP+1)=.TRUE. */
00381 
00382 /*  LDA     (input) INTEGER */
00383 /*          The leading dimension of A, B, S, and T. */
00384 /*          It must be at least 1 and at least max( NN ). */
00385 
00386 /*  B       (input/workspace) DOUBLE PRECISION array, */
00387 /*                                       dimension(LDA, max(NN)) */
00388 /*          Used to hold the original B matrix.  Used as input only */
00389 /*          if NTYPES=MAXTYP+1, DOTYPE(1:MAXTYP)=.FALSE., and */
00390 /*          DOTYPE(MAXTYP+1)=.TRUE. */
00391 
00392 /*  S       (workspace) DOUBLE PRECISION array, */
00393 /*                                 dimension (LDA, max(NN)) */
00394 /*          The Schur form matrix computed from A by DGGES.  On exit, S */
00395 /*          contains the Schur form matrix corresponding to the matrix */
00396 /*          in A. */
00397 
00398 /*  T       (workspace) DOUBLE PRECISION array, */
00399 /*                                 dimension (LDA, max(NN)) */
00400 /*          The upper triangular matrix computed from B by DGGES. */
00401 
00402 /*  Q       (workspace) DOUBLE PRECISION array, */
00403 /*                                 dimension (LDQ, max(NN)) */
00404 /*          The (left) eigenvectors matrix computed by DGGEV. */
00405 
00406 /*  LDQ     (input) INTEGER */
00407 /*          The leading dimension of Q and Z. It must */
00408 /*          be at least 1 and at least max( NN ). */
00409 
00410 /*  Z       (workspace) DOUBLE PRECISION array, dimension( LDQ, max(NN) ) */
00411 /*          The (right) orthogonal matrix computed by DGGES. */
00412 
00413 /*  QE      (workspace) DOUBLE PRECISION array, dimension( LDQ, max(NN) ) */
00414 /*          QE holds the computed right or left eigenvectors. */
00415 
00416 /*  LDQE    (input) INTEGER */
00417 /*          The leading dimension of QE. LDQE >= max(1,max(NN)). */
00418 
00419 /*  ALPHAR  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00420 /*  ALPHAI  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00421 /*  BETA    (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00422 /*          The generalized eigenvalues of (A,B) computed by DGGEV. */
00423 /*          ( ALPHAR(k)+ALPHAI(k)*i ) / BETA(k) is the k-th */
00424 /*          generalized eigenvalue of A and B. */
00425 
00426 /*  ALPHR1  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00427 /*  ALPHI1  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00428 /*  BETA1   (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00429 /*          Like ALPHAR, ALPHAI, BETA, these arrays contain the */
00430 /*          eigenvalues of A and B, but those computed when DGGEV only */
00431 /*          computes a partial eigendecomposition, i.e. not the */
00432 /*          eigenvalues and left and right eigenvectors. */
00433 
00434 /*  WORK    (workspace) DOUBLE PRECISION array, dimension (LWORK) */
00435 
00436 /*  LWORK   (input) INTEGER */
00437 /*          The number of entries in WORK.  LWORK >= MAX( 8*N, N*(N+1) ). */
00438 
00439 /*  RESULT  (output) DOUBLE PRECISION array, dimension (2) */
00440 /*          The values computed by the tests described above. */
00441 /*          The values are currently limited to 1/ulp, to avoid overflow. */
00442 
00443 /*  INFO    (output) INTEGER */
00444 /*          = 0:  successful exit */
00445 /*          < 0:  if INFO = -i, the i-th argument had an illegal value. */
00446 /*          > 0:  A routine returned an error code.  INFO is the */
00447 /*                absolute value of the INFO value returned. */
00448 
00449 /*  ===================================================================== */
00450 
00451 /*     .. Parameters .. */
00452 /*     .. */
00453 /*     .. Local Scalars .. */
00454 /*     .. */
00455 /*     .. Local Arrays .. */
00456 /*     .. */
00457 /*     .. External Functions .. */
00458 /*     .. */
00459 /*     .. External Subroutines .. */
00460 /*     .. */
00461 /*     .. Intrinsic Functions .. */
00462 /*     .. */
00463 /*     .. Data statements .. */
00464     /* Parameter adjustments */
00465     --nn;
00466     --dotype;
00467     --iseed;
00468     t_dim1 = *lda;
00469     t_offset = 1 + t_dim1;
00470     t -= t_offset;
00471     s_dim1 = *lda;
00472     s_offset = 1 + s_dim1;
00473     s -= s_offset;
00474     b_dim1 = *lda;
00475     b_offset = 1 + b_dim1;
00476     b -= b_offset;
00477     a_dim1 = *lda;
00478     a_offset = 1 + a_dim1;
00479     a -= a_offset;
00480     z_dim1 = *ldq;
00481     z_offset = 1 + z_dim1;
00482     z__ -= z_offset;
00483     q_dim1 = *ldq;
00484     q_offset = 1 + q_dim1;
00485     q -= q_offset;
00486     qe_dim1 = *ldqe;
00487     qe_offset = 1 + qe_dim1;
00488     qe -= qe_offset;
00489     --alphar;
00490     --alphai;
00491     --beta;
00492     --alphr1;
00493     --alphi1;
00494     --beta1;
00495     --work;
00496     --result;
00497 
00498     /* Function Body */
00499 /*     .. */
00500 /*     .. Executable Statements .. */
00501 
00502 /*     Check for errors */
00503 
00504     *info = 0;
00505 
00506     badnn = FALSE_;
00507     nmax = 1;
00508     i__1 = *nsizes;
00509     for (j = 1; j <= i__1; ++j) {
00510 /* Computing MAX */
00511         i__2 = nmax, i__3 = nn[j];
00512         nmax = max(i__2,i__3);
00513         if (nn[j] < 0) {
00514             badnn = TRUE_;
00515         }
00516 /* L10: */
00517     }
00518 
00519     if (*nsizes < 0) {
00520         *info = -1;
00521     } else if (badnn) {
00522         *info = -2;
00523     } else if (*ntypes < 0) {
00524         *info = -3;
00525     } else if (*thresh < 0.) {
00526         *info = -6;
00527     } else if (*lda <= 1 || *lda < nmax) {
00528         *info = -9;
00529     } else if (*ldq <= 1 || *ldq < nmax) {
00530         *info = -14;
00531     } else if (*ldqe <= 1 || *ldqe < nmax) {
00532         *info = -17;
00533     }
00534 
00535 /*     Compute workspace */
00536 /*      (Note: Comments in the code beginning "Workspace:" describe the */
00537 /*       minimal amount of workspace needed at that point in the code, */
00538 /*       as well as the preferred amount for good performance. */
00539 /*       NB refers to the optimal block size for the immediately */
00540 /*       following subroutine, as returned by ILAENV. */
00541 
00542     minwrk = 1;
00543     if (*info == 0 && *lwork >= 1) {
00544 /* Computing MAX */
00545         i__1 = 1, i__2 = nmax << 3, i__1 = max(i__1,i__2), i__2 = nmax * (
00546                 nmax + 1);
00547         minwrk = max(i__1,i__2);
00548         maxwrk = nmax * 7 + nmax * ilaenv_(&c__1, "DGEQRF", " ", &nmax, &c__1, 
00549                  &nmax, &c__0);
00550 /* Computing MAX */
00551         i__1 = maxwrk, i__2 = nmax * (nmax + 1);
00552         maxwrk = max(i__1,i__2);
00553         work[1] = (doublereal) maxwrk;
00554     }
00555 
00556     if (*lwork < minwrk) {
00557         *info = -25;
00558     }
00559 
00560     if (*info != 0) {
00561         i__1 = -(*info);
00562         xerbla_("DDRGEV", &i__1);
00563         return 0;
00564     }
00565 
00566 /*     Quick return if possible */
00567 
00568     if (*nsizes == 0 || *ntypes == 0) {
00569         return 0;
00570     }
00571 
00572     safmin = dlamch_("Safe minimum");
00573     ulp = dlamch_("Epsilon") * dlamch_("Base");
00574     safmin /= ulp;
00575     safmax = 1. / safmin;
00576     dlabad_(&safmin, &safmax);
00577     ulpinv = 1. / ulp;
00578 
00579 /*     The values RMAGN(2:3) depend on N, see below. */
00580 
00581     rmagn[0] = 0.;
00582     rmagn[1] = 1.;
00583 
00584 /*     Loop over sizes, types */
00585 
00586     ntestt = 0;
00587     nerrs = 0;
00588     nmats = 0;
00589 
00590     i__1 = *nsizes;
00591     for (jsize = 1; jsize <= i__1; ++jsize) {
00592         n = nn[jsize];
00593         n1 = max(1,n);
00594         rmagn[2] = safmax * ulp / (doublereal) n1;
00595         rmagn[3] = safmin * ulpinv * n1;
00596 
00597         if (*nsizes != 1) {
00598             mtypes = min(26,*ntypes);
00599         } else {
00600             mtypes = min(27,*ntypes);
00601         }
00602 
00603         i__2 = mtypes;
00604         for (jtype = 1; jtype <= i__2; ++jtype) {
00605             if (! dotype[jtype]) {
00606                 goto L210;
00607             }
00608             ++nmats;
00609 
00610 /*           Save ISEED in case of an error. */
00611 
00612             for (j = 1; j <= 4; ++j) {
00613                 ioldsd[j - 1] = iseed[j];
00614 /* L20: */
00615             }
00616 
00617 /*           Generate test matrices A and B */
00618 
00619 /*           Description of control parameters: */
00620 
00621 /*           KZLASS: =1 means w/o rotation, =2 means w/ rotation, */
00622 /*                   =3 means random. */
00623 /*           KATYPE: the "type" to be passed to DLATM4 for computing A. */
00624 /*           KAZERO: the pattern of zeros on the diagonal for A: */
00625 /*                   =1: ( xxx ), =2: (0, xxx ) =3: ( 0, 0, xxx, 0 ), */
00626 /*                   =4: ( 0, xxx, 0, 0 ), =5: ( 0, 0, 1, xxx, 0 ), */
00627 /*                   =6: ( 0, 1, 0, xxx, 0 ).  (xxx means a string of */
00628 /*                   non-zero entries.) */
00629 /*           KAMAGN: the magnitude of the matrix: =0: zero, =1: O(1), */
00630 /*                   =2: large, =3: small. */
00631 /*           IASIGN: 1 if the diagonal elements of A are to be */
00632 /*                   multiplied by a random magnitude 1 number, =2 if */
00633 /*                   randomly chosen diagonal blocks are to be rotated */
00634 /*                   to form 2x2 blocks. */
00635 /*           KBTYPE, KBZERO, KBMAGN, IBSIGN: the same, but for B. */
00636 /*           KTRIAN: =0: don't fill in the upper triangle, =1: do. */
00637 /*           KZ1, KZ2, KADD: used to implement KAZERO and KBZERO. */
00638 /*           RMAGN: used to implement KAMAGN and KBMAGN. */
00639 
00640             if (mtypes > 26) {
00641                 goto L100;
00642             }
00643             ierr = 0;
00644             if (kclass[jtype - 1] < 3) {
00645 
00646 /*              Generate A (w/o rotation) */
00647 
00648                 if ((i__3 = katype[jtype - 1], abs(i__3)) == 3) {
00649                     in = ((n - 1) / 2 << 1) + 1;
00650                     if (in != n) {
00651                         dlaset_("Full", &n, &n, &c_b17, &c_b17, &a[a_offset], 
00652                                 lda);
00653                     }
00654                 } else {
00655                     in = n;
00656                 }
00657                 dlatm4_(&katype[jtype - 1], &in, &kz1[kazero[jtype - 1] - 1], 
00658                         &kz2[kazero[jtype - 1] - 1], &iasign[jtype - 1], &
00659                         rmagn[kamagn[jtype - 1]], &ulp, &rmagn[ktrian[jtype - 
00660                         1] * kamagn[jtype - 1]], &c__2, &iseed[1], &a[
00661                         a_offset], lda);
00662                 iadd = kadd[kazero[jtype - 1] - 1];
00663                 if (iadd > 0 && iadd <= n) {
00664                     a[iadd + iadd * a_dim1] = 1.;
00665                 }
00666 
00667 /*              Generate B (w/o rotation) */
00668 
00669                 if ((i__3 = kbtype[jtype - 1], abs(i__3)) == 3) {
00670                     in = ((n - 1) / 2 << 1) + 1;
00671                     if (in != n) {
00672                         dlaset_("Full", &n, &n, &c_b17, &c_b17, &b[b_offset], 
00673                                 lda);
00674                     }
00675                 } else {
00676                     in = n;
00677                 }
00678                 dlatm4_(&kbtype[jtype - 1], &in, &kz1[kbzero[jtype - 1] - 1], 
00679                         &kz2[kbzero[jtype - 1] - 1], &ibsign[jtype - 1], &
00680                         rmagn[kbmagn[jtype - 1]], &c_b23, &rmagn[ktrian[jtype 
00681                         - 1] * kbmagn[jtype - 1]], &c__2, &iseed[1], &b[
00682                         b_offset], lda);
00683                 iadd = kadd[kbzero[jtype - 1] - 1];
00684                 if (iadd != 0 && iadd <= n) {
00685                     b[iadd + iadd * b_dim1] = 1.;
00686                 }
00687 
00688                 if (kclass[jtype - 1] == 2 && n > 0) {
00689 
00690 /*                 Include rotations */
00691 
00692 /*                 Generate Q, Z as Householder transformations times */
00693 /*                 a diagonal matrix. */
00694 
00695                     i__3 = n - 1;
00696                     for (jc = 1; jc <= i__3; ++jc) {
00697                         i__4 = n;
00698                         for (jr = jc; jr <= i__4; ++jr) {
00699                             q[jr + jc * q_dim1] = dlarnd_(&c__3, &iseed[1]);
00700                             z__[jr + jc * z_dim1] = dlarnd_(&c__3, &iseed[1]);
00701 /* L30: */
00702                         }
00703                         i__4 = n + 1 - jc;
00704                         dlarfg_(&i__4, &q[jc + jc * q_dim1], &q[jc + 1 + jc * 
00705                                 q_dim1], &c__1, &work[jc]);
00706                         work[(n << 1) + jc] = d_sign(&c_b23, &q[jc + jc * 
00707                                 q_dim1]);
00708                         q[jc + jc * q_dim1] = 1.;
00709                         i__4 = n + 1 - jc;
00710                         dlarfg_(&i__4, &z__[jc + jc * z_dim1], &z__[jc + 1 + 
00711                                 jc * z_dim1], &c__1, &work[n + jc]);
00712                         work[n * 3 + jc] = d_sign(&c_b23, &z__[jc + jc * 
00713                                 z_dim1]);
00714                         z__[jc + jc * z_dim1] = 1.;
00715 /* L40: */
00716                     }
00717                     q[n + n * q_dim1] = 1.;
00718                     work[n] = 0.;
00719                     d__1 = dlarnd_(&c__2, &iseed[1]);
00720                     work[n * 3] = d_sign(&c_b23, &d__1);
00721                     z__[n + n * z_dim1] = 1.;
00722                     work[n * 2] = 0.;
00723                     d__1 = dlarnd_(&c__2, &iseed[1]);
00724                     work[n * 4] = d_sign(&c_b23, &d__1);
00725 
00726 /*                 Apply the diagonal matrices */
00727 
00728                     i__3 = n;
00729                     for (jc = 1; jc <= i__3; ++jc) {
00730                         i__4 = n;
00731                         for (jr = 1; jr <= i__4; ++jr) {
00732                             a[jr + jc * a_dim1] = work[(n << 1) + jr] * work[
00733                                     n * 3 + jc] * a[jr + jc * a_dim1];
00734                             b[jr + jc * b_dim1] = work[(n << 1) + jr] * work[
00735                                     n * 3 + jc] * b[jr + jc * b_dim1];
00736 /* L50: */
00737                         }
00738 /* L60: */
00739                     }
00740                     i__3 = n - 1;
00741                     dorm2r_("L", "N", &n, &n, &i__3, &q[q_offset], ldq, &work[
00742                             1], &a[a_offset], lda, &work[(n << 1) + 1], &ierr);
00743                     if (ierr != 0) {
00744                         goto L90;
00745                     }
00746                     i__3 = n - 1;
00747                     dorm2r_("R", "T", &n, &n, &i__3, &z__[z_offset], ldq, &
00748                             work[n + 1], &a[a_offset], lda, &work[(n << 1) + 
00749                             1], &ierr);
00750                     if (ierr != 0) {
00751                         goto L90;
00752                     }
00753                     i__3 = n - 1;
00754                     dorm2r_("L", "N", &n, &n, &i__3, &q[q_offset], ldq, &work[
00755                             1], &b[b_offset], lda, &work[(n << 1) + 1], &ierr);
00756                     if (ierr != 0) {
00757                         goto L90;
00758                     }
00759                     i__3 = n - 1;
00760                     dorm2r_("R", "T", &n, &n, &i__3, &z__[z_offset], ldq, &
00761                             work[n + 1], &b[b_offset], lda, &work[(n << 1) + 
00762                             1], &ierr);
00763                     if (ierr != 0) {
00764                         goto L90;
00765                     }
00766                 }
00767             } else {
00768 
00769 /*              Random matrices */
00770 
00771                 i__3 = n;
00772                 for (jc = 1; jc <= i__3; ++jc) {
00773                     i__4 = n;
00774                     for (jr = 1; jr <= i__4; ++jr) {
00775                         a[jr + jc * a_dim1] = rmagn[kamagn[jtype - 1]] * 
00776                                 dlarnd_(&c__2, &iseed[1]);
00777                         b[jr + jc * b_dim1] = rmagn[kbmagn[jtype - 1]] * 
00778                                 dlarnd_(&c__2, &iseed[1]);
00779 /* L70: */
00780                     }
00781 /* L80: */
00782                 }
00783             }
00784 
00785 L90:
00786 
00787             if (ierr != 0) {
00788                 io___38.ciunit = *nounit;
00789                 s_wsfe(&io___38);
00790                 do_fio(&c__1, "Generator", (ftnlen)9);
00791                 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00792                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00793                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00794                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00795                 e_wsfe();
00796                 *info = abs(ierr);
00797                 return 0;
00798             }
00799 
00800 L100:
00801 
00802             for (i__ = 1; i__ <= 7; ++i__) {
00803                 result[i__] = -1.;
00804 /* L110: */
00805             }
00806 
00807 /*           Call DGGEV to compute eigenvalues and eigenvectors. */
00808 
00809             dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00810             dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00811             dggev_("V", "V", &n, &s[s_offset], lda, &t[t_offset], lda, &
00812                     alphar[1], &alphai[1], &beta[1], &q[q_offset], ldq, &z__[
00813                     z_offset], ldq, &work[1], lwork, &ierr);
00814             if (ierr != 0 && ierr != n + 1) {
00815                 result[1] = ulpinv;
00816                 io___40.ciunit = *nounit;
00817                 s_wsfe(&io___40);
00818                 do_fio(&c__1, "DGGEV1", (ftnlen)6);
00819                 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00820                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00821                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00822                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00823                 e_wsfe();
00824                 *info = abs(ierr);
00825                 goto L190;
00826             }
00827 
00828 /*           Do the tests (1) and (2) */
00829 
00830             dget52_(&c_true, &n, &a[a_offset], lda, &b[b_offset], lda, &q[
00831                     q_offset], ldq, &alphar[1], &alphai[1], &beta[1], &work[1]
00832 , &result[1]);
00833             if (result[2] > *thresh) {
00834                 io___41.ciunit = *nounit;
00835                 s_wsfe(&io___41);
00836                 do_fio(&c__1, "Left", (ftnlen)4);
00837                 do_fio(&c__1, "DGGEV1", (ftnlen)6);
00838                 do_fio(&c__1, (char *)&result[2], (ftnlen)sizeof(doublereal));
00839                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00840                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00841                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00842                 e_wsfe();
00843             }
00844 
00845 /*           Do the tests (3) and (4) */
00846 
00847             dget52_(&c_false, &n, &a[a_offset], lda, &b[b_offset], lda, &z__[
00848                     z_offset], ldq, &alphar[1], &alphai[1], &beta[1], &work[1]
00849 , &result[3]);
00850             if (result[4] > *thresh) {
00851                 io___42.ciunit = *nounit;
00852                 s_wsfe(&io___42);
00853                 do_fio(&c__1, "Right", (ftnlen)5);
00854                 do_fio(&c__1, "DGGEV1", (ftnlen)6);
00855                 do_fio(&c__1, (char *)&result[4], (ftnlen)sizeof(doublereal));
00856                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00857                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00858                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00859                 e_wsfe();
00860             }
00861 
00862 /*           Do the test (5) */
00863 
00864             dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00865             dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00866             dggev_("N", "N", &n, &s[s_offset], lda, &t[t_offset], lda, &
00867                     alphr1[1], &alphi1[1], &beta1[1], &q[q_offset], ldq, &z__[
00868                     z_offset], ldq, &work[1], lwork, &ierr);
00869             if (ierr != 0 && ierr != n + 1) {
00870                 result[1] = ulpinv;
00871                 io___43.ciunit = *nounit;
00872                 s_wsfe(&io___43);
00873                 do_fio(&c__1, "DGGEV2", (ftnlen)6);
00874                 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00875                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00876                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00877                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00878                 e_wsfe();
00879                 *info = abs(ierr);
00880                 goto L190;
00881             }
00882 
00883             i__3 = n;
00884             for (j = 1; j <= i__3; ++j) {
00885                 if (alphar[j] != alphr1[j] || alphai[j] != alphi1[j] || beta[
00886                         j] != beta1[j]) {
00887                     result[5] = ulpinv;
00888                 }
00889 /* L120: */
00890             }
00891 
00892 /*           Do the test (6): Compute eigenvalues and left eigenvectors, */
00893 /*           and test them */
00894 
00895             dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00896             dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00897             dggev_("V", "N", &n, &s[s_offset], lda, &t[t_offset], lda, &
00898                     alphr1[1], &alphi1[1], &beta1[1], &qe[qe_offset], ldqe, &
00899                     z__[z_offset], ldq, &work[1], lwork, &ierr);
00900             if (ierr != 0 && ierr != n + 1) {
00901                 result[1] = ulpinv;
00902                 io___44.ciunit = *nounit;
00903                 s_wsfe(&io___44);
00904                 do_fio(&c__1, "DGGEV3", (ftnlen)6);
00905                 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00906                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00907                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00908                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00909                 e_wsfe();
00910                 *info = abs(ierr);
00911                 goto L190;
00912             }
00913 
00914             i__3 = n;
00915             for (j = 1; j <= i__3; ++j) {
00916                 if (alphar[j] != alphr1[j] || alphai[j] != alphi1[j] || beta[
00917                         j] != beta1[j]) {
00918                     result[6] = ulpinv;
00919                 }
00920 /* L130: */
00921             }
00922 
00923             i__3 = n;
00924             for (j = 1; j <= i__3; ++j) {
00925                 i__4 = n;
00926                 for (jc = 1; jc <= i__4; ++jc) {
00927                     if (q[j + jc * q_dim1] != qe[j + jc * qe_dim1]) {
00928                         result[6] = ulpinv;
00929                     }
00930 /* L140: */
00931                 }
00932 /* L150: */
00933             }
00934 
00935 /*           DO the test (7): Compute eigenvalues and right eigenvectors, */
00936 /*           and test them */
00937 
00938             dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00939             dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00940             dggev_("N", "V", &n, &s[s_offset], lda, &t[t_offset], lda, &
00941                     alphr1[1], &alphi1[1], &beta1[1], &q[q_offset], ldq, &qe[
00942                     qe_offset], ldqe, &work[1], lwork, &ierr);
00943             if (ierr != 0 && ierr != n + 1) {
00944                 result[1] = ulpinv;
00945                 io___45.ciunit = *nounit;
00946                 s_wsfe(&io___45);
00947                 do_fio(&c__1, "DGGEV4", (ftnlen)6);
00948                 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00949                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00950                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00951                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00952                 e_wsfe();
00953                 *info = abs(ierr);
00954                 goto L190;
00955             }
00956 
00957             i__3 = n;
00958             for (j = 1; j <= i__3; ++j) {
00959                 if (alphar[j] != alphr1[j] || alphai[j] != alphi1[j] || beta[
00960                         j] != beta1[j]) {
00961                     result[7] = ulpinv;
00962                 }
00963 /* L160: */
00964             }
00965 
00966             i__3 = n;
00967             for (j = 1; j <= i__3; ++j) {
00968                 i__4 = n;
00969                 for (jc = 1; jc <= i__4; ++jc) {
00970                     if (z__[j + jc * z_dim1] != qe[j + jc * qe_dim1]) {
00971                         result[7] = ulpinv;
00972                     }
00973 /* L170: */
00974                 }
00975 /* L180: */
00976             }
00977 
00978 /*           End of Loop -- Check for RESULT(j) > THRESH */
00979 
00980 L190:
00981 
00982             ntestt += 7;
00983 
00984 /*           Print out tests which fail. */
00985 
00986             for (jr = 1; jr <= 7; ++jr) {
00987                 if (result[jr] >= *thresh) {
00988 
00989 /*                 If this is the first test to fail, */
00990 /*                 print a header to the data file. */
00991 
00992                     if (nerrs == 0) {
00993                         io___46.ciunit = *nounit;
00994                         s_wsfe(&io___46);
00995                         do_fio(&c__1, "DGV", (ftnlen)3);
00996                         e_wsfe();
00997 
00998 /*                    Matrix types */
00999 
01000                         io___47.ciunit = *nounit;
01001                         s_wsfe(&io___47);
01002                         e_wsfe();
01003                         io___48.ciunit = *nounit;
01004                         s_wsfe(&io___48);
01005                         e_wsfe();
01006                         io___49.ciunit = *nounit;
01007                         s_wsfe(&io___49);
01008                         do_fio(&c__1, "Orthogonal", (ftnlen)10);
01009                         e_wsfe();
01010 
01011 /*                    Tests performed */
01012 
01013                         io___50.ciunit = *nounit;
01014                         s_wsfe(&io___50);
01015                         e_wsfe();
01016 
01017                     }
01018                     ++nerrs;
01019                     if (result[jr] < 1e4) {
01020                         io___51.ciunit = *nounit;
01021                         s_wsfe(&io___51);
01022                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01023                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01024                                 ;
01025                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01026                                 integer));
01027                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01028                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01029                                 doublereal));
01030                         e_wsfe();
01031                     } else {
01032                         io___52.ciunit = *nounit;
01033                         s_wsfe(&io___52);
01034                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01035                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01036                                 ;
01037                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01038                                 integer));
01039                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01040                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01041                                 doublereal));
01042                         e_wsfe();
01043                     }
01044                 }
01045 /* L200: */
01046             }
01047 
01048 L210:
01049             ;
01050         }
01051 /* L220: */
01052     }
01053 
01054 /*     Summary */
01055 
01056     alasvm_("DGV", nounit, &nerrs, &ntestt, &c__0);
01057 
01058     work[1] = (doublereal) maxwrk;
01059 
01060     return 0;
01061 
01062 
01063 
01064 
01065 
01066 
01067 
01068 /*     End of DDRGEV */
01069 
01070 } /* ddrgev_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:39