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