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 real c_b7 = 0.f;
00019 static real c_b8 = 1.f;
00020 static integer c__3 = 3;
00021 static integer c__1 = 1;
00022 static integer c__2 = 2;
00023
00024 int slaqr5_(logical *wantt, logical *wantz, integer *kacc22,
00025 integer *n, integer *ktop, integer *kbot, integer *nshfts, real *sr,
00026 real *si, real *h__, integer *ldh, integer *iloz, integer *ihiz, real
00027 *z__, integer *ldz, real *v, integer *ldv, real *u, integer *ldu,
00028 integer *nv, real *wv, integer *ldwv, integer *nh, real *wh, integer *
00029 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;
00035 real r__1, r__2, r__3, r__4, r__5;
00036
00037
00038 integer i__, j, k, m, i2, j2, i4, j4, k1;
00039 real h11, h12, h21, h22;
00040 integer m22, ns, nu;
00041 real vt[3], scl;
00042 integer kdu, kms;
00043 real ulp;
00044 integer knz, kzs;
00045 real tst1, tst2, beta;
00046 logical blk22, bmp22;
00047 integer mend, jcol, jlen, jbot, mbot;
00048 real swap;
00049 integer jtop, jrow, mtop;
00050 real alpha;
00051 logical accum;
00052 integer ndcol, incol;
00053 extern int sgemm_(char *, char *, integer *, integer *,
00054 integer *, real *, real *, integer *, real *, integer *, real *,
00055 real *, integer *);
00056 integer krcol, nbmps;
00057 extern int strmm_(char *, char *, char *, char *,
00058 integer *, integer *, real *, real *, integer *, real *, integer *
00059 ), slaqr1_(integer *, real *,
00060 integer *, real *, real *, real *, real *, real *), slabad_(real *
00061 , real *);
00062 extern doublereal slamch_(char *);
00063 real safmin;
00064 extern int slarfg_(integer *, real *, real *, integer *,
00065 real *);
00066 real safmax;
00067 extern int slacpy_(char *, integer *, integer *, real *,
00068 integer *, real *, integer *), slaset_(char *, integer *,
00069 integer *, real *, real *, real *, integer *);
00070 real refsum;
00071 integer mstart;
00072 real smlnum;
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 --sr;
00224 --si;
00225 h_dim1 = *ldh;
00226 h_offset = 1 + h_dim1;
00227 h__ -= h_offset;
00228 z_dim1 = *ldz;
00229 z_offset = 1 + z_dim1;
00230 z__ -= z_offset;
00231 v_dim1 = *ldv;
00232 v_offset = 1 + v_dim1;
00233 v -= v_offset;
00234 u_dim1 = *ldu;
00235 u_offset = 1 + u_dim1;
00236 u -= u_offset;
00237 wv_dim1 = *ldwv;
00238 wv_offset = 1 + wv_dim1;
00239 wv -= wv_offset;
00240 wh_dim1 = *ldwh;
00241 wh_offset = 1 + wh_dim1;
00242 wh -= wh_offset;
00243
00244
00245 if (*nshfts < 2) {
00246 return 0;
00247 }
00248
00249
00250
00251
00252 if (*ktop >= *kbot) {
00253 return 0;
00254 }
00255
00256
00257
00258
00259
00260
00261 i__1 = *nshfts - 2;
00262 for (i__ = 1; i__ <= i__1; i__ += 2) {
00263 if (si[i__] != -si[i__ + 1]) {
00264
00265 swap = sr[i__];
00266 sr[i__] = sr[i__ + 1];
00267 sr[i__ + 1] = sr[i__ + 2];
00268 sr[i__ + 2] = swap;
00269
00270 swap = si[i__];
00271 si[i__] = si[i__ + 1];
00272 si[i__ + 1] = si[i__ + 2];
00273 si[i__ + 2] = swap;
00274 }
00275
00276 }
00277
00278
00279
00280
00281
00282
00283 ns = *nshfts - *nshfts % 2;
00284
00285
00286
00287 safmin = slamch_("SAFE MINIMUM");
00288 safmax = 1.f / safmin;
00289 slabad_(&safmin, &safmax);
00290 ulp = slamch_("PRECISION");
00291 smlnum = safmin * ((real) (*n) / ulp);
00292
00293
00294
00295
00296 accum = *kacc22 == 1 || *kacc22 == 2;
00297
00298
00299
00300 blk22 = ns > 2 && *kacc22 == 2;
00301
00302
00303
00304 if (*ktop + 2 <= *kbot) {
00305 h__[*ktop + 2 + *ktop * h_dim1] = 0.f;
00306 }
00307
00308
00309
00310 nbmps = ns / 2;
00311
00312
00313
00314 kdu = nbmps * 6 - 3;
00315
00316
00317
00318 i__1 = *kbot - 2;
00319 i__2 = nbmps * 3 - 2;
00320 for (incol = (1 - nbmps) * 3 + *ktop - 1; i__2 < 0 ? incol >= i__1 :
00321 incol <= i__1; incol += i__2) {
00322 ndcol = incol + kdu;
00323 if (accum) {
00324 slaset_("ALL", &kdu, &kdu, &c_b7, &c_b8, &u[u_offset], ldu);
00325 }
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340 i__4 = incol + nbmps * 3 - 3, i__5 = *kbot - 2;
00341 i__3 = min(i__4,i__5);
00342 for (krcol = incol; krcol <= i__3; ++krcol) {
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352 i__4 = 1, i__5 = (*ktop - 1 - krcol + 2) / 3 + 1;
00353 mtop = max(i__4,i__5);
00354
00355 i__4 = nbmps, i__5 = (*kbot - krcol) / 3;
00356 mbot = min(i__4,i__5);
00357 m22 = mbot + 1;
00358 bmp22 = mbot < nbmps && krcol + (m22 - 1) * 3 == *kbot - 2;
00359
00360
00361
00362
00363 i__4 = mbot;
00364 for (m = mtop; m <= i__4; ++m) {
00365 k = krcol + (m - 1) * 3;
00366 if (k == *ktop - 1) {
00367 slaqr1_(&c__3, &h__[*ktop + *ktop * h_dim1], ldh, &sr[(m
00368 << 1) - 1], &si[(m << 1) - 1], &sr[m * 2], &si[m *
00369 2], &v[m * v_dim1 + 1]);
00370 alpha = v[m * v_dim1 + 1];
00371 slarfg_(&c__3, &alpha, &v[m * v_dim1 + 2], &c__1, &v[m *
00372 v_dim1 + 1]);
00373 } else {
00374 beta = h__[k + 1 + k * h_dim1];
00375 v[m * v_dim1 + 2] = h__[k + 2 + k * h_dim1];
00376 v[m * v_dim1 + 3] = h__[k + 3 + k * h_dim1];
00377 slarfg_(&c__3, &beta, &v[m * v_dim1 + 2], &c__1, &v[m *
00378 v_dim1 + 1]);
00379
00380
00381
00382
00383
00384
00385 if (h__[k + 3 + k * h_dim1] != 0.f || h__[k + 3 + (k + 1)
00386 * h_dim1] != 0.f || h__[k + 3 + (k + 2) * h_dim1]
00387 == 0.f) {
00388
00389
00390
00391 h__[k + 1 + k * h_dim1] = beta;
00392 h__[k + 2 + k * h_dim1] = 0.f;
00393 h__[k + 3 + k * h_dim1] = 0.f;
00394 } else {
00395
00396
00397
00398
00399
00400
00401
00402 slaqr1_(&c__3, &h__[k + 1 + (k + 1) * h_dim1], ldh, &
00403 sr[(m << 1) - 1], &si[(m << 1) - 1], &sr[m *
00404 2], &si[m * 2], vt);
00405 alpha = vt[0];
00406 slarfg_(&c__3, &alpha, &vt[1], &c__1, vt);
00407 refsum = vt[0] * (h__[k + 1 + k * h_dim1] + vt[1] *
00408 h__[k + 2 + k * h_dim1]);
00409
00410 if ((r__1 = h__[k + 2 + k * h_dim1] - refsum * vt[1],
00411 dabs(r__1)) + (r__2 = refsum * vt[2], dabs(
00412 r__2)) > ulp * ((r__3 = h__[k + k * h_dim1],
00413 dabs(r__3)) + (r__4 = h__[k + 1 + (k + 1) *
00414 h_dim1], dabs(r__4)) + (r__5 = h__[k + 2 + (k
00415 + 2) * h_dim1], dabs(r__5)))) {
00416
00417
00418
00419
00420
00421 h__[k + 1 + k * h_dim1] = beta;
00422 h__[k + 2 + k * h_dim1] = 0.f;
00423 h__[k + 3 + k * h_dim1] = 0.f;
00424 } else {
00425
00426
00427
00428
00429
00430
00431 h__[k + 1 + k * h_dim1] -= refsum;
00432 h__[k + 2 + k * h_dim1] = 0.f;
00433 h__[k + 3 + k * h_dim1] = 0.f;
00434 v[m * v_dim1 + 1] = vt[0];
00435 v[m * v_dim1 + 2] = vt[1];
00436 v[m * v_dim1 + 3] = vt[2];
00437 }
00438 }
00439 }
00440
00441 }
00442
00443
00444
00445 k = krcol + (m22 - 1) * 3;
00446 if (bmp22) {
00447 if (k == *ktop - 1) {
00448 slaqr1_(&c__2, &h__[k + 1 + (k + 1) * h_dim1], ldh, &sr[(
00449 m22 << 1) - 1], &si[(m22 << 1) - 1], &sr[m22 * 2],
00450 &si[m22 * 2], &v[m22 * v_dim1 + 1]);
00451 beta = v[m22 * v_dim1 + 1];
00452 slarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
00453 * v_dim1 + 1]);
00454 } else {
00455 beta = h__[k + 1 + k * h_dim1];
00456 v[m22 * v_dim1 + 2] = h__[k + 2 + k * h_dim1];
00457 slarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
00458 * v_dim1 + 1]);
00459 h__[k + 1 + k * h_dim1] = beta;
00460 h__[k + 2 + k * h_dim1] = 0.f;
00461 }
00462 }
00463
00464
00465
00466 if (accum) {
00467 jbot = min(ndcol,*kbot);
00468 } else if (*wantt) {
00469 jbot = *n;
00470 } else {
00471 jbot = *kbot;
00472 }
00473 i__4 = jbot;
00474 for (j = max(*ktop,krcol); j <= i__4; ++j) {
00475
00476 i__5 = mbot, i__6 = (j - krcol + 2) / 3;
00477 mend = min(i__5,i__6);
00478 i__5 = mend;
00479 for (m = mtop; m <= i__5; ++m) {
00480 k = krcol + (m - 1) * 3;
00481 refsum = v[m * v_dim1 + 1] * (h__[k + 1 + j * h_dim1] + v[
00482 m * v_dim1 + 2] * h__[k + 2 + j * h_dim1] + v[m *
00483 v_dim1 + 3] * h__[k + 3 + j * h_dim1]);
00484 h__[k + 1 + j * h_dim1] -= refsum;
00485 h__[k + 2 + j * h_dim1] -= refsum * v[m * v_dim1 + 2];
00486 h__[k + 3 + j * h_dim1] -= refsum * v[m * v_dim1 + 3];
00487
00488 }
00489
00490 }
00491 if (bmp22) {
00492 k = krcol + (m22 - 1) * 3;
00493
00494 i__4 = k + 1;
00495 i__5 = jbot;
00496 for (j = max(i__4,*ktop); j <= i__5; ++j) {
00497 refsum = v[m22 * v_dim1 + 1] * (h__[k + 1 + j * h_dim1] +
00498 v[m22 * v_dim1 + 2] * h__[k + 2 + j * h_dim1]);
00499 h__[k + 1 + j * h_dim1] -= refsum;
00500 h__[k + 2 + j * h_dim1] -= refsum * v[m22 * v_dim1 + 2];
00501
00502 }
00503 }
00504
00505
00506
00507
00508
00509 if (accum) {
00510 jtop = max(*ktop,incol);
00511 } else if (*wantt) {
00512 jtop = 1;
00513 } else {
00514 jtop = *ktop;
00515 }
00516 i__5 = mbot;
00517 for (m = mtop; m <= i__5; ++m) {
00518 if (v[m * v_dim1 + 1] != 0.f) {
00519 k = krcol + (m - 1) * 3;
00520
00521 i__6 = *kbot, i__7 = k + 3;
00522 i__4 = min(i__6,i__7);
00523 for (j = jtop; j <= i__4; ++j) {
00524 refsum = v[m * v_dim1 + 1] * (h__[j + (k + 1) *
00525 h_dim1] + v[m * v_dim1 + 2] * h__[j + (k + 2)
00526 * h_dim1] + v[m * v_dim1 + 3] * h__[j + (k +
00527 3) * h_dim1]);
00528 h__[j + (k + 1) * h_dim1] -= refsum;
00529 h__[j + (k + 2) * h_dim1] -= refsum * v[m * v_dim1 +
00530 2];
00531 h__[j + (k + 3) * h_dim1] -= refsum * v[m * v_dim1 +
00532 3];
00533
00534 }
00535
00536 if (accum) {
00537
00538
00539
00540
00541
00542 kms = k - incol;
00543
00544 i__4 = 1, i__6 = *ktop - incol;
00545 i__7 = kdu;
00546 for (j = max(i__4,i__6); j <= i__7; ++j) {
00547 refsum = v[m * v_dim1 + 1] * (u[j + (kms + 1) *
00548 u_dim1] + v[m * v_dim1 + 2] * u[j + (kms
00549 + 2) * u_dim1] + v[m * v_dim1 + 3] * u[j
00550 + (kms + 3) * u_dim1]);
00551 u[j + (kms + 1) * u_dim1] -= refsum;
00552 u[j + (kms + 2) * u_dim1] -= refsum * v[m *
00553 v_dim1 + 2];
00554 u[j + (kms + 3) * u_dim1] -= refsum * v[m *
00555 v_dim1 + 3];
00556
00557 }
00558 } else if (*wantz) {
00559
00560
00561
00562
00563
00564 i__7 = *ihiz;
00565 for (j = *iloz; j <= i__7; ++j) {
00566 refsum = v[m * v_dim1 + 1] * (z__[j + (k + 1) *
00567 z_dim1] + v[m * v_dim1 + 2] * z__[j + (k
00568 + 2) * z_dim1] + v[m * v_dim1 + 3] * z__[
00569 j + (k + 3) * z_dim1]);
00570 z__[j + (k + 1) * z_dim1] -= refsum;
00571 z__[j + (k + 2) * z_dim1] -= refsum * v[m *
00572 v_dim1 + 2];
00573 z__[j + (k + 3) * z_dim1] -= refsum * v[m *
00574 v_dim1 + 3];
00575
00576 }
00577 }
00578 }
00579
00580 }
00581
00582
00583
00584 k = krcol + (m22 - 1) * 3;
00585 if (bmp22 && v[m22 * v_dim1 + 1] != 0.f) {
00586
00587 i__7 = *kbot, i__4 = k + 3;
00588 i__5 = min(i__7,i__4);
00589 for (j = jtop; j <= i__5; ++j) {
00590 refsum = v[m22 * v_dim1 + 1] * (h__[j + (k + 1) * h_dim1]
00591 + v[m22 * v_dim1 + 2] * h__[j + (k + 2) * h_dim1])
00592 ;
00593 h__[j + (k + 1) * h_dim1] -= refsum;
00594 h__[j + (k + 2) * h_dim1] -= refsum * v[m22 * v_dim1 + 2];
00595
00596 }
00597
00598 if (accum) {
00599 kms = k - incol;
00600
00601 i__5 = 1, i__7 = *ktop - incol;
00602 i__4 = kdu;
00603 for (j = max(i__5,i__7); j <= i__4; ++j) {
00604 refsum = v[m22 * v_dim1 + 1] * (u[j + (kms + 1) *
00605 u_dim1] + v[m22 * v_dim1 + 2] * u[j + (kms +
00606 2) * u_dim1]);
00607 u[j + (kms + 1) * u_dim1] -= refsum;
00608 u[j + (kms + 2) * u_dim1] -= refsum * v[m22 * v_dim1
00609 + 2];
00610
00611 }
00612 } else if (*wantz) {
00613 i__4 = *ihiz;
00614 for (j = *iloz; j <= i__4; ++j) {
00615 refsum = v[m22 * v_dim1 + 1] * (z__[j + (k + 1) *
00616 z_dim1] + v[m22 * v_dim1 + 2] * z__[j + (k +
00617 2) * z_dim1]);
00618 z__[j + (k + 1) * z_dim1] -= refsum;
00619 z__[j + (k + 2) * z_dim1] -= refsum * v[m22 * v_dim1
00620 + 2];
00621
00622 }
00623 }
00624 }
00625
00626
00627
00628 mstart = mtop;
00629 if (krcol + (mstart - 1) * 3 < *ktop) {
00630 ++mstart;
00631 }
00632 mend = mbot;
00633 if (bmp22) {
00634 ++mend;
00635 }
00636 if (krcol == *kbot - 2) {
00637 ++mend;
00638 }
00639 i__4 = mend;
00640 for (m = mstart; m <= i__4; ++m) {
00641
00642 i__5 = *kbot - 1, i__7 = krcol + (m - 1) * 3;
00643 k = min(i__5,i__7);
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654 if (h__[k + 1 + k * h_dim1] != 0.f) {
00655 tst1 = (r__1 = h__[k + k * h_dim1], dabs(r__1)) + (r__2 =
00656 h__[k + 1 + (k + 1) * h_dim1], dabs(r__2));
00657 if (tst1 == 0.f) {
00658 if (k >= *ktop + 1) {
00659 tst1 += (r__1 = h__[k + (k - 1) * h_dim1], dabs(
00660 r__1));
00661 }
00662 if (k >= *ktop + 2) {
00663 tst1 += (r__1 = h__[k + (k - 2) * h_dim1], dabs(
00664 r__1));
00665 }
00666 if (k >= *ktop + 3) {
00667 tst1 += (r__1 = h__[k + (k - 3) * h_dim1], dabs(
00668 r__1));
00669 }
00670 if (k <= *kbot - 2) {
00671 tst1 += (r__1 = h__[k + 2 + (k + 1) * h_dim1],
00672 dabs(r__1));
00673 }
00674 if (k <= *kbot - 3) {
00675 tst1 += (r__1 = h__[k + 3 + (k + 1) * h_dim1],
00676 dabs(r__1));
00677 }
00678 if (k <= *kbot - 4) {
00679 tst1 += (r__1 = h__[k + 4 + (k + 1) * h_dim1],
00680 dabs(r__1));
00681 }
00682 }
00683
00684 r__2 = smlnum, r__3 = ulp * tst1;
00685 if ((r__1 = h__[k + 1 + k * h_dim1], dabs(r__1)) <= dmax(
00686 r__2,r__3)) {
00687
00688 r__3 = (r__1 = h__[k + 1 + k * h_dim1], dabs(r__1)),
00689 r__4 = (r__2 = h__[k + (k + 1) * h_dim1],
00690 dabs(r__2));
00691 h12 = dmax(r__3,r__4);
00692
00693 r__3 = (r__1 = h__[k + 1 + k * h_dim1], dabs(r__1)),
00694 r__4 = (r__2 = h__[k + (k + 1) * h_dim1],
00695 dabs(r__2));
00696 h21 = dmin(r__3,r__4);
00697
00698 r__3 = (r__1 = h__[k + 1 + (k + 1) * h_dim1], dabs(
00699 r__1)), r__4 = (r__2 = h__[k + k * h_dim1] -
00700 h__[k + 1 + (k + 1) * h_dim1], dabs(r__2));
00701 h11 = dmax(r__3,r__4);
00702
00703 r__3 = (r__1 = h__[k + 1 + (k + 1) * h_dim1], dabs(
00704 r__1)), r__4 = (r__2 = h__[k + k * h_dim1] -
00705 h__[k + 1 + (k + 1) * h_dim1], dabs(r__2));
00706 h22 = dmin(r__3,r__4);
00707 scl = h11 + h12;
00708 tst2 = h22 * (h11 / scl);
00709
00710
00711 r__1 = smlnum, r__2 = ulp * tst2;
00712 if (tst2 == 0.f || h21 * (h12 / scl) <= dmax(r__1,
00713 r__2)) {
00714 h__[k + 1 + k * h_dim1] = 0.f;
00715 }
00716 }
00717 }
00718
00719 }
00720
00721
00722
00723
00724 i__4 = nbmps, i__5 = (*kbot - krcol - 1) / 3;
00725 mend = min(i__4,i__5);
00726 i__4 = mend;
00727 for (m = mtop; m <= i__4; ++m) {
00728 k = krcol + (m - 1) * 3;
00729 refsum = v[m * v_dim1 + 1] * v[m * v_dim1 + 3] * h__[k + 4 + (
00730 k + 3) * h_dim1];
00731 h__[k + 4 + (k + 1) * h_dim1] = -refsum;
00732 h__[k + 4 + (k + 2) * h_dim1] = -refsum * v[m * v_dim1 + 2];
00733 h__[k + 4 + (k + 3) * h_dim1] -= refsum * v[m * v_dim1 + 3];
00734
00735 }
00736
00737
00738
00739
00740 }
00741
00742
00743
00744
00745
00746 if (accum) {
00747 if (*wantt) {
00748 jtop = 1;
00749 jbot = *n;
00750 } else {
00751 jtop = *ktop;
00752 jbot = *kbot;
00753 }
00754 if (! blk22 || incol < *ktop || ndcol > *kbot || ns <= 2) {
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766 i__3 = 1, i__4 = *ktop - incol;
00767 k1 = max(i__3,i__4);
00768
00769 i__3 = 0, i__4 = ndcol - *kbot;
00770 nu = kdu - max(i__3,i__4) - k1 + 1;
00771
00772
00773
00774 i__3 = jbot;
00775 i__4 = *nh;
00776 for (jcol = min(ndcol,*kbot) + 1; i__4 < 0 ? jcol >= i__3 :
00777 jcol <= i__3; jcol += i__4) {
00778
00779 i__5 = *nh, i__7 = jbot - jcol + 1;
00780 jlen = min(i__5,i__7);
00781 sgemm_("C", "N", &nu, &jlen, &nu, &c_b8, &u[k1 + k1 *
00782 u_dim1], ldu, &h__[incol + k1 + jcol * h_dim1],
00783 ldh, &c_b7, &wh[wh_offset], ldwh);
00784 slacpy_("ALL", &nu, &jlen, &wh[wh_offset], ldwh, &h__[
00785 incol + k1 + jcol * h_dim1], ldh);
00786
00787 }
00788
00789
00790
00791 i__4 = max(*ktop,incol) - 1;
00792 i__3 = *nv;
00793 for (jrow = jtop; i__3 < 0 ? jrow >= i__4 : jrow <= i__4;
00794 jrow += i__3) {
00795
00796 i__5 = *nv, i__7 = max(*ktop,incol) - jrow;
00797 jlen = min(i__5,i__7);
00798 sgemm_("N", "N", &jlen, &nu, &nu, &c_b8, &h__[jrow + (
00799 incol + k1) * h_dim1], ldh, &u[k1 + k1 * u_dim1],
00800 ldu, &c_b7, &wv[wv_offset], ldwv);
00801 slacpy_("ALL", &jlen, &nu, &wv[wv_offset], ldwv, &h__[
00802 jrow + (incol + k1) * h_dim1], ldh);
00803
00804 }
00805
00806
00807
00808 if (*wantz) {
00809 i__3 = *ihiz;
00810 i__4 = *nv;
00811 for (jrow = *iloz; i__4 < 0 ? jrow >= i__3 : jrow <= i__3;
00812 jrow += i__4) {
00813
00814 i__5 = *nv, i__7 = *ihiz - jrow + 1;
00815 jlen = min(i__5,i__7);
00816 sgemm_("N", "N", &jlen, &nu, &nu, &c_b8, &z__[jrow + (
00817 incol + k1) * z_dim1], ldz, &u[k1 + k1 *
00818 u_dim1], ldu, &c_b7, &wv[wv_offset], ldwv);
00819 slacpy_("ALL", &jlen, &nu, &wv[wv_offset], ldwv, &z__[
00820 jrow + (incol + k1) * z_dim1], ldz)
00821 ;
00822
00823 }
00824 }
00825 } else {
00826
00827
00828
00829
00830
00831 i2 = (kdu + 1) / 2;
00832 i4 = kdu;
00833 j2 = i4 - i2;
00834 j4 = kdu;
00835
00836
00837
00838
00839
00840 kzs = j4 - j2 - (ns + 1);
00841 knz = ns + 1;
00842
00843
00844
00845 i__4 = jbot;
00846 i__3 = *nh;
00847 for (jcol = min(ndcol,*kbot) + 1; i__3 < 0 ? jcol >= i__4 :
00848 jcol <= i__4; jcol += i__3) {
00849
00850 i__5 = *nh, i__7 = jbot - jcol + 1;
00851 jlen = min(i__5,i__7);
00852
00853
00854
00855
00856 slacpy_("ALL", &knz, &jlen, &h__[incol + 1 + j2 + jcol *
00857 h_dim1], ldh, &wh[kzs + 1 + wh_dim1], ldwh);
00858
00859
00860
00861 slaset_("ALL", &kzs, &jlen, &c_b7, &c_b7, &wh[wh_offset],
00862 ldwh);
00863 strmm_("L", "U", "C", "N", &knz, &jlen, &c_b8, &u[j2 + 1
00864 + (kzs + 1) * u_dim1], ldu, &wh[kzs + 1 + wh_dim1]
00865 , ldwh);
00866
00867
00868
00869 sgemm_("C", "N", &i2, &jlen, &j2, &c_b8, &u[u_offset],
00870 ldu, &h__[incol + 1 + jcol * h_dim1], ldh, &c_b8,
00871 &wh[wh_offset], ldwh);
00872
00873
00874
00875 slacpy_("ALL", &j2, &jlen, &h__[incol + 1 + jcol * h_dim1]
00876 , ldh, &wh[i2 + 1 + wh_dim1], ldwh);
00877
00878
00879
00880 strmm_("L", "L", "C", "N", &j2, &jlen, &c_b8, &u[(i2 + 1)
00881 * u_dim1 + 1], ldu, &wh[i2 + 1 + wh_dim1], ldwh);
00882
00883
00884
00885 i__5 = i4 - i2;
00886 i__7 = j4 - j2;
00887 sgemm_("C", "N", &i__5, &jlen, &i__7, &c_b8, &u[j2 + 1 + (
00888 i2 + 1) * u_dim1], ldu, &h__[incol + 1 + j2 +
00889 jcol * h_dim1], ldh, &c_b8, &wh[i2 + 1 + wh_dim1],
00890 ldwh);
00891
00892
00893
00894 slacpy_("ALL", &kdu, &jlen, &wh[wh_offset], ldwh, &h__[
00895 incol + 1 + jcol * h_dim1], ldh);
00896
00897 }
00898
00899
00900
00901 i__3 = max(incol,*ktop) - 1;
00902 i__4 = *nv;
00903 for (jrow = jtop; i__4 < 0 ? jrow >= i__3 : jrow <= i__3;
00904 jrow += i__4) {
00905
00906 i__5 = *nv, i__7 = max(incol,*ktop) - jrow;
00907 jlen = min(i__5,i__7);
00908
00909
00910
00911
00912 slacpy_("ALL", &jlen, &knz, &h__[jrow + (incol + 1 + j2) *
00913 h_dim1], ldh, &wv[(kzs + 1) * wv_dim1 + 1], ldwv);
00914
00915
00916
00917 slaset_("ALL", &jlen, &kzs, &c_b7, &c_b7, &wv[wv_offset],
00918 ldwv);
00919 strmm_("R", "U", "N", "N", &jlen, &knz, &c_b8, &u[j2 + 1
00920 + (kzs + 1) * u_dim1], ldu, &wv[(kzs + 1) *
00921 wv_dim1 + 1], ldwv);
00922
00923
00924
00925 sgemm_("N", "N", &jlen, &i2, &j2, &c_b8, &h__[jrow + (
00926 incol + 1) * h_dim1], ldh, &u[u_offset], ldu, &
00927 c_b8, &wv[wv_offset], ldwv);
00928
00929
00930
00931 slacpy_("ALL", &jlen, &j2, &h__[jrow + (incol + 1) *
00932 h_dim1], ldh, &wv[(i2 + 1) * wv_dim1 + 1], ldwv);
00933
00934
00935
00936 i__5 = i4 - i2;
00937 strmm_("R", "L", "N", "N", &jlen, &i__5, &c_b8, &u[(i2 +
00938 1) * u_dim1 + 1], ldu, &wv[(i2 + 1) * wv_dim1 + 1]
00939 , ldwv);
00940
00941
00942
00943 i__5 = i4 - i2;
00944 i__7 = j4 - j2;
00945 sgemm_("N", "N", &jlen, &i__5, &i__7, &c_b8, &h__[jrow + (
00946 incol + 1 + j2) * h_dim1], ldh, &u[j2 + 1 + (i2 +
00947 1) * u_dim1], ldu, &c_b8, &wv[(i2 + 1) * wv_dim1
00948 + 1], ldwv);
00949
00950
00951
00952 slacpy_("ALL", &jlen, &kdu, &wv[wv_offset], ldwv, &h__[
00953 jrow + (incol + 1) * h_dim1], ldh);
00954
00955 }
00956
00957
00958
00959 if (*wantz) {
00960 i__4 = *ihiz;
00961 i__3 = *nv;
00962 for (jrow = *iloz; i__3 < 0 ? jrow >= i__4 : jrow <= i__4;
00963 jrow += i__3) {
00964
00965 i__5 = *nv, i__7 = *ihiz - jrow + 1;
00966 jlen = min(i__5,i__7);
00967
00968
00969
00970
00971 slacpy_("ALL", &jlen, &knz, &z__[jrow + (incol + 1 +
00972 j2) * z_dim1], ldz, &wv[(kzs + 1) * wv_dim1 +
00973 1], ldwv);
00974
00975
00976
00977 slaset_("ALL", &jlen, &kzs, &c_b7, &c_b7, &wv[
00978 wv_offset], ldwv);
00979 strmm_("R", "U", "N", "N", &jlen, &knz, &c_b8, &u[j2
00980 + 1 + (kzs + 1) * u_dim1], ldu, &wv[(kzs + 1)
00981 * wv_dim1 + 1], ldwv);
00982
00983
00984
00985 sgemm_("N", "N", &jlen, &i2, &j2, &c_b8, &z__[jrow + (
00986 incol + 1) * z_dim1], ldz, &u[u_offset], ldu,
00987 &c_b8, &wv[wv_offset], ldwv);
00988
00989
00990
00991 slacpy_("ALL", &jlen, &j2, &z__[jrow + (incol + 1) *
00992 z_dim1], ldz, &wv[(i2 + 1) * wv_dim1 + 1],
00993 ldwv);
00994
00995
00996
00997 i__5 = i4 - i2;
00998 strmm_("R", "L", "N", "N", &jlen, &i__5, &c_b8, &u[(
00999 i2 + 1) * u_dim1 + 1], ldu, &wv[(i2 + 1) *
01000 wv_dim1 + 1], ldwv);
01001
01002
01003
01004 i__5 = i4 - i2;
01005 i__7 = j4 - j2;
01006 sgemm_("N", "N", &jlen, &i__5, &i__7, &c_b8, &z__[
01007 jrow + (incol + 1 + j2) * z_dim1], ldz, &u[j2
01008 + 1 + (i2 + 1) * u_dim1], ldu, &c_b8, &wv[(i2
01009 + 1) * wv_dim1 + 1], ldwv);
01010
01011
01012
01013 slacpy_("ALL", &jlen, &kdu, &wv[wv_offset], ldwv, &
01014 z__[jrow + (incol + 1) * z_dim1], ldz);
01015
01016 }
01017 }
01018 }
01019 }
01020
01021 }
01022
01023
01024
01025 return 0;
01026 }