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 integer c__1 = 1;
00019 static integer c__0 = 0;
00020 static doublereal c_b17 = 0.;
00021 static integer c__2 = 2;
00022 static doublereal c_b23 = 1.;
00023 static integer c__3 = 3;
00024 static integer c__4 = 4;
00025 static logical c_true = TRUE_;
00026 static logical c_false = FALSE_;
00027
00028 int ddrgev_(integer *nsizes, integer *nn, integer *ntypes,
00029 logical *dotype, integer *iseed, doublereal *thresh, integer *nounit,
00030 doublereal *a, integer *lda, doublereal *b, doublereal *s, doublereal
00031 *t, doublereal *q, integer *ldq, doublereal *z__, doublereal *qe,
00032 integer *ldqe, doublereal *alphar, doublereal *alphai, doublereal *
00033 beta, doublereal *alphr1, doublereal *alphi1, doublereal *beta1,
00034 doublereal *work, integer *lwork, doublereal *result, integer *info)
00035 {
00036
00037
00038 static integer kclass[26] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,
00039 2,2,2,3 };
00040 static integer kbmagn[26] = { 1,1,1,1,1,1,1,1,3,2,3,2,2,3,1,1,1,1,1,1,1,3,
00041 2,3,2,1 };
00042 static integer ktrian[26] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
00043 1,1,1,1 };
00044 static integer iasign[26] = { 0,0,0,0,0,0,2,0,2,2,0,0,2,2,2,0,2,0,0,0,2,2,
00045 2,2,2,0 };
00046 static integer ibsign[26] = { 0,0,0,0,0,0,0,2,0,0,2,2,0,0,2,0,2,0,0,0,0,0,
00047 0,0,0,0 };
00048 static integer kz1[6] = { 0,1,2,1,3,3 };
00049 static integer kz2[6] = { 0,0,1,2,1,1 };
00050 static integer kadd[6] = { 0,0,0,0,3,2 };
00051 static integer katype[26] = { 0,1,0,1,2,3,4,1,4,4,1,1,4,4,4,2,4,5,8,7,9,4,
00052 4,4,4,0 };
00053 static integer kbtype[26] = { 0,0,1,1,2,-3,1,4,1,1,4,4,1,1,-4,2,-4,8,8,8,
00054 8,8,8,8,8,0 };
00055 static integer kazero[26] = { 1,1,1,1,1,1,2,1,2,2,1,1,2,2,3,1,3,5,5,5,5,3,
00056 3,3,3,1 };
00057 static integer kbzero[26] = { 1,1,1,1,1,1,1,2,1,1,2,2,1,1,4,1,4,6,6,6,6,4,
00058 4,4,4,1 };
00059 static integer kamagn[26] = { 1,1,1,1,1,1,1,1,2,3,2,3,2,3,1,1,1,1,1,1,1,2,
00060 3,3,2,1 };
00061
00062
00063 static char fmt_9999[] = "(\002 DDRGEV: \002,a,\002 returned INFO=\002,i"
00064 "6,\002.\002,/3x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00065 "(\002,4(i4,\002,\002),i5,\002)\002)";
00066 static char fmt_9998[] = "(\002 DDRGEV: \002,a,\002 Eigenvectors from"
00067 " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00068 "error=\002,0p,g10.3,\002,\002,3x,\002N=\002,i4,\002, JTYPE=\002,"
00069 "i3,\002, ISEED=(\002,4(i4,\002,\002),i5,\002)\002)";
00070 static char fmt_9997[] = "(/1x,a3,\002 -- Real Generalized eigenvalue pr"
00071 "oblem driver\002)";
00072 static char fmt_9996[] = "(\002 Matrix types (see DDRGEV for details):"
00073 " \002)";
00074 static char fmt_9995[] = "(\002 Special Matrices:\002,23x,\002(J'=transp"
00075 "osed Jordan block)\002,/\002 1=(0,0) 2=(I,0) 3=(0,I) 4=(I,I"
00076 ") 5=(J',J') \002,\0026=(diag(J',I), diag(I,J'))\002,/\002 Diag"
00077 "onal Matrices: ( \002,\002D=diag(0,1,2,...) )\002,/\002 7=(D,"
00078 "I) 9=(large*D, small*I\002,\002) 11=(large*I, small*D) 13=(l"
00079 "arge*D, large*I)\002,/\002 8=(I,D) 10=(small*D, large*I) 12="
00080 "(small*I, large*D) \002,\002 14=(small*D, small*I)\002,/\002 15"
00081 "=(D, reversed D)\002)";
00082 static char fmt_9994[] = "(\002 Matrices Rotated by Random \002,a,\002 M"
00083 "atrices U, V:\002,/\002 16=Transposed Jordan Blocks "
00084 " 19=geometric \002,\002alpha, beta=0,1\002,/\002 17=arithm. alp"
00085 "ha&beta \002,\002 20=arithmetic alpha, beta=0,"
00086 "1\002,/\002 18=clustered \002,\002alpha, beta=0,1 21"
00087 "=random alpha, beta=0,1\002,/\002 Large & Small Matrices:\002,"
00088 "/\002 22=(large, small) \002,\00223=(small,large) 24=(smal"
00089 "l,small) 25=(large,large)\002,/\002 26=random O(1) matrices"
00090 ".\002)";
00091 static char fmt_9993[] = "(/\002 Tests performed: \002,/\002 1 = max "
00092 "| ( b A - a B )'*l | / const.,\002,/\002 2 = | |VR(i)| - 1 | / u"
00093 "lp,\002,/\002 3 = max | ( b A - a B )*r | / const.\002,/\002 4 ="
00094 " | |VL(i)| - 1 | / ulp,\002,/\002 5 = 0 if W same no matter if r"
00095 " or l computed,\002,/\002 6 = 0 if l same no matter if l compute"
00096 "d,\002,/\002 7 = 0 if r same no matter if r computed,\002,/1x)";
00097 static char fmt_9992[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00098 ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00099 ",0p,f8.2)";
00100 static char fmt_9991[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00101 ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i2,\002 is\002"
00102 ",1p,d10.3)";
00103
00104
00105 integer a_dim1, a_offset, b_dim1, b_offset, q_dim1, q_offset, qe_dim1,
00106 qe_offset, s_dim1, s_offset, t_dim1, t_offset, z_dim1, z_offset,
00107 i__1, i__2, i__3, i__4;
00108 doublereal d__1;
00109
00110
00111 double d_sign(doublereal *, doublereal *);
00112 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00113
00114
00115 integer i__, j, n, n1, jc, in, jr;
00116 doublereal ulp;
00117 integer iadd, ierr, nmax;
00118 logical badnn;
00119 extern int dget52_(logical *, integer *, doublereal *,
00120 integer *, doublereal *, integer *, doublereal *, integer *,
00121 doublereal *, doublereal *, doublereal *, doublereal *,
00122 doublereal *), dggev_(char *, char *, integer *, doublereal *,
00123 integer *, doublereal *, integer *, doublereal *, doublereal *,
00124 doublereal *, doublereal *, integer *, doublereal *, integer *,
00125 doublereal *, integer *, integer *);
00126 doublereal rmagn[4];
00127 integer nmats, jsize, nerrs, jtype;
00128 extern int dlatm4_(integer *, integer *, integer *,
00129 integer *, integer *, doublereal *, doublereal *, doublereal *,
00130 integer *, integer *, doublereal *, integer *), dorm2r_(char *,
00131 char *, integer *, integer *, integer *, doublereal *, integer *,
00132 doublereal *, doublereal *, integer *, doublereal *, integer *), dlabad_(doublereal *, doublereal *);
00133 extern doublereal dlamch_(char *);
00134 extern int dlarfg_(integer *, doublereal *, doublereal *,
00135 integer *, doublereal *);
00136 extern doublereal dlarnd_(integer *, integer *);
00137 doublereal safmin;
00138 integer ioldsd[4];
00139 doublereal safmax;
00140 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
00141 integer *, integer *);
00142 extern int dlacpy_(char *, integer *, integer *,
00143 doublereal *, integer *, doublereal *, integer *),
00144 alasvm_(char *, integer *, integer *, integer *, integer *), dlaset_(char *, integer *, integer *, doublereal *,
00145 doublereal *, doublereal *, integer *), xerbla_(char *,
00146 integer *);
00147 integer minwrk, maxwrk;
00148 doublereal ulpinv;
00149 integer mtypes, ntestt;
00150
00151
00152 static cilist io___38 = { 0, 0, 0, fmt_9999, 0 };
00153 static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00154 static cilist io___41 = { 0, 0, 0, fmt_9998, 0 };
00155 static cilist io___42 = { 0, 0, 0, fmt_9998, 0 };
00156 static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00157 static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00158 static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00159 static cilist io___46 = { 0, 0, 0, fmt_9997, 0 };
00160 static cilist io___47 = { 0, 0, 0, fmt_9996, 0 };
00161 static cilist io___48 = { 0, 0, 0, fmt_9995, 0 };
00162 static cilist io___49 = { 0, 0, 0, fmt_9994, 0 };
00163 static cilist io___50 = { 0, 0, 0, fmt_9993, 0 };
00164 static cilist io___51 = { 0, 0, 0, fmt_9992, 0 };
00165 static cilist io___52 = { 0, 0, 0, fmt_9991, 0 };
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
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 --nn;
00466 --dotype;
00467 --iseed;
00468 t_dim1 = *lda;
00469 t_offset = 1 + t_dim1;
00470 t -= t_offset;
00471 s_dim1 = *lda;
00472 s_offset = 1 + s_dim1;
00473 s -= s_offset;
00474 b_dim1 = *lda;
00475 b_offset = 1 + b_dim1;
00476 b -= b_offset;
00477 a_dim1 = *lda;
00478 a_offset = 1 + a_dim1;
00479 a -= a_offset;
00480 z_dim1 = *ldq;
00481 z_offset = 1 + z_dim1;
00482 z__ -= z_offset;
00483 q_dim1 = *ldq;
00484 q_offset = 1 + q_dim1;
00485 q -= q_offset;
00486 qe_dim1 = *ldqe;
00487 qe_offset = 1 + qe_dim1;
00488 qe -= qe_offset;
00489 --alphar;
00490 --alphai;
00491 --beta;
00492 --alphr1;
00493 --alphi1;
00494 --beta1;
00495 --work;
00496 --result;
00497
00498
00499
00500
00501
00502
00503
00504 *info = 0;
00505
00506 badnn = FALSE_;
00507 nmax = 1;
00508 i__1 = *nsizes;
00509 for (j = 1; j <= i__1; ++j) {
00510
00511 i__2 = nmax, i__3 = nn[j];
00512 nmax = max(i__2,i__3);
00513 if (nn[j] < 0) {
00514 badnn = TRUE_;
00515 }
00516
00517 }
00518
00519 if (*nsizes < 0) {
00520 *info = -1;
00521 } else if (badnn) {
00522 *info = -2;
00523 } else if (*ntypes < 0) {
00524 *info = -3;
00525 } else if (*thresh < 0.) {
00526 *info = -6;
00527 } else if (*lda <= 1 || *lda < nmax) {
00528 *info = -9;
00529 } else if (*ldq <= 1 || *ldq < nmax) {
00530 *info = -14;
00531 } else if (*ldqe <= 1 || *ldqe < nmax) {
00532 *info = -17;
00533 }
00534
00535
00536
00537
00538
00539
00540
00541
00542 minwrk = 1;
00543 if (*info == 0 && *lwork >= 1) {
00544
00545 i__1 = 1, i__2 = nmax << 3, i__1 = max(i__1,i__2), i__2 = nmax * (
00546 nmax + 1);
00547 minwrk = max(i__1,i__2);
00548 maxwrk = nmax * 7 + nmax * ilaenv_(&c__1, "DGEQRF", " ", &nmax, &c__1,
00549 &nmax, &c__0);
00550
00551 i__1 = maxwrk, i__2 = nmax * (nmax + 1);
00552 maxwrk = max(i__1,i__2);
00553 work[1] = (doublereal) maxwrk;
00554 }
00555
00556 if (*lwork < minwrk) {
00557 *info = -25;
00558 }
00559
00560 if (*info != 0) {
00561 i__1 = -(*info);
00562 xerbla_("DDRGEV", &i__1);
00563 return 0;
00564 }
00565
00566
00567
00568 if (*nsizes == 0 || *ntypes == 0) {
00569 return 0;
00570 }
00571
00572 safmin = dlamch_("Safe minimum");
00573 ulp = dlamch_("Epsilon") * dlamch_("Base");
00574 safmin /= ulp;
00575 safmax = 1. / safmin;
00576 dlabad_(&safmin, &safmax);
00577 ulpinv = 1. / ulp;
00578
00579
00580
00581 rmagn[0] = 0.;
00582 rmagn[1] = 1.;
00583
00584
00585
00586 ntestt = 0;
00587 nerrs = 0;
00588 nmats = 0;
00589
00590 i__1 = *nsizes;
00591 for (jsize = 1; jsize <= i__1; ++jsize) {
00592 n = nn[jsize];
00593 n1 = max(1,n);
00594 rmagn[2] = safmax * ulp / (doublereal) n1;
00595 rmagn[3] = safmin * ulpinv * n1;
00596
00597 if (*nsizes != 1) {
00598 mtypes = min(26,*ntypes);
00599 } else {
00600 mtypes = min(27,*ntypes);
00601 }
00602
00603 i__2 = mtypes;
00604 for (jtype = 1; jtype <= i__2; ++jtype) {
00605 if (! dotype[jtype]) {
00606 goto L210;
00607 }
00608 ++nmats;
00609
00610
00611
00612 for (j = 1; j <= 4; ++j) {
00613 ioldsd[j - 1] = iseed[j];
00614
00615 }
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640 if (mtypes > 26) {
00641 goto L100;
00642 }
00643 ierr = 0;
00644 if (kclass[jtype - 1] < 3) {
00645
00646
00647
00648 if ((i__3 = katype[jtype - 1], abs(i__3)) == 3) {
00649 in = ((n - 1) / 2 << 1) + 1;
00650 if (in != n) {
00651 dlaset_("Full", &n, &n, &c_b17, &c_b17, &a[a_offset],
00652 lda);
00653 }
00654 } else {
00655 in = n;
00656 }
00657 dlatm4_(&katype[jtype - 1], &in, &kz1[kazero[jtype - 1] - 1],
00658 &kz2[kazero[jtype - 1] - 1], &iasign[jtype - 1], &
00659 rmagn[kamagn[jtype - 1]], &ulp, &rmagn[ktrian[jtype -
00660 1] * kamagn[jtype - 1]], &c__2, &iseed[1], &a[
00661 a_offset], lda);
00662 iadd = kadd[kazero[jtype - 1] - 1];
00663 if (iadd > 0 && iadd <= n) {
00664 a[iadd + iadd * a_dim1] = 1.;
00665 }
00666
00667
00668
00669 if ((i__3 = kbtype[jtype - 1], abs(i__3)) == 3) {
00670 in = ((n - 1) / 2 << 1) + 1;
00671 if (in != n) {
00672 dlaset_("Full", &n, &n, &c_b17, &c_b17, &b[b_offset],
00673 lda);
00674 }
00675 } else {
00676 in = n;
00677 }
00678 dlatm4_(&kbtype[jtype - 1], &in, &kz1[kbzero[jtype - 1] - 1],
00679 &kz2[kbzero[jtype - 1] - 1], &ibsign[jtype - 1], &
00680 rmagn[kbmagn[jtype - 1]], &c_b23, &rmagn[ktrian[jtype
00681 - 1] * kbmagn[jtype - 1]], &c__2, &iseed[1], &b[
00682 b_offset], lda);
00683 iadd = kadd[kbzero[jtype - 1] - 1];
00684 if (iadd != 0 && iadd <= n) {
00685 b[iadd + iadd * b_dim1] = 1.;
00686 }
00687
00688 if (kclass[jtype - 1] == 2 && n > 0) {
00689
00690
00691
00692
00693
00694
00695 i__3 = n - 1;
00696 for (jc = 1; jc <= i__3; ++jc) {
00697 i__4 = n;
00698 for (jr = jc; jr <= i__4; ++jr) {
00699 q[jr + jc * q_dim1] = dlarnd_(&c__3, &iseed[1]);
00700 z__[jr + jc * z_dim1] = dlarnd_(&c__3, &iseed[1]);
00701
00702 }
00703 i__4 = n + 1 - jc;
00704 dlarfg_(&i__4, &q[jc + jc * q_dim1], &q[jc + 1 + jc *
00705 q_dim1], &c__1, &work[jc]);
00706 work[(n << 1) + jc] = d_sign(&c_b23, &q[jc + jc *
00707 q_dim1]);
00708 q[jc + jc * q_dim1] = 1.;
00709 i__4 = n + 1 - jc;
00710 dlarfg_(&i__4, &z__[jc + jc * z_dim1], &z__[jc + 1 +
00711 jc * z_dim1], &c__1, &work[n + jc]);
00712 work[n * 3 + jc] = d_sign(&c_b23, &z__[jc + jc *
00713 z_dim1]);
00714 z__[jc + jc * z_dim1] = 1.;
00715
00716 }
00717 q[n + n * q_dim1] = 1.;
00718 work[n] = 0.;
00719 d__1 = dlarnd_(&c__2, &iseed[1]);
00720 work[n * 3] = d_sign(&c_b23, &d__1);
00721 z__[n + n * z_dim1] = 1.;
00722 work[n * 2] = 0.;
00723 d__1 = dlarnd_(&c__2, &iseed[1]);
00724 work[n * 4] = d_sign(&c_b23, &d__1);
00725
00726
00727
00728 i__3 = n;
00729 for (jc = 1; jc <= i__3; ++jc) {
00730 i__4 = n;
00731 for (jr = 1; jr <= i__4; ++jr) {
00732 a[jr + jc * a_dim1] = work[(n << 1) + jr] * work[
00733 n * 3 + jc] * a[jr + jc * a_dim1];
00734 b[jr + jc * b_dim1] = work[(n << 1) + jr] * work[
00735 n * 3 + jc] * b[jr + jc * b_dim1];
00736
00737 }
00738
00739 }
00740 i__3 = n - 1;
00741 dorm2r_("L", "N", &n, &n, &i__3, &q[q_offset], ldq, &work[
00742 1], &a[a_offset], lda, &work[(n << 1) + 1], &ierr);
00743 if (ierr != 0) {
00744 goto L90;
00745 }
00746 i__3 = n - 1;
00747 dorm2r_("R", "T", &n, &n, &i__3, &z__[z_offset], ldq, &
00748 work[n + 1], &a[a_offset], lda, &work[(n << 1) +
00749 1], &ierr);
00750 if (ierr != 0) {
00751 goto L90;
00752 }
00753 i__3 = n - 1;
00754 dorm2r_("L", "N", &n, &n, &i__3, &q[q_offset], ldq, &work[
00755 1], &b[b_offset], lda, &work[(n << 1) + 1], &ierr);
00756 if (ierr != 0) {
00757 goto L90;
00758 }
00759 i__3 = n - 1;
00760 dorm2r_("R", "T", &n, &n, &i__3, &z__[z_offset], ldq, &
00761 work[n + 1], &b[b_offset], lda, &work[(n << 1) +
00762 1], &ierr);
00763 if (ierr != 0) {
00764 goto L90;
00765 }
00766 }
00767 } else {
00768
00769
00770
00771 i__3 = n;
00772 for (jc = 1; jc <= i__3; ++jc) {
00773 i__4 = n;
00774 for (jr = 1; jr <= i__4; ++jr) {
00775 a[jr + jc * a_dim1] = rmagn[kamagn[jtype - 1]] *
00776 dlarnd_(&c__2, &iseed[1]);
00777 b[jr + jc * b_dim1] = rmagn[kbmagn[jtype - 1]] *
00778 dlarnd_(&c__2, &iseed[1]);
00779
00780 }
00781
00782 }
00783 }
00784
00785 L90:
00786
00787 if (ierr != 0) {
00788 io___38.ciunit = *nounit;
00789 s_wsfe(&io___38);
00790 do_fio(&c__1, "Generator", (ftnlen)9);
00791 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00792 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00793 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00794 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00795 e_wsfe();
00796 *info = abs(ierr);
00797 return 0;
00798 }
00799
00800 L100:
00801
00802 for (i__ = 1; i__ <= 7; ++i__) {
00803 result[i__] = -1.;
00804
00805 }
00806
00807
00808
00809 dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00810 dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00811 dggev_("V", "V", &n, &s[s_offset], lda, &t[t_offset], lda, &
00812 alphar[1], &alphai[1], &beta[1], &q[q_offset], ldq, &z__[
00813 z_offset], ldq, &work[1], lwork, &ierr);
00814 if (ierr != 0 && ierr != n + 1) {
00815 result[1] = ulpinv;
00816 io___40.ciunit = *nounit;
00817 s_wsfe(&io___40);
00818 do_fio(&c__1, "DGGEV1", (ftnlen)6);
00819 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00820 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00821 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00822 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00823 e_wsfe();
00824 *info = abs(ierr);
00825 goto L190;
00826 }
00827
00828
00829
00830 dget52_(&c_true, &n, &a[a_offset], lda, &b[b_offset], lda, &q[
00831 q_offset], ldq, &alphar[1], &alphai[1], &beta[1], &work[1]
00832 , &result[1]);
00833 if (result[2] > *thresh) {
00834 io___41.ciunit = *nounit;
00835 s_wsfe(&io___41);
00836 do_fio(&c__1, "Left", (ftnlen)4);
00837 do_fio(&c__1, "DGGEV1", (ftnlen)6);
00838 do_fio(&c__1, (char *)&result[2], (ftnlen)sizeof(doublereal));
00839 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00840 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00841 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00842 e_wsfe();
00843 }
00844
00845
00846
00847 dget52_(&c_false, &n, &a[a_offset], lda, &b[b_offset], lda, &z__[
00848 z_offset], ldq, &alphar[1], &alphai[1], &beta[1], &work[1]
00849 , &result[3]);
00850 if (result[4] > *thresh) {
00851 io___42.ciunit = *nounit;
00852 s_wsfe(&io___42);
00853 do_fio(&c__1, "Right", (ftnlen)5);
00854 do_fio(&c__1, "DGGEV1", (ftnlen)6);
00855 do_fio(&c__1, (char *)&result[4], (ftnlen)sizeof(doublereal));
00856 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00857 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00858 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00859 e_wsfe();
00860 }
00861
00862
00863
00864 dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00865 dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00866 dggev_("N", "N", &n, &s[s_offset], lda, &t[t_offset], lda, &
00867 alphr1[1], &alphi1[1], &beta1[1], &q[q_offset], ldq, &z__[
00868 z_offset], ldq, &work[1], lwork, &ierr);
00869 if (ierr != 0 && ierr != n + 1) {
00870 result[1] = ulpinv;
00871 io___43.ciunit = *nounit;
00872 s_wsfe(&io___43);
00873 do_fio(&c__1, "DGGEV2", (ftnlen)6);
00874 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00875 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00876 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00877 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00878 e_wsfe();
00879 *info = abs(ierr);
00880 goto L190;
00881 }
00882
00883 i__3 = n;
00884 for (j = 1; j <= i__3; ++j) {
00885 if (alphar[j] != alphr1[j] || alphai[j] != alphi1[j] || beta[
00886 j] != beta1[j]) {
00887 result[5] = ulpinv;
00888 }
00889
00890 }
00891
00892
00893
00894
00895 dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00896 dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00897 dggev_("V", "N", &n, &s[s_offset], lda, &t[t_offset], lda, &
00898 alphr1[1], &alphi1[1], &beta1[1], &qe[qe_offset], ldqe, &
00899 z__[z_offset], ldq, &work[1], lwork, &ierr);
00900 if (ierr != 0 && ierr != n + 1) {
00901 result[1] = ulpinv;
00902 io___44.ciunit = *nounit;
00903 s_wsfe(&io___44);
00904 do_fio(&c__1, "DGGEV3", (ftnlen)6);
00905 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00906 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00907 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00908 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00909 e_wsfe();
00910 *info = abs(ierr);
00911 goto L190;
00912 }
00913
00914 i__3 = n;
00915 for (j = 1; j <= i__3; ++j) {
00916 if (alphar[j] != alphr1[j] || alphai[j] != alphi1[j] || beta[
00917 j] != beta1[j]) {
00918 result[6] = ulpinv;
00919 }
00920
00921 }
00922
00923 i__3 = n;
00924 for (j = 1; j <= i__3; ++j) {
00925 i__4 = n;
00926 for (jc = 1; jc <= i__4; ++jc) {
00927 if (q[j + jc * q_dim1] != qe[j + jc * qe_dim1]) {
00928 result[6] = ulpinv;
00929 }
00930
00931 }
00932
00933 }
00934
00935
00936
00937
00938 dlacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00939 dlacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00940 dggev_("N", "V", &n, &s[s_offset], lda, &t[t_offset], lda, &
00941 alphr1[1], &alphi1[1], &beta1[1], &q[q_offset], ldq, &qe[
00942 qe_offset], ldqe, &work[1], lwork, &ierr);
00943 if (ierr != 0 && ierr != n + 1) {
00944 result[1] = ulpinv;
00945 io___45.ciunit = *nounit;
00946 s_wsfe(&io___45);
00947 do_fio(&c__1, "DGGEV4", (ftnlen)6);
00948 do_fio(&c__1, (char *)&ierr, (ftnlen)sizeof(integer));
00949 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00950 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00951 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00952 e_wsfe();
00953 *info = abs(ierr);
00954 goto L190;
00955 }
00956
00957 i__3 = n;
00958 for (j = 1; j <= i__3; ++j) {
00959 if (alphar[j] != alphr1[j] || alphai[j] != alphi1[j] || beta[
00960 j] != beta1[j]) {
00961 result[7] = ulpinv;
00962 }
00963
00964 }
00965
00966 i__3 = n;
00967 for (j = 1; j <= i__3; ++j) {
00968 i__4 = n;
00969 for (jc = 1; jc <= i__4; ++jc) {
00970 if (z__[j + jc * z_dim1] != qe[j + jc * qe_dim1]) {
00971 result[7] = ulpinv;
00972 }
00973
00974 }
00975
00976 }
00977
00978
00979
00980 L190:
00981
00982 ntestt += 7;
00983
00984
00985
00986 for (jr = 1; jr <= 7; ++jr) {
00987 if (result[jr] >= *thresh) {
00988
00989
00990
00991
00992 if (nerrs == 0) {
00993 io___46.ciunit = *nounit;
00994 s_wsfe(&io___46);
00995 do_fio(&c__1, "DGV", (ftnlen)3);
00996 e_wsfe();
00997
00998
00999
01000 io___47.ciunit = *nounit;
01001 s_wsfe(&io___47);
01002 e_wsfe();
01003 io___48.ciunit = *nounit;
01004 s_wsfe(&io___48);
01005 e_wsfe();
01006 io___49.ciunit = *nounit;
01007 s_wsfe(&io___49);
01008 do_fio(&c__1, "Orthogonal", (ftnlen)10);
01009 e_wsfe();
01010
01011
01012
01013 io___50.ciunit = *nounit;
01014 s_wsfe(&io___50);
01015 e_wsfe();
01016
01017 }
01018 ++nerrs;
01019 if (result[jr] < 1e4) {
01020 io___51.ciunit = *nounit;
01021 s_wsfe(&io___51);
01022 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01023 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01024 ;
01025 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01026 integer));
01027 do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01028 do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01029 doublereal));
01030 e_wsfe();
01031 } else {
01032 io___52.ciunit = *nounit;
01033 s_wsfe(&io___52);
01034 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01035 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01036 ;
01037 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01038 integer));
01039 do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01040 do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01041 doublereal));
01042 e_wsfe();
01043 }
01044 }
01045
01046 }
01047
01048 L210:
01049 ;
01050 }
01051
01052 }
01053
01054
01055
01056 alasvm_("DGV", nounit, &nerrs, &ntestt, &c__0);
01057
01058 work[1] = (doublereal) maxwrk;
01059
01060 return 0;
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070 }