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_n1 = -1;
00020 static integer c__0 = 0;
00021 static integer c__4 = 4;
00022 static real c_b36 = 0.f;
00023 static integer c__2 = 2;
00024 static real c_b42 = 1.f;
00025 static integer c__3 = 3;
00026 static logical c_true = TRUE_;
00027 static logical c_false = FALSE_;
00028
00029 int sdrvgg_(integer *nsizes, integer *nn, integer *ntypes,
00030 logical *dotype, integer *iseed, real *thresh, real *thrshn, integer *
00031 nounit, real *a, integer *lda, real *b, real *s, real *t, real *s2,
00032 real *t2, real *q, integer *ldq, real *z__, real *alphr1, real *
00033 alphi1, real *beta1, real *alphr2, real *alphi2, real *beta2, real *
00034 vl, real *vr, real *work, integer *lwork, real *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 SDRVGG: \002,a,\002 returned INFO=\002,i"
00064 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00065 "(\002,3(i5,\002,\002),i5,\002)\002)";
00066 static char fmt_9997[] = "(\002 SDRVGG: SGET53 returned INFO=\002,i1,"
00067 "\002 for eigenvalue \002,i6,\002.\002,/9x,\002N=\002,i6,\002, JT"
00068 "YPE=\002,i6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00069 static char fmt_9996[] = "(\002 SDRVGG: S not in Schur form at eigenvalu"
00070 "e \002,i6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, "
00071 "ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00072 static char fmt_9998[] = "(\002 SDRVGG: \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_9995[] = "(/1x,a3,\002 -- Real Generalized eigenvalue pr"
00077 "oblem driver\002)";
00078 static char fmt_9994[] = "(\002 Matrix types (see SDRVGG for details):"
00079 " \002)";
00080 static char fmt_9993[] = "(\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_9992[] = "(\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_9991[] = "(/\002 Tests performed: (S is Schur, T is tri"
00098 "angular, \002,\002Q and Z are \002,a,\002,\002,/20x,\002l and r "
00099 "are the appropriate left and right\002,/19x,\002eigenvectors, re"
00100 "sp., a is alpha, b is beta, and\002,/19x,a,\002 means \002,a,"
00101 "\002.)\002,/\002 1 = | A - Q S Z\002,a,\002 | / ( |A| n ulp ) "
00102 " 2 = | B - Q T Z\002,a,\002 | / ( |B| n ulp )\002,/\002 3 = | "
00103 "I - QQ\002,a,\002 | / ( n ulp ) 4 = | I - ZZ\002,a"
00104 ",\002 | / ( n ulp )\002,/\002 5 = difference between (alpha,beta"
00105 ") and diagonals of\002,\002 (S,T)\002,/\002 6 = max | ( b A - a "
00106 "B )\002,a,\002 l | / const. 7 = max | ( b A - a B ) r | / cons"
00107 "t.\002,/1x)";
00108 static char fmt_9990[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00109 ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i3,\002 is\002"
00110 ",0p,f8.2)";
00111 static char fmt_9989[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00112 ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i3,\002 is\002"
00113 ",1p,e10.3)";
00114
00115
00116 integer a_dim1, a_offset, b_dim1, b_offset, q_dim1, q_offset, s_dim1,
00117 s_offset, s2_dim1, s2_offset, t_dim1, t_offset, t2_dim1,
00118 t2_offset, vl_dim1, vl_offset, vr_dim1, vr_offset, z_dim1,
00119 z_offset, i__1, i__2, i__3, i__4;
00120 real r__1, r__2, r__3, r__4, r__5, r__6, r__7, r__8, r__9, r__10;
00121
00122
00123 double r_sign(real *, real *);
00124 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00125
00126
00127 integer j, n, i1, n1, jc, nb, in, jr, ns, nbz;
00128 real ulp;
00129 integer iadd, nmax;
00130 real temp1, temp2;
00131 logical badnn;
00132 real dumma[4];
00133 integer iinfo;
00134 real rmagn[4];
00135 extern int sgegs_(char *, char *, integer *, real *,
00136 integer *, real *, integer *, real *, real *, real *, real *,
00137 integer *, real *, integer *, real *, integer *, integer *), sget51_(integer *, integer *, real *, integer *,
00138 real *, integer *, real *, integer *, real *, integer *, real *,
00139 real *), sget52_(logical *, integer *, real *, integer *, real *,
00140 integer *, real *, integer *, real *, real *, real *, real *,
00141 real *), sgegv_(char *, char *, integer *, real *, integer *,
00142 real *, integer *, real *, real *, real *, real *, integer *,
00143 real *, integer *, real *, integer *, integer *),
00144 sget53_(real *, integer *, real *, integer *, real *, real *,
00145 real *, real *, integer *);
00146 integer nmats, jsize, nerrs, jtype, ntest;
00147 extern int slatm4_(integer *, integer *, integer *,
00148 integer *, integer *, real *, real *, real *, integer *, integer *
00149 , real *, integer *);
00150 logical ilabad;
00151 extern int sorm2r_(char *, char *, integer *, integer *,
00152 integer *, real *, integer *, real *, real *, integer *, real *,
00153 integer *), slabad_(real *, real *);
00154 extern doublereal slamch_(char *);
00155 real safmin;
00156 integer ioldsd[4];
00157 real safmax;
00158 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
00159 integer *, integer *);
00160 extern int slarfg_(integer *, real *, real *, integer *,
00161 real *);
00162 extern doublereal slarnd_(integer *, integer *);
00163 extern int alasvm_(char *, integer *, integer *, integer
00164 *, integer *), xerbla_(char *, integer *),
00165 slacpy_(char *, integer *, integer *, real *, integer *, real *,
00166 integer *), slaset_(char *, integer *, integer *, real *,
00167 real *, real *, integer *);
00168 real ulpinv;
00169 integer lwkopt, mtypes, ntestt;
00170
00171
00172 static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00173 static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00174 static cilist io___47 = { 0, 0, 0, fmt_9997, 0 };
00175 static cilist io___48 = { 0, 0, 0, fmt_9996, 0 };
00176 static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00177 static cilist io___51 = { 0, 0, 0, fmt_9998, 0 };
00178 static cilist io___52 = { 0, 0, 0, fmt_9998, 0 };
00179 static cilist io___53 = { 0, 0, 0, fmt_9996, 0 };
00180 static cilist io___54 = { 0, 0, 0, fmt_9995, 0 };
00181 static cilist io___55 = { 0, 0, 0, fmt_9994, 0 };
00182 static cilist io___56 = { 0, 0, 0, fmt_9993, 0 };
00183 static cilist io___57 = { 0, 0, 0, fmt_9992, 0 };
00184 static cilist io___58 = { 0, 0, 0, fmt_9991, 0 };
00185 static cilist io___59 = { 0, 0, 0, fmt_9990, 0 };
00186 static cilist io___60 = { 0, 0, 0, fmt_9989, 0 };
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
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 --nn;
00524 --dotype;
00525 --iseed;
00526 t2_dim1 = *lda;
00527 t2_offset = 1 + t2_dim1;
00528 t2 -= t2_offset;
00529 s2_dim1 = *lda;
00530 s2_offset = 1 + s2_dim1;
00531 s2 -= s2_offset;
00532 t_dim1 = *lda;
00533 t_offset = 1 + t_dim1;
00534 t -= t_offset;
00535 s_dim1 = *lda;
00536 s_offset = 1 + s_dim1;
00537 s -= s_offset;
00538 b_dim1 = *lda;
00539 b_offset = 1 + b_dim1;
00540 b -= b_offset;
00541 a_dim1 = *lda;
00542 a_offset = 1 + a_dim1;
00543 a -= a_offset;
00544 vr_dim1 = *ldq;
00545 vr_offset = 1 + vr_dim1;
00546 vr -= vr_offset;
00547 vl_dim1 = *ldq;
00548 vl_offset = 1 + vl_dim1;
00549 vl -= vl_offset;
00550 z_dim1 = *ldq;
00551 z_offset = 1 + z_dim1;
00552 z__ -= z_offset;
00553 q_dim1 = *ldq;
00554 q_offset = 1 + q_dim1;
00555 q -= q_offset;
00556 --alphr1;
00557 --alphi1;
00558 --beta1;
00559 --alphr2;
00560 --alphi2;
00561 --beta2;
00562 --work;
00563 --result;
00564
00565
00566
00567
00568
00569
00570
00571 *info = 0;
00572
00573 badnn = FALSE_;
00574 nmax = 1;
00575 i__1 = *nsizes;
00576 for (j = 1; j <= i__1; ++j) {
00577
00578 i__2 = nmax, i__3 = nn[j];
00579 nmax = max(i__2,i__3);
00580 if (nn[j] < 0) {
00581 badnn = TRUE_;
00582 }
00583
00584 }
00585
00586
00587
00588
00589
00590 i__1 = 1, i__2 = ilaenv_(&c__1, "SGEQRF", " ", &nmax, &nmax, &c_n1, &c_n1), i__1 = max(i__1,i__2), i__2 = ilaenv_(&
00591 c__1, "SORMQR", "LT", &nmax, &nmax, &nmax, &c_n1), i__1 = max(i__1,i__2), i__2 = ilaenv_(&c__1, "SORGQR",
00592 " ", &nmax, &nmax, &nmax, &c_n1);
00593 nb = max(i__1,i__2);
00594 nbz = ilaenv_(&c__1, "SHGEQZ", "SII", &nmax, &c__1, &nmax, &c__0);
00595 ns = ilaenv_(&c__4, "SHGEQZ", "SII", &nmax, &c__1, &nmax, &c__0);
00596 i1 = nbz + ns;
00597
00598 i__1 = nmax * 6, i__2 = nmax * (nb + 1), i__1 = max(i__1,i__2), i__2 = ((
00599 i1 << 1) + nmax + 1) * (i1 + 1);
00600 lwkopt = (nmax << 1) + max(i__1,i__2);
00601
00602
00603
00604 if (*nsizes < 0) {
00605 *info = -1;
00606 } else if (badnn) {
00607 *info = -2;
00608 } else if (*ntypes < 0) {
00609 *info = -3;
00610 } else if (*thresh < 0.f) {
00611 *info = -6;
00612 } else if (*lda <= 1 || *lda < nmax) {
00613 *info = -10;
00614 } else if (*ldq <= 1 || *ldq < nmax) {
00615 *info = -19;
00616 } else if (lwkopt > *lwork) {
00617 *info = -30;
00618 }
00619
00620 if (*info != 0) {
00621 i__1 = -(*info);
00622 xerbla_("SDRVGG", &i__1);
00623 return 0;
00624 }
00625
00626
00627
00628 if (*nsizes == 0 || *ntypes == 0) {
00629 return 0;
00630 }
00631
00632 safmin = slamch_("Safe minimum");
00633 ulp = slamch_("Epsilon") * slamch_("Base");
00634 safmin /= ulp;
00635 safmax = 1.f / safmin;
00636 slabad_(&safmin, &safmax);
00637 ulpinv = 1.f / ulp;
00638
00639
00640
00641 rmagn[0] = 0.f;
00642 rmagn[1] = 1.f;
00643
00644
00645
00646 ntestt = 0;
00647 nerrs = 0;
00648 nmats = 0;
00649
00650 i__1 = *nsizes;
00651 for (jsize = 1; jsize <= i__1; ++jsize) {
00652 n = nn[jsize];
00653 n1 = max(1,n);
00654 rmagn[2] = safmax * ulp / (real) n1;
00655 rmagn[3] = safmin * ulpinv * n1;
00656
00657 if (*nsizes != 1) {
00658 mtypes = min(26,*ntypes);
00659 } else {
00660 mtypes = min(27,*ntypes);
00661 }
00662
00663 i__2 = mtypes;
00664 for (jtype = 1; jtype <= i__2; ++jtype) {
00665 if (! dotype[jtype]) {
00666 goto L160;
00667 }
00668 ++nmats;
00669 ntest = 0;
00670
00671
00672
00673 for (j = 1; j <= 4; ++j) {
00674 ioldsd[j - 1] = iseed[j];
00675
00676 }
00677
00678
00679
00680 for (j = 1; j <= 15; ++j) {
00681 result[j] = 0.f;
00682
00683 }
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708 if (mtypes > 26) {
00709 goto L110;
00710 }
00711 iinfo = 0;
00712 if (kclass[jtype - 1] < 3) {
00713
00714
00715
00716 if ((i__3 = katype[jtype - 1], abs(i__3)) == 3) {
00717 in = ((n - 1) / 2 << 1) + 1;
00718 if (in != n) {
00719 slaset_("Full", &n, &n, &c_b36, &c_b36, &a[a_offset],
00720 lda);
00721 }
00722 } else {
00723 in = n;
00724 }
00725 slatm4_(&katype[jtype - 1], &in, &kz1[kazero[jtype - 1] - 1],
00726 &kz2[kazero[jtype - 1] - 1], &iasign[jtype - 1], &
00727 rmagn[kamagn[jtype - 1]], &ulp, &rmagn[ktrian[jtype -
00728 1] * kamagn[jtype - 1]], &c__2, &iseed[1], &a[
00729 a_offset], lda);
00730 iadd = kadd[kazero[jtype - 1] - 1];
00731 if (iadd > 0 && iadd <= n) {
00732 a[iadd + iadd * a_dim1] = 1.f;
00733 }
00734
00735
00736
00737 if ((i__3 = kbtype[jtype - 1], abs(i__3)) == 3) {
00738 in = ((n - 1) / 2 << 1) + 1;
00739 if (in != n) {
00740 slaset_("Full", &n, &n, &c_b36, &c_b36, &b[b_offset],
00741 lda);
00742 }
00743 } else {
00744 in = n;
00745 }
00746 slatm4_(&kbtype[jtype - 1], &in, &kz1[kbzero[jtype - 1] - 1],
00747 &kz2[kbzero[jtype - 1] - 1], &ibsign[jtype - 1], &
00748 rmagn[kbmagn[jtype - 1]], &c_b42, &rmagn[ktrian[jtype
00749 - 1] * kbmagn[jtype - 1]], &c__2, &iseed[1], &b[
00750 b_offset], lda);
00751 iadd = kadd[kbzero[jtype - 1] - 1];
00752 if (iadd != 0 && iadd <= n) {
00753 b[iadd + iadd * b_dim1] = 1.f;
00754 }
00755
00756 if (kclass[jtype - 1] == 2 && n > 0) {
00757
00758
00759
00760
00761
00762
00763 i__3 = n - 1;
00764 for (jc = 1; jc <= i__3; ++jc) {
00765 i__4 = n;
00766 for (jr = jc; jr <= i__4; ++jr) {
00767 q[jr + jc * q_dim1] = slarnd_(&c__3, &iseed[1]);
00768 z__[jr + jc * z_dim1] = slarnd_(&c__3, &iseed[1]);
00769
00770 }
00771 i__4 = n + 1 - jc;
00772 slarfg_(&i__4, &q[jc + jc * q_dim1], &q[jc + 1 + jc *
00773 q_dim1], &c__1, &work[jc]);
00774 work[(n << 1) + jc] = r_sign(&c_b42, &q[jc + jc *
00775 q_dim1]);
00776 q[jc + jc * q_dim1] = 1.f;
00777 i__4 = n + 1 - jc;
00778 slarfg_(&i__4, &z__[jc + jc * z_dim1], &z__[jc + 1 +
00779 jc * z_dim1], &c__1, &work[n + jc]);
00780 work[n * 3 + jc] = r_sign(&c_b42, &z__[jc + jc *
00781 z_dim1]);
00782 z__[jc + jc * z_dim1] = 1.f;
00783
00784 }
00785 q[n + n * q_dim1] = 1.f;
00786 work[n] = 0.f;
00787 r__1 = slarnd_(&c__2, &iseed[1]);
00788 work[n * 3] = r_sign(&c_b42, &r__1);
00789 z__[n + n * z_dim1] = 1.f;
00790 work[n * 2] = 0.f;
00791 r__1 = slarnd_(&c__2, &iseed[1]);
00792 work[n * 4] = r_sign(&c_b42, &r__1);
00793
00794
00795
00796 i__3 = n;
00797 for (jc = 1; jc <= i__3; ++jc) {
00798 i__4 = n;
00799 for (jr = 1; jr <= i__4; ++jr) {
00800 a[jr + jc * a_dim1] = work[(n << 1) + jr] * work[
00801 n * 3 + jc] * a[jr + jc * a_dim1];
00802 b[jr + jc * b_dim1] = work[(n << 1) + jr] * work[
00803 n * 3 + jc] * b[jr + jc * b_dim1];
00804
00805 }
00806
00807 }
00808 i__3 = n - 1;
00809 sorm2r_("L", "N", &n, &n, &i__3, &q[q_offset], ldq, &work[
00810 1], &a[a_offset], lda, &work[(n << 1) + 1], &
00811 iinfo);
00812 if (iinfo != 0) {
00813 goto L100;
00814 }
00815 i__3 = n - 1;
00816 sorm2r_("R", "T", &n, &n, &i__3, &z__[z_offset], ldq, &
00817 work[n + 1], &a[a_offset], lda, &work[(n << 1) +
00818 1], &iinfo);
00819 if (iinfo != 0) {
00820 goto L100;
00821 }
00822 i__3 = n - 1;
00823 sorm2r_("L", "N", &n, &n, &i__3, &q[q_offset], ldq, &work[
00824 1], &b[b_offset], lda, &work[(n << 1) + 1], &
00825 iinfo);
00826 if (iinfo != 0) {
00827 goto L100;
00828 }
00829 i__3 = n - 1;
00830 sorm2r_("R", "T", &n, &n, &i__3, &z__[z_offset], ldq, &
00831 work[n + 1], &b[b_offset], lda, &work[(n << 1) +
00832 1], &iinfo);
00833 if (iinfo != 0) {
00834 goto L100;
00835 }
00836 }
00837 } else {
00838
00839
00840
00841 i__3 = n;
00842 for (jc = 1; jc <= i__3; ++jc) {
00843 i__4 = n;
00844 for (jr = 1; jr <= i__4; ++jr) {
00845 a[jr + jc * a_dim1] = rmagn[kamagn[jtype - 1]] *
00846 slarnd_(&c__2, &iseed[1]);
00847 b[jr + jc * b_dim1] = rmagn[kbmagn[jtype - 1]] *
00848 slarnd_(&c__2, &iseed[1]);
00849
00850 }
00851
00852 }
00853 }
00854
00855 L100:
00856
00857 if (iinfo != 0) {
00858 io___42.ciunit = *nounit;
00859 s_wsfe(&io___42);
00860 do_fio(&c__1, "Generator", (ftnlen)9);
00861 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00862 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00863 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00864 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00865 e_wsfe();
00866 *info = abs(iinfo);
00867 return 0;
00868 }
00869
00870 L110:
00871
00872
00873
00874 slacpy_(" ", &n, &n, &a[a_offset], lda, &s[s_offset], lda);
00875 slacpy_(" ", &n, &n, &b[b_offset], lda, &t[t_offset], lda);
00876 ntest = 1;
00877 result[1] = ulpinv;
00878
00879 sgegs_("V", "V", &n, &s[s_offset], lda, &t[t_offset], lda, &
00880 alphr1[1], &alphi1[1], &beta1[1], &q[q_offset], ldq, &z__[
00881 z_offset], ldq, &work[1], lwork, &iinfo);
00882 if (iinfo != 0) {
00883 io___43.ciunit = *nounit;
00884 s_wsfe(&io___43);
00885 do_fio(&c__1, "SGEGS", (ftnlen)5);
00886 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00887 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00888 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00889 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00890 e_wsfe();
00891 *info = abs(iinfo);
00892 goto L140;
00893 }
00894
00895 ntest = 4;
00896
00897
00898
00899 sget51_(&c__1, &n, &a[a_offset], lda, &s[s_offset], lda, &q[
00900 q_offset], ldq, &z__[z_offset], ldq, &work[1], &result[1])
00901 ;
00902 sget51_(&c__1, &n, &b[b_offset], lda, &t[t_offset], lda, &q[
00903 q_offset], ldq, &z__[z_offset], ldq, &work[1], &result[2])
00904 ;
00905 sget51_(&c__3, &n, &b[b_offset], lda, &t[t_offset], lda, &q[
00906 q_offset], ldq, &q[q_offset], ldq, &work[1], &result[3]);
00907 sget51_(&c__3, &n, &b[b_offset], lda, &t[t_offset], lda, &z__[
00908 z_offset], ldq, &z__[z_offset], ldq, &work[1], &result[4])
00909 ;
00910
00911
00912
00913
00914 temp1 = 0.f;
00915
00916 i__3 = n;
00917 for (j = 1; j <= i__3; ++j) {
00918 ilabad = FALSE_;
00919 if (alphi1[j] == 0.f) {
00920
00921 r__7 = safmin, r__8 = (r__2 = alphr1[j], dabs(r__2)),
00922 r__7 = max(r__7,r__8), r__8 = (r__3 = s[j + j *
00923 s_dim1], dabs(r__3));
00924
00925 r__9 = safmin, r__10 = (r__5 = beta1[j], dabs(r__5)),
00926 r__9 = max(r__9,r__10), r__10 = (r__6 = t[j + j *
00927 t_dim1], dabs(r__6));
00928 temp2 = ((r__1 = alphr1[j] - s[j + j * s_dim1], dabs(r__1)
00929 ) / dmax(r__7,r__8) + (r__4 = beta1[j] - t[j + j *
00930 t_dim1], dabs(r__4)) / dmax(r__9,r__10)) / ulp;
00931 if (j < n) {
00932 if (s[j + 1 + j * s_dim1] != 0.f) {
00933 ilabad = TRUE_;
00934 }
00935 }
00936 if (j > 1) {
00937 if (s[j + (j - 1) * s_dim1] != 0.f) {
00938 ilabad = TRUE_;
00939 }
00940 }
00941 } else {
00942 if (alphi1[j] > 0.f) {
00943 i1 = j;
00944 } else {
00945 i1 = j - 1;
00946 }
00947 if (i1 <= 0 || i1 >= n) {
00948 ilabad = TRUE_;
00949 } else if (i1 < n - 1) {
00950 if (s[i1 + 2 + (i1 + 1) * s_dim1] != 0.f) {
00951 ilabad = TRUE_;
00952 }
00953 } else if (i1 > 1) {
00954 if (s[i1 + (i1 - 1) * s_dim1] != 0.f) {
00955 ilabad = TRUE_;
00956 }
00957 }
00958 if (! ilabad) {
00959 sget53_(&s[i1 + i1 * s_dim1], lda, &t[i1 + i1 *
00960 t_dim1], lda, &beta1[j], &alphr1[j], &alphi1[
00961 j], &temp2, &iinfo);
00962 if (iinfo >= 3) {
00963 io___47.ciunit = *nounit;
00964 s_wsfe(&io___47);
00965 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
00966 integer));
00967 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer))
00968 ;
00969 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00970 ;
00971 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
00972 integer));
00973 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00974 integer));
00975 e_wsfe();
00976 *info = abs(iinfo);
00977 }
00978 } else {
00979 temp2 = ulpinv;
00980 }
00981 }
00982 temp1 = dmax(temp1,temp2);
00983 if (ilabad) {
00984 io___48.ciunit = *nounit;
00985 s_wsfe(&io___48);
00986 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
00987 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00988 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00989 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00990 ;
00991 e_wsfe();
00992 }
00993
00994 }
00995 result[5] = temp1;
00996
00997
00998
00999
01000
01001 slacpy_(" ", &n, &n, &a[a_offset], lda, &s2[s2_offset], lda);
01002 slacpy_(" ", &n, &n, &b[b_offset], lda, &t2[t2_offset], lda);
01003 ntest = 6;
01004 result[6] = ulpinv;
01005
01006 sgegv_("V", "V", &n, &s2[s2_offset], lda, &t2[t2_offset], lda, &
01007 alphr2[1], &alphi2[1], &beta2[1], &vl[vl_offset], ldq, &
01008 vr[vr_offset], ldq, &work[1], lwork, &iinfo);
01009 if (iinfo != 0) {
01010 io___49.ciunit = *nounit;
01011 s_wsfe(&io___49);
01012 do_fio(&c__1, "SGEGV", (ftnlen)5);
01013 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01014 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01015 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01016 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01017 e_wsfe();
01018 *info = abs(iinfo);
01019 goto L140;
01020 }
01021
01022 ntest = 7;
01023
01024
01025
01026 sget52_(&c_true, &n, &a[a_offset], lda, &b[b_offset], lda, &vl[
01027 vl_offset], ldq, &alphr2[1], &alphi2[1], &beta2[1], &work[
01028 1], dumma);
01029 result[6] = dumma[0];
01030 if (dumma[1] > *thrshn) {
01031 io___51.ciunit = *nounit;
01032 s_wsfe(&io___51);
01033 do_fio(&c__1, "Left", (ftnlen)4);
01034 do_fio(&c__1, "SGEGV", (ftnlen)5);
01035 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(real));
01036 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01037 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01038 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01039 e_wsfe();
01040 }
01041
01042 sget52_(&c_false, &n, &a[a_offset], lda, &b[b_offset], lda, &vr[
01043 vr_offset], ldq, &alphr2[1], &alphi2[1], &beta2[1], &work[
01044 1], dumma);
01045 result[7] = dumma[0];
01046 if (dumma[1] > *thresh) {
01047 io___52.ciunit = *nounit;
01048 s_wsfe(&io___52);
01049 do_fio(&c__1, "Right", (ftnlen)5);
01050 do_fio(&c__1, "SGEGV", (ftnlen)5);
01051 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(real));
01052 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01053 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01054 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01055 e_wsfe();
01056 }
01057
01058
01059
01060 i__3 = n;
01061 for (j = 1; j <= i__3; ++j) {
01062 ilabad = FALSE_;
01063 if (alphi2[j] > 0.f) {
01064 if (j == n) {
01065 ilabad = TRUE_;
01066 } else if (alphi2[j + 1] >= 0.f) {
01067 ilabad = TRUE_;
01068 }
01069 } else if (alphi2[j] < 0.f) {
01070 if (j == 1) {
01071 ilabad = TRUE_;
01072 } else if (alphi2[j - 1] <= 0.f) {
01073 ilabad = TRUE_;
01074 }
01075 }
01076 if (ilabad) {
01077 io___53.ciunit = *nounit;
01078 s_wsfe(&io___53);
01079 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01080 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01081 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01082 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01083 ;
01084 e_wsfe();
01085 }
01086
01087 }
01088
01089
01090
01091 L140:
01092
01093 ntestt += ntest;
01094
01095
01096
01097 i__3 = ntest;
01098 for (jr = 1; jr <= i__3; ++jr) {
01099 if (result[jr] >= *thresh) {
01100
01101
01102
01103
01104 if (nerrs == 0) {
01105 io___54.ciunit = *nounit;
01106 s_wsfe(&io___54);
01107 do_fio(&c__1, "SGG", (ftnlen)3);
01108 e_wsfe();
01109
01110
01111
01112 io___55.ciunit = *nounit;
01113 s_wsfe(&io___55);
01114 e_wsfe();
01115 io___56.ciunit = *nounit;
01116 s_wsfe(&io___56);
01117 e_wsfe();
01118 io___57.ciunit = *nounit;
01119 s_wsfe(&io___57);
01120 do_fio(&c__1, "Orthogonal", (ftnlen)10);
01121 e_wsfe();
01122
01123
01124
01125 io___58.ciunit = *nounit;
01126 s_wsfe(&io___58);
01127 do_fio(&c__1, "orthogonal", (ftnlen)10);
01128 do_fio(&c__1, "'", (ftnlen)1);
01129 do_fio(&c__1, "transpose", (ftnlen)9);
01130 for (j = 1; j <= 5; ++j) {
01131 do_fio(&c__1, "'", (ftnlen)1);
01132 }
01133 e_wsfe();
01134
01135 }
01136 ++nerrs;
01137 if (result[jr] < 1e4f) {
01138 io___59.ciunit = *nounit;
01139 s_wsfe(&io___59);
01140 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01141 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01142 ;
01143 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01144 integer));
01145 do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01146 do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01147 real));
01148 e_wsfe();
01149 } else {
01150 io___60.ciunit = *nounit;
01151 s_wsfe(&io___60);
01152 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01153 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01154 ;
01155 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01156 integer));
01157 do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
01158 do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
01159 real));
01160 e_wsfe();
01161 }
01162 }
01163
01164 }
01165
01166 L160:
01167 ;
01168 }
01169
01170 }
01171
01172
01173
01174 alasvm_("SGG", nounit, &nerrs, &ntestt, &c__0);
01175 return 0;
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187 }