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