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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:00