00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static doublecomplex c_b1 = {0.,0.};
00019 static doublecomplex c_b2 = {1.,0.};
00020 static integer c__4 = 4;
00021 static doublereal c_b17 = 1.;
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 int zchkgg_(integer *nsizes, integer *nn, integer *ntypes,
00029 logical *dotype, integer *iseed, doublereal *thresh, logical *tstdif,
00030 doublereal *thrshn, integer *nounit, doublecomplex *a, integer *lda,
00031 doublecomplex *b, doublecomplex *h__, doublecomplex *t, doublecomplex
00032 *s1, doublecomplex *s2, doublecomplex *p1, doublecomplex *p2,
00033 doublecomplex *u, integer *ldu, doublecomplex *v, doublecomplex *q,
00034 doublecomplex *z__, doublecomplex *alpha1, doublecomplex *beta1,
00035 doublecomplex *alpha3, doublecomplex *beta3, doublecomplex *evectl,
00036 doublecomplex *evectr, doublecomplex *work, integer *lwork,
00037 doublereal *rwork, logical *llwork, doublereal *result, integer *info)
00038 {
00039
00040
00041 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,
00042 2,2,2,3 };
00043 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,
00044 2,3,2,1 };
00045 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,
00046 1,1,1,1 };
00047 static logical lasign[26] = { FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,
00048 TRUE_,FALSE_,TRUE_,TRUE_,FALSE_,FALSE_,TRUE_,TRUE_,TRUE_,FALSE_,
00049 TRUE_,FALSE_,FALSE_,FALSE_,TRUE_,TRUE_,TRUE_,TRUE_,TRUE_,FALSE_ };
00050 static logical lbsign[26] = { FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,
00051 FALSE_,TRUE_,FALSE_,FALSE_,TRUE_,TRUE_,FALSE_,FALSE_,TRUE_,FALSE_,
00052 TRUE_,FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,FALSE_,
00053 FALSE_ };
00054 static integer kz1[6] = { 0,1,2,1,3,3 };
00055 static integer kz2[6] = { 0,0,1,2,1,1 };
00056 static integer kadd[6] = { 0,0,0,0,3,2 };
00057 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,
00058 4,4,4,0 };
00059 static integer kbtype[26] = { 0,0,1,1,2,-3,1,4,1,1,4,4,1,1,-4,2,-4,8,8,8,
00060 8,8,8,8,8,0 };
00061 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,
00062 3,3,3,1 };
00063 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,
00064 4,4,4,1 };
00065 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,
00066 3,3,2,1 };
00067
00068
00069 static char fmt_9999[] = "(\002 ZCHKGG: \002,a,\002 returned INFO=\002,i"
00070 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00071 "(\002,3(i5,\002,\002),i5,\002)\002)";
00072 static char fmt_9998[] = "(\002 ZCHKGG: \002,a,\002 Eigenvectors from"
00073 " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00074 "error=\002,0p,g10.3,\002,\002,9x,\002N=\002,i6,\002, JTYPE=\002,"
00075 "i6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00076 static char fmt_9997[] = "(1x,a3,\002 -- Complex Generalized eigenvalue "
00077 "problem\002)";
00078 static char fmt_9996[] = "(\002 Matrix types (see ZCHKGG for details):"
00079 " \002)";
00080 static char fmt_9995[] = "(\002 Special Matrices:\002,23x,\002(J'=transp"
00081 "osed Jordan block)\002,/\002 1=(0,0) 2=(I,0) 3=(0,I) 4=(I,I"
00082 ") 5=(J',J') \002,\0026=(diag(J',I), diag(I,J'))\002,/\002 Diag"
00083 "onal Matrices: ( \002,\002D=diag(0,1,2,...) )\002,/\002 7=(D,"
00084 "I) 9=(large*D, small*I\002,\002) 11=(large*I, small*D) 13=(l"
00085 "arge*D, large*I)\002,/\002 8=(I,D) 10=(small*D, large*I) 12="
00086 "(small*I, large*D) \002,\002 14=(small*D, small*I)\002,/\002 15"
00087 "=(D, reversed D)\002)";
00088 static char fmt_9994[] = "(\002 Matrices Rotated by Random \002,a,\002 M"
00089 "atrices U, V:\002,/\002 16=Transposed Jordan Blocks "
00090 " 19=geometric \002,\002alpha, beta=0,1\002,/\002 17=arithm. alp"
00091 "ha&beta \002,\002 20=arithmetic alpha, beta=0,"
00092 "1\002,/\002 18=clustered \002,\002alpha, beta=0,1 21"
00093 "=random alpha, beta=0,1\002,/\002 Large & Small Matrices:\002,"
00094 "/\002 22=(large, small) \002,\00223=(small,large) 24=(smal"
00095 "l,small) 25=(large,large)\002,/\002 26=random O(1) matrices"
00096 ".\002)";
00097 static char fmt_9993[] = "(/\002 Tests performed: (H is Hessenberg, S "
00098 "is Schur, B, \002,\002T, P are triangular,\002,/20x,\002U, V, Q,"
00099 " and Z are \002,a,\002, l and r are the\002,/20x,\002appropriate"
00100 " left and right eigenvectors, resp., a is\002,/20x,\002alpha, b "
00101 "is beta, and \002,a,\002 means \002,a,\002.)\002,/\002 1 = | A -"
00102 " U H V\002,a,\002 | / ( |A| n ulp ) 2 = | B - U T V\002,a"
00103 ",\002 | / ( |B| n ulp )\002,/\002 3 = | I - UU\002,a,\002 | / ( "
00104 "n ulp ) 4 = | I - VV\002,a,\002 | / ( n ulp )\002,"
00105 "/\002 5 = | H - Q S Z\002,a,\002 | / ( |H| n ulp )\002,6x,\0026 "
00106 "= | T - Q P Z\002,a,\002 | / ( |T| n ulp )\002,/\002 7 = | I - QQ"
00107 "\002,a,\002 | / ( n ulp ) 8 = | I - ZZ\002,a,\002 | "
00108 "/ ( n ulp )\002,/\002 9 = max | ( b S - a P )\002,a,\002 l | / c"
00109 "onst. 10 = max | ( b H - a T )\002,a,\002 l | / const.\002,/"
00110 "\002 11= max | ( b S - a P ) r | / const. 12 = max | ( b H\002,"
00111 "\002 - a T ) r | / const.\002,/1x)";
00112 static char fmt_9992[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00113 ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00114 ",0p,f8.2)";
00115 static char fmt_9991[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00116 ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00117 ",1p,d10.3)";
00118
00119
00120 integer a_dim1, a_offset, b_dim1, b_offset, evectl_dim1, evectl_offset,
00121 evectr_dim1, evectr_offset, h_dim1, h_offset, p1_dim1, p1_offset,
00122 p2_dim1, p2_offset, q_dim1, q_offset, s1_dim1, s1_offset, s2_dim1,
00123 s2_offset, t_dim1, t_offset, u_dim1, u_offset, v_dim1, v_offset,
00124 z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7;
00125 doublereal d__1, d__2;
00126 doublecomplex z__1, z__2, z__3;
00127
00128
00129 double d_sign(doublereal *, doublereal *), z_abs(doublecomplex *);
00130 void d_cnjg(doublecomplex *, doublecomplex *);
00131 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00132
00133
00134 integer j, n, i1, n1, jc, in, jr;
00135 doublereal ulp;
00136 integer iadd, nmax;
00137 doublereal temp1, temp2;
00138 logical badnn;
00139 doublereal dumma[4];
00140 integer iinfo;
00141 doublereal rmagn[4];
00142 doublecomplex ctemp;
00143 doublereal anorm, bnorm;
00144 extern int zget51_(integer *, integer *, doublecomplex *,
00145 integer *, doublecomplex *, integer *, doublecomplex *, integer *
00146 , doublecomplex *, integer *, doublecomplex *, doublereal *,
00147 doublereal *), zget52_(logical *, integer *, doublecomplex *,
00148 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00149 doublecomplex *, doublecomplex *, doublecomplex *, doublereal *,
00150 doublereal *);
00151 integer nmats, jsize, nerrs, jtype, ntest;
00152 extern int dlabad_(doublereal *, doublereal *), zgeqr2_(
00153 integer *, integer *, doublecomplex *, integer *, doublecomplex *,
00154 doublecomplex *, integer *), zlatm4_(integer *, integer *,
00155 integer *, integer *, logical *, doublereal *, doublereal *,
00156 doublereal *, integer *, integer *, doublecomplex *, integer *);
00157 extern doublereal dlamch_(char *);
00158 extern int zunm2r_(char *, char *, integer *, integer *,
00159 integer *, doublecomplex *, integer *, doublecomplex *,
00160 doublecomplex *, integer *, doublecomplex *, integer *);
00161 doublecomplex cdumma[4];
00162 doublereal safmin, safmax;
00163 integer ioldsd[4];
00164 extern doublereal zlange_(char *, integer *, integer *, doublecomplex *,
00165 integer *, doublereal *);
00166 extern int dlasum_(char *, integer *, integer *, integer
00167 *), xerbla_(char *, integer *);
00168 extern VOID zlarnd_(doublecomplex *, integer *,
00169 integer *);
00170 extern int zgghrd_(char *, char *, integer *, integer *,
00171 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00172 doublecomplex *, integer *, doublecomplex *, integer *, integer *
00173 ), zlacpy_(char *, integer *, integer *,
00174 doublecomplex *, integer *, doublecomplex *, integer *),
00175 zlarfg_(integer *, doublecomplex *, doublecomplex *, integer *,
00176 doublecomplex *), zlaset_(char *, integer *, integer *,
00177 doublecomplex *, doublecomplex *, doublecomplex *, integer *), ztgevc_(char *, char *, logical *, integer *,
00178 doublecomplex *, integer *, doublecomplex *, integer *,
00179 doublecomplex *, integer *, doublecomplex *, integer *, integer *,
00180 integer *, doublecomplex *, doublereal *, integer *), zhgeqz_(char *, char *, char *, integer *, integer *,
00181 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00182 doublecomplex *, doublecomplex *, doublecomplex *, integer *,
00183 doublecomplex *, integer *, doublecomplex *, integer *,
00184 doublereal *, integer *);
00185 doublereal ulpinv;
00186 integer lwkopt, mtypes, ntestt;
00187
00188
00189 static cilist io___41 = { 0, 0, 0, fmt_9999, 0 };
00190 static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00191 static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00192 static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00193 static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00194 static cilist io___46 = { 0, 0, 0, fmt_9999, 0 };
00195 static cilist io___47 = { 0, 0, 0, fmt_9999, 0 };
00196 static cilist io___48 = { 0, 0, 0, fmt_9999, 0 };
00197 static cilist io___51 = { 0, 0, 0, fmt_9999, 0 };
00198 static cilist io___52 = { 0, 0, 0, fmt_9999, 0 };
00199 static cilist io___54 = { 0, 0, 0, fmt_9998, 0 };
00200 static cilist io___55 = { 0, 0, 0, fmt_9999, 0 };
00201 static cilist io___56 = { 0, 0, 0, fmt_9998, 0 };
00202 static cilist io___57 = { 0, 0, 0, fmt_9999, 0 };
00203 static cilist io___58 = { 0, 0, 0, fmt_9999, 0 };
00204 static cilist io___59 = { 0, 0, 0, fmt_9998, 0 };
00205 static cilist io___60 = { 0, 0, 0, fmt_9999, 0 };
00206 static cilist io___61 = { 0, 0, 0, fmt_9998, 0 };
00207 static cilist io___64 = { 0, 0, 0, fmt_9997, 0 };
00208 static cilist io___65 = { 0, 0, 0, fmt_9996, 0 };
00209 static cilist io___66 = { 0, 0, 0, fmt_9995, 0 };
00210 static cilist io___67 = { 0, 0, 0, fmt_9994, 0 };
00211 static cilist io___68 = { 0, 0, 0, fmt_9993, 0 };
00212 static cilist io___69 = { 0, 0, 0, fmt_9992, 0 };
00213 static cilist io___70 = { 0, 0, 0, fmt_9991, 0 };
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583 --nn;
00584 --dotype;
00585 --iseed;
00586 p2_dim1 = *lda;
00587 p2_offset = 1 + p2_dim1;
00588 p2 -= p2_offset;
00589 p1_dim1 = *lda;
00590 p1_offset = 1 + p1_dim1;
00591 p1 -= p1_offset;
00592 s2_dim1 = *lda;
00593 s2_offset = 1 + s2_dim1;
00594 s2 -= s2_offset;
00595 s1_dim1 = *lda;
00596 s1_offset = 1 + s1_dim1;
00597 s1 -= s1_offset;
00598 t_dim1 = *lda;
00599 t_offset = 1 + t_dim1;
00600 t -= t_offset;
00601 h_dim1 = *lda;
00602 h_offset = 1 + h_dim1;
00603 h__ -= h_offset;
00604 b_dim1 = *lda;
00605 b_offset = 1 + b_dim1;
00606 b -= b_offset;
00607 a_dim1 = *lda;
00608 a_offset = 1 + a_dim1;
00609 a -= a_offset;
00610 evectr_dim1 = *ldu;
00611 evectr_offset = 1 + evectr_dim1;
00612 evectr -= evectr_offset;
00613 evectl_dim1 = *ldu;
00614 evectl_offset = 1 + evectl_dim1;
00615 evectl -= evectl_offset;
00616 z_dim1 = *ldu;
00617 z_offset = 1 + z_dim1;
00618 z__ -= z_offset;
00619 q_dim1 = *ldu;
00620 q_offset = 1 + q_dim1;
00621 q -= q_offset;
00622 v_dim1 = *ldu;
00623 v_offset = 1 + v_dim1;
00624 v -= v_offset;
00625 u_dim1 = *ldu;
00626 u_offset = 1 + u_dim1;
00627 u -= u_offset;
00628 --alpha1;
00629 --beta1;
00630 --alpha3;
00631 --beta3;
00632 --work;
00633 --rwork;
00634 --llwork;
00635 --result;
00636
00637
00638
00639
00640
00641
00642
00643 *info = 0;
00644
00645 badnn = FALSE_;
00646 nmax = 1;
00647 i__1 = *nsizes;
00648 for (j = 1; j <= i__1; ++j) {
00649
00650 i__2 = nmax, i__3 = nn[j];
00651 nmax = max(i__2,i__3);
00652 if (nn[j] < 0) {
00653 badnn = TRUE_;
00654 }
00655
00656 }
00657
00658
00659 i__1 = (nmax << 1) * nmax, i__2 = nmax << 2, i__1 = max(i__1,i__2);
00660 lwkopt = max(i__1,1);
00661
00662
00663
00664 if (*nsizes < 0) {
00665 *info = -1;
00666 } else if (badnn) {
00667 *info = -2;
00668 } else if (*ntypes < 0) {
00669 *info = -3;
00670 } else if (*thresh < 0.) {
00671 *info = -6;
00672 } else if (*lda <= 1 || *lda < nmax) {
00673 *info = -10;
00674 } else if (*ldu <= 1 || *ldu < nmax) {
00675 *info = -19;
00676 } else if (lwkopt > *lwork) {
00677 *info = -30;
00678 }
00679
00680 if (*info != 0) {
00681 i__1 = -(*info);
00682 xerbla_("ZCHKGG", &i__1);
00683 return 0;
00684 }
00685
00686
00687
00688 if (*nsizes == 0 || *ntypes == 0) {
00689 return 0;
00690 }
00691
00692 safmin = dlamch_("Safe minimum");
00693 ulp = dlamch_("Epsilon") * dlamch_("Base");
00694 safmin /= ulp;
00695 safmax = 1. / safmin;
00696 dlabad_(&safmin, &safmax);
00697 ulpinv = 1. / ulp;
00698
00699
00700
00701 rmagn[0] = 0.;
00702 rmagn[1] = 1.;
00703
00704
00705
00706 ntestt = 0;
00707 nerrs = 0;
00708 nmats = 0;
00709
00710 i__1 = *nsizes;
00711 for (jsize = 1; jsize <= i__1; ++jsize) {
00712 n = nn[jsize];
00713 n1 = max(1,n);
00714 rmagn[2] = safmax * ulp / (doublereal) n1;
00715 rmagn[3] = safmin * ulpinv * n1;
00716
00717 if (*nsizes != 1) {
00718 mtypes = min(26,*ntypes);
00719 } else {
00720 mtypes = min(27,*ntypes);
00721 }
00722
00723 i__2 = mtypes;
00724 for (jtype = 1; jtype <= i__2; ++jtype) {
00725 if (! dotype[jtype]) {
00726 goto L230;
00727 }
00728 ++nmats;
00729 ntest = 0;
00730
00731
00732
00733 for (j = 1; j <= 4; ++j) {
00734 ioldsd[j - 1] = iseed[j];
00735
00736 }
00737
00738
00739
00740 for (j = 1; j <= 15; ++j) {
00741 result[j] = 0.;
00742
00743 }
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766 if (mtypes > 26) {
00767 goto L110;
00768 }
00769 iinfo = 0;
00770 if (kclass[jtype - 1] < 3) {
00771
00772
00773
00774 if ((i__3 = katype[jtype - 1], abs(i__3)) == 3) {
00775 in = ((n - 1) / 2 << 1) + 1;
00776 if (in != n) {
00777 zlaset_("Full", &n, &n, &c_b1, &c_b1, &a[a_offset],
00778 lda);
00779 }
00780 } else {
00781 in = n;
00782 }
00783 zlatm4_(&katype[jtype - 1], &in, &kz1[kazero[jtype - 1] - 1],
00784 &kz2[kazero[jtype - 1] - 1], &lasign[jtype - 1], &
00785 rmagn[kamagn[jtype - 1]], &ulp, &rmagn[ktrian[jtype -
00786 1] * kamagn[jtype - 1]], &c__4, &iseed[1], &a[
00787 a_offset], lda);
00788 iadd = kadd[kazero[jtype - 1] - 1];
00789 if (iadd > 0 && iadd <= n) {
00790 i__3 = iadd + iadd * a_dim1;
00791 i__4 = kamagn[jtype - 1];
00792 a[i__3].r = rmagn[i__4], a[i__3].i = 0.;
00793 }
00794
00795
00796
00797 if ((i__3 = kbtype[jtype - 1], abs(i__3)) == 3) {
00798 in = ((n - 1) / 2 << 1) + 1;
00799 if (in != n) {
00800 zlaset_("Full", &n, &n, &c_b1, &c_b1, &b[b_offset],
00801 lda);
00802 }
00803 } else {
00804 in = n;
00805 }
00806 zlatm4_(&kbtype[jtype - 1], &in, &kz1[kbzero[jtype - 1] - 1],
00807 &kz2[kbzero[jtype - 1] - 1], &lbsign[jtype - 1], &
00808 rmagn[kbmagn[jtype - 1]], &c_b17, &rmagn[ktrian[jtype
00809 - 1] * kbmagn[jtype - 1]], &c__4, &iseed[1], &b[
00810 b_offset], lda);
00811 iadd = kadd[kbzero[jtype - 1] - 1];
00812 if (iadd != 0) {
00813 i__3 = iadd + iadd * b_dim1;
00814 i__4 = kbmagn[jtype - 1];
00815 b[i__3].r = rmagn[i__4], b[i__3].i = 0.;
00816 }
00817
00818 if (kclass[jtype - 1] == 2 && n > 0) {
00819
00820
00821
00822
00823
00824
00825
00826 i__3 = n - 1;
00827 for (jc = 1; jc <= i__3; ++jc) {
00828 i__4 = n;
00829 for (jr = jc; jr <= i__4; ++jr) {
00830 i__5 = jr + jc * u_dim1;
00831 zlarnd_(&z__1, &c__3, &iseed[1]);
00832 u[i__5].r = z__1.r, u[i__5].i = z__1.i;
00833 i__5 = jr + jc * v_dim1;
00834 zlarnd_(&z__1, &c__3, &iseed[1]);
00835 v[i__5].r = z__1.r, v[i__5].i = z__1.i;
00836
00837 }
00838 i__4 = n + 1 - jc;
00839 zlarfg_(&i__4, &u[jc + jc * u_dim1], &u[jc + 1 + jc *
00840 u_dim1], &c__1, &work[jc]);
00841 i__4 = (n << 1) + jc;
00842 i__5 = jc + jc * u_dim1;
00843 d__2 = u[i__5].r;
00844 d__1 = d_sign(&c_b17, &d__2);
00845 work[i__4].r = d__1, work[i__4].i = 0.;
00846 i__4 = jc + jc * u_dim1;
00847 u[i__4].r = 1., u[i__4].i = 0.;
00848 i__4 = n + 1 - jc;
00849 zlarfg_(&i__4, &v[jc + jc * v_dim1], &v[jc + 1 + jc *
00850 v_dim1], &c__1, &work[n + jc]);
00851 i__4 = n * 3 + jc;
00852 i__5 = jc + jc * v_dim1;
00853 d__2 = v[i__5].r;
00854 d__1 = d_sign(&c_b17, &d__2);
00855 work[i__4].r = d__1, work[i__4].i = 0.;
00856 i__4 = jc + jc * v_dim1;
00857 v[i__4].r = 1., v[i__4].i = 0.;
00858
00859 }
00860 zlarnd_(&z__1, &c__3, &iseed[1]);
00861 ctemp.r = z__1.r, ctemp.i = z__1.i;
00862 i__3 = n + n * u_dim1;
00863 u[i__3].r = 1., u[i__3].i = 0.;
00864 i__3 = n;
00865 work[i__3].r = 0., work[i__3].i = 0.;
00866 i__3 = n * 3;
00867 d__1 = z_abs(&ctemp);
00868 z__1.r = ctemp.r / d__1, z__1.i = ctemp.i / d__1;
00869 work[i__3].r = z__1.r, work[i__3].i = z__1.i;
00870 zlarnd_(&z__1, &c__3, &iseed[1]);
00871 ctemp.r = z__1.r, ctemp.i = z__1.i;
00872 i__3 = n + n * v_dim1;
00873 v[i__3].r = 1., v[i__3].i = 0.;
00874 i__3 = n << 1;
00875 work[i__3].r = 0., work[i__3].i = 0.;
00876 i__3 = n << 2;
00877 d__1 = z_abs(&ctemp);
00878 z__1.r = ctemp.r / d__1, z__1.i = ctemp.i / d__1;
00879 work[i__3].r = z__1.r, work[i__3].i = z__1.i;
00880
00881
00882
00883 i__3 = n;
00884 for (jc = 1; jc <= i__3; ++jc) {
00885 i__4 = n;
00886 for (jr = 1; jr <= i__4; ++jr) {
00887 i__5 = jr + jc * a_dim1;
00888 i__6 = (n << 1) + jr;
00889 d_cnjg(&z__3, &work[n * 3 + jc]);
00890 z__2.r = work[i__6].r * z__3.r - work[i__6].i *
00891 z__3.i, z__2.i = work[i__6].r * z__3.i +
00892 work[i__6].i * z__3.r;
00893 i__7 = jr + jc * a_dim1;
00894 z__1.r = z__2.r * a[i__7].r - z__2.i * a[i__7].i,
00895 z__1.i = z__2.r * a[i__7].i + z__2.i * a[
00896 i__7].r;
00897 a[i__5].r = z__1.r, a[i__5].i = z__1.i;
00898 i__5 = jr + jc * b_dim1;
00899 i__6 = (n << 1) + jr;
00900 d_cnjg(&z__3, &work[n * 3 + jc]);
00901 z__2.r = work[i__6].r * z__3.r - work[i__6].i *
00902 z__3.i, z__2.i = work[i__6].r * z__3.i +
00903 work[i__6].i * z__3.r;
00904 i__7 = jr + jc * b_dim1;
00905 z__1.r = z__2.r * b[i__7].r - z__2.i * b[i__7].i,
00906 z__1.i = z__2.r * b[i__7].i + z__2.i * b[
00907 i__7].r;
00908 b[i__5].r = z__1.r, b[i__5].i = z__1.i;
00909
00910 }
00911
00912 }
00913 i__3 = n - 1;
00914 zunm2r_("L", "N", &n, &n, &i__3, &u[u_offset], ldu, &work[
00915 1], &a[a_offset], lda, &work[(n << 1) + 1], &
00916 iinfo);
00917 if (iinfo != 0) {
00918 goto L100;
00919 }
00920 i__3 = n - 1;
00921 zunm2r_("R", "C", &n, &n, &i__3, &v[v_offset], ldu, &work[
00922 n + 1], &a[a_offset], lda, &work[(n << 1) + 1], &
00923 iinfo);
00924 if (iinfo != 0) {
00925 goto L100;
00926 }
00927 i__3 = n - 1;
00928 zunm2r_("L", "N", &n, &n, &i__3, &u[u_offset], ldu, &work[
00929 1], &b[b_offset], lda, &work[(n << 1) + 1], &
00930 iinfo);
00931 if (iinfo != 0) {
00932 goto L100;
00933 }
00934 i__3 = n - 1;
00935 zunm2r_("R", "C", &n, &n, &i__3, &v[v_offset], ldu, &work[
00936 n + 1], &b[b_offset], lda, &work[(n << 1) + 1], &
00937 iinfo);
00938 if (iinfo != 0) {
00939 goto L100;
00940 }
00941 }
00942 } else {
00943
00944
00945
00946 i__3 = n;
00947 for (jc = 1; jc <= i__3; ++jc) {
00948 i__4 = n;
00949 for (jr = 1; jr <= i__4; ++jr) {
00950 i__5 = jr + jc * a_dim1;
00951 i__6 = kamagn[jtype - 1];
00952 zlarnd_(&z__2, &c__4, &iseed[1]);
00953 z__1.r = rmagn[i__6] * z__2.r, z__1.i = rmagn[i__6] *
00954 z__2.i;
00955 a[i__5].r = z__1.r, a[i__5].i = z__1.i;
00956 i__5 = jr + jc * b_dim1;
00957 i__6 = kbmagn[jtype - 1];
00958 zlarnd_(&z__2, &c__4, &iseed[1]);
00959 z__1.r = rmagn[i__6] * z__2.r, z__1.i = rmagn[i__6] *
00960 z__2.i;
00961 b[i__5].r = z__1.r, b[i__5].i = z__1.i;
00962
00963 }
00964
00965 }
00966 }
00967
00968 anorm = zlange_("1", &n, &n, &a[a_offset], lda, &rwork[1]);
00969 bnorm = zlange_("1", &n, &n, &b[b_offset], lda, &rwork[1]);
00970
00971 L100:
00972
00973 if (iinfo != 0) {
00974 io___41.ciunit = *nounit;
00975 s_wsfe(&io___41);
00976 do_fio(&c__1, "Generator", (ftnlen)9);
00977 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00978 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00979 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00980 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00981 e_wsfe();
00982 *info = abs(iinfo);
00983 return 0;
00984 }
00985
00986 L110:
00987
00988
00989
00990 zlacpy_(" ", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00991 zlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00992 ntest = 1;
00993 result[1] = ulpinv;
00994
00995 zgeqr2_(&n, &n, &t[t_offset], lda, &work[1], &work[n + 1], &iinfo)
00996 ;
00997 if (iinfo != 0) {
00998 io___42.ciunit = *nounit;
00999 s_wsfe(&io___42);
01000 do_fio(&c__1, "ZGEQR2", (ftnlen)6);
01001 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01002 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01003 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01004 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01005 e_wsfe();
01006 *info = abs(iinfo);
01007 goto L210;
01008 }
01009
01010 zunm2r_("L", "C", &n, &n, &n, &t[t_offset], lda, &work[1], &h__[
01011 h_offset], lda, &work[n + 1], &iinfo);
01012 if (iinfo != 0) {
01013 io___43.ciunit = *nounit;
01014 s_wsfe(&io___43);
01015 do_fio(&c__1, "ZUNM2R", (ftnlen)6);
01016 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01017 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01018 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01019 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01020 e_wsfe();
01021 *info = abs(iinfo);
01022 goto L210;
01023 }
01024
01025 zlaset_("Full", &n, &n, &c_b1, &c_b2, &u[u_offset], ldu);
01026 zunm2r_("R", "N", &n, &n, &n, &t[t_offset], lda, &work[1], &u[
01027 u_offset], ldu, &work[n + 1], &iinfo);
01028 if (iinfo != 0) {
01029 io___44.ciunit = *nounit;
01030 s_wsfe(&io___44);
01031 do_fio(&c__1, "ZUNM2R", (ftnlen)6);
01032 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01033 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01034 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01035 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01036 e_wsfe();
01037 *info = abs(iinfo);
01038 goto L210;
01039 }
01040
01041 zgghrd_("V", "I", &n, &c__1, &n, &h__[h_offset], lda, &t[t_offset]
01042 , lda, &u[u_offset], ldu, &v[v_offset], ldu, &iinfo);
01043 if (iinfo != 0) {
01044 io___45.ciunit = *nounit;
01045 s_wsfe(&io___45);
01046 do_fio(&c__1, "ZGGHRD", (ftnlen)6);
01047 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01048 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01049 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01050 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01051 e_wsfe();
01052 *info = abs(iinfo);
01053 goto L210;
01054 }
01055 ntest = 4;
01056
01057
01058
01059 zget51_(&c__1, &n, &a[a_offset], lda, &h__[h_offset], lda, &u[
01060 u_offset], ldu, &v[v_offset], ldu, &work[1], &rwork[1], &
01061 result[1]);
01062 zget51_(&c__1, &n, &b[b_offset], lda, &t[t_offset], lda, &u[
01063 u_offset], ldu, &v[v_offset], ldu, &work[1], &rwork[1], &
01064 result[2]);
01065 zget51_(&c__3, &n, &b[b_offset], lda, &t[t_offset], lda, &u[
01066 u_offset], ldu, &u[u_offset], ldu, &work[1], &rwork[1], &
01067 result[3]);
01068 zget51_(&c__3, &n, &b[b_offset], lda, &t[t_offset], lda, &v[
01069 v_offset], ldu, &v[v_offset], ldu, &work[1], &rwork[1], &
01070 result[4]);
01071
01072
01073
01074
01075
01076
01077
01078 zlacpy_(" ", &n, &n, &h__[h_offset], lda, &s2[s2_offset], lda);
01079 zlacpy_(" ", &n, &n, &t[t_offset], lda, &p2[p2_offset], lda);
01080 ntest = 5;
01081 result[5] = ulpinv;
01082
01083 zhgeqz_("E", "N", "N", &n, &c__1, &n, &s2[s2_offset], lda, &p2[
01084 p2_offset], lda, &alpha3[1], &beta3[1], &q[q_offset], ldu,
01085 &z__[z_offset], ldu, &work[1], lwork, &rwork[1], &iinfo);
01086 if (iinfo != 0) {
01087 io___46.ciunit = *nounit;
01088 s_wsfe(&io___46);
01089 do_fio(&c__1, "ZHGEQZ(E)", (ftnlen)9);
01090 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01091 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01092 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01093 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01094 e_wsfe();
01095 *info = abs(iinfo);
01096 goto L210;
01097 }
01098
01099
01100
01101 zlacpy_(" ", &n, &n, &h__[h_offset], lda, &s2[s2_offset], lda);
01102 zlacpy_(" ", &n, &n, &t[t_offset], lda, &p2[p2_offset], lda);
01103
01104 zhgeqz_("S", "N", "N", &n, &c__1, &n, &s2[s2_offset], lda, &p2[
01105 p2_offset], lda, &alpha1[1], &beta1[1], &q[q_offset], ldu,
01106 &z__[z_offset], ldu, &work[1], lwork, &rwork[1], &iinfo);
01107 if (iinfo != 0) {
01108 io___47.ciunit = *nounit;
01109 s_wsfe(&io___47);
01110 do_fio(&c__1, "ZHGEQZ(S)", (ftnlen)9);
01111 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01112 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01113 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01114 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01115 e_wsfe();
01116 *info = abs(iinfo);
01117 goto L210;
01118 }
01119
01120
01121
01122 zlacpy_(" ", &n, &n, &h__[h_offset], lda, &s1[s1_offset], lda);
01123 zlacpy_(" ", &n, &n, &t[t_offset], lda, &p1[p1_offset], lda);
01124
01125 zhgeqz_("S", "I", "I", &n, &c__1, &n, &s1[s1_offset], lda, &p1[
01126 p1_offset], lda, &alpha1[1], &beta1[1], &q[q_offset], ldu,
01127 &z__[z_offset], ldu, &work[1], lwork, &rwork[1], &iinfo);
01128 if (iinfo != 0) {
01129 io___48.ciunit = *nounit;
01130 s_wsfe(&io___48);
01131 do_fio(&c__1, "ZHGEQZ(V)", (ftnlen)9);
01132 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01133 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01134 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01135 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01136 e_wsfe();
01137 *info = abs(iinfo);
01138 goto L210;
01139 }
01140
01141 ntest = 8;
01142
01143
01144
01145 zget51_(&c__1, &n, &h__[h_offset], lda, &s1[s1_offset], lda, &q[
01146 q_offset], ldu, &z__[z_offset], ldu, &work[1], &rwork[1],
01147 &result[5]);
01148 zget51_(&c__1, &n, &t[t_offset], lda, &p1[p1_offset], lda, &q[
01149 q_offset], ldu, &z__[z_offset], ldu, &work[1], &rwork[1],
01150 &result[6]);
01151 zget51_(&c__3, &n, &t[t_offset], lda, &p1[p1_offset], lda, &q[
01152 q_offset], ldu, &q[q_offset], ldu, &work[1], &rwork[1], &
01153 result[7]);
01154 zget51_(&c__3, &n, &t[t_offset], lda, &p1[p1_offset], lda, &z__[
01155 z_offset], ldu, &z__[z_offset], ldu, &work[1], &rwork[1],
01156 &result[8]);
01157
01158
01159
01160
01161
01162
01163 ntest = 9;
01164 result[9] = ulpinv;
01165
01166
01167
01168
01169 i1 = n / 2;
01170 i__3 = i1;
01171 for (j = 1; j <= i__3; ++j) {
01172 llwork[j] = TRUE_;
01173
01174 }
01175 i__3 = n;
01176 for (j = i1 + 1; j <= i__3; ++j) {
01177 llwork[j] = FALSE_;
01178
01179 }
01180
01181 ztgevc_("L", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01182 p1_offset], lda, &evectl[evectl_offset], ldu, cdumma, ldu,
01183 &n, &in, &work[1], &rwork[1], &iinfo);
01184 if (iinfo != 0) {
01185 io___51.ciunit = *nounit;
01186 s_wsfe(&io___51);
01187 do_fio(&c__1, "ZTGEVC(L,S1)", (ftnlen)12);
01188 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01189 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01190 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01191 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01192 e_wsfe();
01193 *info = abs(iinfo);
01194 goto L210;
01195 }
01196
01197 i1 = in;
01198 i__3 = i1;
01199 for (j = 1; j <= i__3; ++j) {
01200 llwork[j] = FALSE_;
01201
01202 }
01203 i__3 = n;
01204 for (j = i1 + 1; j <= i__3; ++j) {
01205 llwork[j] = TRUE_;
01206
01207 }
01208
01209 ztgevc_("L", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01210 p1_offset], lda, &evectl[(i1 + 1) * evectl_dim1 + 1], ldu,
01211 cdumma, ldu, &n, &in, &work[1], &rwork[1], &iinfo);
01212 if (iinfo != 0) {
01213 io___52.ciunit = *nounit;
01214 s_wsfe(&io___52);
01215 do_fio(&c__1, "ZTGEVC(L,S2)", (ftnlen)12);
01216 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01217 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01218 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01219 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01220 e_wsfe();
01221 *info = abs(iinfo);
01222 goto L210;
01223 }
01224
01225 zget52_(&c_true, &n, &s1[s1_offset], lda, &p1[p1_offset], lda, &
01226 evectl[evectl_offset], ldu, &alpha1[1], &beta1[1], &work[
01227 1], &rwork[1], dumma);
01228 result[9] = dumma[0];
01229 if (dumma[1] > *thrshn) {
01230 io___54.ciunit = *nounit;
01231 s_wsfe(&io___54);
01232 do_fio(&c__1, "Left", (ftnlen)4);
01233 do_fio(&c__1, "ZTGEVC(HOWMNY=S)", (ftnlen)16);
01234 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01235 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01236 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01237 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01238 e_wsfe();
01239 }
01240
01241
01242
01243
01244 ntest = 10;
01245 result[10] = ulpinv;
01246 zlacpy_("F", &n, &n, &q[q_offset], ldu, &evectl[evectl_offset],
01247 ldu);
01248 ztgevc_("L", "B", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01249 p1_offset], lda, &evectl[evectl_offset], ldu, cdumma, ldu,
01250 &n, &in, &work[1], &rwork[1], &iinfo);
01251 if (iinfo != 0) {
01252 io___55.ciunit = *nounit;
01253 s_wsfe(&io___55);
01254 do_fio(&c__1, "ZTGEVC(L,B)", (ftnlen)11);
01255 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01256 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01257 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01258 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01259 e_wsfe();
01260 *info = abs(iinfo);
01261 goto L210;
01262 }
01263
01264 zget52_(&c_true, &n, &h__[h_offset], lda, &t[t_offset], lda, &
01265 evectl[evectl_offset], ldu, &alpha1[1], &beta1[1], &work[
01266 1], &rwork[1], dumma);
01267 result[10] = dumma[0];
01268 if (dumma[1] > *thrshn) {
01269 io___56.ciunit = *nounit;
01270 s_wsfe(&io___56);
01271 do_fio(&c__1, "Left", (ftnlen)4);
01272 do_fio(&c__1, "ZTGEVC(HOWMNY=B)", (ftnlen)16);
01273 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01274 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01275 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01276 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01277 e_wsfe();
01278 }
01279
01280
01281
01282
01283 ntest = 11;
01284 result[11] = ulpinv;
01285
01286
01287
01288
01289 i1 = n / 2;
01290 i__3 = i1;
01291 for (j = 1; j <= i__3; ++j) {
01292 llwork[j] = TRUE_;
01293
01294 }
01295 i__3 = n;
01296 for (j = i1 + 1; j <= i__3; ++j) {
01297 llwork[j] = FALSE_;
01298
01299 }
01300
01301 ztgevc_("R", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01302 p1_offset], lda, cdumma, ldu, &evectr[evectr_offset], ldu,
01303 &n, &in, &work[1], &rwork[1], &iinfo);
01304 if (iinfo != 0) {
01305 io___57.ciunit = *nounit;
01306 s_wsfe(&io___57);
01307 do_fio(&c__1, "ZTGEVC(R,S1)", (ftnlen)12);
01308 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01309 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01310 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01311 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01312 e_wsfe();
01313 *info = abs(iinfo);
01314 goto L210;
01315 }
01316
01317 i1 = in;
01318 i__3 = i1;
01319 for (j = 1; j <= i__3; ++j) {
01320 llwork[j] = FALSE_;
01321
01322 }
01323 i__3 = n;
01324 for (j = i1 + 1; j <= i__3; ++j) {
01325 llwork[j] = TRUE_;
01326
01327 }
01328
01329 ztgevc_("R", "S", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01330 p1_offset], lda, cdumma, ldu, &evectr[(i1 + 1) *
01331 evectr_dim1 + 1], ldu, &n, &in, &work[1], &rwork[1], &
01332 iinfo);
01333 if (iinfo != 0) {
01334 io___58.ciunit = *nounit;
01335 s_wsfe(&io___58);
01336 do_fio(&c__1, "ZTGEVC(R,S2)", (ftnlen)12);
01337 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01338 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01339 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01340 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01341 e_wsfe();
01342 *info = abs(iinfo);
01343 goto L210;
01344 }
01345
01346 zget52_(&c_false, &n, &s1[s1_offset], lda, &p1[p1_offset], lda, &
01347 evectr[evectr_offset], ldu, &alpha1[1], &beta1[1], &work[
01348 1], &rwork[1], dumma);
01349 result[11] = dumma[0];
01350 if (dumma[1] > *thresh) {
01351 io___59.ciunit = *nounit;
01352 s_wsfe(&io___59);
01353 do_fio(&c__1, "Right", (ftnlen)5);
01354 do_fio(&c__1, "ZTGEVC(HOWMNY=S)", (ftnlen)16);
01355 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01356 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01357 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01358 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01359 e_wsfe();
01360 }
01361
01362
01363
01364
01365 ntest = 12;
01366 result[12] = ulpinv;
01367 zlacpy_("F", &n, &n, &z__[z_offset], ldu, &evectr[evectr_offset],
01368 ldu);
01369 ztgevc_("R", "B", &llwork[1], &n, &s1[s1_offset], lda, &p1[
01370 p1_offset], lda, cdumma, ldu, &evectr[evectr_offset], ldu,
01371 &n, &in, &work[1], &rwork[1], &iinfo);
01372 if (iinfo != 0) {
01373 io___60.ciunit = *nounit;
01374 s_wsfe(&io___60);
01375 do_fio(&c__1, "ZTGEVC(R,B)", (ftnlen)11);
01376 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01377 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01378 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01379 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01380 e_wsfe();
01381 *info = abs(iinfo);
01382 goto L210;
01383 }
01384
01385 zget52_(&c_false, &n, &h__[h_offset], lda, &t[t_offset], lda, &
01386 evectr[evectr_offset], ldu, &alpha1[1], &beta1[1], &work[
01387 1], &rwork[1], dumma);
01388 result[12] = dumma[0];
01389 if (dumma[1] > *thresh) {
01390 io___61.ciunit = *nounit;
01391 s_wsfe(&io___61);
01392 do_fio(&c__1, "Right", (ftnlen)5);
01393 do_fio(&c__1, "ZTGEVC(HOWMNY=B)", (ftnlen)16);
01394 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01395 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01396 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01397 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01398 e_wsfe();
01399 }
01400
01401
01402
01403 if (*tstdif) {
01404
01405
01406
01407 zget51_(&c__2, &n, &s1[s1_offset], lda, &s2[s2_offset], lda, &
01408 q[q_offset], ldu, &z__[z_offset], ldu, &work[1], &
01409 rwork[1], &result[13]);
01410 zget51_(&c__2, &n, &p1[p1_offset], lda, &p2[p2_offset], lda, &
01411 q[q_offset], ldu, &z__[z_offset], ldu, &work[1], &
01412 rwork[1], &result[14]);
01413
01414
01415
01416 temp1 = 0.;
01417 temp2 = 0.;
01418 i__3 = n;
01419 for (j = 1; j <= i__3; ++j) {
01420
01421 i__4 = j;
01422 i__5 = j;
01423 z__1.r = alpha1[i__4].r - alpha3[i__5].r, z__1.i = alpha1[
01424 i__4].i - alpha3[i__5].i;
01425 d__1 = temp1, d__2 = z_abs(&z__1);
01426 temp1 = max(d__1,d__2);
01427
01428 i__4 = j;
01429 i__5 = j;
01430 z__1.r = beta1[i__4].r - beta3[i__5].r, z__1.i = beta1[
01431 i__4].i - beta3[i__5].i;
01432 d__1 = temp2, d__2 = z_abs(&z__1);
01433 temp2 = max(d__1,d__2);
01434
01435 }
01436
01437
01438 d__1 = safmin, d__2 = ulp * max(temp1,anorm);
01439 temp1 /= max(d__1,d__2);
01440
01441 d__1 = safmin, d__2 = ulp * max(temp2,bnorm);
01442 temp2 /= max(d__1,d__2);
01443 result[15] = max(temp1,temp2);
01444 ntest = 15;
01445 } else {
01446 result[13] = 0.;
01447 result[14] = 0.;
01448 result[15] = 0.;
01449 ntest = 12;
01450 }
01451
01452
01453
01454 L210:
01455
01456 ntestt += ntest;
01457
01458
01459
01460 i__3 = ntest;
01461 for (jr = 1; jr <= i__3; ++jr) {
01462 if (result[jr] >= *thresh) {
01463
01464
01465
01466
01467 if (nerrs == 0) {
01468 io___64.ciunit = *nounit;
01469 s_wsfe(&io___64);
01470 do_fio(&c__1, "ZGG", (ftnlen)3);
01471 e_wsfe();
01472
01473
01474
01475 io___65.ciunit = *nounit;
01476 s_wsfe(&io___65);
01477 e_wsfe();
01478 io___66.ciunit = *nounit;
01479 s_wsfe(&io___66);
01480 e_wsfe();
01481 io___67.ciunit = *nounit;
01482 s_wsfe(&io___67);
01483 do_fio(&c__1, "Unitary", (ftnlen)7);
01484 e_wsfe();
01485
01486
01487
01488 io___68.ciunit = *nounit;
01489 s_wsfe(&io___68);
01490 do_fio(&c__1, "unitary", (ftnlen)7);
01491 do_fio(&c__1, "*", (ftnlen)1);
01492 do_fio(&c__1, "conjugate transpose", (ftnlen)19);
01493 for (j = 1; j <= 10; ++j) {
01494 do_fio(&c__1, "*", (ftnlen)1);
01495 }
01496 e_wsfe();
01497
01498 }
01499 ++nerrs;
01500 if (result[jr] < 1e4) {
01501 io___69.ciunit = *nounit;
01502 s_wsfe(&io___69);
01503 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01504 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01505 ;
01506 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01507 integer));
01508 do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01509 do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01510 doublereal));
01511 e_wsfe();
01512 } else {
01513 io___70.ciunit = *nounit;
01514 s_wsfe(&io___70);
01515 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01516 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01517 ;
01518 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01519 integer));
01520 do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01521 do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01522 doublereal));
01523 e_wsfe();
01524 }
01525 }
01526
01527 }
01528
01529 L230:
01530 ;
01531 }
01532
01533 }
01534
01535
01536
01537 dlasum_("ZGG", nounit, &nerrs, &ntestt);
01538 return 0;
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549 }