dchkgg.c
Go to the documentation of this file.
00001 /* dchkgg.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 doublereal c_b13 = 0.;
00019 static integer c__2 = 2;
00020 static doublereal c_b19 = 1.;
00021 static integer c__3 = 3;
00022 static integer c__1 = 1;
00023 static integer c__4 = 4;
00024 static logical c_true = TRUE_;
00025 static logical c_false = FALSE_;
00026 
00027 /* Subroutine */ int dchkgg_(integer *nsizes, integer *nn, integer *ntypes, 
00028         logical *dotype, integer *iseed, doublereal *thresh, logical *tstdif, 
00029         doublereal *thrshn, integer *nounit, doublereal *a, integer *lda, 
00030         doublereal *b, doublereal *h__, doublereal *t, doublereal *s1, 
00031         doublereal *s2, doublereal *p1, doublereal *p2, doublereal *u, 
00032         integer *ldu, doublereal *v, doublereal *q, doublereal *z__, 
00033         doublereal *alphr1, doublereal *alphi1, doublereal *beta1, doublereal 
00034         *alphr3, doublereal *alphi3, doublereal *beta3, doublereal *evectl, 
00035         doublereal *evectr, doublereal *work, integer *lwork, logical *llwork, 
00036          doublereal *result, integer *info)
00037 {
00038     /* Initialized data */
00039 
00040     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,
00041             2,2,2,3 };
00042     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,
00043             2,3,2,1 };
00044     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,
00045             1,1,1,1 };
00046     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,
00047             2,2,2,0 };
00048     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,
00049             0,0,0,0 };
00050     static integer kz1[6] = { 0,1,2,1,3,3 };
00051     static integer kz2[6] = { 0,0,1,2,1,1 };
00052     static integer kadd[6] = { 0,0,0,0,3,2 };
00053     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,
00054             4,4,4,0 };
00055     static integer kbtype[26] = { 0,0,1,1,2,-3,1,4,1,1,4,4,1,1,-4,2,-4,8,8,8,
00056             8,8,8,8,8,0 };
00057     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,
00058             3,3,3,1 };
00059     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,
00060             4,4,4,1 };
00061     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,
00062             3,3,2,1 };
00063 
00064     /* Format strings */
00065     static char fmt_9999[] = "(\002 DCHKGG: \002,a,\002 returned INFO=\002,i"
00066             "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00067             "(\002,3(i5,\002,\002),i5,\002)\002)";
00068     static char fmt_9998[] = "(\002 DCHKGG: \002,a,\002 Eigenvectors from"
00069             " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00070             "error=\002,0p,g10.3,\002,\002,9x,\002N=\002,i6,\002, JTYPE=\002,"
00071             "i6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00072     static char fmt_9997[] = "(/1x,a3,\002 -- Real Generalized eigenvalue pr"
00073             "oblem\002)";
00074     static char fmt_9996[] = "(\002 Matrix types (see DCHKGG for details):"
00075             " \002)";
00076     static char fmt_9995[] = "(\002 Special Matrices:\002,23x,\002(J'=transp"
00077             "osed Jordan block)\002,/\002   1=(0,0)  2=(I,0)  3=(0,I)  4=(I,I"
00078             ")  5=(J',J')  \002,\0026=(diag(J',I), diag(I,J'))\002,/\002 Diag"
00079             "onal Matrices:  ( \002,\002D=diag(0,1,2,...) )\002,/\002   7=(D,"
00080             "I)   9=(large*D, small*I\002,\002)  11=(large*I, small*D)  13=(l"
00081             "arge*D, large*I)\002,/\002   8=(I,D)  10=(small*D, large*I)  12="
00082             "(small*I, large*D) \002,\002 14=(small*D, small*I)\002,/\002  15"
00083             "=(D, reversed D)\002)";
00084     static char fmt_9994[] = "(\002 Matrices Rotated by Random \002,a,\002 M"
00085             "atrices U, V:\002,/\002  16=Transposed Jordan Blocks            "
00086             " 19=geometric \002,\002alpha, beta=0,1\002,/\002  17=arithm. alp"
00087             "ha&beta             \002,\002      20=arithmetic alpha, beta=0,"
00088             "1\002,/\002  18=clustered \002,\002alpha, beta=0,1            21"
00089             "=random alpha, beta=0,1\002,/\002 Large & Small Matrices:\002,"
00090             "/\002  22=(large, small)   \002,\00223=(small,large)    24=(smal"
00091             "l,small)    25=(large,large)\002,/\002  26=random O(1) matrices"
00092             ".\002)";
00093     static char fmt_9993[] = "(/\002 Tests performed:   (H is Hessenberg, S "
00094             "is Schur, B, \002,\002T, P are triangular,\002,/20x,\002U, V, Q,"
00095             " and Z are \002,a,\002, l and r are the\002,/20x,\002appropriate"
00096             " left and right eigenvectors, resp., a is\002,/20x,\002alpha, b "
00097             "is beta, and \002,a,\002 means \002,a,\002.)\002,/\002 1 = | A -"
00098             " U H V\002,a,\002 | / ( |A| n ulp )      2 = | B - U T V\002,a"
00099             ",\002 | / ( |B| n ulp )\002,/\002 3 = | I - UU\002,a,\002 | / ( "
00100             "n ulp )             4 = | I - VV\002,a,\002 | / ( n ulp )\002,"
00101             "/\002 5 = | H - Q S Z\002,a,\002 | / ( |H| n ulp )\002,6x,\0026 "
00102             "= | T - Q P Z\002,a,\002 | / ( |T| n ulp )\002,/\002 7 = | I - QQ"
00103             "\002,a,\002 | / ( n ulp )             8 = | I - ZZ\002,a,\002 | "
00104             "/ ( n ulp )\002,/\002 9 = max | ( b S - a P )\002,a,\002 l | / c"
00105             "onst.  10 = max | ( b H - a T )\002,a,\002 l | / const.\002,/"
00106             "\002 11= max | ( b S - a P ) r | / const.   12 = max | ( b H\002,"
00107             "\002 - a T ) r | / const.\002,/1x)";
00108     static char fmt_9992[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00109             ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00110             ",0p,f8.2)";
00111     static char fmt_9991[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00112             ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00113             ",1p,d10.3)";
00114 
00115     /* System generated locals */
00116     integer a_dim1, a_offset, b_dim1, b_offset, evectl_dim1, evectl_offset, 
00117             evectr_dim1, evectr_offset, h_dim1, h_offset, p1_dim1, p1_offset, 
00118             p2_dim1, p2_offset, q_dim1, q_offset, s1_dim1, s1_offset, s2_dim1,
00119              s2_offset, t_dim1, t_offset, u_dim1, u_offset, v_dim1, v_offset, 
00120             z_dim1, z_offset, i__1, i__2, i__3, i__4;
00121     doublereal d__1, d__2, d__3, d__4;
00122 
00123     /* Builtin functions */
00124     double d_sign(doublereal *, doublereal *);
00125     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00126 
00127     /* Local variables */
00128     integer j, n, i1, n1, jc, in, jr;
00129     doublereal ulp;
00130     integer iadd, nmax;
00131     doublereal temp1, temp2;
00132     logical badnn;
00133     extern /* Subroutine */ int dget51_(integer *, integer *, doublereal *, 
00134             integer *, doublereal *, integer *, doublereal *, integer *, 
00135             doublereal *, integer *, doublereal *, doublereal *), dget52_(
00136             logical *, integer *, doublereal *, integer *, doublereal *, 
00137             integer *, doublereal *, integer *, doublereal *, doublereal *, 
00138             doublereal *, doublereal *, doublereal *);
00139     doublereal dumma[4];
00140     integer iinfo;
00141     doublereal rmagn[4], anorm, bnorm;
00142     integer nmats, jsize, nerrs, jtype, ntest;
00143     extern /* Subroutine */ int dgeqr2_(integer *, integer *, doublereal *, 
00144             integer *, doublereal *, doublereal *, integer *), dlatm4_(
00145             integer *, integer *, integer *, integer *, integer *, doublereal 
00146             *, doublereal *, doublereal *, integer *, integer *, doublereal *, 
00147              integer *), dorm2r_(char *, char *, integer *, integer *, 
00148             integer *, doublereal *, integer *, doublereal *, doublereal *, 
00149             integer *, doublereal *, integer *), dlabad_(
00150             doublereal *, doublereal *);
00151     extern doublereal dlamch_(char *), dlange_(char *, integer *, 
00152             integer *, doublereal *, integer *, doublereal *);
00153     extern /* Subroutine */ int dgghrd_(char *, char *, integer *, integer *, 
00154             integer *, doublereal *, integer *, doublereal *, integer *, 
00155             doublereal *, integer *, doublereal *, integer *, integer *), dlarfg_(integer *, doublereal *, doublereal *, 
00156             integer *, doublereal *);
00157     extern doublereal dlarnd_(integer *, integer *);
00158     extern /* Subroutine */ int dlacpy_(char *, integer *, integer *, 
00159             doublereal *, integer *, doublereal *, integer *);
00160     doublereal safmin;
00161     integer ioldsd[4];
00162     doublereal safmax;
00163     extern /* Subroutine */ int dlaset_(char *, integer *, integer *, 
00164             doublereal *, doublereal *, doublereal *, integer *), 
00165             dhgeqz_(char *, char *, char *, integer *, integer *, integer *, 
00166             doublereal *, integer *, doublereal *, integer *, doublereal *, 
00167             doublereal *, doublereal *, doublereal *, integer *, doublereal *, 
00168              integer *, doublereal *, integer *, integer *), dtgevc_(char *, char *, logical *, integer *, doublereal 
00169             *, integer *, doublereal *, integer *, doublereal *, integer *, 
00170             doublereal *, integer *, integer *, integer *, doublereal *, 
00171             integer *), dlasum_(char *, integer *, integer *, 
00172             integer *), xerbla_(char *, integer *);
00173     doublereal ulpinv;
00174     integer lwkopt, mtypes, ntestt;
00175 
00176     /* Fortran I/O blocks */
00177     static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00178     static cilist io___41 = { 0, 0, 0, fmt_9999, 0 };
00179     static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00180     static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00181     static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00182     static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00183     static cilist io___46 = { 0, 0, 0, fmt_9999, 0 };
00184     static cilist io___47 = { 0, 0, 0, fmt_9999, 0 };
00185     static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00186     static cilist io___51 = { 0, 0, 0, fmt_9999, 0 };
00187     static cilist io___52 = { 0, 0, 0, fmt_9998, 0 };
00188     static cilist io___53 = { 0, 0, 0, fmt_9999, 0 };
00189     static cilist io___54 = { 0, 0, 0, fmt_9998, 0 };
00190     static cilist io___55 = { 0, 0, 0, fmt_9999, 0 };
00191     static cilist io___56 = { 0, 0, 0, fmt_9999, 0 };
00192     static cilist io___57 = { 0, 0, 0, fmt_9998, 0 };
00193     static cilist io___58 = { 0, 0, 0, fmt_9999, 0 };
00194     static cilist io___59 = { 0, 0, 0, fmt_9998, 0 };
00195     static cilist io___62 = { 0, 0, 0, fmt_9997, 0 };
00196     static cilist io___63 = { 0, 0, 0, fmt_9996, 0 };
00197     static cilist io___64 = { 0, 0, 0, fmt_9995, 0 };
00198     static cilist io___65 = { 0, 0, 0, fmt_9994, 0 };
00199     static cilist io___66 = { 0, 0, 0, fmt_9993, 0 };
00200     static cilist io___67 = { 0, 0, 0, fmt_9992, 0 };
00201     static cilist io___68 = { 0, 0, 0, fmt_9991, 0 };
00202 
00203 
00204 
00205 /*  -- LAPACK test routine (version 3.1) -- */
00206 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00207 /*     November 2006 */
00208 
00209 /*     .. Scalar Arguments .. */
00210 /*     .. */
00211 /*     .. Array Arguments .. */
00212 /*     .. */
00213 
00214 /*  Purpose */
00215 /*  ======= */
00216 
00217 /*  DCHKGG  checks the nonsymmetric generalized eigenvalue problem */
00218 /*  routines. */
00219 /*                                 T          T        T */
00220 /*  DGGHRD factors A and B as U H V  and U T V , where   means */
00221 /*  transpose, H is hessenberg, T is triangular and U and V are */
00222 /*  orthogonal. */
00223 /*                                  T          T */
00224 /*  DHGEQZ factors H and T as  Q S Z  and Q P Z , where P is upper */
00225 /*  triangular, S is in generalized Schur form (block upper triangular, */
00226 /*  with 1x1 and 2x2 blocks on the diagonal, the 2x2 blocks */
00227 /*  corresponding to complex conjugate pairs of generalized */
00228 /*  eigenvalues), and Q and Z are orthogonal.  It also computes the */
00229 /*  generalized eigenvalues (alpha(1),beta(1)),...,(alpha(n),beta(n)), */
00230 /*  where alpha(j)=S(j,j) and beta(j)=P(j,j) -- thus, */
00231 /*  w(j) = alpha(j)/beta(j) is a root of the generalized eigenvalue */
00232 /*  problem */
00233 
00234 /*      det( A - w(j) B ) = 0 */
00235 
00236 /*  and m(j) = beta(j)/alpha(j) is a root of the essentially equivalent */
00237 /*  problem */
00238 
00239 /*      det( m(j) A - B ) = 0 */
00240 
00241 /*  DTGEVC computes the matrix L of left eigenvectors and the matrix R */
00242 /*  of right eigenvectors for the matrix pair ( S, P ).  In the */
00243 /*  description below,  l and r are left and right eigenvectors */
00244 /*  corresponding to the generalized eigenvalues (alpha,beta). */
00245 
00246 /*  When DCHKGG is called, a number of matrix "sizes" ("n's") and a */
00247 /*  number of matrix "types" are specified.  For each size ("n") */
00248 /*  and each type of matrix, one matrix will be generated and used */
00249 /*  to test the nonsymmetric eigenroutines.  For each matrix, 15 */
00250 /*  tests will be performed.  The first twelve "test ratios" should be */
00251 /*  small -- O(1).  They will be compared with the threshhold THRESH: */
00252 
00253 /*                   T */
00254 /*  (1)   | A - U H V  | / ( |A| n ulp ) */
00255 
00256 /*                   T */
00257 /*  (2)   | B - U T V  | / ( |B| n ulp ) */
00258 
00259 /*                T */
00260 /*  (3)   | I - UU  | / ( n ulp ) */
00261 
00262 /*                T */
00263 /*  (4)   | I - VV  | / ( n ulp ) */
00264 
00265 /*                   T */
00266 /*  (5)   | H - Q S Z  | / ( |H| n ulp ) */
00267 
00268 /*                   T */
00269 /*  (6)   | T - Q P Z  | / ( |T| n ulp ) */
00270 
00271 /*                T */
00272 /*  (7)   | I - QQ  | / ( n ulp ) */
00273 
00274 /*                T */
00275 /*  (8)   | I - ZZ  | / ( n ulp ) */
00276 
00277 /*  (9)   max over all left eigenvalue/-vector pairs (beta/alpha,l) of */
00278 
00279 /*     | l**H * (beta S - alpha P) | / ( ulp max( |beta S|, |alpha P| ) ) */
00280 
00281 /*  (10)  max over all left eigenvalue/-vector pairs (beta/alpha,l') of */
00282 /*                            T */
00283 /*    | l'**H * (beta H - alpha T) | / ( ulp max( |beta H|, |alpha T| ) ) */
00284 
00285 /*        where the eigenvectors l' are the result of passing Q to */
00286 /*        DTGEVC and back transforming (HOWMNY='B'). */
00287 
00288 /*  (11)  max over all right eigenvalue/-vector pairs (beta/alpha,r) of */
00289 
00290 /*        | (beta S - alpha T) r | / ( ulp max( |beta S|, |alpha T| ) ) */
00291 
00292 /*  (12)  max over all right eigenvalue/-vector pairs (beta/alpha,r') of */
00293 
00294 /*        | (beta H - alpha T) r' | / ( ulp max( |beta H|, |alpha T| ) ) */
00295 
00296 /*        where the eigenvectors r' are the result of passing Z to */
00297 /*        DTGEVC and back transforming (HOWMNY='B'). */
00298 
00299 /*  The last three test ratios will usually be small, but there is no */
00300 /*  mathematical requirement that they be so.  They are therefore */
00301 /*  compared with THRESH only if TSTDIF is .TRUE. */
00302 
00303 /*  (13)  | S(Q,Z computed) - S(Q,Z not computed) | / ( |S| ulp ) */
00304 
00305 /*  (14)  | P(Q,Z computed) - P(Q,Z not computed) | / ( |P| ulp ) */
00306 
00307 /*  (15)  max( |alpha(Q,Z computed) - alpha(Q,Z not computed)|/|S| , */
00308 /*             |beta(Q,Z computed) - beta(Q,Z not computed)|/|P| ) / ulp */
00309 
00310 /*  In addition, the normalization of L and R are checked, and compared */
00311 /*  with the threshhold THRSHN. */
00312 
00313 /*  Test Matrices */
00314 /*  ---- -------- */
00315 
00316 /*  The sizes of the test matrices are specified by an array */
00317 /*  NN(1:NSIZES); the value of each element NN(j) specifies one size. */
00318 /*  The "types" are specified by a logical array DOTYPE( 1:NTYPES ); if */
00319 /*  DOTYPE(j) is .TRUE., then matrix type "j" will be generated. */
00320 /*  Currently, the list of possible types is: */
00321 
00322 /*  (1)  ( 0, 0 )         (a pair of zero matrices) */
00323 
00324 /*  (2)  ( I, 0 )         (an identity and a zero matrix) */
00325 
00326 /*  (3)  ( 0, I )         (an identity and a zero matrix) */
00327 
00328 /*  (4)  ( I, I )         (a pair of identity matrices) */
00329 
00330 /*          t   t */
00331 /*  (5)  ( J , J  )       (a pair of transposed Jordan blocks) */
00332 
00333 /*                                      t                ( I   0  ) */
00334 /*  (6)  ( X, Y )         where  X = ( J   0  )  and Y = (      t ) */
00335 /*                                   ( 0   I  )          ( 0   J  ) */
00336 /*                        and I is a k x k identity and J a (k+1)x(k+1) */
00337 /*                        Jordan block; k=(N-1)/2 */
00338 
00339 /*  (7)  ( D, I )         where D is diag( 0, 1,..., N-1 ) (a diagonal */
00340 /*                        matrix with those diagonal entries.) */
00341 /*  (8)  ( I, D ) */
00342 
00343 /*  (9)  ( big*D, small*I ) where "big" is near overflow and small=1/big */
00344 
00345 /*  (10) ( small*D, big*I ) */
00346 
00347 /*  (11) ( big*I, small*D ) */
00348 
00349 /*  (12) ( small*I, big*D ) */
00350 
00351 /*  (13) ( big*D, big*I ) */
00352 
00353 /*  (14) ( small*D, small*I ) */
00354 
00355 /*  (15) ( D1, D2 )        where D1 is diag( 0, 0, 1, ..., N-3, 0 ) and */
00356 /*                         D2 is diag( 0, N-3, N-4,..., 1, 0, 0 ) */
00357 /*            t   t */
00358 /*  (16) U ( J , J ) V     where U and V are random orthogonal matrices. */
00359 
00360 /*  (17) U ( T1, T2 ) V    where T1 and T2 are upper triangular matrices */
00361 /*                         with random O(1) entries above the diagonal */
00362 /*                         and diagonal entries diag(T1) = */
00363 /*                         ( 0, 0, 1, ..., N-3, 0 ) and diag(T2) = */
00364 /*                         ( 0, N-3, N-4,..., 1, 0, 0 ) */
00365 
00366 /*  (18) U ( T1, T2 ) V    diag(T1) = ( 0, 0, 1, 1, s, ..., s, 0 ) */
00367 /*                         diag(T2) = ( 0, 1, 0, 1,..., 1, 0 ) */
00368 /*                         s = machine precision. */
00369 
00370 /*  (19) U ( T1, T2 ) V    diag(T1)=( 0,0,1,1, 1-d, ..., 1-(N-5)*d=s, 0 ) */
00371 /*                         diag(T2) = ( 0, 1, 0, 1, ..., 1, 0 ) */
00372 
00373 /*                                                         N-5 */
00374 /*  (20) U ( T1, T2 ) V    diag(T1)=( 0, 0, 1, 1, a, ..., a   =s, 0 ) */
00375 /*                         diag(T2) = ( 0, 1, 0, 1, ..., 1, 0, 0 ) */
00376 
00377 /*  (21) U ( T1, T2 ) V    diag(T1)=( 0, 0, 1, r1, r2, ..., r(N-4), 0 ) */
00378 /*                         diag(T2) = ( 0, 1, 0, 1, ..., 1, 0, 0 ) */
00379 /*                         where r1,..., r(N-4) are random. */
00380 
00381 /*  (22) U ( big*T1, small*T2 ) V    diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00382 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00383 
00384 /*  (23) U ( small*T1, big*T2 ) V    diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00385 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00386 
00387 /*  (24) U ( small*T1, small*T2 ) V  diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00388 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00389 
00390 /*  (25) U ( big*T1, big*T2 ) V      diag(T1) = ( 0, 0, 1, ..., N-3, 0 ) */
00391 /*                                   diag(T2) = ( 0, 1, ..., 1, 0, 0 ) */
00392 
00393 /*  (26) U ( T1, T2 ) V     where T1 and T2 are random upper-triangular */
00394 /*                          matrices. */
00395 
00396 /*  Arguments */
00397 /*  ========= */
00398 
00399 /*  NSIZES  (input) INTEGER */
00400 /*          The number of sizes of matrices to use.  If it is zero, */
00401 /*          DCHKGG does nothing.  It must be at least zero. */
00402 
00403 /*  NN      (input) INTEGER array, dimension (NSIZES) */
00404 /*          An array containing the sizes to be used for the matrices. */
00405 /*          Zero values will be skipped.  The values must be at least */
00406 /*          zero. */
00407 
00408 /*  NTYPES  (input) INTEGER */
00409 /*          The number of elements in DOTYPE.   If it is zero, DCHKGG */
00410 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00411 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00412 /*          defined, which is to use whatever matrix is in A.  This */
00413 /*          is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00414 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00415 
00416 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00417 /*          If DOTYPE(j) is .TRUE., then for each size in NN a */
00418 /*          matrix of that size and of type j will be generated. */
00419 /*          If NTYPES is smaller than the maximum number of types */
00420 /*          defined (PARAMETER MAXTYP), then types NTYPES+1 through */
00421 /*          MAXTYP will not be generated.  If NTYPES is larger */
00422 /*          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) */
00423 /*          will be ignored. */
00424 
00425 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00426 /*          On entry ISEED specifies the seed of the random number */
00427 /*          generator. The array elements should be between 0 and 4095; */
00428 /*          if not they will be reduced mod 4096.  Also, ISEED(4) must */
00429 /*          be odd.  The random number generator uses a linear */
00430 /*          congruential sequence limited to small integers, and so */
00431 /*          should produce machine independent random numbers. The */
00432 /*          values of ISEED are changed on exit, and can be used in the */
00433 /*          next call to DCHKGG to continue the same random number */
00434 /*          sequence. */
00435 
00436 /*  THRESH  (input) DOUBLE PRECISION */
00437 /*          A test will count as "failed" if the "error", computed as */
00438 /*          described above, exceeds THRESH.  Note that the error is */
00439 /*          scaled to be O(1), so THRESH should be a reasonably small */
00440 /*          multiple of 1, e.g., 10 or 100.  In particular, it should */
00441 /*          not depend on the precision (single vs. double) or the size */
00442 /*          of the matrix.  It must be at least zero. */
00443 
00444 /*  TSTDIF  (input) LOGICAL */
00445 /*          Specifies whether test ratios 13-15 will be computed and */
00446 /*          compared with THRESH. */
00447 /*          = .FALSE.: Only test ratios 1-12 will be computed and tested. */
00448 /*                     Ratios 13-15 will be set to zero. */
00449 /*          = .TRUE.:  All the test ratios 1-15 will be computed and */
00450 /*                     tested. */
00451 
00452 /*  THRSHN  (input) DOUBLE PRECISION */
00453 /*          Threshhold for reporting eigenvector normalization error. */
00454 /*          If the normalization of any eigenvector differs from 1 by */
00455 /*          more than THRSHN*ulp, then a special error message will be */
00456 /*          printed.  (This is handled separately from the other tests, */
00457 /*          since only a compiler or programming error should cause an */
00458 /*          error message, at least if THRSHN is at least 5--10.) */
00459 
00460 /*  NOUNIT  (input) INTEGER */
00461 /*          The FORTRAN unit number for printing out error messages */
00462 /*          (e.g., if a routine returns IINFO not equal to 0.) */
00463 
00464 /*  A       (input/workspace) DOUBLE PRECISION array, dimension */
00465 /*                            (LDA, max(NN)) */
00466 /*          Used to hold the original A matrix.  Used as input only */
00467 /*          if NTYPES=MAXTYP+1, DOTYPE(1:MAXTYP)=.FALSE., and */
00468 /*          DOTYPE(MAXTYP+1)=.TRUE. */
00469 
00470 /*  LDA     (input) INTEGER */
00471 /*          The leading dimension of A, B, H, T, S1, P1, S2, and P2. */
00472 /*          It must be at least 1 and at least max( NN ). */
00473 
00474 /*  B       (input/workspace) DOUBLE PRECISION array, dimension */
00475 /*                            (LDA, max(NN)) */
00476 /*          Used to hold the original B matrix.  Used as input only */
00477 /*          if NTYPES=MAXTYP+1, DOTYPE(1:MAXTYP)=.FALSE., and */
00478 /*          DOTYPE(MAXTYP+1)=.TRUE. */
00479 
00480 /*  H       (workspace) DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00481 /*          The upper Hessenberg matrix computed from A by DGGHRD. */
00482 
00483 /*  T       (workspace) DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00484 /*          The upper triangular matrix computed from B by DGGHRD. */
00485 
00486 /*  S1      (workspace) DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00487 /*          The Schur (block upper triangular) matrix computed from H by */
00488 /*          DHGEQZ when Q and Z are also computed. */
00489 
00490 /*  S2      (workspace) DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00491 /*          The Schur (block upper triangular) matrix computed from H by */
00492 /*          DHGEQZ when Q and Z are not computed. */
00493 
00494 /*  P1      (workspace) DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00495 /*          The upper triangular matrix computed from T by DHGEQZ */
00496 /*          when Q and Z are also computed. */
00497 
00498 /*  P2      (workspace) DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00499 /*          The upper triangular matrix computed from T by DHGEQZ */
00500 /*          when Q and Z are not computed. */
00501 
00502 /*  U       (workspace) DOUBLE PRECISION array, dimension (LDU, max(NN)) */
00503 /*          The (left) orthogonal matrix computed by DGGHRD. */
00504 
00505 /*  LDU     (input) INTEGER */
00506 /*          The leading dimension of U, V, Q, Z, EVECTL, and EVEZTR.  It */
00507 /*          must be at least 1 and at least max( NN ). */
00508 
00509 /*  V       (workspace) DOUBLE PRECISION array, dimension (LDU, max(NN)) */
00510 /*          The (right) orthogonal matrix computed by DGGHRD. */
00511 
00512 /*  Q       (workspace) DOUBLE PRECISION array, dimension (LDU, max(NN)) */
00513 /*          The (left) orthogonal matrix computed by DHGEQZ. */
00514 
00515 /*  Z       (workspace) DOUBLE PRECISION array, dimension (LDU, max(NN)) */
00516 /*          The (left) orthogonal matrix computed by DHGEQZ. */
00517 
00518 /*  ALPHR1  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00519 /*  ALPHI1  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00520 /*  BETA1   (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00521 
00522 /*          The generalized eigenvalues of (A,B) computed by DHGEQZ */
00523 /*          when Q, Z, and the full Schur matrices are computed. */
00524 /*          On exit, ( ALPHR1(k)+ALPHI1(k)*i ) / BETA1(k) is the k-th */
00525 /*          generalized eigenvalue of the matrices in A and B. */
00526 
00527 /*  ALPHR3  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00528 /*  ALPHI3  (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00529 /*  BETA3   (workspace) DOUBLE PRECISION array, dimension (max(NN)) */
00530 
00531 /*  EVECTL  (workspace) DOUBLE PRECISION array, dimension (LDU, max(NN)) */
00532 /*          The (block lower triangular) left eigenvector matrix for */
00533 /*          the matrices in S1 and P1.  (See DTGEVC for the format.) */
00534 
00535 /*  EVEZTR  (workspace) DOUBLE PRECISION array, dimension (LDU, max(NN)) */
00536 /*          The (block upper triangular) right eigenvector matrix for */
00537 /*          the matrices in S1 and P1.  (See DTGEVC for the format.) */
00538 
00539 /*  WORK    (workspace) DOUBLE PRECISION array, dimension (LWORK) */
00540 
00541 /*  LWORK   (input) INTEGER */
00542 /*          The number of entries in WORK.  This must be at least */
00543 /*          max( 2 * N**2, 6*N, 1 ), for all N=NN(j). */
00544 
00545 /*  LLWORK  (workspace) LOGICAL array, dimension (max(NN)) */
00546 
00547 /*  RESULT  (output) DOUBLE PRECISION array, dimension (15) */
00548 /*          The values computed by the tests described above. */
00549 /*          The values are currently limited to 1/ulp, to avoid */
00550 /*          overflow. */
00551 
00552 /*  INFO    (output) INTEGER */
00553 /*          = 0:  successful exit */
00554 /*          < 0:  if INFO = -i, the i-th argument had an illegal value */
00555 /*          > 0:  A routine returned an error code.  INFO is the */
00556 /*                absolute value of the INFO value returned. */
00557 
00558 /*  ===================================================================== */
00559 
00560 /*     .. Parameters .. */
00561 /*     .. */
00562 /*     .. Local Scalars .. */
00563 /*     .. */
00564 /*     .. Local Arrays .. */
00565 /*     .. */
00566 /*     .. External Functions .. */
00567 /*     .. */
00568 /*     .. External Subroutines .. */
00569 /*     .. */
00570 /*     .. Intrinsic Functions .. */
00571 /*     .. */
00572 /*     .. Data statements .. */
00573     /* Parameter adjustments */
00574     --nn;
00575     --dotype;
00576     --iseed;
00577     p2_dim1 = *lda;
00578     p2_offset = 1 + p2_dim1;
00579     p2 -= p2_offset;
00580     p1_dim1 = *lda;
00581     p1_offset = 1 + p1_dim1;
00582     p1 -= p1_offset;
00583     s2_dim1 = *lda;
00584     s2_offset = 1 + s2_dim1;
00585     s2 -= s2_offset;
00586     s1_dim1 = *lda;
00587     s1_offset = 1 + s1_dim1;
00588     s1 -= s1_offset;
00589     t_dim1 = *lda;
00590     t_offset = 1 + t_dim1;
00591     t -= t_offset;
00592     h_dim1 = *lda;
00593     h_offset = 1 + h_dim1;
00594     h__ -= h_offset;
00595     b_dim1 = *lda;
00596     b_offset = 1 + b_dim1;
00597     b -= b_offset;
00598     a_dim1 = *lda;
00599     a_offset = 1 + a_dim1;
00600     a -= a_offset;
00601     evectr_dim1 = *ldu;
00602     evectr_offset = 1 + evectr_dim1;
00603     evectr -= evectr_offset;
00604     evectl_dim1 = *ldu;
00605     evectl_offset = 1 + evectl_dim1;
00606     evectl -= evectl_offset;
00607     z_dim1 = *ldu;
00608     z_offset = 1 + z_dim1;
00609     z__ -= z_offset;
00610     q_dim1 = *ldu;
00611     q_offset = 1 + q_dim1;
00612     q -= q_offset;
00613     v_dim1 = *ldu;
00614     v_offset = 1 + v_dim1;
00615     v -= v_offset;
00616     u_dim1 = *ldu;
00617     u_offset = 1 + u_dim1;
00618     u -= u_offset;
00619     --alphr1;
00620     --alphi1;
00621     --beta1;
00622     --alphr3;
00623     --alphi3;
00624     --beta3;
00625     --work;
00626     --llwork;
00627     --result;
00628 
00629     /* Function Body */
00630 /*     .. */
00631 /*     .. Executable Statements .. */
00632 
00633 /*     Check for errors */
00634 
00635     *info = 0;
00636 
00637     badnn = FALSE_;
00638     nmax = 1;
00639     i__1 = *nsizes;
00640     for (j = 1; j <= i__1; ++j) {
00641 /* Computing MAX */
00642         i__2 = nmax, i__3 = nn[j];
00643         nmax = max(i__2,i__3);
00644         if (nn[j] < 0) {
00645             badnn = TRUE_;
00646         }
00647 /* L10: */
00648     }
00649 
00650 /*     Maximum blocksize and shift -- we assume that blocksize and number */
00651 /*     of shifts are monotone increasing functions of N. */
00652 
00653 /* Computing MAX */
00654     i__1 = nmax * 6, i__2 = (nmax << 1) * nmax, i__1 = max(i__1,i__2);
00655     lwkopt = max(i__1,1);
00656 
00657 /*     Check for errors */
00658 
00659     if (*nsizes < 0) {
00660         *info = -1;
00661     } else if (badnn) {
00662         *info = -2;
00663     } else if (*ntypes < 0) {
00664         *info = -3;
00665     } else if (*thresh < 0.) {
00666         *info = -6;
00667     } else if (*lda <= 1 || *lda < nmax) {
00668         *info = -10;
00669     } else if (*ldu <= 1 || *ldu < nmax) {
00670         *info = -19;
00671     } else if (lwkopt > *lwork) {
00672         *info = -30;
00673     }
00674 
00675     if (*info != 0) {
00676         i__1 = -(*info);
00677         xerbla_("DCHKGG", &i__1);
00678         return 0;
00679     }
00680 
00681 /*     Quick return if possible */
00682 
00683     if (*nsizes == 0 || *ntypes == 0) {
00684         return 0;
00685     }
00686 
00687     safmin = dlamch_("Safe minimum");
00688     ulp = dlamch_("Epsilon") * dlamch_("Base");
00689     safmin /= ulp;
00690     safmax = 1. / safmin;
00691     dlabad_(&safmin, &safmax);
00692     ulpinv = 1. / ulp;
00693 
00694 /*     The values RMAGN(2:3) depend on N, see below. */
00695 
00696     rmagn[0] = 0.;
00697     rmagn[1] = 1.;
00698 
00699 /*     Loop over sizes, types */
00700 
00701     ntestt = 0;
00702     nerrs = 0;
00703     nmats = 0;
00704 
00705     i__1 = *nsizes;
00706     for (jsize = 1; jsize <= i__1; ++jsize) {
00707         n = nn[jsize];
00708         n1 = max(1,n);
00709         rmagn[2] = safmax * ulp / (doublereal) n1;
00710         rmagn[3] = safmin * ulpinv * n1;
00711 
00712         if (*nsizes != 1) {
00713             mtypes = min(26,*ntypes);
00714         } else {
00715             mtypes = min(27,*ntypes);
00716         }
00717 
00718         i__2 = mtypes;
00719         for (jtype = 1; jtype <= i__2; ++jtype) {
00720             if (! dotype[jtype]) {
00721                 goto L230;
00722             }
00723             ++nmats;
00724             ntest = 0;
00725 
00726 /*           Save ISEED in case of an error. */
00727 
00728             for (j = 1; j <= 4; ++j) {
00729                 ioldsd[j - 1] = iseed[j];
00730 /* L20: */
00731             }
00732 
00733 /*           Initialize RESULT */
00734 
00735             for (j = 1; j <= 15; ++j) {
00736                 result[j] = 0.;
00737 /* L30: */
00738             }
00739 
00740 /*           Compute A and B */
00741 
00742 /*           Description of control parameters: */
00743 
00744 /*           KZLASS: =1 means w/o rotation, =2 means w/ rotation, */
00745 /*                   =3 means random. */
00746 /*           KATYPE: the "type" to be passed to DLATM4 for computing A. */
00747 /*           KAZERO: the pattern of zeros on the diagonal for A: */
00748 /*                   =1: ( xxx ), =2: (0, xxx ) =3: ( 0, 0, xxx, 0 ), */
00749 /*                   =4: ( 0, xxx, 0, 0 ), =5: ( 0, 0, 1, xxx, 0 ), */
00750 /*                   =6: ( 0, 1, 0, xxx, 0 ).  (xxx means a string of */
00751 /*                   non-zero entries.) */
00752 /*           KAMAGN: the magnitude of the matrix: =0: zero, =1: O(1), */
00753 /*                   =2: large, =3: small. */
00754 /*           IASIGN: 1 if the diagonal elements of A are to be */
00755 /*                   multiplied by a random magnitude 1 number, =2 if */
00756 /*                   randomly chosen diagonal blocks are to be rotated */
00757 /*                   to form 2x2 blocks. */
00758 /*           KBTYPE, KBZERO, KBMAGN, IBSIGN: the same, but for B. */
00759 /*           KTRIAN: =0: don't fill in the upper triangle, =1: do. */
00760 /*           KZ1, KZ2, KADD: used to implement KAZERO and KBZERO. */
00761 /*           RMAGN: used to implement KAMAGN and KBMAGN. */
00762 
00763             if (mtypes > 26) {
00764                 goto L110;
00765             }
00766             iinfo = 0;
00767             if (kclass[jtype - 1] < 3) {
00768 
00769 /*              Generate A (w/o rotation) */
00770 
00771                 if ((i__3 = katype[jtype - 1], abs(i__3)) == 3) {
00772                     in = ((n - 1) / 2 << 1) + 1;
00773                     if (in != n) {
00774                         dlaset_("Full", &n, &n, &c_b13, &c_b13, &a[a_offset], 
00775                                 lda);
00776                     }
00777                 } else {
00778                     in = n;
00779                 }
00780                 dlatm4_(&katype[jtype - 1], &in, &kz1[kazero[jtype - 1] - 1], 
00781                         &kz2[kazero[jtype - 1] - 1], &iasign[jtype - 1], &
00782                         rmagn[kamagn[jtype - 1]], &ulp, &rmagn[ktrian[jtype - 
00783                         1] * kamagn[jtype - 1]], &c__2, &iseed[1], &a[
00784                         a_offset], lda);
00785                 iadd = kadd[kazero[jtype - 1] - 1];
00786                 if (iadd > 0 && iadd <= n) {
00787                     a[iadd + iadd * a_dim1] = rmagn[kamagn[jtype - 1]];
00788                 }
00789 
00790 /*              Generate B (w/o rotation) */
00791 
00792                 if ((i__3 = kbtype[jtype - 1], abs(i__3)) == 3) {
00793                     in = ((n - 1) / 2 << 1) + 1;
00794                     if (in != n) {
00795                         dlaset_("Full", &n, &n, &c_b13, &c_b13, &b[b_offset], 
00796                                 lda);
00797                     }
00798                 } else {
00799                     in = n;
00800                 }
00801                 dlatm4_(&kbtype[jtype - 1], &in, &kz1[kbzero[jtype - 1] - 1], 
00802                         &kz2[kbzero[jtype - 1] - 1], &ibsign[jtype - 1], &
00803                         rmagn[kbmagn[jtype - 1]], &c_b19, &rmagn[ktrian[jtype 
00804                         - 1] * kbmagn[jtype - 1]], &c__2, &iseed[1], &b[
00805                         b_offset], lda);
00806                 iadd = kadd[kbzero[jtype - 1] - 1];
00807                 if (iadd != 0 && iadd <= n) {
00808                     b[iadd + iadd * b_dim1] = rmagn[kbmagn[jtype - 1]];
00809                 }
00810 
00811                 if (kclass[jtype - 1] == 2 && n > 0) {
00812 
00813 /*                 Include rotations */
00814 
00815 /*                 Generate U, V as Householder transformations times */
00816 /*                 a diagonal matrix. */
00817 
00818                     i__3 = n - 1;
00819                     for (jc = 1; jc <= i__3; ++jc) {
00820                         i__4 = n;
00821                         for (jr = jc; jr <= i__4; ++jr) {
00822                             u[jr + jc * u_dim1] = dlarnd_(&c__3, &iseed[1]);
00823                             v[jr + jc * v_dim1] = dlarnd_(&c__3, &iseed[1]);
00824 /* L40: */
00825                         }
00826                         i__4 = n + 1 - jc;
00827                         dlarfg_(&i__4, &u[jc + jc * u_dim1], &u[jc + 1 + jc * 
00828                                 u_dim1], &c__1, &work[jc]);
00829                         work[(n << 1) + jc] = d_sign(&c_b19, &u[jc + jc * 
00830                                 u_dim1]);
00831                         u[jc + jc * u_dim1] = 1.;
00832                         i__4 = n + 1 - jc;
00833                         dlarfg_(&i__4, &v[jc + jc * v_dim1], &v[jc + 1 + jc * 
00834                                 v_dim1], &c__1, &work[n + jc]);
00835                         work[n * 3 + jc] = d_sign(&c_b19, &v[jc + jc * v_dim1]
00836                                 );
00837                         v[jc + jc * v_dim1] = 1.;
00838 /* L50: */
00839                     }
00840                     u[n + n * u_dim1] = 1.;
00841                     work[n] = 0.;
00842                     d__1 = dlarnd_(&c__2, &iseed[1]);
00843                     work[n * 3] = d_sign(&c_b19, &d__1);
00844                     v[n + n * v_dim1] = 1.;
00845                     work[n * 2] = 0.;
00846                     d__1 = dlarnd_(&c__2, &iseed[1]);
00847                     work[n * 4] = d_sign(&c_b19, &d__1);
00848 
00849 /*                 Apply the diagonal matrices */
00850 
00851                     i__3 = n;
00852                     for (jc = 1; jc <= i__3; ++jc) {
00853                         i__4 = n;
00854                         for (jr = 1; jr <= i__4; ++jr) {
00855                             a[jr + jc * a_dim1] = work[(n << 1) + jr] * work[
00856                                     n * 3 + jc] * a[jr + jc * a_dim1];
00857                             b[jr + jc * b_dim1] = work[(n << 1) + jr] * work[
00858                                     n * 3 + jc] * b[jr + jc * b_dim1];
00859 /* L60: */
00860                         }
00861 /* L70: */
00862                     }
00863                     i__3 = n - 1;
00864                     dorm2r_("L", "N", &n, &n, &i__3, &u[u_offset], ldu, &work[
00865                             1], &a[a_offset], lda, &work[(n << 1) + 1], &
00866                             iinfo);
00867                     if (iinfo != 0) {
00868                         goto L100;
00869                     }
00870                     i__3 = n - 1;
00871                     dorm2r_("R", "T", &n, &n, &i__3, &v[v_offset], ldu, &work[
00872                             n + 1], &a[a_offset], lda, &work[(n << 1) + 1], &
00873                             iinfo);
00874                     if (iinfo != 0) {
00875                         goto L100;
00876                     }
00877                     i__3 = n - 1;
00878                     dorm2r_("L", "N", &n, &n, &i__3, &u[u_offset], ldu, &work[
00879                             1], &b[b_offset], lda, &work[(n << 1) + 1], &
00880                             iinfo);
00881                     if (iinfo != 0) {
00882                         goto L100;
00883                     }
00884                     i__3 = n - 1;
00885                     dorm2r_("R", "T", &n, &n, &i__3, &v[v_offset], ldu, &work[
00886                             n + 1], &b[b_offset], lda, &work[(n << 1) + 1], &
00887                             iinfo);
00888                     if (iinfo != 0) {
00889                         goto L100;
00890                     }
00891                 }
00892             } else {
00893 
00894 /*              Random matrices */
00895 
00896                 i__3 = n;
00897                 for (jc = 1; jc <= i__3; ++jc) {
00898                     i__4 = n;
00899                     for (jr = 1; jr <= i__4; ++jr) {
00900                         a[jr + jc * a_dim1] = rmagn[kamagn[jtype - 1]] * 
00901                                 dlarnd_(&c__2, &iseed[1]);
00902                         b[jr + jc * b_dim1] = rmagn[kbmagn[jtype - 1]] * 
00903                                 dlarnd_(&c__2, &iseed[1]);
00904 /* L80: */
00905                     }
00906 /* L90: */
00907                 }
00908             }
00909 
00910             anorm = dlange_("1", &n, &n, &a[a_offset], lda, &work[1]);
00911             bnorm = dlange_("1", &n, &n, &b[b_offset], lda, &work[1]);
00912 
00913 L100:
00914 
00915             if (iinfo != 0) {
00916                 io___40.ciunit = *nounit;
00917                 s_wsfe(&io___40);
00918                 do_fio(&c__1, "Generator", (ftnlen)9);
00919                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00920                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00921                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00922                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00923                 e_wsfe();
00924                 *info = abs(iinfo);
00925                 return 0;
00926             }
00927 
00928 L110:
00929 
00930 /*           Call DGEQR2, DORM2R, and DGGHRD to compute H, T, U, and V */
00931 
00932             dlacpy_(" ", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00933             dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00934             ntest = 1;
00935             result[1] = ulpinv;
00936 
00937             dgeqr2_(&n, &n, &t[t_offset], lda, &work[1], &work[n + 1], &iinfo)
00938                     ;
00939             if (iinfo != 0) {
00940                 io___41.ciunit = *nounit;
00941                 s_wsfe(&io___41);
00942                 do_fio(&c__1, "DGEQR2", (ftnlen)6);
00943                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00944                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00945                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00946                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00947                 e_wsfe();
00948                 *info = abs(iinfo);
00949                 goto L210;
00950             }
00951 
00952             dorm2r_("L", "T", &n, &n, &n, &t[t_offset], lda, &work[1], &h__[
00953                     h_offset], lda, &work[n + 1], &iinfo);
00954             if (iinfo != 0) {
00955                 io___42.ciunit = *nounit;
00956                 s_wsfe(&io___42);
00957                 do_fio(&c__1, "DORM2R", (ftnlen)6);
00958                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00959                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00960                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00961                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00962                 e_wsfe();
00963                 *info = abs(iinfo);
00964                 goto L210;
00965             }
00966 
00967             dlaset_("Full", &n, &n, &c_b13, &c_b19, &u[u_offset], ldu);
00968             dorm2r_("R", "N", &n, &n, &n, &t[t_offset], lda, &work[1], &u[
00969                     u_offset], ldu, &work[n + 1], &iinfo);
00970             if (iinfo != 0) {
00971                 io___43.ciunit = *nounit;
00972                 s_wsfe(&io___43);
00973                 do_fio(&c__1, "DORM2R", (ftnlen)6);
00974                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00975                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00976                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00977                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00978                 e_wsfe();
00979                 *info = abs(iinfo);
00980                 goto L210;
00981             }
00982 
00983             dgghrd_("V", "I", &n, &c__1, &n, &h__[h_offset], lda, &t[t_offset]
00984 , lda, &u[u_offset], ldu, &v[v_offset], ldu, &iinfo);
00985             if (iinfo != 0) {
00986                 io___44.ciunit = *nounit;
00987                 s_wsfe(&io___44);
00988                 do_fio(&c__1, "DGGHRD", (ftnlen)6);
00989                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00990                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00991                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00992                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00993                 e_wsfe();
00994                 *info = abs(iinfo);
00995                 goto L210;
00996             }
00997             ntest = 4;
00998 
00999 /*           Do tests 1--4 */
01000 
01001             dget51_(&c__1, &n, &a[a_offset], lda, &h__[h_offset], lda, &u[
01002                     u_offset], ldu, &v[v_offset], ldu, &work[1], &result[1]);
01003             dget51_(&c__1, &n, &b[b_offset], lda, &t[t_offset], lda, &u[
01004                     u_offset], ldu, &v[v_offset], ldu, &work[1], &result[2]);
01005             dget51_(&c__3, &n, &b[b_offset], lda, &t[t_offset], lda, &u[
01006                     u_offset], ldu, &u[u_offset], ldu, &work[1], &result[3]);
01007             dget51_(&c__3, &n, &b[b_offset], lda, &t[t_offset], lda, &v[
01008                     v_offset], ldu, &v[v_offset], ldu, &work[1], &result[4]);
01009 
01010 /*           Call DHGEQZ to compute S1, P1, S2, P2, Q, and Z, do tests. */
01011 
01012 /*           Compute T1 and UZ */
01013 
01014 /*           Eigenvalues only */
01015 
01016             dlacpy_(" ", &n, &n, &h__[h_offset], lda, &s2[s2_offset], lda);
01017             dlacpy_(" ", &n, &n, &t[t_offset], lda, &p2[p2_offset], lda);
01018             ntest = 5;
01019             result[5] = ulpinv;
01020 
01021             dhgeqz_("E", "N", "N", &n, &c__1, &n, &s2[s2_offset], lda, &p2[
01022                     p2_offset], lda, &alphr3[1], &alphi3[1], &beta3[1], &q[
01023                     q_offset], ldu, &z__[z_offset], ldu, &work[1], lwork, &
01024                     iinfo);
01025             if (iinfo != 0) {
01026                 io___45.ciunit = *nounit;
01027                 s_wsfe(&io___45);
01028                 do_fio(&c__1, "DHGEQZ(E)", (ftnlen)9);
01029                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01030                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01031                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01032                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01033                 e_wsfe();
01034                 *info = abs(iinfo);
01035                 goto L210;
01036             }
01037 
01038 /*           Eigenvalues and Full Schur Form */
01039 
01040             dlacpy_(" ", &n, &n, &h__[h_offset], lda, &s2[s2_offset], lda);
01041             dlacpy_(" ", &n, &n, &t[t_offset], lda, &p2[p2_offset], lda);
01042 
01043             dhgeqz_("S", "N", "N", &n, &c__1, &n, &s2[s2_offset], lda, &p2[
01044                     p2_offset], lda, &alphr1[1], &alphi1[1], &beta1[1], &q[
01045                     q_offset], ldu, &z__[z_offset], ldu, &work[1], lwork, &
01046                     iinfo);
01047             if (iinfo != 0) {
01048                 io___46.ciunit = *nounit;
01049                 s_wsfe(&io___46);
01050                 do_fio(&c__1, "DHGEQZ(S)", (ftnlen)9);
01051                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
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                 *info = abs(iinfo);
01057                 goto L210;
01058             }
01059 
01060 /*           Eigenvalues, Schur Form, and Schur Vectors */
01061 
01062             dlacpy_(" ", &n, &n, &h__[h_offset], lda, &s1[s1_offset], lda);
01063             dlacpy_(" ", &n, &n, &t[t_offset], lda, &p1[p1_offset], lda);
01064 
01065             dhgeqz_("S", "I", "I", &n, &c__1, &n, &s1[s1_offset], lda, &p1[
01066                     p1_offset], lda, &alphr1[1], &alphi1[1], &beta1[1], &q[
01067                     q_offset], ldu, &z__[z_offset], ldu, &work[1], lwork, &
01068                     iinfo);
01069             if (iinfo != 0) {
01070                 io___47.ciunit = *nounit;
01071                 s_wsfe(&io___47);
01072                 do_fio(&c__1, "DHGEQZ(V)", (ftnlen)9);
01073                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01074                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01075                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01076                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01077                 e_wsfe();
01078                 *info = abs(iinfo);
01079                 goto L210;
01080             }
01081 
01082             ntest = 8;
01083 
01084 /*           Do Tests 5--8 */
01085 
01086             dget51_(&c__1, &n, &h__[h_offset], lda, &s1[s1_offset], lda, &q[
01087                     q_offset], ldu, &z__[z_offset], ldu, &work[1], &result[5])
01088                     ;
01089             dget51_(&c__1, &n, &t[t_offset], lda, &p1[p1_offset], lda, &q[
01090                     q_offset], ldu, &z__[z_offset], ldu, &work[1], &result[6])
01091                     ;
01092             dget51_(&c__3, &n, &t[t_offset], lda, &p1[p1_offset], lda, &q[
01093                     q_offset], ldu, &q[q_offset], ldu, &work[1], &result[7]);
01094             dget51_(&c__3, &n, &t[t_offset], lda, &p1[p1_offset], lda, &z__[
01095                     z_offset], ldu, &z__[z_offset], ldu, &work[1], &result[8])
01096                     ;
01097 
01098 /*           Compute the Left and Right Eigenvectors of (S1,P1) */
01099 
01100 /*           9: Compute the left eigenvector Matrix without */
01101 /*              back transforming: */
01102 
01103             ntest = 9;
01104             result[9] = ulpinv;
01105 
01106 /*           To test "SELECT" option, compute half of the eigenvectors */
01107 /*           in one call, and half in another */
01108 
01109             i1 = n / 2;
01110             i__3 = i1;
01111             for (j = 1; j <= i__3; ++j) {
01112                 llwork[j] = TRUE_;
01113 /* L120: */
01114             }
01115             i__3 = n;
01116             for (j = i1 + 1; j <= i__3; ++j) {
01117                 llwork[j] = FALSE_;
01118 /* L130: */
01119             }
01120 
01121             dtgevc_("L", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01122                     p1_offset], lda, &evectl[evectl_offset], ldu, dumma, ldu, 
01123                     &n, &in, &work[1], &iinfo);
01124             if (iinfo != 0) {
01125                 io___50.ciunit = *nounit;
01126                 s_wsfe(&io___50);
01127                 do_fio(&c__1, "DTGEVC(L,S1)", (ftnlen)12);
01128                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01129                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01130                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01131                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01132                 e_wsfe();
01133                 *info = abs(iinfo);
01134                 goto L210;
01135             }
01136 
01137             i1 = in;
01138             i__3 = i1;
01139             for (j = 1; j <= i__3; ++j) {
01140                 llwork[j] = FALSE_;
01141 /* L140: */
01142             }
01143             i__3 = n;
01144             for (j = i1 + 1; j <= i__3; ++j) {
01145                 llwork[j] = TRUE_;
01146 /* L150: */
01147             }
01148 
01149             dtgevc_("L", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01150                     p1_offset], lda, &evectl[(i1 + 1) * evectl_dim1 + 1], ldu, 
01151                      dumma, ldu, &n, &in, &work[1], &iinfo);
01152             if (iinfo != 0) {
01153                 io___51.ciunit = *nounit;
01154                 s_wsfe(&io___51);
01155                 do_fio(&c__1, "DTGEVC(L,S2)", (ftnlen)12);
01156                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01157                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01158                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01159                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01160                 e_wsfe();
01161                 *info = abs(iinfo);
01162                 goto L210;
01163             }
01164 
01165             dget52_(&c_true, &n, &s1[s1_offset], lda, &p1[p1_offset], lda, &
01166                     evectl[evectl_offset], ldu, &alphr1[1], &alphi1[1], &
01167                     beta1[1], &work[1], dumma);
01168             result[9] = dumma[0];
01169             if (dumma[1] > *thrshn) {
01170                 io___52.ciunit = *nounit;
01171                 s_wsfe(&io___52);
01172                 do_fio(&c__1, "Left", (ftnlen)4);
01173                 do_fio(&c__1, "DTGEVC(HOWMNY=S)", (ftnlen)16);
01174                 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01175                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01176                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01177                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01178                 e_wsfe();
01179             }
01180 
01181 /*           10: Compute the left eigenvector Matrix with */
01182 /*               back transforming: */
01183 
01184             ntest = 10;
01185             result[10] = ulpinv;
01186             dlacpy_("F", &n, &n, &q[q_offset], ldu, &evectl[evectl_offset], 
01187                     ldu);
01188             dtgevc_("L", "B", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01189                     p1_offset], lda, &evectl[evectl_offset], ldu, dumma, ldu, 
01190                     &n, &in, &work[1], &iinfo);
01191             if (iinfo != 0) {
01192                 io___53.ciunit = *nounit;
01193                 s_wsfe(&io___53);
01194                 do_fio(&c__1, "DTGEVC(L,B)", (ftnlen)11);
01195                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01196                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01197                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01198                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01199                 e_wsfe();
01200                 *info = abs(iinfo);
01201                 goto L210;
01202             }
01203 
01204             dget52_(&c_true, &n, &h__[h_offset], lda, &t[t_offset], lda, &
01205                     evectl[evectl_offset], ldu, &alphr1[1], &alphi1[1], &
01206                     beta1[1], &work[1], dumma);
01207             result[10] = dumma[0];
01208             if (dumma[1] > *thrshn) {
01209                 io___54.ciunit = *nounit;
01210                 s_wsfe(&io___54);
01211                 do_fio(&c__1, "Left", (ftnlen)4);
01212                 do_fio(&c__1, "DTGEVC(HOWMNY=B)", (ftnlen)16);
01213                 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01214                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01215                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01216                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01217                 e_wsfe();
01218             }
01219 
01220 /*           11: Compute the right eigenvector Matrix without */
01221 /*               back transforming: */
01222 
01223             ntest = 11;
01224             result[11] = ulpinv;
01225 
01226 /*           To test "SELECT" option, compute half of the eigenvectors */
01227 /*           in one call, and half in another */
01228 
01229             i1 = n / 2;
01230             i__3 = i1;
01231             for (j = 1; j <= i__3; ++j) {
01232                 llwork[j] = TRUE_;
01233 /* L160: */
01234             }
01235             i__3 = n;
01236             for (j = i1 + 1; j <= i__3; ++j) {
01237                 llwork[j] = FALSE_;
01238 /* L170: */
01239             }
01240 
01241             dtgevc_("R", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01242                     p1_offset], lda, dumma, ldu, &evectr[evectr_offset], ldu, 
01243                     &n, &in, &work[1], &iinfo);
01244             if (iinfo != 0) {
01245                 io___55.ciunit = *nounit;
01246                 s_wsfe(&io___55);
01247                 do_fio(&c__1, "DTGEVC(R,S1)", (ftnlen)12);
01248                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01249                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01250                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01251                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01252                 e_wsfe();
01253                 *info = abs(iinfo);
01254                 goto L210;
01255             }
01256 
01257             i1 = in;
01258             i__3 = i1;
01259             for (j = 1; j <= i__3; ++j) {
01260                 llwork[j] = FALSE_;
01261 /* L180: */
01262             }
01263             i__3 = n;
01264             for (j = i1 + 1; j <= i__3; ++j) {
01265                 llwork[j] = TRUE_;
01266 /* L190: */
01267             }
01268 
01269             dtgevc_("R", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01270                     p1_offset], lda, dumma, ldu, &evectr[(i1 + 1) * 
01271                     evectr_dim1 + 1], ldu, &n, &in, &work[1], &iinfo);
01272             if (iinfo != 0) {
01273                 io___56.ciunit = *nounit;
01274                 s_wsfe(&io___56);
01275                 do_fio(&c__1, "DTGEVC(R,S2)", (ftnlen)12);
01276                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01277                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01278                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01279                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01280                 e_wsfe();
01281                 *info = abs(iinfo);
01282                 goto L210;
01283             }
01284 
01285             dget52_(&c_false, &n, &s1[s1_offset], lda, &p1[p1_offset], lda, &
01286                     evectr[evectr_offset], ldu, &alphr1[1], &alphi1[1], &
01287                     beta1[1], &work[1], dumma);
01288             result[11] = dumma[0];
01289             if (dumma[1] > *thresh) {
01290                 io___57.ciunit = *nounit;
01291                 s_wsfe(&io___57);
01292                 do_fio(&c__1, "Right", (ftnlen)5);
01293                 do_fio(&c__1, "DTGEVC(HOWMNY=S)", (ftnlen)16);
01294                 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01295                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01296                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01297                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01298                 e_wsfe();
01299             }
01300 
01301 /*           12: Compute the right eigenvector Matrix with */
01302 /*               back transforming: */
01303 
01304             ntest = 12;
01305             result[12] = ulpinv;
01306             dlacpy_("F", &n, &n, &z__[z_offset], ldu, &evectr[evectr_offset], 
01307                     ldu);
01308             dtgevc_("R", "B", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01309                     p1_offset], lda, dumma, ldu, &evectr[evectr_offset], ldu, 
01310                     &n, &in, &work[1], &iinfo);
01311             if (iinfo != 0) {
01312                 io___58.ciunit = *nounit;
01313                 s_wsfe(&io___58);
01314                 do_fio(&c__1, "DTGEVC(R,B)", (ftnlen)11);
01315                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01316                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01317                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01318                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01319                 e_wsfe();
01320                 *info = abs(iinfo);
01321                 goto L210;
01322             }
01323 
01324             dget52_(&c_false, &n, &h__[h_offset], lda, &t[t_offset], lda, &
01325                     evectr[evectr_offset], ldu, &alphr1[1], &alphi1[1], &
01326                     beta1[1], &work[1], dumma);
01327             result[12] = dumma[0];
01328             if (dumma[1] > *thresh) {
01329                 io___59.ciunit = *nounit;
01330                 s_wsfe(&io___59);
01331                 do_fio(&c__1, "Right", (ftnlen)5);
01332                 do_fio(&c__1, "DTGEVC(HOWMNY=B)", (ftnlen)16);
01333                 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01334                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01335                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01336                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01337                 e_wsfe();
01338             }
01339 
01340 /*           Tests 13--15 are done only on request */
01341 
01342             if (*tstdif) {
01343 
01344 /*              Do Tests 13--14 */
01345 
01346                 dget51_(&c__2, &n, &s1[s1_offset], lda, &s2[s2_offset], lda, &
01347                         q[q_offset], ldu, &z__[z_offset], ldu, &work[1], &
01348                         result[13]);
01349                 dget51_(&c__2, &n, &p1[p1_offset], lda, &p2[p2_offset], lda, &
01350                         q[q_offset], ldu, &z__[z_offset], ldu, &work[1], &
01351                         result[14]);
01352 
01353 /*              Do Test 15 */
01354 
01355                 temp1 = 0.;
01356                 temp2 = 0.;
01357                 i__3 = n;
01358                 for (j = 1; j <= i__3; ++j) {
01359 /* Computing MAX */
01360                     d__3 = temp1, d__4 = (d__1 = alphr1[j] - alphr3[j], abs(
01361                             d__1)) + (d__2 = alphi1[j] - alphi3[j], abs(d__2))
01362                             ;
01363                     temp1 = max(d__3,d__4);
01364 /* Computing MAX */
01365                     d__2 = temp2, d__3 = (d__1 = beta1[j] - beta3[j], abs(
01366                             d__1));
01367                     temp2 = max(d__2,d__3);
01368 /* L200: */
01369                 }
01370 
01371 /* Computing MAX */
01372                 d__1 = safmin, d__2 = ulp * max(temp1,anorm);
01373                 temp1 /= max(d__1,d__2);
01374 /* Computing MAX */
01375                 d__1 = safmin, d__2 = ulp * max(temp2,bnorm);
01376                 temp2 /= max(d__1,d__2);
01377                 result[15] = max(temp1,temp2);
01378                 ntest = 15;
01379             } else {
01380                 result[13] = 0.;
01381                 result[14] = 0.;
01382                 result[15] = 0.;
01383                 ntest = 12;
01384             }
01385 
01386 /*           End of Loop -- Check for RESULT(j) > THRESH */
01387 
01388 L210:
01389 
01390             ntestt += ntest;
01391 
01392 /*           Print out tests which fail. */
01393 
01394             i__3 = ntest;
01395             for (jr = 1; jr <= i__3; ++jr) {
01396                 if (result[jr] >= *thresh) {
01397 
01398 /*                 If this is the first test to fail, */
01399 /*                 print a header to the data file. */
01400 
01401                     if (nerrs == 0) {
01402                         io___62.ciunit = *nounit;
01403                         s_wsfe(&io___62);
01404                         do_fio(&c__1, "DGG", (ftnlen)3);
01405                         e_wsfe();
01406 
01407 /*                    Matrix types */
01408 
01409                         io___63.ciunit = *nounit;
01410                         s_wsfe(&io___63);
01411                         e_wsfe();
01412                         io___64.ciunit = *nounit;
01413                         s_wsfe(&io___64);
01414                         e_wsfe();
01415                         io___65.ciunit = *nounit;
01416                         s_wsfe(&io___65);
01417                         do_fio(&c__1, "Orthogonal", (ftnlen)10);
01418                         e_wsfe();
01419 
01420 /*                    Tests performed */
01421 
01422                         io___66.ciunit = *nounit;
01423                         s_wsfe(&io___66);
01424                         do_fio(&c__1, "orthogonal", (ftnlen)10);
01425                         do_fio(&c__1, "'", (ftnlen)1);
01426                         do_fio(&c__1, "transpose", (ftnlen)9);
01427                         for (j = 1; j <= 10; ++j) {
01428                             do_fio(&c__1, "'", (ftnlen)1);
01429                         }
01430                         e_wsfe();
01431 
01432                     }
01433                     ++nerrs;
01434                     if (result[jr] < 1e4) {
01435                         io___67.ciunit = *nounit;
01436                         s_wsfe(&io___67);
01437                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01438                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01439                                 ;
01440                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01441                                 integer));
01442                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01443                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01444                                 doublereal));
01445                         e_wsfe();
01446                     } else {
01447                         io___68.ciunit = *nounit;
01448                         s_wsfe(&io___68);
01449                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01450                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01451                                 ;
01452                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01453                                 integer));
01454                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01455                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01456                                 doublereal));
01457                         e_wsfe();
01458                     }
01459                 }
01460 /* L220: */
01461             }
01462 
01463 L230:
01464             ;
01465         }
01466 /* L240: */
01467     }
01468 
01469 /*     Summary */
01470 
01471     dlasum_("DGG", nounit, &nerrs, &ntestt);
01472     return 0;
01473 
01474 
01475 
01476 
01477 
01478 
01479 
01480 
01481 /*     End of DCHKGG */
01482 
01483 } /* dchkgg_ */


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