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 complex c_b1 = {0.f,0.f};
00019 static complex c_b2 = {1.f,0.f};
00020 static integer c__3 = 3;
00021 static integer c__1 = 1;
00022 static integer c__2 = 2;
00023
00024 int claqr5_(logical *wantt, logical *wantz, integer *kacc22,
00025 integer *n, integer *ktop, integer *kbot, integer *nshfts, complex *s,
00026 complex *h__, integer *ldh, integer *iloz, integer *ihiz, complex *
00027 z__, integer *ldz, complex *v, integer *ldv, complex *u, integer *ldu,
00028 integer *nv, complex *wv, integer *ldwv, integer *nh, complex *wh,
00029 integer *ldwh)
00030 {
00031
00032 integer h_dim1, h_offset, u_dim1, u_offset, v_dim1, v_offset, wh_dim1,
00033 wh_offset, wv_dim1, wv_offset, z_dim1, z_offset, i__1, i__2, i__3,
00034 i__4, i__5, i__6, i__7, i__8, i__9, i__10, i__11;
00035 real r__1, r__2, r__3, r__4, r__5, r__6, r__7, r__8, r__9, r__10;
00036 complex q__1, q__2, q__3, q__4, q__5, q__6, q__7, q__8;
00037
00038
00039 void r_cnjg(complex *, complex *);
00040 double r_imag(complex *);
00041
00042
00043 integer j, k, m, i2, j2, i4, j4, k1;
00044 real h11, h12, h21, h22;
00045 integer m22, ns, nu;
00046 complex vt[3];
00047 real scl;
00048 integer kdu, kms;
00049 real ulp;
00050 integer knz, kzs;
00051 real tst1, tst2;
00052 complex beta;
00053 logical blk22, bmp22;
00054 integer mend, jcol, jlen, jbot, mbot, jtop, jrow, mtop;
00055 complex alpha;
00056 logical accum;
00057 extern int cgemm_(char *, char *, integer *, integer *,
00058 integer *, complex *, complex *, integer *, complex *, integer *,
00059 complex *, complex *, integer *);
00060 integer ndcol, incol, krcol, nbmps;
00061 extern int ctrmm_(char *, char *, char *, char *,
00062 integer *, integer *, complex *, complex *, integer *, complex *,
00063 integer *), claqr1_(integer *,
00064 complex *, integer *, complex *, complex *, complex *), slabad_(
00065 real *, real *), clarfg_(integer *, complex *, complex *, integer
00066 *, complex *);
00067 extern doublereal slamch_(char *);
00068 extern int clacpy_(char *, integer *, integer *, complex
00069 *, integer *, complex *, integer *), claset_(char *,
00070 integer *, integer *, complex *, complex *, complex *, integer *);
00071 real safmin, safmax;
00072 complex refsum;
00073 integer mstart;
00074 real smlnum;
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
00224
00225
00226 --s;
00227 h_dim1 = *ldh;
00228 h_offset = 1 + h_dim1;
00229 h__ -= h_offset;
00230 z_dim1 = *ldz;
00231 z_offset = 1 + z_dim1;
00232 z__ -= z_offset;
00233 v_dim1 = *ldv;
00234 v_offset = 1 + v_dim1;
00235 v -= v_offset;
00236 u_dim1 = *ldu;
00237 u_offset = 1 + u_dim1;
00238 u -= u_offset;
00239 wv_dim1 = *ldwv;
00240 wv_offset = 1 + wv_dim1;
00241 wv -= wv_offset;
00242 wh_dim1 = *ldwh;
00243 wh_offset = 1 + wh_dim1;
00244 wh -= wh_offset;
00245
00246
00247 if (*nshfts < 2) {
00248 return 0;
00249 }
00250
00251
00252
00253
00254 if (*ktop >= *kbot) {
00255 return 0;
00256 }
00257
00258
00259
00260
00261 ns = *nshfts - *nshfts % 2;
00262
00263
00264
00265 safmin = slamch_("SAFE MINIMUM");
00266 safmax = 1.f / safmin;
00267 slabad_(&safmin, &safmax);
00268 ulp = slamch_("PRECISION");
00269 smlnum = safmin * ((real) (*n) / ulp);
00270
00271
00272
00273
00274 accum = *kacc22 == 1 || *kacc22 == 2;
00275
00276
00277
00278 blk22 = ns > 2 && *kacc22 == 2;
00279
00280
00281
00282 if (*ktop + 2 <= *kbot) {
00283 i__1 = *ktop + 2 + *ktop * h_dim1;
00284 h__[i__1].r = 0.f, h__[i__1].i = 0.f;
00285 }
00286
00287
00288
00289 nbmps = ns / 2;
00290
00291
00292
00293 kdu = nbmps * 6 - 3;
00294
00295
00296
00297 i__1 = *kbot - 2;
00298 i__2 = nbmps * 3 - 2;
00299 for (incol = (1 - nbmps) * 3 + *ktop - 1; i__2 < 0 ? incol >= i__1 :
00300 incol <= i__1; incol += i__2) {
00301 ndcol = incol + kdu;
00302 if (accum) {
00303 claset_("ALL", &kdu, &kdu, &c_b1, &c_b2, &u[u_offset], ldu);
00304 }
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319 i__4 = incol + nbmps * 3 - 3, i__5 = *kbot - 2;
00320 i__3 = min(i__4,i__5);
00321 for (krcol = incol; krcol <= i__3; ++krcol) {
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331 i__4 = 1, i__5 = (*ktop - 1 - krcol + 2) / 3 + 1;
00332 mtop = max(i__4,i__5);
00333
00334 i__4 = nbmps, i__5 = (*kbot - krcol) / 3;
00335 mbot = min(i__4,i__5);
00336 m22 = mbot + 1;
00337 bmp22 = mbot < nbmps && krcol + (m22 - 1) * 3 == *kbot - 2;
00338
00339
00340
00341
00342 i__4 = mbot;
00343 for (m = mtop; m <= i__4; ++m) {
00344 k = krcol + (m - 1) * 3;
00345 if (k == *ktop - 1) {
00346 claqr1_(&c__3, &h__[*ktop + *ktop * h_dim1], ldh, &s[(m <<
00347 1) - 1], &s[m * 2], &v[m * v_dim1 + 1]);
00348 i__5 = m * v_dim1 + 1;
00349 alpha.r = v[i__5].r, alpha.i = v[i__5].i;
00350 clarfg_(&c__3, &alpha, &v[m * v_dim1 + 2], &c__1, &v[m *
00351 v_dim1 + 1]);
00352 } else {
00353 i__5 = k + 1 + k * h_dim1;
00354 beta.r = h__[i__5].r, beta.i = h__[i__5].i;
00355 i__5 = m * v_dim1 + 2;
00356 i__6 = k + 2 + k * h_dim1;
00357 v[i__5].r = h__[i__6].r, v[i__5].i = h__[i__6].i;
00358 i__5 = m * v_dim1 + 3;
00359 i__6 = k + 3 + k * h_dim1;
00360 v[i__5].r = h__[i__6].r, v[i__5].i = h__[i__6].i;
00361 clarfg_(&c__3, &beta, &v[m * v_dim1 + 2], &c__1, &v[m *
00362 v_dim1 + 1]);
00363
00364
00365
00366
00367
00368
00369 i__5 = k + 3 + k * h_dim1;
00370 i__6 = k + 3 + (k + 1) * h_dim1;
00371 i__7 = k + 3 + (k + 2) * h_dim1;
00372 if (h__[i__5].r != 0.f || h__[i__5].i != 0.f || (h__[i__6]
00373 .r != 0.f || h__[i__6].i != 0.f) || h__[i__7].r ==
00374 0.f && h__[i__7].i == 0.f) {
00375
00376
00377
00378 i__5 = k + 1 + k * h_dim1;
00379 h__[i__5].r = beta.r, h__[i__5].i = beta.i;
00380 i__5 = k + 2 + k * h_dim1;
00381 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00382 i__5 = k + 3 + k * h_dim1;
00383 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00384 } else {
00385
00386
00387
00388
00389
00390
00391
00392 claqr1_(&c__3, &h__[k + 1 + (k + 1) * h_dim1], ldh, &
00393 s[(m << 1) - 1], &s[m * 2], vt);
00394 alpha.r = vt[0].r, alpha.i = vt[0].i;
00395 clarfg_(&c__3, &alpha, &vt[1], &c__1, vt);
00396 r_cnjg(&q__2, vt);
00397 i__5 = k + 1 + k * h_dim1;
00398 r_cnjg(&q__5, &vt[1]);
00399 i__6 = k + 2 + k * h_dim1;
00400 q__4.r = q__5.r * h__[i__6].r - q__5.i * h__[i__6].i,
00401 q__4.i = q__5.r * h__[i__6].i + q__5.i * h__[
00402 i__6].r;
00403 q__3.r = h__[i__5].r + q__4.r, q__3.i = h__[i__5].i +
00404 q__4.i;
00405 q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i =
00406 q__2.r * q__3.i + q__2.i * q__3.r;
00407 refsum.r = q__1.r, refsum.i = q__1.i;
00408
00409 i__5 = k + 2 + k * h_dim1;
00410 q__3.r = refsum.r * vt[1].r - refsum.i * vt[1].i,
00411 q__3.i = refsum.r * vt[1].i + refsum.i * vt[1]
00412 .r;
00413 q__2.r = h__[i__5].r - q__3.r, q__2.i = h__[i__5].i -
00414 q__3.i;
00415 q__1.r = q__2.r, q__1.i = q__2.i;
00416 q__5.r = refsum.r * vt[2].r - refsum.i * vt[2].i,
00417 q__5.i = refsum.r * vt[2].i + refsum.i * vt[2]
00418 .r;
00419 q__4.r = q__5.r, q__4.i = q__5.i;
00420 i__6 = k + k * h_dim1;
00421 i__7 = k + 1 + (k + 1) * h_dim1;
00422 i__8 = k + 2 + (k + 2) * h_dim1;
00423 if ((r__1 = q__1.r, dabs(r__1)) + (r__2 = r_imag(&
00424 q__1), dabs(r__2)) + ((r__3 = q__4.r, dabs(
00425 r__3)) + (r__4 = r_imag(&q__4), dabs(r__4)))
00426 > ulp * ((r__5 = h__[i__6].r, dabs(r__5)) + (
00427 r__6 = r_imag(&h__[k + k * h_dim1]), dabs(
00428 r__6)) + ((r__7 = h__[i__7].r, dabs(r__7)) + (
00429 r__8 = r_imag(&h__[k + 1 + (k + 1) * h_dim1]),
00430 dabs(r__8))) + ((r__9 = h__[i__8].r, dabs(
00431 r__9)) + (r__10 = r_imag(&h__[k + 2 + (k + 2)
00432 * h_dim1]), dabs(r__10))))) {
00433
00434
00435
00436
00437
00438 i__5 = k + 1 + k * h_dim1;
00439 h__[i__5].r = beta.r, h__[i__5].i = beta.i;
00440 i__5 = k + 2 + k * h_dim1;
00441 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00442 i__5 = k + 3 + k * h_dim1;
00443 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00444 } else {
00445
00446
00447
00448
00449
00450
00451 i__5 = k + 1 + k * h_dim1;
00452 i__6 = k + 1 + k * h_dim1;
00453 q__1.r = h__[i__6].r - refsum.r, q__1.i = h__[
00454 i__6].i - refsum.i;
00455 h__[i__5].r = q__1.r, h__[i__5].i = q__1.i;
00456 i__5 = k + 2 + k * h_dim1;
00457 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00458 i__5 = k + 3 + k * h_dim1;
00459 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00460 i__5 = m * v_dim1 + 1;
00461 v[i__5].r = vt[0].r, v[i__5].i = vt[0].i;
00462 i__5 = m * v_dim1 + 2;
00463 v[i__5].r = vt[1].r, v[i__5].i = vt[1].i;
00464 i__5 = m * v_dim1 + 3;
00465 v[i__5].r = vt[2].r, v[i__5].i = vt[2].i;
00466 }
00467 }
00468 }
00469
00470 }
00471
00472
00473
00474 k = krcol + (m22 - 1) * 3;
00475 if (bmp22) {
00476 if (k == *ktop - 1) {
00477 claqr1_(&c__2, &h__[k + 1 + (k + 1) * h_dim1], ldh, &s[(
00478 m22 << 1) - 1], &s[m22 * 2], &v[m22 * v_dim1 + 1])
00479 ;
00480 i__4 = m22 * v_dim1 + 1;
00481 beta.r = v[i__4].r, beta.i = v[i__4].i;
00482 clarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
00483 * v_dim1 + 1]);
00484 } else {
00485 i__4 = k + 1 + k * h_dim1;
00486 beta.r = h__[i__4].r, beta.i = h__[i__4].i;
00487 i__4 = m22 * v_dim1 + 2;
00488 i__5 = k + 2 + k * h_dim1;
00489 v[i__4].r = h__[i__5].r, v[i__4].i = h__[i__5].i;
00490 clarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
00491 * v_dim1 + 1]);
00492 i__4 = k + 1 + k * h_dim1;
00493 h__[i__4].r = beta.r, h__[i__4].i = beta.i;
00494 i__4 = k + 2 + k * h_dim1;
00495 h__[i__4].r = 0.f, h__[i__4].i = 0.f;
00496 }
00497 }
00498
00499
00500
00501 if (accum) {
00502 jbot = min(ndcol,*kbot);
00503 } else if (*wantt) {
00504 jbot = *n;
00505 } else {
00506 jbot = *kbot;
00507 }
00508 i__4 = jbot;
00509 for (j = max(*ktop,krcol); j <= i__4; ++j) {
00510
00511 i__5 = mbot, i__6 = (j - krcol + 2) / 3;
00512 mend = min(i__5,i__6);
00513 i__5 = mend;
00514 for (m = mtop; m <= i__5; ++m) {
00515 k = krcol + (m - 1) * 3;
00516 r_cnjg(&q__2, &v[m * v_dim1 + 1]);
00517 i__6 = k + 1 + j * h_dim1;
00518 r_cnjg(&q__6, &v[m * v_dim1 + 2]);
00519 i__7 = k + 2 + j * h_dim1;
00520 q__5.r = q__6.r * h__[i__7].r - q__6.i * h__[i__7].i,
00521 q__5.i = q__6.r * h__[i__7].i + q__6.i * h__[i__7]
00522 .r;
00523 q__4.r = h__[i__6].r + q__5.r, q__4.i = h__[i__6].i +
00524 q__5.i;
00525 r_cnjg(&q__8, &v[m * v_dim1 + 3]);
00526 i__8 = k + 3 + j * h_dim1;
00527 q__7.r = q__8.r * h__[i__8].r - q__8.i * h__[i__8].i,
00528 q__7.i = q__8.r * h__[i__8].i + q__8.i * h__[i__8]
00529 .r;
00530 q__3.r = q__4.r + q__7.r, q__3.i = q__4.i + q__7.i;
00531 q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i =
00532 q__2.r * q__3.i + q__2.i * q__3.r;
00533 refsum.r = q__1.r, refsum.i = q__1.i;
00534 i__6 = k + 1 + j * h_dim1;
00535 i__7 = k + 1 + j * h_dim1;
00536 q__1.r = h__[i__7].r - refsum.r, q__1.i = h__[i__7].i -
00537 refsum.i;
00538 h__[i__6].r = q__1.r, h__[i__6].i = q__1.i;
00539 i__6 = k + 2 + j * h_dim1;
00540 i__7 = k + 2 + j * h_dim1;
00541 i__8 = m * v_dim1 + 2;
00542 q__2.r = refsum.r * v[i__8].r - refsum.i * v[i__8].i,
00543 q__2.i = refsum.r * v[i__8].i + refsum.i * v[i__8]
00544 .r;
00545 q__1.r = h__[i__7].r - q__2.r, q__1.i = h__[i__7].i -
00546 q__2.i;
00547 h__[i__6].r = q__1.r, h__[i__6].i = q__1.i;
00548 i__6 = k + 3 + j * h_dim1;
00549 i__7 = k + 3 + j * h_dim1;
00550 i__8 = m * v_dim1 + 3;
00551 q__2.r = refsum.r * v[i__8].r - refsum.i * v[i__8].i,
00552 q__2.i = refsum.r * v[i__8].i + refsum.i * v[i__8]
00553 .r;
00554 q__1.r = h__[i__7].r - q__2.r, q__1.i = h__[i__7].i -
00555 q__2.i;
00556 h__[i__6].r = q__1.r, h__[i__6].i = q__1.i;
00557
00558 }
00559
00560 }
00561 if (bmp22) {
00562 k = krcol + (m22 - 1) * 3;
00563
00564 i__4 = k + 1;
00565 i__5 = jbot;
00566 for (j = max(i__4,*ktop); j <= i__5; ++j) {
00567 r_cnjg(&q__2, &v[m22 * v_dim1 + 1]);
00568 i__4 = k + 1 + j * h_dim1;
00569 r_cnjg(&q__5, &v[m22 * v_dim1 + 2]);
00570 i__6 = k + 2 + j * h_dim1;
00571 q__4.r = q__5.r * h__[i__6].r - q__5.i * h__[i__6].i,
00572 q__4.i = q__5.r * h__[i__6].i + q__5.i * h__[i__6]
00573 .r;
00574 q__3.r = h__[i__4].r + q__4.r, q__3.i = h__[i__4].i +
00575 q__4.i;
00576 q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i =
00577 q__2.r * q__3.i + q__2.i * q__3.r;
00578 refsum.r = q__1.r, refsum.i = q__1.i;
00579 i__4 = k + 1 + j * h_dim1;
00580 i__6 = k + 1 + j * h_dim1;
00581 q__1.r = h__[i__6].r - refsum.r, q__1.i = h__[i__6].i -
00582 refsum.i;
00583 h__[i__4].r = q__1.r, h__[i__4].i = q__1.i;
00584 i__4 = k + 2 + j * h_dim1;
00585 i__6 = k + 2 + j * h_dim1;
00586 i__7 = m22 * v_dim1 + 2;
00587 q__2.r = refsum.r * v[i__7].r - refsum.i * v[i__7].i,
00588 q__2.i = refsum.r * v[i__7].i + refsum.i * v[i__7]
00589 .r;
00590 q__1.r = h__[i__6].r - q__2.r, q__1.i = h__[i__6].i -
00591 q__2.i;
00592 h__[i__4].r = q__1.r, h__[i__4].i = q__1.i;
00593
00594 }
00595 }
00596
00597
00598
00599
00600
00601 if (accum) {
00602 jtop = max(*ktop,incol);
00603 } else if (*wantt) {
00604 jtop = 1;
00605 } else {
00606 jtop = *ktop;
00607 }
00608 i__5 = mbot;
00609 for (m = mtop; m <= i__5; ++m) {
00610 i__4 = m * v_dim1 + 1;
00611 if (v[i__4].r != 0.f || v[i__4].i != 0.f) {
00612 k = krcol + (m - 1) * 3;
00613
00614 i__6 = *kbot, i__7 = k + 3;
00615 i__4 = min(i__6,i__7);
00616 for (j = jtop; j <= i__4; ++j) {
00617 i__6 = m * v_dim1 + 1;
00618 i__7 = j + (k + 1) * h_dim1;
00619 i__8 = m * v_dim1 + 2;
00620 i__9 = j + (k + 2) * h_dim1;
00621 q__4.r = v[i__8].r * h__[i__9].r - v[i__8].i * h__[
00622 i__9].i, q__4.i = v[i__8].r * h__[i__9].i + v[
00623 i__8].i * h__[i__9].r;
00624 q__3.r = h__[i__7].r + q__4.r, q__3.i = h__[i__7].i +
00625 q__4.i;
00626 i__10 = m * v_dim1 + 3;
00627 i__11 = j + (k + 3) * h_dim1;
00628 q__5.r = v[i__10].r * h__[i__11].r - v[i__10].i * h__[
00629 i__11].i, q__5.i = v[i__10].r * h__[i__11].i
00630 + v[i__10].i * h__[i__11].r;
00631 q__2.r = q__3.r + q__5.r, q__2.i = q__3.i + q__5.i;
00632 q__1.r = v[i__6].r * q__2.r - v[i__6].i * q__2.i,
00633 q__1.i = v[i__6].r * q__2.i + v[i__6].i *
00634 q__2.r;
00635 refsum.r = q__1.r, refsum.i = q__1.i;
00636 i__6 = j + (k + 1) * h_dim1;
00637 i__7 = j + (k + 1) * h_dim1;
00638 q__1.r = h__[i__7].r - refsum.r, q__1.i = h__[i__7].i
00639 - refsum.i;
00640 h__[i__6].r = q__1.r, h__[i__6].i = q__1.i;
00641 i__6 = j + (k + 2) * h_dim1;
00642 i__7 = j + (k + 2) * h_dim1;
00643 r_cnjg(&q__3, &v[m * v_dim1 + 2]);
00644 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00645 q__2.i = refsum.r * q__3.i + refsum.i *
00646 q__3.r;
00647 q__1.r = h__[i__7].r - q__2.r, q__1.i = h__[i__7].i -
00648 q__2.i;
00649 h__[i__6].r = q__1.r, h__[i__6].i = q__1.i;
00650 i__6 = j + (k + 3) * h_dim1;
00651 i__7 = j + (k + 3) * h_dim1;
00652 r_cnjg(&q__3, &v[m * v_dim1 + 3]);
00653 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00654 q__2.i = refsum.r * q__3.i + refsum.i *
00655 q__3.r;
00656 q__1.r = h__[i__7].r - q__2.r, q__1.i = h__[i__7].i -
00657 q__2.i;
00658 h__[i__6].r = q__1.r, h__[i__6].i = q__1.i;
00659
00660 }
00661
00662 if (accum) {
00663
00664
00665
00666
00667
00668 kms = k - incol;
00669
00670 i__4 = 1, i__6 = *ktop - incol;
00671 i__7 = kdu;
00672 for (j = max(i__4,i__6); j <= i__7; ++j) {
00673 i__4 = m * v_dim1 + 1;
00674 i__6 = j + (kms + 1) * u_dim1;
00675 i__8 = m * v_dim1 + 2;
00676 i__9 = j + (kms + 2) * u_dim1;
00677 q__4.r = v[i__8].r * u[i__9].r - v[i__8].i * u[
00678 i__9].i, q__4.i = v[i__8].r * u[i__9].i +
00679 v[i__8].i * u[i__9].r;
00680 q__3.r = u[i__6].r + q__4.r, q__3.i = u[i__6].i +
00681 q__4.i;
00682 i__10 = m * v_dim1 + 3;
00683 i__11 = j + (kms + 3) * u_dim1;
00684 q__5.r = v[i__10].r * u[i__11].r - v[i__10].i * u[
00685 i__11].i, q__5.i = v[i__10].r * u[i__11]
00686 .i + v[i__10].i * u[i__11].r;
00687 q__2.r = q__3.r + q__5.r, q__2.i = q__3.i +
00688 q__5.i;
00689 q__1.r = v[i__4].r * q__2.r - v[i__4].i * q__2.i,
00690 q__1.i = v[i__4].r * q__2.i + v[i__4].i *
00691 q__2.r;
00692 refsum.r = q__1.r, refsum.i = q__1.i;
00693 i__4 = j + (kms + 1) * u_dim1;
00694 i__6 = j + (kms + 1) * u_dim1;
00695 q__1.r = u[i__6].r - refsum.r, q__1.i = u[i__6].i
00696 - refsum.i;
00697 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
00698 i__4 = j + (kms + 2) * u_dim1;
00699 i__6 = j + (kms + 2) * u_dim1;
00700 r_cnjg(&q__3, &v[m * v_dim1 + 2]);
00701 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00702 q__2.i = refsum.r * q__3.i + refsum.i *
00703 q__3.r;
00704 q__1.r = u[i__6].r - q__2.r, q__1.i = u[i__6].i -
00705 q__2.i;
00706 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
00707 i__4 = j + (kms + 3) * u_dim1;
00708 i__6 = j + (kms + 3) * u_dim1;
00709 r_cnjg(&q__3, &v[m * v_dim1 + 3]);
00710 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00711 q__2.i = refsum.r * q__3.i + refsum.i *
00712 q__3.r;
00713 q__1.r = u[i__6].r - q__2.r, q__1.i = u[i__6].i -
00714 q__2.i;
00715 u[i__4].r = q__1.r, u[i__4].i = q__1.i;
00716
00717 }
00718 } else if (*wantz) {
00719
00720
00721
00722
00723
00724 i__7 = *ihiz;
00725 for (j = *iloz; j <= i__7; ++j) {
00726 i__4 = m * v_dim1 + 1;
00727 i__6 = j + (k + 1) * z_dim1;
00728 i__8 = m * v_dim1 + 2;
00729 i__9 = j + (k + 2) * z_dim1;
00730 q__4.r = v[i__8].r * z__[i__9].r - v[i__8].i *
00731 z__[i__9].i, q__4.i = v[i__8].r * z__[
00732 i__9].i + v[i__8].i * z__[i__9].r;
00733 q__3.r = z__[i__6].r + q__4.r, q__3.i = z__[i__6]
00734 .i + q__4.i;
00735 i__10 = m * v_dim1 + 3;
00736 i__11 = j + (k + 3) * z_dim1;
00737 q__5.r = v[i__10].r * z__[i__11].r - v[i__10].i *
00738 z__[i__11].i, q__5.i = v[i__10].r * z__[
00739 i__11].i + v[i__10].i * z__[i__11].r;
00740 q__2.r = q__3.r + q__5.r, q__2.i = q__3.i +
00741 q__5.i;
00742 q__1.r = v[i__4].r * q__2.r - v[i__4].i * q__2.i,
00743 q__1.i = v[i__4].r * q__2.i + v[i__4].i *
00744 q__2.r;
00745 refsum.r = q__1.r, refsum.i = q__1.i;
00746 i__4 = j + (k + 1) * z_dim1;
00747 i__6 = j + (k + 1) * z_dim1;
00748 q__1.r = z__[i__6].r - refsum.r, q__1.i = z__[
00749 i__6].i - refsum.i;
00750 z__[i__4].r = q__1.r, z__[i__4].i = q__1.i;
00751 i__4 = j + (k + 2) * z_dim1;
00752 i__6 = j + (k + 2) * z_dim1;
00753 r_cnjg(&q__3, &v[m * v_dim1 + 2]);
00754 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00755 q__2.i = refsum.r * q__3.i + refsum.i *
00756 q__3.r;
00757 q__1.r = z__[i__6].r - q__2.r, q__1.i = z__[i__6]
00758 .i - q__2.i;
00759 z__[i__4].r = q__1.r, z__[i__4].i = q__1.i;
00760 i__4 = j + (k + 3) * z_dim1;
00761 i__6 = j + (k + 3) * z_dim1;
00762 r_cnjg(&q__3, &v[m * v_dim1 + 3]);
00763 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00764 q__2.i = refsum.r * q__3.i + refsum.i *
00765 q__3.r;
00766 q__1.r = z__[i__6].r - q__2.r, q__1.i = z__[i__6]
00767 .i - q__2.i;
00768 z__[i__4].r = q__1.r, z__[i__4].i = q__1.i;
00769
00770 }
00771 }
00772 }
00773
00774 }
00775
00776
00777
00778 k = krcol + (m22 - 1) * 3;
00779 i__5 = m22 * v_dim1 + 1;
00780 if (bmp22 && (v[i__5].r != 0.f || v[i__5].i != 0.f)) {
00781
00782 i__7 = *kbot, i__4 = k + 3;
00783 i__5 = min(i__7,i__4);
00784 for (j = jtop; j <= i__5; ++j) {
00785 i__7 = m22 * v_dim1 + 1;
00786 i__4 = j + (k + 1) * h_dim1;
00787 i__6 = m22 * v_dim1 + 2;
00788 i__8 = j + (k + 2) * h_dim1;
00789 q__3.r = v[i__6].r * h__[i__8].r - v[i__6].i * h__[i__8]
00790 .i, q__3.i = v[i__6].r * h__[i__8].i + v[i__6].i *
00791 h__[i__8].r;
00792 q__2.r = h__[i__4].r + q__3.r, q__2.i = h__[i__4].i +
00793 q__3.i;
00794 q__1.r = v[i__7].r * q__2.r - v[i__7].i * q__2.i, q__1.i =
00795 v[i__7].r * q__2.i + v[i__7].i * q__2.r;
00796 refsum.r = q__1.r, refsum.i = q__1.i;
00797 i__7 = j + (k + 1) * h_dim1;
00798 i__4 = j + (k + 1) * h_dim1;
00799 q__1.r = h__[i__4].r - refsum.r, q__1.i = h__[i__4].i -
00800 refsum.i;
00801 h__[i__7].r = q__1.r, h__[i__7].i = q__1.i;
00802 i__7 = j + (k + 2) * h_dim1;
00803 i__4 = j + (k + 2) * h_dim1;
00804 r_cnjg(&q__3, &v[m22 * v_dim1 + 2]);
00805 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i, q__2.i =
00806 refsum.r * q__3.i + refsum.i * q__3.r;
00807 q__1.r = h__[i__4].r - q__2.r, q__1.i = h__[i__4].i -
00808 q__2.i;
00809 h__[i__7].r = q__1.r, h__[i__7].i = q__1.i;
00810
00811 }
00812
00813 if (accum) {
00814 kms = k - incol;
00815
00816 i__5 = 1, i__7 = *ktop - incol;
00817 i__4 = kdu;
00818 for (j = max(i__5,i__7); j <= i__4; ++j) {
00819 i__5 = m22 * v_dim1 + 1;
00820 i__7 = j + (kms + 1) * u_dim1;
00821 i__6 = m22 * v_dim1 + 2;
00822 i__8 = j + (kms + 2) * u_dim1;
00823 q__3.r = v[i__6].r * u[i__8].r - v[i__6].i * u[i__8]
00824 .i, q__3.i = v[i__6].r * u[i__8].i + v[i__6]
00825 .i * u[i__8].r;
00826 q__2.r = u[i__7].r + q__3.r, q__2.i = u[i__7].i +
00827 q__3.i;
00828 q__1.r = v[i__5].r * q__2.r - v[i__5].i * q__2.i,
00829 q__1.i = v[i__5].r * q__2.i + v[i__5].i *
00830 q__2.r;
00831 refsum.r = q__1.r, refsum.i = q__1.i;
00832 i__5 = j + (kms + 1) * u_dim1;
00833 i__7 = j + (kms + 1) * u_dim1;
00834 q__1.r = u[i__7].r - refsum.r, q__1.i = u[i__7].i -
00835 refsum.i;
00836 u[i__5].r = q__1.r, u[i__5].i = q__1.i;
00837 i__5 = j + (kms + 2) * u_dim1;
00838 i__7 = j + (kms + 2) * u_dim1;
00839 r_cnjg(&q__3, &v[m22 * v_dim1 + 2]);
00840 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00841 q__2.i = refsum.r * q__3.i + refsum.i *
00842 q__3.r;
00843 q__1.r = u[i__7].r - q__2.r, q__1.i = u[i__7].i -
00844 q__2.i;
00845 u[i__5].r = q__1.r, u[i__5].i = q__1.i;
00846
00847 }
00848 } else if (*wantz) {
00849 i__4 = *ihiz;
00850 for (j = *iloz; j <= i__4; ++j) {
00851 i__5 = m22 * v_dim1 + 1;
00852 i__7 = j + (k + 1) * z_dim1;
00853 i__6 = m22 * v_dim1 + 2;
00854 i__8 = j + (k + 2) * z_dim1;
00855 q__3.r = v[i__6].r * z__[i__8].r - v[i__6].i * z__[
00856 i__8].i, q__3.i = v[i__6].r * z__[i__8].i + v[
00857 i__6].i * z__[i__8].r;
00858 q__2.r = z__[i__7].r + q__3.r, q__2.i = z__[i__7].i +
00859 q__3.i;
00860 q__1.r = v[i__5].r * q__2.r - v[i__5].i * q__2.i,
00861 q__1.i = v[i__5].r * q__2.i + v[i__5].i *
00862 q__2.r;
00863 refsum.r = q__1.r, refsum.i = q__1.i;
00864 i__5 = j + (k + 1) * z_dim1;
00865 i__7 = j + (k + 1) * z_dim1;
00866 q__1.r = z__[i__7].r - refsum.r, q__1.i = z__[i__7].i
00867 - refsum.i;
00868 z__[i__5].r = q__1.r, z__[i__5].i = q__1.i;
00869 i__5 = j + (k + 2) * z_dim1;
00870 i__7 = j + (k + 2) * z_dim1;
00871 r_cnjg(&q__3, &v[m22 * v_dim1 + 2]);
00872 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i,
00873 q__2.i = refsum.r * q__3.i + refsum.i *
00874 q__3.r;
00875 q__1.r = z__[i__7].r - q__2.r, q__1.i = z__[i__7].i -
00876 q__2.i;
00877 z__[i__5].r = q__1.r, z__[i__5].i = q__1.i;
00878
00879 }
00880 }
00881 }
00882
00883
00884
00885 mstart = mtop;
00886 if (krcol + (mstart - 1) * 3 < *ktop) {
00887 ++mstart;
00888 }
00889 mend = mbot;
00890 if (bmp22) {
00891 ++mend;
00892 }
00893 if (krcol == *kbot - 2) {
00894 ++mend;
00895 }
00896 i__4 = mend;
00897 for (m = mstart; m <= i__4; ++m) {
00898
00899 i__5 = *kbot - 1, i__7 = krcol + (m - 1) * 3;
00900 k = min(i__5,i__7);
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911 i__5 = k + 1 + k * h_dim1;
00912 if (h__[i__5].r != 0.f || h__[i__5].i != 0.f) {
00913 i__5 = k + k * h_dim1;
00914 i__7 = k + 1 + (k + 1) * h_dim1;
00915 tst1 = (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 = r_imag(&
00916 h__[k + k * h_dim1]), dabs(r__2)) + ((r__3 = h__[
00917 i__7].r, dabs(r__3)) + (r__4 = r_imag(&h__[k + 1
00918 + (k + 1) * h_dim1]), dabs(r__4)));
00919 if (tst1 == 0.f) {
00920 if (k >= *ktop + 1) {
00921 i__5 = k + (k - 1) * h_dim1;
00922 tst1 += (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00923 r_imag(&h__[k + (k - 1) * h_dim1]), dabs(
00924 r__2));
00925 }
00926 if (k >= *ktop + 2) {
00927 i__5 = k + (k - 2) * h_dim1;
00928 tst1 += (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00929 r_imag(&h__[k + (k - 2) * h_dim1]), dabs(
00930 r__2));
00931 }
00932 if (k >= *ktop + 3) {
00933 i__5 = k + (k - 3) * h_dim1;
00934 tst1 += (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00935 r_imag(&h__[k + (k - 3) * h_dim1]), dabs(
00936 r__2));
00937 }
00938 if (k <= *kbot - 2) {
00939 i__5 = k + 2 + (k + 1) * h_dim1;
00940 tst1 += (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00941 r_imag(&h__[k + 2 + (k + 1) * h_dim1]),
00942 dabs(r__2));
00943 }
00944 if (k <= *kbot - 3) {
00945 i__5 = k + 3 + (k + 1) * h_dim1;
00946 tst1 += (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00947 r_imag(&h__[k + 3 + (k + 1) * h_dim1]),
00948 dabs(r__2));
00949 }
00950 if (k <= *kbot - 4) {
00951 i__5 = k + 4 + (k + 1) * h_dim1;
00952 tst1 += (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00953 r_imag(&h__[k + 4 + (k + 1) * h_dim1]),
00954 dabs(r__2));
00955 }
00956 }
00957 i__5 = k + 1 + k * h_dim1;
00958
00959 r__3 = smlnum, r__4 = ulp * tst1;
00960 if ((r__1 = h__[i__5].r, dabs(r__1)) + (r__2 = r_imag(&
00961 h__[k + 1 + k * h_dim1]), dabs(r__2)) <= dmax(
00962 r__3,r__4)) {
00963
00964 i__5 = k + 1 + k * h_dim1;
00965 i__7 = k + (k + 1) * h_dim1;
00966 r__5 = (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00967 r_imag(&h__[k + 1 + k * h_dim1]), dabs(r__2)),
00968 r__6 = (r__3 = h__[i__7].r, dabs(r__3)) + (
00969 r__4 = r_imag(&h__[k + (k + 1) * h_dim1]),
00970 dabs(r__4));
00971 h12 = dmax(r__5,r__6);
00972
00973 i__5 = k + 1 + k * h_dim1;
00974 i__7 = k + (k + 1) * h_dim1;
00975 r__5 = (r__1 = h__[i__5].r, dabs(r__1)) + (r__2 =
00976 r_imag(&h__[k + 1 + k * h_dim1]), dabs(r__2)),
00977 r__6 = (r__3 = h__[i__7].r, dabs(r__3)) + (
00978 r__4 = r_imag(&h__[k + (k + 1) * h_dim1]),
00979 dabs(r__4));
00980 h21 = dmin(r__5,r__6);
00981 i__5 = k + k * h_dim1;
00982 i__7 = k + 1 + (k + 1) * h_dim1;
00983 q__2.r = h__[i__5].r - h__[i__7].r, q__2.i = h__[i__5]
00984 .i - h__[i__7].i;
00985 q__1.r = q__2.r, q__1.i = q__2.i;
00986
00987 i__6 = k + 1 + (k + 1) * h_dim1;
00988 r__5 = (r__1 = h__[i__6].r, dabs(r__1)) + (r__2 =
00989 r_imag(&h__[k + 1 + (k + 1) * h_dim1]), dabs(
00990 r__2)), r__6 = (r__3 = q__1.r, dabs(r__3)) + (
00991 r__4 = r_imag(&q__1), dabs(r__4));
00992 h11 = dmax(r__5,r__6);
00993 i__5 = k + k * h_dim1;
00994 i__7 = k + 1 + (k + 1) * h_dim1;
00995 q__2.r = h__[i__5].r - h__[i__7].r, q__2.i = h__[i__5]
00996 .i - h__[i__7].i;
00997 q__1.r = q__2.r, q__1.i = q__2.i;
00998
00999 i__6 = k + 1 + (k + 1) * h_dim1;
01000 r__5 = (r__1 = h__[i__6].r, dabs(r__1)) + (r__2 =
01001 r_imag(&h__[k + 1 + (k + 1) * h_dim1]), dabs(
01002 r__2)), r__6 = (r__3 = q__1.r, dabs(r__3)) + (
01003 r__4 = r_imag(&q__1), dabs(r__4));
01004 h22 = dmin(r__5,r__6);
01005 scl = h11 + h12;
01006 tst2 = h22 * (h11 / scl);
01007
01008
01009 r__1 = smlnum, r__2 = ulp * tst2;
01010 if (tst2 == 0.f || h21 * (h12 / scl) <= dmax(r__1,
01011 r__2)) {
01012 i__5 = k + 1 + k * h_dim1;
01013 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
01014 }
01015 }
01016 }
01017
01018 }
01019
01020
01021
01022
01023 i__4 = nbmps, i__5 = (*kbot - krcol - 1) / 3;
01024 mend = min(i__4,i__5);
01025 i__4 = mend;
01026 for (m = mtop; m <= i__4; ++m) {
01027 k = krcol + (m - 1) * 3;
01028 i__5 = m * v_dim1 + 1;
01029 i__7 = m * v_dim1 + 3;
01030 q__2.r = v[i__5].r * v[i__7].r - v[i__5].i * v[i__7].i,
01031 q__2.i = v[i__5].r * v[i__7].i + v[i__5].i * v[i__7]
01032 .r;
01033 i__6 = k + 4 + (k + 3) * h_dim1;
01034 q__1.r = q__2.r * h__[i__6].r - q__2.i * h__[i__6].i, q__1.i =
01035 q__2.r * h__[i__6].i + q__2.i * h__[i__6].r;
01036 refsum.r = q__1.r, refsum.i = q__1.i;
01037 i__5 = k + 4 + (k + 1) * h_dim1;
01038 q__1.r = -refsum.r, q__1.i = -refsum.i;
01039 h__[i__5].r = q__1.r, h__[i__5].i = q__1.i;
01040 i__5 = k + 4 + (k + 2) * h_dim1;
01041 q__2.r = -refsum.r, q__2.i = -refsum.i;
01042 r_cnjg(&q__3, &v[m * v_dim1 + 2]);
01043 q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i = q__2.r *
01044 q__3.i + q__2.i * q__3.r;
01045 h__[i__5].r = q__1.r, h__[i__5].i = q__1.i;
01046 i__5 = k + 4 + (k + 3) * h_dim1;
01047 i__7 = k + 4 + (k + 3) * h_dim1;
01048 r_cnjg(&q__3, &v[m * v_dim1 + 3]);
01049 q__2.r = refsum.r * q__3.r - refsum.i * q__3.i, q__2.i =
01050 refsum.r * q__3.i + refsum.i * q__3.r;
01051 q__1.r = h__[i__7].r - q__2.r, q__1.i = h__[i__7].i - q__2.i;
01052 h__[i__5].r = q__1.r, h__[i__5].i = q__1.i;
01053
01054 }
01055
01056
01057
01058
01059 }
01060
01061
01062
01063
01064
01065 if (accum) {
01066 if (*wantt) {
01067 jtop = 1;
01068 jbot = *n;
01069 } else {
01070 jtop = *ktop;
01071 jbot = *kbot;
01072 }
01073 if (! blk22 || incol < *ktop || ndcol > *kbot || ns <= 2) {
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085 i__3 = 1, i__4 = *ktop - incol;
01086 k1 = max(i__3,i__4);
01087
01088 i__3 = 0, i__4 = ndcol - *kbot;
01089 nu = kdu - max(i__3,i__4) - k1 + 1;
01090
01091
01092
01093 i__3 = jbot;
01094 i__4 = *nh;
01095 for (jcol = min(ndcol,*kbot) + 1; i__4 < 0 ? jcol >= i__3 :
01096 jcol <= i__3; jcol += i__4) {
01097
01098 i__5 = *nh, i__7 = jbot - jcol + 1;
01099 jlen = min(i__5,i__7);
01100 cgemm_("C", "N", &nu, &jlen, &nu, &c_b2, &u[k1 + k1 *
01101 u_dim1], ldu, &h__[incol + k1 + jcol * h_dim1],
01102 ldh, &c_b1, &wh[wh_offset], ldwh);
01103 clacpy_("ALL", &nu, &jlen, &wh[wh_offset], ldwh, &h__[
01104 incol + k1 + jcol * h_dim1], ldh);
01105
01106 }
01107
01108
01109
01110 i__4 = max(*ktop,incol) - 1;
01111 i__3 = *nv;
01112 for (jrow = jtop; i__3 < 0 ? jrow >= i__4 : jrow <= i__4;
01113 jrow += i__3) {
01114
01115 i__5 = *nv, i__7 = max(*ktop,incol) - jrow;
01116 jlen = min(i__5,i__7);
01117 cgemm_("N", "N", &jlen, &nu, &nu, &c_b2, &h__[jrow + (
01118 incol + k1) * h_dim1], ldh, &u[k1 + k1 * u_dim1],
01119 ldu, &c_b1, &wv[wv_offset], ldwv);
01120 clacpy_("ALL", &jlen, &nu, &wv[wv_offset], ldwv, &h__[
01121 jrow + (incol + k1) * h_dim1], ldh);
01122
01123 }
01124
01125
01126
01127 if (*wantz) {
01128 i__3 = *ihiz;
01129 i__4 = *nv;
01130 for (jrow = *iloz; i__4 < 0 ? jrow >= i__3 : jrow <= i__3;
01131 jrow += i__4) {
01132
01133 i__5 = *nv, i__7 = *ihiz - jrow + 1;
01134 jlen = min(i__5,i__7);
01135 cgemm_("N", "N", &jlen, &nu, &nu, &c_b2, &z__[jrow + (
01136 incol + k1) * z_dim1], ldz, &u[k1 + k1 *
01137 u_dim1], ldu, &c_b1, &wv[wv_offset], ldwv);
01138 clacpy_("ALL", &jlen, &nu, &wv[wv_offset], ldwv, &z__[
01139 jrow + (incol + k1) * z_dim1], ldz)
01140 ;
01141
01142 }
01143 }
01144 } else {
01145
01146
01147
01148
01149
01150 i2 = (kdu + 1) / 2;
01151 i4 = kdu;
01152 j2 = i4 - i2;
01153 j4 = kdu;
01154
01155
01156
01157
01158
01159 kzs = j4 - j2 - (ns + 1);
01160 knz = ns + 1;
01161
01162
01163
01164 i__4 = jbot;
01165 i__3 = *nh;
01166 for (jcol = min(ndcol,*kbot) + 1; i__3 < 0 ? jcol >= i__4 :
01167 jcol <= i__4; jcol += i__3) {
01168
01169 i__5 = *nh, i__7 = jbot - jcol + 1;
01170 jlen = min(i__5,i__7);
01171
01172
01173
01174
01175 clacpy_("ALL", &knz, &jlen, &h__[incol + 1 + j2 + jcol *
01176 h_dim1], ldh, &wh[kzs + 1 + wh_dim1], ldwh);
01177
01178
01179
01180 claset_("ALL", &kzs, &jlen, &c_b1, &c_b1, &wh[wh_offset],
01181 ldwh);
01182 ctrmm_("L", "U", "C", "N", &knz, &jlen, &c_b2, &u[j2 + 1
01183 + (kzs + 1) * u_dim1], ldu, &wh[kzs + 1 + wh_dim1]
01184 , ldwh);
01185
01186
01187
01188 cgemm_("C", "N", &i2, &jlen, &j2, &c_b2, &u[u_offset],
01189 ldu, &h__[incol + 1 + jcol * h_dim1], ldh, &c_b2,
01190 &wh[wh_offset], ldwh);
01191
01192
01193
01194 clacpy_("ALL", &j2, &jlen, &h__[incol + 1 + jcol * h_dim1]
01195 , ldh, &wh[i2 + 1 + wh_dim1], ldwh);
01196
01197
01198
01199 ctrmm_("L", "L", "C", "N", &j2, &jlen, &c_b2, &u[(i2 + 1)
01200 * u_dim1 + 1], ldu, &wh[i2 + 1 + wh_dim1], ldwh);
01201
01202
01203
01204 i__5 = i4 - i2;
01205 i__7 = j4 - j2;
01206 cgemm_("C", "N", &i__5, &jlen, &i__7, &c_b2, &u[j2 + 1 + (
01207 i2 + 1) * u_dim1], ldu, &h__[incol + 1 + j2 +
01208 jcol * h_dim1], ldh, &c_b2, &wh[i2 + 1 + wh_dim1],
01209 ldwh);
01210
01211
01212
01213 clacpy_("ALL", &kdu, &jlen, &wh[wh_offset], ldwh, &h__[
01214 incol + 1 + jcol * h_dim1], ldh);
01215
01216 }
01217
01218
01219
01220 i__3 = max(incol,*ktop) - 1;
01221 i__4 = *nv;
01222 for (jrow = jtop; i__4 < 0 ? jrow >= i__3 : jrow <= i__3;
01223 jrow += i__4) {
01224
01225 i__5 = *nv, i__7 = max(incol,*ktop) - jrow;
01226 jlen = min(i__5,i__7);
01227
01228
01229
01230
01231 clacpy_("ALL", &jlen, &knz, &h__[jrow + (incol + 1 + j2) *
01232 h_dim1], ldh, &wv[(kzs + 1) * wv_dim1 + 1], ldwv);
01233
01234
01235
01236 claset_("ALL", &jlen, &kzs, &c_b1, &c_b1, &wv[wv_offset],
01237 ldwv);
01238 ctrmm_("R", "U", "N", "N", &jlen, &knz, &c_b2, &u[j2 + 1
01239 + (kzs + 1) * u_dim1], ldu, &wv[(kzs + 1) *
01240 wv_dim1 + 1], ldwv);
01241
01242
01243
01244 cgemm_("N", "N", &jlen, &i2, &j2, &c_b2, &h__[jrow + (
01245 incol + 1) * h_dim1], ldh, &u[u_offset], ldu, &
01246 c_b2, &wv[wv_offset], ldwv);
01247
01248
01249
01250 clacpy_("ALL", &jlen, &j2, &h__[jrow + (incol + 1) *
01251 h_dim1], ldh, &wv[(i2 + 1) * wv_dim1 + 1], ldwv);
01252
01253
01254
01255 i__5 = i4 - i2;
01256 ctrmm_("R", "L", "N", "N", &jlen, &i__5, &c_b2, &u[(i2 +
01257 1) * u_dim1 + 1], ldu, &wv[(i2 + 1) * wv_dim1 + 1]
01258 , ldwv);
01259
01260
01261
01262 i__5 = i4 - i2;
01263 i__7 = j4 - j2;
01264 cgemm_("N", "N", &jlen, &i__5, &i__7, &c_b2, &h__[jrow + (
01265 incol + 1 + j2) * h_dim1], ldh, &u[j2 + 1 + (i2 +
01266 1) * u_dim1], ldu, &c_b2, &wv[(i2 + 1) * wv_dim1
01267 + 1], ldwv);
01268
01269
01270
01271 clacpy_("ALL", &jlen, &kdu, &wv[wv_offset], ldwv, &h__[
01272 jrow + (incol + 1) * h_dim1], ldh);
01273
01274 }
01275
01276
01277
01278 if (*wantz) {
01279 i__4 = *ihiz;
01280 i__3 = *nv;
01281 for (jrow = *iloz; i__3 < 0 ? jrow >= i__4 : jrow <= i__4;
01282 jrow += i__3) {
01283
01284 i__5 = *nv, i__7 = *ihiz - jrow + 1;
01285 jlen = min(i__5,i__7);
01286
01287
01288
01289
01290 clacpy_("ALL", &jlen, &knz, &z__[jrow + (incol + 1 +
01291 j2) * z_dim1], ldz, &wv[(kzs + 1) * wv_dim1 +
01292 1], ldwv);
01293
01294
01295
01296 claset_("ALL", &jlen, &kzs, &c_b1, &c_b1, &wv[
01297 wv_offset], ldwv);
01298 ctrmm_("R", "U", "N", "N", &jlen, &knz, &c_b2, &u[j2
01299 + 1 + (kzs + 1) * u_dim1], ldu, &wv[(kzs + 1)
01300 * wv_dim1 + 1], ldwv);
01301
01302
01303
01304 cgemm_("N", "N", &jlen, &i2, &j2, &c_b2, &z__[jrow + (
01305 incol + 1) * z_dim1], ldz, &u[u_offset], ldu,
01306 &c_b2, &wv[wv_offset], ldwv);
01307
01308
01309
01310 clacpy_("ALL", &jlen, &j2, &z__[jrow + (incol + 1) *
01311 z_dim1], ldz, &wv[(i2 + 1) * wv_dim1 + 1],
01312 ldwv);
01313
01314
01315
01316 i__5 = i4 - i2;
01317 ctrmm_("R", "L", "N", "N", &jlen, &i__5, &c_b2, &u[(
01318 i2 + 1) * u_dim1 + 1], ldu, &wv[(i2 + 1) *
01319 wv_dim1 + 1], ldwv);
01320
01321
01322
01323 i__5 = i4 - i2;
01324 i__7 = j4 - j2;
01325 cgemm_("N", "N", &jlen, &i__5, &i__7, &c_b2, &z__[
01326 jrow + (incol + 1 + j2) * z_dim1], ldz, &u[j2
01327 + 1 + (i2 + 1) * u_dim1], ldu, &c_b2, &wv[(i2
01328 + 1) * wv_dim1 + 1], ldwv);
01329
01330
01331
01332 clacpy_("ALL", &jlen, &kdu, &wv[wv_offset], ldwv, &
01333 z__[jrow + (incol + 1) * z_dim1], ldz);
01334
01335 }
01336 }
01337 }
01338 }
01339
01340 }
01341
01342
01343
01344 return 0;
01345 }