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__16 = 16;
00019 static integer c__0 = 0;
00020 static integer c__1 = 1;
00021 static integer c__4 = 4;
00022 static integer c__5 = 5;
00023 static logical c_true = TRUE_;
00024 static integer c__2 = 2;
00025 static integer c__32 = 32;
00026 static integer c__3 = 3;
00027 static real c_b64 = 1.f;
00028
00029 int sget34_(real *rmax, integer *lmax, integer *ninfo,
00030 integer *knt)
00031 {
00032
00033 real r__1, r__2, r__3;
00034
00035
00036 double sqrt(doublereal), r_sign(real *, real *);
00037
00038
00039 integer i__, j;
00040 real q[16] , t[16] , t1[16]
00041 ;
00042 integer ia, ib, ic;
00043 real vm[2];
00044 integer ia11, ia12, ia21, ia22, ic11, ic12, ic21, ic22, iam, icm;
00045 real val[9], eps, res;
00046 integer info;
00047 real tnrm, work[32];
00048 extern int shst01_(integer *, integer *, integer *, real
00049 *, integer *, real *, integer *, real *, integer *, real *,
00050 integer *, real *), scopy_(integer *, real *, integer *, real *,
00051 integer *), slabad_(real *, real *);
00052 extern doublereal slamch_(char *);
00053 extern int slaexc_(logical *, integer *, real *, integer
00054 *, real *, integer *, integer *, integer *, integer *, real *,
00055 integer *);
00056 real bignum, smlnum, result[2];
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
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 --ninfo;
00121
00122
00123 eps = slamch_("P");
00124 smlnum = slamch_("S") / eps;
00125 bignum = 1.f / smlnum;
00126 slabad_(&smlnum, &bignum);
00127
00128
00129
00130 val[0] = 0.f;
00131 val[1] = sqrt(smlnum);
00132 val[2] = 1.f;
00133 val[3] = 2.f;
00134 val[4] = sqrt(bignum);
00135 val[5] = -sqrt(smlnum);
00136 val[6] = -1.f;
00137 val[7] = -2.f;
00138 val[8] = -sqrt(bignum);
00139 vm[0] = 1.f;
00140 vm[1] = eps * 2.f + 1.f;
00141 scopy_(&c__16, &val[3], &c__0, t, &c__1);
00142
00143 ninfo[1] = 0;
00144 ninfo[2] = 0;
00145 *knt = 0;
00146 *lmax = 0;
00147 *rmax = 0.f;
00148
00149
00150
00151 for (ia = 1; ia <= 9; ++ia) {
00152 for (iam = 1; iam <= 2; ++iam) {
00153 for (ib = 1; ib <= 9; ++ib) {
00154 for (ic = 1; ic <= 9; ++ic) {
00155 t[0] = val[ia - 1] * vm[iam - 1];
00156 t[5] = val[ic - 1];
00157 t[4] = val[ib - 1];
00158 t[1] = 0.f;
00159
00160 r__1 = dabs(t[0]), r__2 = dabs(t[5]), r__1 = max(r__1,
00161 r__2), r__2 = dabs(t[4]);
00162 tnrm = dmax(r__1,r__2);
00163 scopy_(&c__16, t, &c__1, t1, &c__1);
00164 scopy_(&c__16, val, &c__0, q, &c__1);
00165 scopy_(&c__4, &val[2], &c__0, q, &c__5);
00166 slaexc_(&c_true, &c__2, t, &c__4, q, &c__4, &c__1, &c__1,
00167 &c__1, work, &info);
00168 if (info != 0) {
00169 ++ninfo[info];
00170 }
00171 shst01_(&c__2, &c__1, &c__2, t1, &c__4, t, &c__4, q, &
00172 c__4, work, &c__32, result);
00173 res = result[0] + result[1];
00174 if (info != 0) {
00175 res += 1.f / eps;
00176 }
00177 if (t[0] != t1[5]) {
00178 res += 1.f / eps;
00179 }
00180 if (t[5] != t1[0]) {
00181 res += 1.f / eps;
00182 }
00183 if (t[1] != 0.f) {
00184 res += 1.f / eps;
00185 }
00186 ++(*knt);
00187 if (res > *rmax) {
00188 *lmax = *knt;
00189 *rmax = res;
00190 }
00191
00192 }
00193
00194 }
00195
00196 }
00197
00198 }
00199
00200 for (ia = 1; ia <= 5; ++ia) {
00201 for (iam = 1; iam <= 2; ++iam) {
00202 for (ib = 1; ib <= 5; ++ib) {
00203 for (ic11 = 1; ic11 <= 5; ++ic11) {
00204 for (ic12 = 2; ic12 <= 5; ++ic12) {
00205 for (ic21 = 2; ic21 <= 4; ++ic21) {
00206 for (ic22 = -1; ic22 <= 1; ic22 += 2) {
00207 t[0] = val[ia - 1] * vm[iam - 1];
00208 t[4] = val[ib - 1];
00209 t[8] = val[ib - 1] * -2.f;
00210 t[1] = 0.f;
00211 t[5] = val[ic11 - 1];
00212 t[9] = val[ic12 - 1];
00213 t[2] = 0.f;
00214 t[6] = -val[ic21 - 1];
00215 t[10] = val[ic11 - 1] * (real) ic22;
00216
00217 r__1 = dabs(t[0]), r__2 = dabs(t[4]), r__1 =
00218 max(r__1,r__2), r__2 = dabs(t[8]),
00219 r__1 = max(r__1,r__2), r__2 = dabs(t[
00220 5]), r__1 = max(r__1,r__2), r__2 =
00221 dabs(t[9]), r__1 = max(r__1,r__2),
00222 r__2 = dabs(t[6]), r__1 = max(r__1,
00223 r__2), r__2 = dabs(t[10]);
00224 tnrm = dmax(r__1,r__2);
00225 scopy_(&c__16, t, &c__1, t1, &c__1);
00226 scopy_(&c__16, val, &c__0, q, &c__1);
00227 scopy_(&c__4, &val[2], &c__0, q, &c__5);
00228 slaexc_(&c_true, &c__3, t, &c__4, q, &c__4, &
00229 c__1, &c__1, &c__2, work, &info);
00230 if (info != 0) {
00231 ++ninfo[info];
00232 }
00233 shst01_(&c__3, &c__1, &c__3, t1, &c__4, t, &
00234 c__4, q, &c__4, work, &c__32, result);
00235 res = result[0] + result[1];
00236 if (info == 0) {
00237 if (t1[0] != t[10]) {
00238 res += 1.f / eps;
00239 }
00240 if (t[2] != 0.f) {
00241 res += 1.f / eps;
00242 }
00243 if (t[6] != 0.f) {
00244 res += 1.f / eps;
00245 }
00246 if (t[1] != 0.f && (t[0] != t[5] ||
00247 r_sign(&c_b64, &t[4]) == r_sign(&
00248 c_b64, &t[1]))) {
00249 res += 1.f / eps;
00250 }
00251 }
00252 ++(*knt);
00253 if (res > *rmax) {
00254 *lmax = *knt;
00255 *rmax = res;
00256 }
00257
00258 }
00259
00260 }
00261
00262 }
00263
00264 }
00265
00266 }
00267
00268 }
00269
00270 }
00271
00272 for (ia11 = 1; ia11 <= 5; ++ia11) {
00273 for (ia12 = 2; ia12 <= 5; ++ia12) {
00274 for (ia21 = 2; ia21 <= 4; ++ia21) {
00275 for (ia22 = -1; ia22 <= 1; ia22 += 2) {
00276 for (icm = 1; icm <= 2; ++icm) {
00277 for (ib = 1; ib <= 5; ++ib) {
00278 for (ic = 1; ic <= 5; ++ic) {
00279 t[0] = val[ia11 - 1];
00280 t[4] = val[ia12 - 1];
00281 t[8] = val[ib - 1] * -2.f;
00282 t[1] = -val[ia21 - 1];
00283 t[5] = val[ia11 - 1] * (real) ia22;
00284 t[9] = val[ib - 1];
00285 t[2] = 0.f;
00286 t[6] = 0.f;
00287 t[10] = val[ic - 1] * vm[icm - 1];
00288
00289 r__1 = dabs(t[0]), r__2 = dabs(t[4]), r__1 =
00290 max(r__1,r__2), r__2 = dabs(t[8]),
00291 r__1 = max(r__1,r__2), r__2 = dabs(t[
00292 5]), r__1 = max(r__1,r__2), r__2 =
00293 dabs(t[9]), r__1 = max(r__1,r__2),
00294 r__2 = dabs(t[6]), r__1 = max(r__1,
00295 r__2), r__2 = dabs(t[10]);
00296 tnrm = dmax(r__1,r__2);
00297 scopy_(&c__16, t, &c__1, t1, &c__1);
00298 scopy_(&c__16, val, &c__0, q, &c__1);
00299 scopy_(&c__4, &val[2], &c__0, q, &c__5);
00300 slaexc_(&c_true, &c__3, t, &c__4, q, &c__4, &
00301 c__1, &c__2, &c__1, work, &info);
00302 if (info != 0) {
00303 ++ninfo[info];
00304 }
00305 shst01_(&c__3, &c__1, &c__3, t1, &c__4, t, &
00306 c__4, q, &c__4, work, &c__32, result);
00307 res = result[0] + result[1];
00308 if (info == 0) {
00309 if (t1[10] != t[0]) {
00310 res += 1.f / eps;
00311 }
00312 if (t[1] != 0.f) {
00313 res += 1.f / eps;
00314 }
00315 if (t[2] != 0.f) {
00316 res += 1.f / eps;
00317 }
00318 if (t[6] != 0.f && (t[5] != t[10] ||
00319 r_sign(&c_b64, &t[9]) == r_sign(&
00320 c_b64, &t[6]))) {
00321 res += 1.f / eps;
00322 }
00323 }
00324 ++(*knt);
00325 if (res > *rmax) {
00326 *lmax = *knt;
00327 *rmax = res;
00328 }
00329
00330 }
00331
00332 }
00333
00334 }
00335
00336 }
00337
00338 }
00339
00340 }
00341
00342 }
00343
00344 for (ia11 = 1; ia11 <= 5; ++ia11) {
00345 for (ia12 = 2; ia12 <= 5; ++ia12) {
00346 for (ia21 = 2; ia21 <= 4; ++ia21) {
00347 for (ia22 = -1; ia22 <= 1; ia22 += 2) {
00348 for (ib = 1; ib <= 5; ++ib) {
00349 for (ic11 = 3; ic11 <= 4; ++ic11) {
00350 for (ic12 = 3; ic12 <= 4; ++ic12) {
00351 for (ic21 = 3; ic21 <= 4; ++ic21) {
00352 for (ic22 = -1; ic22 <= 1; ic22 += 2) {
00353 for (icm = 5; icm <= 7; ++icm) {
00354 iam = 1;
00355 t[0] = val[ia11 - 1] * vm[iam - 1]
00356 ;
00357 t[4] = val[ia12 - 1] * vm[iam - 1]
00358 ;
00359 t[8] = val[ib - 1] * -2.f;
00360 t[12] = val[ib - 1] * .5f;
00361 t[1] = -t[4] * val[ia21 - 1];
00362 t[5] = val[ia11 - 1] * (real)
00363 ia22 * vm[iam - 1];
00364 t[9] = val[ib - 1];
00365 t[13] = val[ib - 1] * 3.f;
00366 t[2] = 0.f;
00367 t[6] = 0.f;
00368 t[10] = val[ic11 - 1] * (r__1 =
00369 val[icm - 1], dabs(r__1));
00370 t[14] = val[ic12 - 1] * (r__1 =
00371 val[icm - 1], dabs(r__1));
00372 t[3] = 0.f;
00373 t[7] = 0.f;
00374 t[11] = -t[14] * val[ic21 - 1] * (
00375 r__1 = val[icm - 1], dabs(
00376 r__1));
00377 t[15] = val[ic11 - 1] * (real)
00378 ic22 * (r__1 = val[icm -
00379 1], dabs(r__1));
00380 tnrm = 0.f;
00381 for (i__ = 1; i__ <= 4; ++i__) {
00382 for (j = 1; j <= 4; ++j) {
00383
00384 r__2 = tnrm, r__3 = (r__1 = t[i__ + (j << 2) -
00385 5], dabs(r__1));
00386 tnrm = dmax(r__2,r__3);
00387
00388 }
00389
00390 }
00391 scopy_(&c__16, t, &c__1, t1, &
00392 c__1);
00393 scopy_(&c__16, val, &c__0, q, &
00394 c__1);
00395 scopy_(&c__4, &val[2], &c__0, q, &
00396 c__5);
00397 slaexc_(&c_true, &c__4, t, &c__4,
00398 q, &c__4, &c__1, &c__2, &
00399 c__2, work, &info);
00400 if (info != 0) {
00401 ++ninfo[info];
00402 }
00403 shst01_(&c__4, &c__1, &c__4, t1, &
00404 c__4, t, &c__4, q, &c__4,
00405 work, &c__32, result);
00406 res = result[0] + result[1];
00407 if (info == 0) {
00408 if (t[2] != 0.f) {
00409 res += 1.f / eps;
00410 }
00411 if (t[3] != 0.f) {
00412 res += 1.f / eps;
00413 }
00414 if (t[6] != 0.f) {
00415 res += 1.f / eps;
00416 }
00417 if (t[7] != 0.f) {
00418 res += 1.f / eps;
00419 }
00420 if (t[1] != 0.f && (t[0] != t[5] || r_sign(&c_b64, &
00421 t[4]) == r_sign(&c_b64, &t[1]))) {
00422 res += 1.f / eps;
00423 }
00424 if (t[11] != 0.f && (t[10] != t[15] || r_sign(&
00425 c_b64, &t[14]) == r_sign(&c_b64, &t[11]))) {
00426 res += 1.f / eps;
00427 }
00428 }
00429 ++(*knt);
00430 if (res > *rmax) {
00431 *lmax = *knt;
00432 *rmax = res;
00433 }
00434
00435 }
00436
00437 }
00438
00439 }
00440
00441 }
00442
00443 }
00444
00445 }
00446
00447 }
00448
00449 }
00450
00451 }
00452
00453 }
00454
00455 return 0;
00456
00457
00458
00459 }