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


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