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 real c_b17 = 0.f;
00019 static integer c__0 = 0;
00020 static real c_b31 = 1.f;
00021 static integer c__4 = 4;
00022 static integer c__6 = 6;
00023 static integer c__1 = 1;
00024 static integer c__2 = 2;
00025
00026 int sdrvev_(integer *nsizes, integer *nn, integer *ntypes,
00027 logical *dotype, integer *iseed, real *thresh, integer *nounit, real *
00028 a, integer *lda, real *h__, real *wr, real *wi, real *wr1, real *wi1,
00029 real *vl, integer *ldvl, real *vr, integer *ldvr, real *lre, integer *
00030 ldlre, real *result, real *work, integer *nwork, integer *iwork,
00031 integer *info)
00032 {
00033
00034
00035 static integer ktype[21] = { 1,2,3,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,9,9,9 };
00036 static integer kmagn[21] = { 1,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,2,3,1,2,3 };
00037 static integer kmode[21] = { 0,0,0,4,3,1,4,4,4,3,1,5,4,3,1,5,5,5,4,3,1 };
00038 static integer kconds[21] = { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,2,2,0,0,0 };
00039
00040
00041 static char fmt_9993[] = "(\002 SDRVEV: \002,a,\002 returned INFO=\002,i"
00042 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00043 "(\002,3(i5,\002,\002),i5,\002)\002)";
00044 static char fmt_9999[] = "(/1x,a3,\002 -- Real Eigenvalue-Eigenvector De"
00045 "composition\002,\002 Driver\002,/\002 Matrix types (see SDRVEV f"
00046 "or details): \002)";
00047 static char fmt_9998[] = "(/\002 Special Matrices:\002,/\002 1=Zero mat"
00048 "rix. \002,\002 \002,\002 5=Diagonal: geom"
00049 "etr. spaced entries.\002,/\002 2=Identity matrix. "
00050 " \002,\002 6=Diagona\002,\002l: clustered entries.\002,"
00051 "/\002 3=Transposed Jordan block. \002,\002 \002,\002 "
00052 " 7=Diagonal: large, evenly spaced.\002,/\002 \002,\0024=Diagona"
00053 "l: evenly spaced entries. \002,\002 8=Diagonal: s\002,\002ma"
00054 "ll, evenly spaced.\002)";
00055 static char fmt_9997[] = "(\002 Dense, Non-Symmetric Matrices:\002,/\002"
00056 " 9=Well-cond., ev\002,\002enly spaced eigenvals.\002,\002 14=Il"
00057 "l-cond., geomet. spaced e\002,\002igenals.\002,/\002 10=Well-con"
00058 "d., geom. spaced eigenvals. \002,\002 15=Ill-conditioned, cluste"
00059 "red e.vals.\002,/\002 11=Well-cond\002,\002itioned, clustered e."
00060 "vals. \002,\002 16=Ill-cond., random comp\002,\002lex \002,/\002"
00061 " 12=Well-cond., random complex \002,6x,\002 \002,\002 17=Ill-c"
00062 "ond., large rand. complx \002,/\002 13=Ill-condi\002,\002tioned,"
00063 " evenly spaced. \002,\002 18=Ill-cond., small rand.\002,\002"
00064 " complx \002)";
00065 static char fmt_9996[] = "(\002 19=Matrix with random O(1) entries. "
00066 " \002,\002 21=Matrix \002,\002with small random entries.\002,"
00067 "/\002 20=Matrix with large ran\002,\002dom entries. \002,/)";
00068 static char fmt_9995[] = "(\002 Tests performed with test threshold ="
00069 "\002,f8.2,//\002 1 = | A VR - VR W | / ( n |A| ulp ) \002,/\002 "
00070 "2 = | transpose(A) VL - VL W | / ( n |A| ulp ) \002,/\002 3 = | "
00071 "|VR(i)| - 1 | / ulp \002,/\002 4 = | |VL(i)| - 1 | / ulp \002,"
00072 "/\002 5 = 0 if W same no matter if VR or VL computed,\002,\002 1"
00073 "/ulp otherwise\002,/\002 6 = 0 if VR same no matter if VL comput"
00074 "ed,\002,\002 1/ulp otherwise\002,/\002 7 = 0 if VL same no matt"
00075 "er if VR computed,\002,\002 1/ulp otherwise\002,/)";
00076 static char fmt_9994[] = "(\002 N=\002,i5,\002, IWK=\002,i2,\002, seed"
00077 "=\002,4(i4,\002,\002),\002 type \002,i2,\002, test(\002,i2,\002)="
00078 "\002,g10.3)";
00079
00080
00081 integer a_dim1, a_offset, h_dim1, h_offset, lre_dim1, lre_offset, vl_dim1,
00082 vl_offset, vr_dim1, vr_offset, i__1, i__2, i__3, i__4;
00083 real r__1, r__2, r__3, r__4, r__5;
00084
00085
00086 int s_copy(char *, char *, ftnlen, ftnlen);
00087 double sqrt(doublereal);
00088 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00089
00090
00091 integer j, n, jj;
00092 real dum[1], res[2];
00093 integer iwk;
00094 real ulp, vmx, cond;
00095 integer jcol;
00096 char path[3];
00097 integer nmax;
00098 real unfl, ovfl, tnrm, vrmx, vtst;
00099 extern doublereal snrm2_(integer *, real *, integer *);
00100 logical badnn;
00101 integer nfail, imode, iinfo;
00102 real conds;
00103 extern int sget22_(char *, char *, char *, integer *,
00104 real *, integer *, real *, integer *, real *, real *, real *,
00105 real *), sgeev_(char *, char *, integer *,
00106 real *, integer *, real *, real *, real *, integer *, real *,
00107 integer *, real *, integer *, integer *);
00108 real anorm;
00109 integer jsize, nerrs, itype, jtype, ntest;
00110 real rtulp;
00111 extern doublereal slapy2_(real *, real *);
00112 extern int slabad_(real *, real *);
00113 char adumma[1*1];
00114 extern doublereal slamch_(char *);
00115 integer idumma[1];
00116 extern int xerbla_(char *, integer *);
00117 integer ioldsd[4];
00118 extern int slatme_(integer *, char *, integer *, real *,
00119 integer *, real *, real *, char *, char *, char *, char *, real *,
00120 integer *, real *, integer *, integer *, real *, real *, integer
00121 *, real *, integer *),
00122 slacpy_(char *, integer *, integer *, real *, integer *, real *,
00123 integer *), slaset_(char *, integer *, integer *, real *,
00124 real *, real *, integer *), slatmr_(integer *, integer *,
00125 char *, integer *, char *, real *, integer *, real *, real *,
00126 char *, char *, real *, integer *, real *, real *, integer *,
00127 real *, char *, integer *, integer *, integer *, real *, real *,
00128 char *, real *, integer *, integer *, integer *);
00129 integer ntestf;
00130 extern int slasum_(char *, integer *, integer *, integer
00131 *), slatms_(integer *, integer *, char *, integer *, char
00132 *, real *, integer *, real *, real *, integer *, integer *, char *
00133 , real *, integer *, real *, integer *);
00134 real ulpinv;
00135 integer nnwork;
00136 real rtulpi;
00137 integer mtypes, ntestt;
00138
00139
00140 static cilist io___32 = { 0, 0, 0, fmt_9993, 0 };
00141 static cilist io___35 = { 0, 0, 0, fmt_9993, 0 };
00142 static cilist io___43 = { 0, 0, 0, fmt_9993, 0 };
00143 static cilist io___44 = { 0, 0, 0, fmt_9993, 0 };
00144 static cilist io___45 = { 0, 0, 0, fmt_9993, 0 };
00145 static cilist io___48 = { 0, 0, 0, fmt_9999, 0 };
00146 static cilist io___49 = { 0, 0, 0, fmt_9998, 0 };
00147 static cilist io___50 = { 0, 0, 0, fmt_9997, 0 };
00148 static cilist io___51 = { 0, 0, 0, fmt_9996, 0 };
00149 static cilist io___52 = { 0, 0, 0, fmt_9995, 0 };
00150 static cilist io___53 = { 0, 0, 0, fmt_9994, 0 };
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
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 --nn;
00459 --dotype;
00460 --iseed;
00461 h_dim1 = *lda;
00462 h_offset = 1 + h_dim1;
00463 h__ -= h_offset;
00464 a_dim1 = *lda;
00465 a_offset = 1 + a_dim1;
00466 a -= a_offset;
00467 --wr;
00468 --wi;
00469 --wr1;
00470 --wi1;
00471 vl_dim1 = *ldvl;
00472 vl_offset = 1 + vl_dim1;
00473 vl -= vl_offset;
00474 vr_dim1 = *ldvr;
00475 vr_offset = 1 + vr_dim1;
00476 vr -= vr_offset;
00477 lre_dim1 = *ldlre;
00478 lre_offset = 1 + lre_dim1;
00479 lre -= lre_offset;
00480 --result;
00481 --work;
00482 --iwork;
00483
00484
00485
00486
00487
00488 s_copy(path, "Single precision", (ftnlen)1, (ftnlen)16);
00489 s_copy(path + 1, "EV", (ftnlen)2, (ftnlen)2);
00490
00491
00492
00493 ntestt = 0;
00494 ntestf = 0;
00495 *info = 0;
00496
00497
00498
00499 badnn = FALSE_;
00500 nmax = 0;
00501 i__1 = *nsizes;
00502 for (j = 1; j <= i__1; ++j) {
00503
00504 i__2 = nmax, i__3 = nn[j];
00505 nmax = max(i__2,i__3);
00506 if (nn[j] < 0) {
00507 badnn = TRUE_;
00508 }
00509
00510 }
00511
00512
00513
00514 if (*nsizes < 0) {
00515 *info = -1;
00516 } else if (badnn) {
00517 *info = -2;
00518 } else if (*ntypes < 0) {
00519 *info = -3;
00520 } else if (*thresh < 0.f) {
00521 *info = -6;
00522 } else if (*nounit <= 0) {
00523 *info = -7;
00524 } else if (*lda < 1 || *lda < nmax) {
00525 *info = -9;
00526 } else if (*ldvl < 1 || *ldvl < nmax) {
00527 *info = -16;
00528 } else if (*ldvr < 1 || *ldvr < nmax) {
00529 *info = -18;
00530 } else if (*ldlre < 1 || *ldlre < nmax) {
00531 *info = -20;
00532 } else {
00533
00534 i__1 = nmax;
00535 if (nmax * 5 + (i__1 * i__1 << 1) > *nwork) {
00536 *info = -23;
00537 }
00538 }
00539
00540 if (*info != 0) {
00541 i__1 = -(*info);
00542 xerbla_("SDRVEV", &i__1);
00543 return 0;
00544 }
00545
00546
00547
00548 if (*nsizes == 0 || *ntypes == 0) {
00549 return 0;
00550 }
00551
00552
00553
00554 unfl = slamch_("Safe minimum");
00555 ovfl = 1.f / unfl;
00556 slabad_(&unfl, &ovfl);
00557 ulp = slamch_("Precision");
00558 ulpinv = 1.f / ulp;
00559 rtulp = sqrt(ulp);
00560 rtulpi = 1.f / rtulp;
00561
00562
00563
00564 nerrs = 0;
00565
00566 i__1 = *nsizes;
00567 for (jsize = 1; jsize <= i__1; ++jsize) {
00568 n = nn[jsize];
00569 if (*nsizes != 1) {
00570 mtypes = min(21,*ntypes);
00571 } else {
00572 mtypes = min(22,*ntypes);
00573 }
00574
00575 i__2 = mtypes;
00576 for (jtype = 1; jtype <= i__2; ++jtype) {
00577 if (! dotype[jtype]) {
00578 goto L260;
00579 }
00580
00581
00582
00583 for (j = 1; j <= 4; ++j) {
00584 ioldsd[j - 1] = iseed[j];
00585
00586 }
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604 if (mtypes > 21) {
00605 goto L90;
00606 }
00607
00608 itype = ktype[jtype - 1];
00609 imode = kmode[jtype - 1];
00610
00611
00612
00613 switch (kmagn[jtype - 1]) {
00614 case 1: goto L30;
00615 case 2: goto L40;
00616 case 3: goto L50;
00617 }
00618
00619 L30:
00620 anorm = 1.f;
00621 goto L60;
00622
00623 L40:
00624 anorm = ovfl * ulp;
00625 goto L60;
00626
00627 L50:
00628 anorm = unfl * ulpinv;
00629 goto L60;
00630
00631 L60:
00632
00633 slaset_("Full", lda, &n, &c_b17, &c_b17, &a[a_offset], lda);
00634 iinfo = 0;
00635 cond = ulpinv;
00636
00637
00638
00639
00640
00641 if (itype == 1) {
00642 iinfo = 0;
00643
00644 } else if (itype == 2) {
00645
00646
00647
00648 i__3 = n;
00649 for (jcol = 1; jcol <= i__3; ++jcol) {
00650 a[jcol + jcol * a_dim1] = anorm;
00651
00652 }
00653
00654 } else if (itype == 3) {
00655
00656
00657
00658 i__3 = n;
00659 for (jcol = 1; jcol <= i__3; ++jcol) {
00660 a[jcol + jcol * a_dim1] = anorm;
00661 if (jcol > 1) {
00662 a[jcol + (jcol - 1) * a_dim1] = 1.f;
00663 }
00664
00665 }
00666
00667 } else if (itype == 4) {
00668
00669
00670
00671 slatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond,
00672 &anorm, &c__0, &c__0, "N", &a[a_offset], lda, &work[n
00673 + 1], &iinfo);
00674
00675 } else if (itype == 5) {
00676
00677
00678
00679 slatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond,
00680 &anorm, &n, &n, "N", &a[a_offset], lda, &work[n + 1],
00681 &iinfo);
00682
00683 } else if (itype == 6) {
00684
00685
00686
00687 if (kconds[jtype - 1] == 1) {
00688 conds = 1.f;
00689 } else if (kconds[jtype - 1] == 2) {
00690 conds = rtulpi;
00691 } else {
00692 conds = 0.f;
00693 }
00694
00695 *(unsigned char *)&adumma[0] = ' ';
00696 slatme_(&n, "S", &iseed[1], &work[1], &imode, &cond, &c_b31,
00697 adumma, "T", "T", "T", &work[n + 1], &c__4, &conds, &
00698 n, &n, &anorm, &a[a_offset], lda, &work[(n << 1) + 1],
00699 &iinfo);
00700
00701 } else if (itype == 7) {
00702
00703
00704
00705 slatmr_(&n, &n, "S", &iseed[1], "S", &work[1], &c__6, &c_b31,
00706 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00707 n << 1) + 1], &c__1, &c_b31, "N", idumma, &c__0, &
00708 c__0, &c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[
00709 1], &iinfo);
00710
00711 } else if (itype == 8) {
00712
00713
00714
00715 slatmr_(&n, &n, "S", &iseed[1], "S", &work[1], &c__6, &c_b31,
00716 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00717 n << 1) + 1], &c__1, &c_b31, "N", idumma, &n, &n, &
00718 c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00719 iinfo);
00720
00721 } else if (itype == 9) {
00722
00723
00724
00725 slatmr_(&n, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b31,
00726 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00727 n << 1) + 1], &c__1, &c_b31, "N", idumma, &n, &n, &
00728 c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00729 iinfo);
00730 if (n >= 4) {
00731 slaset_("Full", &c__2, &n, &c_b17, &c_b17, &a[a_offset],
00732 lda);
00733 i__3 = n - 3;
00734 slaset_("Full", &i__3, &c__1, &c_b17, &c_b17, &a[a_dim1 +
00735 3], lda);
00736 i__3 = n - 3;
00737 slaset_("Full", &i__3, &c__2, &c_b17, &c_b17, &a[(n - 1) *
00738 a_dim1 + 3], lda);
00739 slaset_("Full", &c__1, &n, &c_b17, &c_b17, &a[n + a_dim1],
00740 lda);
00741 }
00742
00743 } else if (itype == 10) {
00744
00745
00746
00747 slatmr_(&n, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b31,
00748 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00749 n << 1) + 1], &c__1, &c_b31, "N", idumma, &n, &c__0, &
00750 c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00751 iinfo);
00752
00753 } else {
00754
00755 iinfo = 1;
00756 }
00757
00758 if (iinfo != 0) {
00759 io___32.ciunit = *nounit;
00760 s_wsfe(&io___32);
00761 do_fio(&c__1, "Generator", (ftnlen)9);
00762 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00763 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00764 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00765 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00766 e_wsfe();
00767 *info = abs(iinfo);
00768 return 0;
00769 }
00770
00771 L90:
00772
00773
00774
00775 for (iwk = 1; iwk <= 2; ++iwk) {
00776 if (iwk == 1) {
00777 nnwork = n << 2;
00778 } else {
00779
00780 i__3 = n;
00781 nnwork = n * 5 + (i__3 * i__3 << 1);
00782 }
00783 nnwork = max(nnwork,1);
00784
00785
00786
00787 for (j = 1; j <= 7; ++j) {
00788 result[j] = -1.f;
00789
00790 }
00791
00792
00793
00794 slacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00795 sgeev_("V", "V", &n, &h__[h_offset], lda, &wr[1], &wi[1], &vl[
00796 vl_offset], ldvl, &vr[vr_offset], ldvr, &work[1], &
00797 nnwork, &iinfo);
00798 if (iinfo != 0) {
00799 result[1] = ulpinv;
00800 io___35.ciunit = *nounit;
00801 s_wsfe(&io___35);
00802 do_fio(&c__1, "SGEEV1", (ftnlen)6);
00803 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00804 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00805 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00806 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00807 ;
00808 e_wsfe();
00809 *info = abs(iinfo);
00810 goto L220;
00811 }
00812
00813
00814
00815 sget22_("N", "N", "N", &n, &a[a_offset], lda, &vr[vr_offset],
00816 ldvr, &wr[1], &wi[1], &work[1], res);
00817 result[1] = res[0];
00818
00819
00820
00821 sget22_("T", "N", "T", &n, &a[a_offset], lda, &vl[vl_offset],
00822 ldvl, &wr[1], &wi[1], &work[1], res);
00823 result[2] = res[0];
00824
00825
00826
00827 i__3 = n;
00828 for (j = 1; j <= i__3; ++j) {
00829 tnrm = 1.f;
00830 if (wi[j] == 0.f) {
00831 tnrm = snrm2_(&n, &vr[j * vr_dim1 + 1], &c__1);
00832 } else if (wi[j] > 0.f) {
00833 r__1 = snrm2_(&n, &vr[j * vr_dim1 + 1], &c__1);
00834 r__2 = snrm2_(&n, &vr[(j + 1) * vr_dim1 + 1], &c__1);
00835 tnrm = slapy2_(&r__1, &r__2);
00836 }
00837
00838
00839 r__4 = ulpinv, r__5 = (r__1 = tnrm - 1.f, dabs(r__1)) /
00840 ulp;
00841 r__2 = result[3], r__3 = dmin(r__4,r__5);
00842 result[3] = dmax(r__2,r__3);
00843 if (wi[j] > 0.f) {
00844 vmx = 0.f;
00845 vrmx = 0.f;
00846 i__4 = n;
00847 for (jj = 1; jj <= i__4; ++jj) {
00848 vtst = slapy2_(&vr[jj + j * vr_dim1], &vr[jj + (j
00849 + 1) * vr_dim1]);
00850 if (vtst > vmx) {
00851 vmx = vtst;
00852 }
00853 if (vr[jj + (j + 1) * vr_dim1] == 0.f && (r__1 =
00854 vr[jj + j * vr_dim1], dabs(r__1)) > vrmx)
00855 {
00856 vrmx = (r__2 = vr[jj + j * vr_dim1], dabs(
00857 r__2));
00858 }
00859
00860 }
00861 if (vrmx / vmx < 1.f - ulp * 2.f) {
00862 result[3] = ulpinv;
00863 }
00864 }
00865
00866 }
00867
00868
00869
00870 i__3 = n;
00871 for (j = 1; j <= i__3; ++j) {
00872 tnrm = 1.f;
00873 if (wi[j] == 0.f) {
00874 tnrm = snrm2_(&n, &vl[j * vl_dim1 + 1], &c__1);
00875 } else if (wi[j] > 0.f) {
00876 r__1 = snrm2_(&n, &vl[j * vl_dim1 + 1], &c__1);
00877 r__2 = snrm2_(&n, &vl[(j + 1) * vl_dim1 + 1], &c__1);
00878 tnrm = slapy2_(&r__1, &r__2);
00879 }
00880
00881
00882 r__4 = ulpinv, r__5 = (r__1 = tnrm - 1.f, dabs(r__1)) /
00883 ulp;
00884 r__2 = result[4], r__3 = dmin(r__4,r__5);
00885 result[4] = dmax(r__2,r__3);
00886 if (wi[j] > 0.f) {
00887 vmx = 0.f;
00888 vrmx = 0.f;
00889 i__4 = n;
00890 for (jj = 1; jj <= i__4; ++jj) {
00891 vtst = slapy2_(&vl[jj + j * vl_dim1], &vl[jj + (j
00892 + 1) * vl_dim1]);
00893 if (vtst > vmx) {
00894 vmx = vtst;
00895 }
00896 if (vl[jj + (j + 1) * vl_dim1] == 0.f && (r__1 =
00897 vl[jj + j * vl_dim1], dabs(r__1)) > vrmx)
00898 {
00899 vrmx = (r__2 = vl[jj + j * vl_dim1], dabs(
00900 r__2));
00901 }
00902
00903 }
00904 if (vrmx / vmx < 1.f - ulp * 2.f) {
00905 result[4] = ulpinv;
00906 }
00907 }
00908
00909 }
00910
00911
00912
00913 slacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00914 sgeev_("N", "N", &n, &h__[h_offset], lda, &wr1[1], &wi1[1],
00915 dum, &c__1, dum, &c__1, &work[1], &nnwork, &iinfo);
00916 if (iinfo != 0) {
00917 result[1] = ulpinv;
00918 io___43.ciunit = *nounit;
00919 s_wsfe(&io___43);
00920 do_fio(&c__1, "SGEEV2", (ftnlen)6);
00921 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00922 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00923 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00924 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00925 ;
00926 e_wsfe();
00927 *info = abs(iinfo);
00928 goto L220;
00929 }
00930
00931
00932
00933 i__3 = n;
00934 for (j = 1; j <= i__3; ++j) {
00935 if (wr[j] != wr1[j] || wi[j] != wi1[j]) {
00936 result[5] = ulpinv;
00937 }
00938
00939 }
00940
00941
00942
00943 slacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00944 sgeev_("N", "V", &n, &h__[h_offset], lda, &wr1[1], &wi1[1],
00945 dum, &c__1, &lre[lre_offset], ldlre, &work[1], &
00946 nnwork, &iinfo);
00947 if (iinfo != 0) {
00948 result[1] = ulpinv;
00949 io___44.ciunit = *nounit;
00950 s_wsfe(&io___44);
00951 do_fio(&c__1, "SGEEV3", (ftnlen)6);
00952 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00953 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00954 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00955 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00956 ;
00957 e_wsfe();
00958 *info = abs(iinfo);
00959 goto L220;
00960 }
00961
00962
00963
00964 i__3 = n;
00965 for (j = 1; j <= i__3; ++j) {
00966 if (wr[j] != wr1[j] || wi[j] != wi1[j]) {
00967 result[5] = ulpinv;
00968 }
00969
00970 }
00971
00972
00973
00974 i__3 = n;
00975 for (j = 1; j <= i__3; ++j) {
00976 i__4 = n;
00977 for (jj = 1; jj <= i__4; ++jj) {
00978 if (vr[j + jj * vr_dim1] != lre[j + jj * lre_dim1]) {
00979 result[6] = ulpinv;
00980 }
00981
00982 }
00983
00984 }
00985
00986
00987
00988 slacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00989 sgeev_("V", "N", &n, &h__[h_offset], lda, &wr1[1], &wi1[1], &
00990 lre[lre_offset], ldlre, dum, &c__1, &work[1], &nnwork,
00991 &iinfo);
00992 if (iinfo != 0) {
00993 result[1] = ulpinv;
00994 io___45.ciunit = *nounit;
00995 s_wsfe(&io___45);
00996 do_fio(&c__1, "SGEEV4", (ftnlen)6);
00997 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00998 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00999 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01000 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01001 ;
01002 e_wsfe();
01003 *info = abs(iinfo);
01004 goto L220;
01005 }
01006
01007
01008
01009 i__3 = n;
01010 for (j = 1; j <= i__3; ++j) {
01011 if (wr[j] != wr1[j] || wi[j] != wi1[j]) {
01012 result[5] = ulpinv;
01013 }
01014
01015 }
01016
01017
01018
01019 i__3 = n;
01020 for (j = 1; j <= i__3; ++j) {
01021 i__4 = n;
01022 for (jj = 1; jj <= i__4; ++jj) {
01023 if (vl[j + jj * vl_dim1] != lre[j + jj * lre_dim1]) {
01024 result[7] = ulpinv;
01025 }
01026
01027 }
01028
01029 }
01030
01031
01032
01033 L220:
01034
01035 ntest = 0;
01036 nfail = 0;
01037 for (j = 1; j <= 7; ++j) {
01038 if (result[j] >= 0.f) {
01039 ++ntest;
01040 }
01041 if (result[j] >= *thresh) {
01042 ++nfail;
01043 }
01044
01045 }
01046
01047 if (nfail > 0) {
01048 ++ntestf;
01049 }
01050 if (ntestf == 1) {
01051 io___48.ciunit = *nounit;
01052 s_wsfe(&io___48);
01053 do_fio(&c__1, path, (ftnlen)3);
01054 e_wsfe();
01055 io___49.ciunit = *nounit;
01056 s_wsfe(&io___49);
01057 e_wsfe();
01058 io___50.ciunit = *nounit;
01059 s_wsfe(&io___50);
01060 e_wsfe();
01061 io___51.ciunit = *nounit;
01062 s_wsfe(&io___51);
01063 e_wsfe();
01064 io___52.ciunit = *nounit;
01065 s_wsfe(&io___52);
01066 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(real));
01067 e_wsfe();
01068 ntestf = 2;
01069 }
01070
01071 for (j = 1; j <= 7; ++j) {
01072 if (result[j] >= *thresh) {
01073 io___53.ciunit = *nounit;
01074 s_wsfe(&io___53);
01075 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01076 do_fio(&c__1, (char *)&iwk, (ftnlen)sizeof(integer));
01077 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01078 integer));
01079 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01080 ;
01081 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01082 do_fio(&c__1, (char *)&result[j], (ftnlen)sizeof(real)
01083 );
01084 e_wsfe();
01085 }
01086
01087 }
01088
01089 nerrs += nfail;
01090 ntestt += ntest;
01091
01092
01093 }
01094 L260:
01095 ;
01096 }
01097
01098 }
01099
01100
01101
01102 slasum_(path, nounit, &nerrs, &ntestt);
01103
01104
01105
01106 return 0;
01107
01108
01109
01110 }