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_b7 = 10.f;
00019 static integer c_n1 = -1;
00020 static integer c__5 = 5;
00021 static integer c__13 = 13;
00022 static integer c__1 = 1;
00023
00024 int schkeq_(real *thresh, integer *nout)
00025 {
00026
00027 static char fmt_9999[] = "(1x,\002All tests for \002,a3,\002 routines pa"
00028 "ssed the threshold\002)";
00029 static char fmt_9998[] = "(\002 SGEEQU failed test with value \002,e10"
00030 ".3,\002 exceeding\002,\002 threshold \002,e10.3)";
00031 static char fmt_9997[] = "(\002 SGBEQU failed test with value \002,e10"
00032 ".3,\002 exceeding\002,\002 threshold \002,e10.3)";
00033 static char fmt_9996[] = "(\002 SPOEQU failed test with value \002,e10"
00034 ".3,\002 exceeding\002,\002 threshold \002,e10.3)";
00035 static char fmt_9995[] = "(\002 SPPEQU failed test with value \002,e10"
00036 ".3,\002 exceeding\002,\002 threshold \002,e10.3)";
00037 static char fmt_9994[] = "(\002 SPBEQU failed test with value \002,e10"
00038 ".3,\002 exceeding\002,\002 threshold \002,e10.3)";
00039
00040
00041 integer i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8;
00042 real r__1, r__2, r__3;
00043
00044
00045 int s_copy(char *, char *, ftnlen, ftnlen);
00046 double pow_ri(real *, integer *);
00047 integer pow_ii(integer *, integer *), s_wsle(cilist *), e_wsle(void),
00048 s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00049
00050
00051 real a[25] , c__[5];
00052 integer i__, j, m, n;
00053 real r__[5], ab[65] , ap[15];
00054 integer kl;
00055 logical ok;
00056 integer ku;
00057 real eps, pow[11];
00058 integer info;
00059 char path[3];
00060 real norm, rpow[11], ccond, rcond, rcmin, rcmax, ratio;
00061 extern doublereal slamch_(char *);
00062 extern int sgbequ_(integer *, integer *, integer *,
00063 integer *, real *, integer *, real *, real *, real *, real *,
00064 real *, integer *), sgeequ_(integer *, integer *, real *, integer
00065 *, real *, real *, real *, real *, real *, integer *), spbequ_(
00066 char *, integer *, integer *, real *, integer *, real *, real *,
00067 real *, integer *);
00068 real reslts[5];
00069 extern int spoequ_(integer *, real *, integer *, real *,
00070 real *, real *, integer *), sppequ_(char *, integer *, real *,
00071 real *, real *, real *, integer *);
00072
00073
00074 static cilist io___25 = { 0, 0, 0, 0, 0 };
00075 static cilist io___26 = { 0, 0, 0, fmt_9999, 0 };
00076 static cilist io___27 = { 0, 0, 0, fmt_9998, 0 };
00077 static cilist io___28 = { 0, 0, 0, fmt_9997, 0 };
00078 static cilist io___29 = { 0, 0, 0, fmt_9996, 0 };
00079 static cilist io___30 = { 0, 0, 0, fmt_9995, 0 };
00080 static cilist io___31 = { 0, 0, 0, fmt_9994, 0 };
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 s_copy(path, "Single precision", (ftnlen)1, (ftnlen)16);
00122 s_copy(path + 1, "EQ", (ftnlen)2, (ftnlen)2);
00123
00124 eps = slamch_("P");
00125 for (i__ = 1; i__ <= 5; ++i__) {
00126 reslts[i__ - 1] = 0.f;
00127
00128 }
00129 for (i__ = 1; i__ <= 11; ++i__) {
00130 i__1 = i__ - 1;
00131 pow[i__ - 1] = pow_ri(&c_b7, &i__1);
00132 rpow[i__ - 1] = 1.f / pow[i__ - 1];
00133
00134 }
00135
00136
00137
00138 for (n = 0; n <= 5; ++n) {
00139 for (m = 0; m <= 5; ++m) {
00140
00141 for (j = 1; j <= 5; ++j) {
00142 for (i__ = 1; i__ <= 5; ++i__) {
00143 if (i__ <= m && j <= n) {
00144 i__1 = i__ + j;
00145 a[i__ + j * 5 - 6] = pow[i__ + j] * pow_ii(&c_n1, &
00146 i__1);
00147 } else {
00148 a[i__ + j * 5 - 6] = 0.f;
00149 }
00150
00151 }
00152
00153 }
00154
00155 sgeequ_(&m, &n, a, &c__5, r__, c__, &rcond, &ccond, &norm, &info);
00156
00157 if (info != 0) {
00158 reslts[0] = 1.f;
00159 } else {
00160 if (n != 0 && m != 0) {
00161
00162 r__2 = reslts[0], r__3 = (r__1 = (rcond - rpow[m - 1]) /
00163 rpow[m - 1], dabs(r__1));
00164 reslts[0] = dmax(r__2,r__3);
00165
00166 r__2 = reslts[0], r__3 = (r__1 = (ccond - rpow[n - 1]) /
00167 rpow[n - 1], dabs(r__1));
00168 reslts[0] = dmax(r__2,r__3);
00169
00170 r__2 = reslts[0], r__3 = (r__1 = (norm - pow[n + m]) /
00171 pow[n + m], dabs(r__1));
00172 reslts[0] = dmax(r__2,r__3);
00173 i__1 = m;
00174 for (i__ = 1; i__ <= i__1; ++i__) {
00175
00176 r__2 = reslts[0], r__3 = (r__1 = (r__[i__ - 1] - rpow[
00177 i__ + n]) / rpow[i__ + n], dabs(r__1));
00178 reslts[0] = dmax(r__2,r__3);
00179
00180 }
00181 i__1 = n;
00182 for (j = 1; j <= i__1; ++j) {
00183
00184 r__2 = reslts[0], r__3 = (r__1 = (c__[j - 1] - pow[n
00185 - j]) / pow[n - j], dabs(r__1));
00186 reslts[0] = dmax(r__2,r__3);
00187
00188 }
00189 }
00190 }
00191
00192
00193 }
00194
00195 }
00196
00197
00198
00199 for (j = 1; j <= 5; ++j) {
00200 a[j * 5 - 2] = 0.f;
00201
00202 }
00203 sgeequ_(&c__5, &c__5, a, &c__5, r__, c__, &rcond, &ccond, &norm, &info);
00204 if (info != 4) {
00205 reslts[0] = 1.f;
00206 }
00207
00208 for (j = 1; j <= 5; ++j) {
00209 a[j * 5 - 2] = 1.f;
00210
00211 }
00212 for (i__ = 1; i__ <= 5; ++i__) {
00213 a[i__ + 14] = 0.f;
00214
00215 }
00216 sgeequ_(&c__5, &c__5, a, &c__5, r__, c__, &rcond, &ccond, &norm, &info);
00217 if (info != 9) {
00218 reslts[0] = 1.f;
00219 }
00220 reslts[0] /= eps;
00221
00222
00223
00224 for (n = 0; n <= 5; ++n) {
00225 for (m = 0; m <= 5; ++m) {
00226
00227 i__2 = m - 1;
00228 i__1 = max(i__2,0);
00229 for (kl = 0; kl <= i__1; ++kl) {
00230
00231 i__3 = n - 1;
00232 i__2 = max(i__3,0);
00233 for (ku = 0; ku <= i__2; ++ku) {
00234
00235 for (j = 1; j <= 5; ++j) {
00236 for (i__ = 1; i__ <= 13; ++i__) {
00237 ab[i__ + j * 13 - 14] = 0.f;
00238
00239 }
00240
00241 }
00242 i__3 = n;
00243 for (j = 1; j <= i__3; ++j) {
00244 i__4 = m;
00245 for (i__ = 1; i__ <= i__4; ++i__) {
00246
00247 i__5 = m, i__6 = j + kl;
00248
00249 i__7 = 1, i__8 = j - ku;
00250 if (i__ <= min(i__5,i__6) && i__ >= max(i__7,i__8)
00251 && j <= n) {
00252 i__5 = i__ + j;
00253 ab[ku + 1 + i__ - j + j * 13 - 14] = pow[i__
00254 + j] * pow_ii(&c_n1, &i__5);
00255 }
00256
00257 }
00258
00259 }
00260
00261 sgbequ_(&m, &n, &kl, &ku, ab, &c__13, r__, c__, &rcond, &
00262 ccond, &norm, &info);
00263
00264 if (info != 0) {
00265 if (! (n + kl < m && info == n + kl + 1 || m + ku < n
00266 && info == (m << 1) + ku + 1)) {
00267 reslts[1] = 1.f;
00268 }
00269 } else {
00270 if (n != 0 && m != 0) {
00271
00272 rcmin = r__[0];
00273 rcmax = r__[0];
00274 i__3 = m;
00275 for (i__ = 1; i__ <= i__3; ++i__) {
00276
00277 r__1 = rcmin, r__2 = r__[i__ - 1];
00278 rcmin = dmin(r__1,r__2);
00279
00280 r__1 = rcmax, r__2 = r__[i__ - 1];
00281 rcmax = dmax(r__1,r__2);
00282
00283 }
00284 ratio = rcmin / rcmax;
00285
00286 r__2 = reslts[1], r__3 = (r__1 = (rcond - ratio) /
00287 ratio, dabs(r__1));
00288 reslts[1] = dmax(r__2,r__3);
00289
00290 rcmin = c__[0];
00291 rcmax = c__[0];
00292 i__3 = n;
00293 for (j = 1; j <= i__3; ++j) {
00294
00295 r__1 = rcmin, r__2 = c__[j - 1];
00296 rcmin = dmin(r__1,r__2);
00297
00298 r__1 = rcmax, r__2 = c__[j - 1];
00299 rcmax = dmax(r__1,r__2);
00300
00301 }
00302 ratio = rcmin / rcmax;
00303
00304 r__2 = reslts[1], r__3 = (r__1 = (ccond - ratio) /
00305 ratio, dabs(r__1));
00306 reslts[1] = dmax(r__2,r__3);
00307
00308
00309 r__2 = reslts[1], r__3 = (r__1 = (norm - pow[n +
00310 m]) / pow[n + m], dabs(r__1));
00311 reslts[1] = dmax(r__2,r__3);
00312 i__3 = m;
00313 for (i__ = 1; i__ <= i__3; ++i__) {
00314 rcmax = 0.f;
00315 i__4 = n;
00316 for (j = 1; j <= i__4; ++j) {
00317 if (i__ <= j + kl && i__ >= j - ku) {
00318 ratio = (r__1 = r__[i__ - 1] * pow[
00319 i__ + j] * c__[j - 1], dabs(
00320 r__1));
00321 rcmax = dmax(rcmax,ratio);
00322 }
00323
00324 }
00325
00326 r__2 = reslts[1], r__3 = (r__1 = 1.f - rcmax,
00327 dabs(r__1));
00328 reslts[1] = dmax(r__2,r__3);
00329
00330 }
00331
00332 i__3 = n;
00333 for (j = 1; j <= i__3; ++j) {
00334 rcmax = 0.f;
00335 i__4 = m;
00336 for (i__ = 1; i__ <= i__4; ++i__) {
00337 if (i__ <= j + kl && i__ >= j - ku) {
00338 ratio = (r__1 = r__[i__ - 1] * pow[
00339 i__ + j] * c__[j - 1], dabs(
00340 r__1));
00341 rcmax = dmax(rcmax,ratio);
00342 }
00343
00344 }
00345
00346 r__2 = reslts[1], r__3 = (r__1 = 1.f - rcmax,
00347 dabs(r__1));
00348 reslts[1] = dmax(r__2,r__3);
00349
00350 }
00351 }
00352 }
00353
00354
00355 }
00356
00357 }
00358
00359 }
00360
00361 }
00362 reslts[1] /= eps;
00363
00364
00365
00366 for (n = 0; n <= 5; ++n) {
00367
00368 for (i__ = 1; i__ <= 5; ++i__) {
00369 for (j = 1; j <= 5; ++j) {
00370 if (i__ <= n && j == i__) {
00371 i__1 = i__ + j;
00372 a[i__ + j * 5 - 6] = pow[i__ + j] * pow_ii(&c_n1, &i__1);
00373 } else {
00374 a[i__ + j * 5 - 6] = 0.f;
00375 }
00376
00377 }
00378
00379 }
00380
00381 spoequ_(&n, a, &c__5, r__, &rcond, &norm, &info);
00382
00383 if (info != 0) {
00384 reslts[2] = 1.f;
00385 } else {
00386 if (n != 0) {
00387
00388 r__2 = reslts[2], r__3 = (r__1 = (rcond - rpow[n - 1]) / rpow[
00389 n - 1], dabs(r__1));
00390 reslts[2] = dmax(r__2,r__3);
00391
00392 r__2 = reslts[2], r__3 = (r__1 = (norm - pow[n * 2]) / pow[n *
00393 2], dabs(r__1));
00394 reslts[2] = dmax(r__2,r__3);
00395 i__1 = n;
00396 for (i__ = 1; i__ <= i__1; ++i__) {
00397
00398 r__2 = reslts[2], r__3 = (r__1 = (r__[i__ - 1] - rpow[i__]
00399 ) / rpow[i__], dabs(r__1));
00400 reslts[2] = dmax(r__2,r__3);
00401
00402 }
00403 }
00404 }
00405
00406 }
00407 a[18] = -1.f;
00408 spoequ_(&c__5, a, &c__5, r__, &rcond, &norm, &info);
00409 if (info != 4) {
00410 reslts[2] = 1.f;
00411 }
00412 reslts[2] /= eps;
00413
00414
00415
00416 for (n = 0; n <= 5; ++n) {
00417
00418
00419
00420 i__1 = n * (n + 1) / 2;
00421 for (i__ = 1; i__ <= i__1; ++i__) {
00422 ap[i__ - 1] = 0.f;
00423
00424 }
00425 i__1 = n;
00426 for (i__ = 1; i__ <= i__1; ++i__) {
00427 ap[i__ * (i__ + 1) / 2 - 1] = pow[i__ * 2];
00428
00429 }
00430
00431 sppequ_("U", &n, ap, r__, &rcond, &norm, &info);
00432
00433 if (info != 0) {
00434 reslts[3] = 1.f;
00435 } else {
00436 if (n != 0) {
00437
00438 r__2 = reslts[3], r__3 = (r__1 = (rcond - rpow[n - 1]) / rpow[
00439 n - 1], dabs(r__1));
00440 reslts[3] = dmax(r__2,r__3);
00441
00442 r__2 = reslts[3], r__3 = (r__1 = (norm - pow[n * 2]) / pow[n *
00443 2], dabs(r__1));
00444 reslts[3] = dmax(r__2,r__3);
00445 i__1 = n;
00446 for (i__ = 1; i__ <= i__1; ++i__) {
00447
00448 r__2 = reslts[3], r__3 = (r__1 = (r__[i__ - 1] - rpow[i__]
00449 ) / rpow[i__], dabs(r__1));
00450 reslts[3] = dmax(r__2,r__3);
00451
00452 }
00453 }
00454 }
00455
00456
00457
00458 i__1 = n * (n + 1) / 2;
00459 for (i__ = 1; i__ <= i__1; ++i__) {
00460 ap[i__ - 1] = 0.f;
00461
00462 }
00463 j = 1;
00464 i__1 = n;
00465 for (i__ = 1; i__ <= i__1; ++i__) {
00466 ap[j - 1] = pow[i__ * 2];
00467 j += n - i__ + 1;
00468
00469 }
00470
00471 sppequ_("L", &n, ap, r__, &rcond, &norm, &info);
00472
00473 if (info != 0) {
00474 reslts[3] = 1.f;
00475 } else {
00476 if (n != 0) {
00477
00478 r__2 = reslts[3], r__3 = (r__1 = (rcond - rpow[n - 1]) / rpow[
00479 n - 1], dabs(r__1));
00480 reslts[3] = dmax(r__2,r__3);
00481
00482 r__2 = reslts[3], r__3 = (r__1 = (norm - pow[n * 2]) / pow[n *
00483 2], dabs(r__1));
00484 reslts[3] = dmax(r__2,r__3);
00485 i__1 = n;
00486 for (i__ = 1; i__ <= i__1; ++i__) {
00487
00488 r__2 = reslts[3], r__3 = (r__1 = (r__[i__ - 1] - rpow[i__]
00489 ) / rpow[i__], dabs(r__1));
00490 reslts[3] = dmax(r__2,r__3);
00491
00492 }
00493 }
00494 }
00495
00496
00497 }
00498 i__ = 13;
00499 ap[i__ - 1] = -1.f;
00500 sppequ_("L", &c__5, ap, r__, &rcond, &norm, &info);
00501 if (info != 4) {
00502 reslts[3] = 1.f;
00503 }
00504 reslts[3] /= eps;
00505
00506
00507
00508 for (n = 0; n <= 5; ++n) {
00509
00510 i__2 = n - 1;
00511 i__1 = max(i__2,0);
00512 for (kl = 0; kl <= i__1; ++kl) {
00513
00514
00515
00516 for (j = 1; j <= 5; ++j) {
00517 for (i__ = 1; i__ <= 13; ++i__) {
00518 ab[i__ + j * 13 - 14] = 0.f;
00519
00520 }
00521
00522 }
00523 i__2 = n;
00524 for (j = 1; j <= i__2; ++j) {
00525 ab[kl + 1 + j * 13 - 14] = pow[j * 2];
00526
00527 }
00528
00529 spbequ_("U", &n, &kl, ab, &c__13, r__, &rcond, &norm, &info);
00530
00531 if (info != 0) {
00532 reslts[4] = 1.f;
00533 } else {
00534 if (n != 0) {
00535
00536 r__2 = reslts[4], r__3 = (r__1 = (rcond - rpow[n - 1]) /
00537 rpow[n - 1], dabs(r__1));
00538 reslts[4] = dmax(r__2,r__3);
00539
00540 r__2 = reslts[4], r__3 = (r__1 = (norm - pow[n * 2]) /
00541 pow[n * 2], dabs(r__1));
00542 reslts[4] = dmax(r__2,r__3);
00543 i__2 = n;
00544 for (i__ = 1; i__ <= i__2; ++i__) {
00545
00546 r__2 = reslts[4], r__3 = (r__1 = (r__[i__ - 1] - rpow[
00547 i__]) / rpow[i__], dabs(r__1));
00548 reslts[4] = dmax(r__2,r__3);
00549
00550 }
00551 }
00552 }
00553 if (n != 0) {
00554
00555 i__2 = n - 1;
00556 ab[kl + 1 + max(i__2,1) * 13 - 14] = -1.f;
00557 spbequ_("U", &n, &kl, ab, &c__13, r__, &rcond, &norm, &info);
00558
00559 i__2 = n - 1;
00560 if (info != max(i__2,1)) {
00561 reslts[4] = 1.f;
00562 }
00563 }
00564
00565
00566
00567 for (j = 1; j <= 5; ++j) {
00568 for (i__ = 1; i__ <= 13; ++i__) {
00569 ab[i__ + j * 13 - 14] = 0.f;
00570
00571 }
00572
00573 }
00574 i__2 = n;
00575 for (j = 1; j <= i__2; ++j) {
00576 ab[j * 13 - 13] = pow[j * 2];
00577
00578 }
00579
00580 spbequ_("L", &n, &kl, ab, &c__13, r__, &rcond, &norm, &info);
00581
00582 if (info != 0) {
00583 reslts[4] = 1.f;
00584 } else {
00585 if (n != 0) {
00586
00587 r__2 = reslts[4], r__3 = (r__1 = (rcond - rpow[n - 1]) /
00588 rpow[n - 1], dabs(r__1));
00589 reslts[4] = dmax(r__2,r__3);
00590
00591 r__2 = reslts[4], r__3 = (r__1 = (norm - pow[n * 2]) /
00592 pow[n * 2], dabs(r__1));
00593 reslts[4] = dmax(r__2,r__3);
00594 i__2 = n;
00595 for (i__ = 1; i__ <= i__2; ++i__) {
00596
00597 r__2 = reslts[4], r__3 = (r__1 = (r__[i__ - 1] - rpow[
00598 i__]) / rpow[i__], dabs(r__1));
00599 reslts[4] = dmax(r__2,r__3);
00600
00601 }
00602 }
00603 }
00604 if (n != 0) {
00605
00606 i__2 = n - 1;
00607 ab[max(i__2,1) * 13 - 13] = -1.f;
00608 spbequ_("L", &n, &kl, ab, &c__13, r__, &rcond, &norm, &info);
00609
00610 i__2 = n - 1;
00611 if (info != max(i__2,1)) {
00612 reslts[4] = 1.f;
00613 }
00614 }
00615
00616 }
00617
00618 }
00619 reslts[4] /= eps;
00620 ok = reslts[0] <= *thresh && reslts[1] <= *thresh && reslts[2] <= *thresh
00621 && reslts[3] <= *thresh && reslts[4] <= *thresh;
00622 io___25.ciunit = *nout;
00623 s_wsle(&io___25);
00624 e_wsle();
00625 if (ok) {
00626 io___26.ciunit = *nout;
00627 s_wsfe(&io___26);
00628 do_fio(&c__1, path, (ftnlen)3);
00629 e_wsfe();
00630 } else {
00631 if (reslts[0] > *thresh) {
00632 io___27.ciunit = *nout;
00633 s_wsfe(&io___27);
00634 do_fio(&c__1, (char *)&reslts[0], (ftnlen)sizeof(real));
00635 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(real));
00636 e_wsfe();
00637 }
00638 if (reslts[1] > *thresh) {
00639 io___28.ciunit = *nout;
00640 s_wsfe(&io___28);
00641 do_fio(&c__1, (char *)&reslts[1], (ftnlen)sizeof(real));
00642 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(real));
00643 e_wsfe();
00644 }
00645 if (reslts[2] > *thresh) {
00646 io___29.ciunit = *nout;
00647 s_wsfe(&io___29);
00648 do_fio(&c__1, (char *)&reslts[2], (ftnlen)sizeof(real));
00649 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(real));
00650 e_wsfe();
00651 }
00652 if (reslts[3] > *thresh) {
00653 io___30.ciunit = *nout;
00654 s_wsfe(&io___30);
00655 do_fio(&c__1, (char *)&reslts[3], (ftnlen)sizeof(real));
00656 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(real));
00657 e_wsfe();
00658 }
00659 if (reslts[4] > *thresh) {
00660 io___31.ciunit = *nout;
00661 s_wsfe(&io___31);
00662 do_fio(&c__1, (char *)&reslts[4], (ftnlen)sizeof(real));
00663 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(real));
00664 e_wsfe();
00665 }
00666 }
00667 return 0;
00668
00669
00670
00671 }