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