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__10 = 10;
00019 static integer c__1 = 1;
00020 static logical c_false = FALSE_;
00021 static logical c_true = TRUE_;
00022 static real c_b25 = 1.f;
00023 static real c_b59 = -1.f;
00024
00025 int sget39_(real *rmax, integer *lmax, integer *ninfo,
00026 integer *knt)
00027 {
00028
00029
00030 static integer idim[6] = { 4,5,5,5,5,5 };
00031 static integer ival[150] = { 3,0,0,0,0,1,1,-1,0,0,
00032 3,2,1,0,0,4,3,2,2,0,0,0,0,0,0,1,0,0,0,0,2,2,0,0,0,3,3,4,0,0,4,2,2,
00033 3,0,1,1,1,1,5,1,0,0,0,0,2,4,-2,0,0,3,3,4,0,0,4,2,2,3,0,1,1,1,1,1,
00034 1,0,0,0,0,2,1,-1,0,0,9,8,1,0,0,4,9,1,2,-1,2,2,2,2,2,9,0,0,0,0,6,4,
00035 0,0,0,3,2,1,1,0,5,1,-1,1,0,2,2,2,2,2,4,0,0,0,0,2,2,0,0,0,1,4,4,0,
00036 0,2,4,2,2,-1,2,2,2,2,2 };
00037
00038
00039 integer i__1, i__2;
00040 real r__1, r__2;
00041
00042
00043 double sqrt(doublereal), cos(doublereal), sin(doublereal);
00044
00045
00046 real b[10], d__[20];
00047 integer i__, j, k, n;
00048 real t[100] , w, x[20], y[20], vm1[5], vm2[5], vm3[5],
00049 vm4[5], vm5[3], dum[1], eps;
00050 integer ivm1, ivm2, ivm3, ivm4, ivm5, ndim, info;
00051 real dumm;
00052 extern doublereal sdot_(integer *, real *, integer *, real *, integer *);
00053 real norm, work[10], scale, domin, resid;
00054 extern int sgemv_(char *, integer *, integer *, real *,
00055 real *, integer *, real *, integer *, real *, real *, integer *);
00056 extern doublereal sasum_(integer *, real *, integer *);
00057 extern int scopy_(integer *, real *, integer *, real *,
00058 integer *);
00059 real xnorm;
00060 extern int slabad_(real *, real *);
00061 extern doublereal slamch_(char *), slange_(char *, integer *,
00062 integer *, real *, integer *, real *);
00063 real bignum;
00064 extern integer isamax_(integer *, real *, integer *);
00065 real normtb;
00066 extern int slaqtr_(logical *, logical *, integer *, real
00067 *, integer *, real *, real *, real *, real *, real *, integer *);
00068 real smlnum;
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
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 eps = slamch_("P");
00156 smlnum = slamch_("S");
00157 bignum = 1.f / smlnum;
00158 slabad_(&smlnum, &bignum);
00159
00160
00161
00162 vm1[0] = 1.f;
00163 vm1[1] = sqrt(smlnum);
00164 vm1[2] = sqrt(vm1[1]);
00165 vm1[3] = sqrt(bignum);
00166 vm1[4] = sqrt(vm1[3]);
00167
00168 vm2[0] = 1.f;
00169 vm2[1] = sqrt(smlnum);
00170 vm2[2] = sqrt(vm2[1]);
00171 vm2[3] = sqrt(bignum);
00172 vm2[4] = sqrt(vm2[3]);
00173
00174 vm3[0] = 1.f;
00175 vm3[1] = sqrt(smlnum);
00176 vm3[2] = sqrt(vm3[1]);
00177 vm3[3] = sqrt(bignum);
00178 vm3[4] = sqrt(vm3[3]);
00179
00180 vm4[0] = 1.f;
00181 vm4[1] = sqrt(smlnum);
00182 vm4[2] = sqrt(vm4[1]);
00183 vm4[3] = sqrt(bignum);
00184 vm4[4] = sqrt(vm4[3]);
00185
00186 vm5[0] = 1.f;
00187 vm5[1] = eps;
00188 vm5[2] = sqrt(smlnum);
00189
00190
00191
00192 *knt = 0;
00193 *rmax = 0.f;
00194 *ninfo = 0;
00195 smlnum /= eps;
00196
00197
00198
00199 for (ivm5 = 1; ivm5 <= 3; ++ivm5) {
00200 for (ivm4 = 1; ivm4 <= 5; ++ivm4) {
00201 for (ivm3 = 1; ivm3 <= 5; ++ivm3) {
00202 for (ivm2 = 1; ivm2 <= 5; ++ivm2) {
00203 for (ivm1 = 1; ivm1 <= 5; ++ivm1) {
00204 for (ndim = 1; ndim <= 6; ++ndim) {
00205
00206 n = idim[ndim - 1];
00207 i__1 = n;
00208 for (i__ = 1; i__ <= i__1; ++i__) {
00209 i__2 = n;
00210 for (j = 1; j <= i__2; ++j) {
00211 t[i__ + j * 10 - 11] = (real) ival[i__ + (
00212 j + ndim * 5) * 5 - 31] * vm1[
00213 ivm1 - 1];
00214 if (i__ >= j) {
00215 t[i__ + j * 10 - 11] *= vm5[ivm5 - 1];
00216 }
00217
00218 }
00219
00220 }
00221
00222 w = vm2[ivm2 - 1] * 1.f;
00223
00224 i__1 = n;
00225 for (i__ = 1; i__ <= i__1; ++i__) {
00226 b[i__ - 1] = cos((real) i__) * vm3[ivm3 - 1];
00227
00228 }
00229
00230 i__1 = n << 1;
00231 for (i__ = 1; i__ <= i__1; ++i__) {
00232 d__[i__ - 1] = sin((real) i__) * vm4[ivm4 - 1]
00233 ;
00234
00235 }
00236
00237 norm = slange_("1", &n, &n, t, &c__10, work);
00238 k = isamax_(&n, b, &c__1);
00239 normtb = norm + (r__1 = b[k - 1], dabs(r__1)) +
00240 dabs(w);
00241
00242 scopy_(&n, d__, &c__1, x, &c__1);
00243 ++(*knt);
00244 slaqtr_(&c_false, &c_true, &n, t, &c__10, dum, &
00245 dumm, &scale, x, work, &info);
00246 if (info != 0) {
00247 ++(*ninfo);
00248 }
00249
00250
00251
00252
00253 scopy_(&n, d__, &c__1, y, &c__1);
00254 r__1 = -scale;
00255 sgemv_("No transpose", &n, &n, &c_b25, t, &c__10,
00256 x, &c__1, &r__1, y, &c__1);
00257 xnorm = sasum_(&n, x, &c__1);
00258 resid = sasum_(&n, y, &c__1);
00259
00260 r__1 = smlnum, r__2 = smlnum / eps * norm, r__1 =
00261 max(r__1,r__2), r__2 = norm * eps * xnorm;
00262 domin = dmax(r__1,r__2);
00263 resid /= domin;
00264 if (resid > *rmax) {
00265 *rmax = resid;
00266 *lmax = *knt;
00267 }
00268
00269 scopy_(&n, d__, &c__1, x, &c__1);
00270 ++(*knt);
00271 slaqtr_(&c_true, &c_true, &n, t, &c__10, dum, &
00272 dumm, &scale, x, work, &info);
00273 if (info != 0) {
00274 ++(*ninfo);
00275 }
00276
00277
00278
00279
00280 scopy_(&n, d__, &c__1, y, &c__1);
00281 r__1 = -scale;
00282 sgemv_("Transpose", &n, &n, &c_b25, t, &c__10, x,
00283 &c__1, &r__1, y, &c__1);
00284 xnorm = sasum_(&n, x, &c__1);
00285 resid = sasum_(&n, y, &c__1);
00286
00287 r__1 = smlnum, r__2 = smlnum / eps * norm, r__1 =
00288 max(r__1,r__2), r__2 = norm * eps * xnorm;
00289 domin = dmax(r__1,r__2);
00290 resid /= domin;
00291 if (resid > *rmax) {
00292 *rmax = resid;
00293 *lmax = *knt;
00294 }
00295
00296 i__1 = n << 1;
00297 scopy_(&i__1, d__, &c__1, x, &c__1);
00298 ++(*knt);
00299 slaqtr_(&c_false, &c_false, &n, t, &c__10, b, &w,
00300 &scale, x, work, &info);
00301 if (info != 0) {
00302 ++(*ninfo);
00303 }
00304
00305
00306
00307
00308
00309
00310 i__1 = n << 1;
00311 scopy_(&i__1, d__, &c__1, y, &c__1);
00312 y[0] = sdot_(&n, b, &c__1, &x[n], &c__1) + scale *
00313 y[0];
00314 i__1 = n;
00315 for (i__ = 2; i__ <= i__1; ++i__) {
00316 y[i__ - 1] = w * x[i__ + n - 1] + scale * y[
00317 i__ - 1];
00318
00319 }
00320 sgemv_("No transpose", &n, &n, &c_b25, t, &c__10,
00321 x, &c__1, &c_b59, y, &c__1);
00322
00323 y[n] = sdot_(&n, b, &c__1, x, &c__1) - scale * y[
00324 n];
00325 i__1 = n;
00326 for (i__ = 2; i__ <= i__1; ++i__) {
00327 y[i__ + n - 1] = w * x[i__ - 1] - scale * y[
00328 i__ + n - 1];
00329
00330 }
00331 sgemv_("No transpose", &n, &n, &c_b25, t, &c__10,
00332 &x[n], &c__1, &c_b25, &y[n], &c__1);
00333
00334 i__1 = n << 1;
00335 resid = sasum_(&i__1, y, &c__1);
00336
00337 i__1 = n << 1;
00338 r__1 = smlnum, r__2 = smlnum / eps * normtb, r__1
00339 = max(r__1,r__2), r__2 = eps * (normtb *
00340 sasum_(&i__1, x, &c__1));
00341 domin = dmax(r__1,r__2);
00342 resid /= domin;
00343 if (resid > *rmax) {
00344 *rmax = resid;
00345 *lmax = *knt;
00346 }
00347
00348 i__1 = n << 1;
00349 scopy_(&i__1, d__, &c__1, x, &c__1);
00350 ++(*knt);
00351 slaqtr_(&c_true, &c_false, &n, t, &c__10, b, &w, &
00352 scale, x, work, &info);
00353 if (info != 0) {
00354 ++(*ninfo);
00355 }
00356
00357
00358
00359
00360
00361 i__1 = n << 1;
00362 scopy_(&i__1, d__, &c__1, y, &c__1);
00363 y[0] = b[0] * x[n] - scale * y[0];
00364 i__1 = n;
00365 for (i__ = 2; i__ <= i__1; ++i__) {
00366 y[i__ - 1] = b[i__ - 1] * x[n] + w * x[i__ +
00367 n - 1] - scale * y[i__ - 1];
00368
00369 }
00370 sgemv_("Transpose", &n, &n, &c_b25, t, &c__10, x,
00371 &c__1, &c_b25, y, &c__1);
00372
00373 y[n] = b[0] * x[0] + scale * y[n];
00374 i__1 = n;
00375 for (i__ = 2; i__ <= i__1; ++i__) {
00376 y[i__ + n - 1] = b[i__ - 1] * x[0] + w * x[
00377 i__ - 1] + scale * y[i__ + n - 1];
00378
00379 }
00380 sgemv_("Transpose", &n, &n, &c_b25, t, &c__10, &x[
00381 n], &c__1, &c_b59, &y[n], &c__1);
00382
00383 i__1 = n << 1;
00384 resid = sasum_(&i__1, y, &c__1);
00385
00386 i__1 = n << 1;
00387 r__1 = smlnum, r__2 = smlnum / eps * normtb, r__1
00388 = max(r__1,r__2), r__2 = eps * (normtb *
00389 sasum_(&i__1, x, &c__1));
00390 domin = dmax(r__1,r__2);
00391 resid /= domin;
00392 if (resid > *rmax) {
00393 *rmax = resid;
00394 *lmax = *knt;
00395 }
00396
00397
00398 }
00399
00400 }
00401
00402 }
00403
00404 }
00405
00406 }
00407
00408 }
00409
00410 return 0;
00411
00412
00413
00414 }