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 doublereal c_b29 = 1.;
00019 static doublereal c_b30 = 0.;
00020 static doublereal c_b33 = -1.;
00021
00022 int dlatm5_(integer *prtype, integer *m, integer *n,
00023 doublereal *a, integer *lda, doublereal *b, integer *ldb, doublereal *
00024 c__, integer *ldc, doublereal *d__, integer *ldd, doublereal *e,
00025 integer *lde, doublereal *f, integer *ldf, doublereal *r__, integer *
00026 ldr, doublereal *l, integer *ldl, doublereal *alpha, integer *qblcka,
00027 integer *qblckb)
00028 {
00029
00030 integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, d_dim1,
00031 d_offset, e_dim1, e_offset, f_dim1, f_offset, l_dim1, l_offset,
00032 r_dim1, r_offset, i__1, i__2;
00033
00034
00035 double sin(doublereal);
00036
00037
00038 integer i__, j, k;
00039 extern int dgemm_(char *, char *, integer *, integer *,
00040 integer *, doublereal *, doublereal *, integer *, doublereal *,
00041 integer *, doublereal *, doublereal *, integer *);
00042 doublereal imeps, reeps;
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
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
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
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 a_dim1 = *lda;
00224 a_offset = 1 + a_dim1;
00225 a -= a_offset;
00226 b_dim1 = *ldb;
00227 b_offset = 1 + b_dim1;
00228 b -= b_offset;
00229 c_dim1 = *ldc;
00230 c_offset = 1 + c_dim1;
00231 c__ -= c_offset;
00232 d_dim1 = *ldd;
00233 d_offset = 1 + d_dim1;
00234 d__ -= d_offset;
00235 e_dim1 = *lde;
00236 e_offset = 1 + e_dim1;
00237 e -= e_offset;
00238 f_dim1 = *ldf;
00239 f_offset = 1 + f_dim1;
00240 f -= f_offset;
00241 r_dim1 = *ldr;
00242 r_offset = 1 + r_dim1;
00243 r__ -= r_offset;
00244 l_dim1 = *ldl;
00245 l_offset = 1 + l_dim1;
00246 l -= l_offset;
00247
00248
00249 if (*prtype == 1) {
00250 i__1 = *m;
00251 for (i__ = 1; i__ <= i__1; ++i__) {
00252 i__2 = *m;
00253 for (j = 1; j <= i__2; ++j) {
00254 if (i__ == j) {
00255 a[i__ + j * a_dim1] = 1.;
00256 d__[i__ + j * d_dim1] = 1.;
00257 } else if (i__ == j - 1) {
00258 a[i__ + j * a_dim1] = -1.;
00259 d__[i__ + j * d_dim1] = 0.;
00260 } else {
00261 a[i__ + j * a_dim1] = 0.;
00262 d__[i__ + j * d_dim1] = 0.;
00263 }
00264
00265 }
00266
00267 }
00268
00269 i__1 = *n;
00270 for (i__ = 1; i__ <= i__1; ++i__) {
00271 i__2 = *n;
00272 for (j = 1; j <= i__2; ++j) {
00273 if (i__ == j) {
00274 b[i__ + j * b_dim1] = 1. - *alpha;
00275 e[i__ + j * e_dim1] = 1.;
00276 } else if (i__ == j - 1) {
00277 b[i__ + j * b_dim1] = 1.;
00278 e[i__ + j * e_dim1] = 0.;
00279 } else {
00280 b[i__ + j * b_dim1] = 0.;
00281 e[i__ + j * e_dim1] = 0.;
00282 }
00283
00284 }
00285
00286 }
00287
00288 i__1 = *m;
00289 for (i__ = 1; i__ <= i__1; ++i__) {
00290 i__2 = *n;
00291 for (j = 1; j <= i__2; ++j) {
00292 r__[i__ + j * r_dim1] = (.5 - sin((doublereal) (i__ / j))) *
00293 20.;
00294 l[i__ + j * l_dim1] = r__[i__ + j * r_dim1];
00295
00296 }
00297
00298 }
00299
00300 } else if (*prtype == 2 || *prtype == 3) {
00301 i__1 = *m;
00302 for (i__ = 1; i__ <= i__1; ++i__) {
00303 i__2 = *m;
00304 for (j = 1; j <= i__2; ++j) {
00305 if (i__ <= j) {
00306 a[i__ + j * a_dim1] = (.5 - sin((doublereal) i__)) * 2.;
00307 d__[i__ + j * d_dim1] = (.5 - sin((doublereal) (i__ * j)))
00308 * 2.;
00309 } else {
00310 a[i__ + j * a_dim1] = 0.;
00311 d__[i__ + j * d_dim1] = 0.;
00312 }
00313
00314 }
00315
00316 }
00317
00318 i__1 = *n;
00319 for (i__ = 1; i__ <= i__1; ++i__) {
00320 i__2 = *n;
00321 for (j = 1; j <= i__2; ++j) {
00322 if (i__ <= j) {
00323 b[i__ + j * b_dim1] = (.5 - sin((doublereal) (i__ + j))) *
00324 2.;
00325 e[i__ + j * e_dim1] = (.5 - sin((doublereal) j)) * 2.;
00326 } else {
00327 b[i__ + j * b_dim1] = 0.;
00328 e[i__ + j * e_dim1] = 0.;
00329 }
00330
00331 }
00332
00333 }
00334
00335 i__1 = *m;
00336 for (i__ = 1; i__ <= i__1; ++i__) {
00337 i__2 = *n;
00338 for (j = 1; j <= i__2; ++j) {
00339 r__[i__ + j * r_dim1] = (.5 - sin((doublereal) (i__ * j))) *
00340 20.;
00341 l[i__ + j * l_dim1] = (.5 - sin((doublereal) (i__ + j))) *
00342 20.;
00343
00344 }
00345
00346 }
00347
00348 if (*prtype == 3) {
00349 if (*qblcka <= 1) {
00350 *qblcka = 2;
00351 }
00352 i__1 = *m - 1;
00353 i__2 = *qblcka;
00354 for (k = 1; i__2 < 0 ? k >= i__1 : k <= i__1; k += i__2) {
00355 a[k + 1 + (k + 1) * a_dim1] = a[k + k * a_dim1];
00356 a[k + 1 + k * a_dim1] = -sin(a[k + (k + 1) * a_dim1]);
00357
00358 }
00359
00360 if (*qblckb <= 1) {
00361 *qblckb = 2;
00362 }
00363 i__2 = *n - 1;
00364 i__1 = *qblckb;
00365 for (k = 1; i__1 < 0 ? k >= i__2 : k <= i__2; k += i__1) {
00366 b[k + 1 + (k + 1) * b_dim1] = b[k + k * b_dim1];
00367 b[k + 1 + k * b_dim1] = -sin(b[k + (k + 1) * b_dim1]);
00368
00369 }
00370 }
00371
00372 } else if (*prtype == 4) {
00373 i__1 = *m;
00374 for (i__ = 1; i__ <= i__1; ++i__) {
00375 i__2 = *m;
00376 for (j = 1; j <= i__2; ++j) {
00377 a[i__ + j * a_dim1] = (.5 - sin((doublereal) (i__ * j))) *
00378 20.;
00379 d__[i__ + j * d_dim1] = (.5 - sin((doublereal) (i__ + j))) *
00380 2.;
00381
00382 }
00383
00384 }
00385
00386 i__1 = *n;
00387 for (i__ = 1; i__ <= i__1; ++i__) {
00388 i__2 = *n;
00389 for (j = 1; j <= i__2; ++j) {
00390 b[i__ + j * b_dim1] = (.5 - sin((doublereal) (i__ + j))) *
00391 20.;
00392 e[i__ + j * e_dim1] = (.5 - sin((doublereal) (i__ * j))) * 2.;
00393
00394 }
00395
00396 }
00397
00398 i__1 = *m;
00399 for (i__ = 1; i__ <= i__1; ++i__) {
00400 i__2 = *n;
00401 for (j = 1; j <= i__2; ++j) {
00402 r__[i__ + j * r_dim1] = (.5 - sin((doublereal) (j / i__))) *
00403 20.;
00404 l[i__ + j * l_dim1] = (.5 - sin((doublereal) (i__ * j))) * 2.;
00405
00406 }
00407
00408 }
00409
00410 } else if (*prtype >= 5) {
00411 reeps = 20. / *alpha;
00412 imeps = -1.5 / *alpha;
00413 i__1 = *m;
00414 for (i__ = 1; i__ <= i__1; ++i__) {
00415 i__2 = *n;
00416 for (j = 1; j <= i__2; ++j) {
00417 r__[i__ + j * r_dim1] = (.5 - sin((doublereal) (i__ * j))) * *
00418 alpha / 20.;
00419 l[i__ + j * l_dim1] = (.5 - sin((doublereal) (i__ + j))) * *
00420 alpha / 20.;
00421
00422 }
00423
00424 }
00425
00426 i__1 = *m;
00427 for (i__ = 1; i__ <= i__1; ++i__) {
00428 d__[i__ + i__ * d_dim1] = 1.;
00429
00430 }
00431
00432 i__1 = *m;
00433 for (i__ = 1; i__ <= i__1; ++i__) {
00434 if (i__ <= 4) {
00435 a[i__ + i__ * a_dim1] = 1.;
00436 if (i__ > 2) {
00437 a[i__ + i__ * a_dim1] = reeps + 1.;
00438 }
00439 if (i__ % 2 != 0 && i__ < *m) {
00440 a[i__ + (i__ + 1) * a_dim1] = imeps;
00441 } else if (i__ > 1) {
00442 a[i__ + (i__ - 1) * a_dim1] = -imeps;
00443 }
00444 } else if (i__ <= 8) {
00445 if (i__ <= 6) {
00446 a[i__ + i__ * a_dim1] = reeps;
00447 } else {
00448 a[i__ + i__ * a_dim1] = -reeps;
00449 }
00450 if (i__ % 2 != 0 && i__ < *m) {
00451 a[i__ + (i__ + 1) * a_dim1] = 1.;
00452 } else if (i__ > 1) {
00453 a[i__ + (i__ - 1) * a_dim1] = -1.;
00454 }
00455 } else {
00456 a[i__ + i__ * a_dim1] = 1.;
00457 if (i__ % 2 != 0 && i__ < *m) {
00458 a[i__ + (i__ + 1) * a_dim1] = imeps * 2;
00459 } else if (i__ > 1) {
00460 a[i__ + (i__ - 1) * a_dim1] = -imeps * 2;
00461 }
00462 }
00463
00464 }
00465
00466 i__1 = *n;
00467 for (i__ = 1; i__ <= i__1; ++i__) {
00468 e[i__ + i__ * e_dim1] = 1.;
00469 if (i__ <= 4) {
00470 b[i__ + i__ * b_dim1] = -1.;
00471 if (i__ > 2) {
00472 b[i__ + i__ * b_dim1] = 1. - reeps;
00473 }
00474 if (i__ % 2 != 0 && i__ < *n) {
00475 b[i__ + (i__ + 1) * b_dim1] = imeps;
00476 } else if (i__ > 1) {
00477 b[i__ + (i__ - 1) * b_dim1] = -imeps;
00478 }
00479 } else if (i__ <= 8) {
00480 if (i__ <= 6) {
00481 b[i__ + i__ * b_dim1] = reeps;
00482 } else {
00483 b[i__ + i__ * b_dim1] = -reeps;
00484 }
00485 if (i__ % 2 != 0 && i__ < *n) {
00486 b[i__ + (i__ + 1) * b_dim1] = imeps + 1.;
00487 } else if (i__ > 1) {
00488 b[i__ + (i__ - 1) * b_dim1] = -1. - imeps;
00489 }
00490 } else {
00491 b[i__ + i__ * b_dim1] = 1. - reeps;
00492 if (i__ % 2 != 0 && i__ < *n) {
00493 b[i__ + (i__ + 1) * b_dim1] = imeps * 2;
00494 } else if (i__ > 1) {
00495 b[i__ + (i__ - 1) * b_dim1] = -imeps * 2;
00496 }
00497 }
00498
00499 }
00500 }
00501
00502
00503
00504 dgemm_("N", "N", m, n, m, &c_b29, &a[a_offset], lda, &r__[r_offset], ldr,
00505 &c_b30, &c__[c_offset], ldc);
00506 dgemm_("N", "N", m, n, n, &c_b33, &l[l_offset], ldl, &b[b_offset], ldb, &
00507 c_b29, &c__[c_offset], ldc);
00508 dgemm_("N", "N", m, n, m, &c_b29, &d__[d_offset], ldd, &r__[r_offset],
00509 ldr, &c_b30, &f[f_offset], ldf);
00510 dgemm_("N", "N", m, n, n, &c_b33, &l[l_offset], ldl, &e[e_offset], lde, &
00511 c_b29, &f[f_offset], ldf);
00512
00513
00514
00515 return 0;
00516 }