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


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