00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__1 = 1;
00019 static integer c__2 = 2;
00020
00021 int clahqr_(logical *wantt, logical *wantz, integer *n,
00022 integer *ilo, integer *ihi, complex *h__, integer *ldh, complex *w,
00023 integer *iloz, integer *ihiz, complex *z__, integer *ldz, integer *
00024 info)
00025 {
00026
00027 integer h_dim1, h_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4;
00028 real r__1, r__2, r__3, r__4, r__5, r__6;
00029 complex q__1, q__2, q__3, q__4, q__5, q__6, q__7;
00030
00031
00032 double r_imag(complex *);
00033 void r_cnjg(complex *, complex *);
00034 double c_abs(complex *);
00035 void c_sqrt(complex *, complex *), pow_ci(complex *, complex *, integer *)
00036 ;
00037
00038
00039 integer i__, j, k, l, m;
00040 real s;
00041 complex t, u, v[2], x, y;
00042 integer i1, i2;
00043 complex t1;
00044 real t2;
00045 complex v2;
00046 real aa, ab, ba, bb, h10;
00047 complex h11;
00048 real h21;
00049 complex h22, sc;
00050 integer nh, nz;
00051 real sx;
00052 integer jhi;
00053 complex h11s;
00054 integer jlo, its;
00055 real ulp;
00056 complex sum;
00057 real tst;
00058 complex temp;
00059 extern int cscal_(integer *, complex *, complex *,
00060 integer *), ccopy_(integer *, complex *, integer *, complex *,
00061 integer *);
00062 real rtemp;
00063 extern int slabad_(real *, real *), clarfg_(integer *,
00064 complex *, complex *, integer *, complex *);
00065 extern VOID cladiv_(complex *, complex *, complex *);
00066 extern doublereal slamch_(char *);
00067 real safmin, safmax, smlnum;
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202 h_dim1 = *ldh;
00203 h_offset = 1 + h_dim1;
00204 h__ -= h_offset;
00205 --w;
00206 z_dim1 = *ldz;
00207 z_offset = 1 + z_dim1;
00208 z__ -= z_offset;
00209
00210
00211 *info = 0;
00212
00213
00214
00215 if (*n == 0) {
00216 return 0;
00217 }
00218 if (*ilo == *ihi) {
00219 i__1 = *ilo;
00220 i__2 = *ilo + *ilo * h_dim1;
00221 w[i__1].r = h__[i__2].r, w[i__1].i = h__[i__2].i;
00222 return 0;
00223 }
00224
00225
00226 i__1 = *ihi - 3;
00227 for (j = *ilo; j <= i__1; ++j) {
00228 i__2 = j + 2 + j * h_dim1;
00229 h__[i__2].r = 0.f, h__[i__2].i = 0.f;
00230 i__2 = j + 3 + j * h_dim1;
00231 h__[i__2].r = 0.f, h__[i__2].i = 0.f;
00232
00233 }
00234 if (*ilo <= *ihi - 2) {
00235 i__1 = *ihi + (*ihi - 2) * h_dim1;
00236 h__[i__1].r = 0.f, h__[i__1].i = 0.f;
00237 }
00238
00239 if (*wantt) {
00240 jlo = 1;
00241 jhi = *n;
00242 } else {
00243 jlo = *ilo;
00244 jhi = *ihi;
00245 }
00246 i__1 = *ihi;
00247 for (i__ = *ilo + 1; i__ <= i__1; ++i__) {
00248 if (r_imag(&h__[i__ + (i__ - 1) * h_dim1]) != 0.f) {
00249
00250
00251
00252 i__2 = i__ + (i__ - 1) * h_dim1;
00253 i__3 = i__ + (i__ - 1) * h_dim1;
00254 r__3 = (r__1 = h__[i__3].r, dabs(r__1)) + (r__2 = r_imag(&h__[i__
00255 + (i__ - 1) * h_dim1]), dabs(r__2));
00256 q__1.r = h__[i__2].r / r__3, q__1.i = h__[i__2].i / r__3;
00257 sc.r = q__1.r, sc.i = q__1.i;
00258 r_cnjg(&q__2, &sc);
00259 r__1 = c_abs(&sc);
00260 q__1.r = q__2.r / r__1, q__1.i = q__2.i / r__1;
00261 sc.r = q__1.r, sc.i = q__1.i;
00262 i__2 = i__ + (i__ - 1) * h_dim1;
00263 r__1 = c_abs(&h__[i__ + (i__ - 1) * h_dim1]);
00264 h__[i__2].r = r__1, h__[i__2].i = 0.f;
00265 i__2 = jhi - i__ + 1;
00266 cscal_(&i__2, &sc, &h__[i__ + i__ * h_dim1], ldh);
00267
00268 i__3 = jhi, i__4 = i__ + 1;
00269 i__2 = min(i__3,i__4) - jlo + 1;
00270 r_cnjg(&q__1, &sc);
00271 cscal_(&i__2, &q__1, &h__[jlo + i__ * h_dim1], &c__1);
00272 if (*wantz) {
00273 i__2 = *ihiz - *iloz + 1;
00274 r_cnjg(&q__1, &sc);
00275 cscal_(&i__2, &q__1, &z__[*iloz + i__ * z_dim1], &c__1);
00276 }
00277 }
00278
00279 }
00280
00281 nh = *ihi - *ilo + 1;
00282 nz = *ihiz - *iloz + 1;
00283
00284
00285
00286 safmin = slamch_("SAFE MINIMUM");
00287 safmax = 1.f / safmin;
00288 slabad_(&safmin, &safmax);
00289 ulp = slamch_("PRECISION");
00290 smlnum = safmin * ((real) nh / ulp);
00291
00292
00293
00294
00295
00296 if (*wantt) {
00297 i1 = 1;
00298 i2 = *n;
00299 }
00300
00301
00302
00303
00304
00305
00306
00307 i__ = *ihi;
00308 L30:
00309 if (i__ < *ilo) {
00310 goto L150;
00311 }
00312
00313
00314
00315
00316
00317 l = *ilo;
00318 for (its = 0; its <= 30; ++its) {
00319
00320
00321
00322 i__1 = l + 1;
00323 for (k = i__; k >= i__1; --k) {
00324 i__2 = k + (k - 1) * h_dim1;
00325 if ((r__1 = h__[i__2].r, dabs(r__1)) + (r__2 = r_imag(&h__[k + (k
00326 - 1) * h_dim1]), dabs(r__2)) <= smlnum) {
00327 goto L50;
00328 }
00329 i__2 = k - 1 + (k - 1) * h_dim1;
00330 i__3 = k + k * h_dim1;
00331 tst = (r__1 = h__[i__2].r, dabs(r__1)) + (r__2 = r_imag(&h__[k -
00332 1 + (k - 1) * h_dim1]), dabs(r__2)) + ((r__3 = h__[i__3]
00333 .r, dabs(r__3)) + (r__4 = r_imag(&h__[k + k * h_dim1]),
00334 dabs(r__4)));
00335 if (tst == 0.f) {
00336 if (k - 2 >= *ilo) {
00337 i__2 = k - 1 + (k - 2) * h_dim1;
00338 tst += (r__1 = h__[i__2].r, dabs(r__1));
00339 }
00340 if (k + 1 <= *ihi) {
00341 i__2 = k + 1 + k * h_dim1;
00342 tst += (r__1 = h__[i__2].r, dabs(r__1));
00343 }
00344 }
00345
00346
00347
00348
00349 i__2 = k + (k - 1) * h_dim1;
00350 if ((r__1 = h__[i__2].r, dabs(r__1)) <= ulp * tst) {
00351
00352 i__2 = k + (k - 1) * h_dim1;
00353 i__3 = k - 1 + k * h_dim1;
00354 r__5 = (r__1 = h__[i__2].r, dabs(r__1)) + (r__2 = r_imag(&h__[
00355 k + (k - 1) * h_dim1]), dabs(r__2)), r__6 = (r__3 =
00356 h__[i__3].r, dabs(r__3)) + (r__4 = r_imag(&h__[k - 1
00357 + k * h_dim1]), dabs(r__4));
00358 ab = dmax(r__5,r__6);
00359
00360 i__2 = k + (k - 1) * h_dim1;
00361 i__3 = k - 1 + k * h_dim1;
00362 r__5 = (r__1 = h__[i__2].r, dabs(r__1)) + (r__2 = r_imag(&h__[
00363 k + (k - 1) * h_dim1]), dabs(r__2)), r__6 = (r__3 =
00364 h__[i__3].r, dabs(r__3)) + (r__4 = r_imag(&h__[k - 1
00365 + k * h_dim1]), dabs(r__4));
00366 ba = dmin(r__5,r__6);
00367 i__2 = k - 1 + (k - 1) * h_dim1;
00368 i__3 = k + k * h_dim1;
00369 q__2.r = h__[i__2].r - h__[i__3].r, q__2.i = h__[i__2].i -
00370 h__[i__3].i;
00371 q__1.r = q__2.r, q__1.i = q__2.i;
00372
00373 i__4 = k + k * h_dim1;
00374 r__5 = (r__1 = h__[i__4].r, dabs(r__1)) + (r__2 = r_imag(&h__[
00375 k + k * h_dim1]), dabs(r__2)), r__6 = (r__3 = q__1.r,
00376 dabs(r__3)) + (r__4 = r_imag(&q__1), dabs(r__4));
00377 aa = dmax(r__5,r__6);
00378 i__2 = k - 1 + (k - 1) * h_dim1;
00379 i__3 = k + k * h_dim1;
00380 q__2.r = h__[i__2].r - h__[i__3].r, q__2.i = h__[i__2].i -
00381 h__[i__3].i;
00382 q__1.r = q__2.r, q__1.i = q__2.i;
00383
00384 i__4 = k + k * h_dim1;
00385 r__5 = (r__1 = h__[i__4].r, dabs(r__1)) + (r__2 = r_imag(&h__[
00386 k + k * h_dim1]), dabs(r__2)), r__6 = (r__3 = q__1.r,
00387 dabs(r__3)) + (r__4 = r_imag(&q__1), dabs(r__4));
00388 bb = dmin(r__5,r__6);
00389 s = aa + ab;
00390
00391 r__1 = smlnum, r__2 = ulp * (bb * (aa / s));
00392 if (ba * (ab / s) <= dmax(r__1,r__2)) {
00393 goto L50;
00394 }
00395 }
00396
00397 }
00398 L50:
00399 l = k;
00400 if (l > *ilo) {
00401
00402
00403
00404 i__1 = l + (l - 1) * h_dim1;
00405 h__[i__1].r = 0.f, h__[i__1].i = 0.f;
00406 }
00407
00408
00409
00410 if (l >= i__) {
00411 goto L140;
00412 }
00413
00414
00415
00416
00417
00418 if (! (*wantt)) {
00419 i1 = l;
00420 i2 = i__;
00421 }
00422
00423 if (its == 10) {
00424
00425
00426
00427 i__1 = l + 1 + l * h_dim1;
00428 s = (r__1 = h__[i__1].r, dabs(r__1)) * .75f;
00429 i__1 = l + l * h_dim1;
00430 q__1.r = s + h__[i__1].r, q__1.i = h__[i__1].i;
00431 t.r = q__1.r, t.i = q__1.i;
00432 } else if (its == 20) {
00433
00434
00435
00436 i__1 = i__ + (i__ - 1) * h_dim1;
00437 s = (r__1 = h__[i__1].r, dabs(r__1)) * .75f;
00438 i__1 = i__ + i__ * h_dim1;
00439 q__1.r = s + h__[i__1].r, q__1.i = h__[i__1].i;
00440 t.r = q__1.r, t.i = q__1.i;
00441 } else {
00442
00443
00444
00445 i__1 = i__ + i__ * h_dim1;
00446 t.r = h__[i__1].r, t.i = h__[i__1].i;
00447 c_sqrt(&q__2, &h__[i__ - 1 + i__ * h_dim1]);
00448 c_sqrt(&q__3, &h__[i__ + (i__ - 1) * h_dim1]);
00449 q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i = q__2.r *
00450 q__3.i + q__2.i * q__3.r;
00451 u.r = q__1.r, u.i = q__1.i;
00452 s = (r__1 = u.r, dabs(r__1)) + (r__2 = r_imag(&u), dabs(r__2));
00453 if (s != 0.f) {
00454 i__1 = i__ - 1 + (i__ - 1) * h_dim1;
00455 q__2.r = h__[i__1].r - t.r, q__2.i = h__[i__1].i - t.i;
00456 q__1.r = q__2.r * .5f, q__1.i = q__2.i * .5f;
00457 x.r = q__1.r, x.i = q__1.i;
00458 sx = (r__1 = x.r, dabs(r__1)) + (r__2 = r_imag(&x), dabs(r__2)
00459 );
00460
00461 r__3 = s, r__4 = (r__1 = x.r, dabs(r__1)) + (r__2 = r_imag(&x)
00462 , dabs(r__2));
00463 s = dmax(r__3,r__4);
00464 q__5.r = x.r / s, q__5.i = x.i / s;
00465 pow_ci(&q__4, &q__5, &c__2);
00466 q__7.r = u.r / s, q__7.i = u.i / s;
00467 pow_ci(&q__6, &q__7, &c__2);
00468 q__3.r = q__4.r + q__6.r, q__3.i = q__4.i + q__6.i;
00469 c_sqrt(&q__2, &q__3);
00470 q__1.r = s * q__2.r, q__1.i = s * q__2.i;
00471 y.r = q__1.r, y.i = q__1.i;
00472 if (sx > 0.f) {
00473 q__1.r = x.r / sx, q__1.i = x.i / sx;
00474 q__2.r = x.r / sx, q__2.i = x.i / sx;
00475 if (q__1.r * y.r + r_imag(&q__2) * r_imag(&y) < 0.f) {
00476 q__3.r = -y.r, q__3.i = -y.i;
00477 y.r = q__3.r, y.i = q__3.i;
00478 }
00479 }
00480 q__4.r = x.r + y.r, q__4.i = x.i + y.i;
00481 cladiv_(&q__3, &u, &q__4);
00482 q__2.r = u.r * q__3.r - u.i * q__3.i, q__2.i = u.r * q__3.i +
00483 u.i * q__3.r;
00484 q__1.r = t.r - q__2.r, q__1.i = t.i - q__2.i;
00485 t.r = q__1.r, t.i = q__1.i;
00486 }
00487 }
00488
00489
00490
00491 i__1 = l + 1;
00492 for (m = i__ - 1; m >= i__1; --m) {
00493
00494
00495
00496
00497
00498 i__2 = m + m * h_dim1;
00499 h11.r = h__[i__2].r, h11.i = h__[i__2].i;
00500 i__2 = m + 1 + (m + 1) * h_dim1;
00501 h22.r = h__[i__2].r, h22.i = h__[i__2].i;
00502 q__1.r = h11.r - t.r, q__1.i = h11.i - t.i;
00503 h11s.r = q__1.r, h11s.i = q__1.i;
00504 i__2 = m + 1 + m * h_dim1;
00505 h21 = h__[i__2].r;
00506 s = (r__1 = h11s.r, dabs(r__1)) + (r__2 = r_imag(&h11s), dabs(
00507 r__2)) + dabs(h21);
00508 q__1.r = h11s.r / s, q__1.i = h11s.i / s;
00509 h11s.r = q__1.r, h11s.i = q__1.i;
00510 h21 /= s;
00511 v[0].r = h11s.r, v[0].i = h11s.i;
00512 v[1].r = h21, v[1].i = 0.f;
00513 i__2 = m + (m - 1) * h_dim1;
00514 h10 = h__[i__2].r;
00515 if (dabs(h10) * dabs(h21) <= ulp * (((r__1 = h11s.r, dabs(r__1))
00516 + (r__2 = r_imag(&h11s), dabs(r__2))) * ((r__3 = h11.r,
00517 dabs(r__3)) + (r__4 = r_imag(&h11), dabs(r__4)) + ((r__5 =
00518 h22.r, dabs(r__5)) + (r__6 = r_imag(&h22), dabs(r__6)))))
00519 ) {
00520 goto L70;
00521 }
00522
00523 }
00524 i__1 = l + l * h_dim1;
00525 h11.r = h__[i__1].r, h11.i = h__[i__1].i;
00526 i__1 = l + 1 + (l + 1) * h_dim1;
00527 h22.r = h__[i__1].r, h22.i = h__[i__1].i;
00528 q__1.r = h11.r - t.r, q__1.i = h11.i - t.i;
00529 h11s.r = q__1.r, h11s.i = q__1.i;
00530 i__1 = l + 1 + l * h_dim1;
00531 h21 = h__[i__1].r;
00532 s = (r__1 = h11s.r, dabs(r__1)) + (r__2 = r_imag(&h11s), dabs(r__2))
00533 + dabs(h21);
00534 q__1.r = h11s.r / s, q__1.i = h11s.i / s;
00535 h11s.r = q__1.r, h11s.i = q__1.i;
00536 h21 /= s;
00537 v[0].r = h11s.r, v[0].i = h11s.i;
00538 v[1].r = h21, v[1].i = 0.f;
00539 L70:
00540
00541
00542
00543 i__1 = i__ - 1;
00544 for (k = m; k <= i__1; ++k) {
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558 if (k > m) {
00559 ccopy_(&c__2, &h__[k + (k - 1) * h_dim1], &c__1, v, &c__1);
00560 }
00561 clarfg_(&c__2, v, &v[1], &c__1, &t1);
00562 if (k > m) {
00563 i__2 = k + (k - 1) * h_dim1;
00564 h__[i__2].r = v[0].r, h__[i__2].i = v[0].i;
00565 i__2 = k + 1 + (k - 1) * h_dim1;
00566 h__[i__2].r = 0.f, h__[i__2].i = 0.f;
00567 }
00568 v2.r = v[1].r, v2.i = v[1].i;
00569 q__1.r = t1.r * v2.r - t1.i * v2.i, q__1.i = t1.r * v2.i + t1.i *
00570 v2.r;
00571 t2 = q__1.r;
00572
00573
00574
00575
00576 i__2 = i2;
00577 for (j = k; j <= i__2; ++j) {
00578 r_cnjg(&q__3, &t1);
00579 i__3 = k + j * h_dim1;
00580 q__2.r = q__3.r * h__[i__3].r - q__3.i * h__[i__3].i, q__2.i =
00581 q__3.r * h__[i__3].i + q__3.i * h__[i__3].r;
00582 i__4 = k + 1 + j * h_dim1;
00583 q__4.r = t2 * h__[i__4].r, q__4.i = t2 * h__[i__4].i;
00584 q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i;
00585 sum.r = q__1.r, sum.i = q__1.i;
00586 i__3 = k + j * h_dim1;
00587 i__4 = k + j * h_dim1;
00588 q__1.r = h__[i__4].r - sum.r, q__1.i = h__[i__4].i - sum.i;
00589 h__[i__3].r = q__1.r, h__[i__3].i = q__1.i;
00590 i__3 = k + 1 + j * h_dim1;
00591 i__4 = k + 1 + j * h_dim1;
00592 q__2.r = sum.r * v2.r - sum.i * v2.i, q__2.i = sum.r * v2.i +
00593 sum.i * v2.r;
00594 q__1.r = h__[i__4].r - q__2.r, q__1.i = h__[i__4].i - q__2.i;
00595 h__[i__3].r = q__1.r, h__[i__3].i = q__1.i;
00596
00597 }
00598
00599
00600
00601
00602
00603 i__3 = k + 2;
00604 i__2 = min(i__3,i__);
00605 for (j = i1; j <= i__2; ++j) {
00606 i__3 = j + k * h_dim1;
00607 q__2.r = t1.r * h__[i__3].r - t1.i * h__[i__3].i, q__2.i =
00608 t1.r * h__[i__3].i + t1.i * h__[i__3].r;
00609 i__4 = j + (k + 1) * h_dim1;
00610 q__3.r = t2 * h__[i__4].r, q__3.i = t2 * h__[i__4].i;
00611 q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00612 sum.r = q__1.r, sum.i = q__1.i;
00613 i__3 = j + k * h_dim1;
00614 i__4 = j + k * h_dim1;
00615 q__1.r = h__[i__4].r - sum.r, q__1.i = h__[i__4].i - sum.i;
00616 h__[i__3].r = q__1.r, h__[i__3].i = q__1.i;
00617 i__3 = j + (k + 1) * h_dim1;
00618 i__4 = j + (k + 1) * h_dim1;
00619 r_cnjg(&q__3, &v2);
00620 q__2.r = sum.r * q__3.r - sum.i * q__3.i, q__2.i = sum.r *
00621 q__3.i + sum.i * q__3.r;
00622 q__1.r = h__[i__4].r - q__2.r, q__1.i = h__[i__4].i - q__2.i;
00623 h__[i__3].r = q__1.r, h__[i__3].i = q__1.i;
00624
00625 }
00626
00627 if (*wantz) {
00628
00629
00630
00631 i__2 = *ihiz;
00632 for (j = *iloz; j <= i__2; ++j) {
00633 i__3 = j + k * z_dim1;
00634 q__2.r = t1.r * z__[i__3].r - t1.i * z__[i__3].i, q__2.i =
00635 t1.r * z__[i__3].i + t1.i * z__[i__3].r;
00636 i__4 = j + (k + 1) * z_dim1;
00637 q__3.r = t2 * z__[i__4].r, q__3.i = t2 * z__[i__4].i;
00638 q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00639 sum.r = q__1.r, sum.i = q__1.i;
00640 i__3 = j + k * z_dim1;
00641 i__4 = j + k * z_dim1;
00642 q__1.r = z__[i__4].r - sum.r, q__1.i = z__[i__4].i -
00643 sum.i;
00644 z__[i__3].r = q__1.r, z__[i__3].i = q__1.i;
00645 i__3 = j + (k + 1) * z_dim1;
00646 i__4 = j + (k + 1) * z_dim1;
00647 r_cnjg(&q__3, &v2);
00648 q__2.r = sum.r * q__3.r - sum.i * q__3.i, q__2.i = sum.r *
00649 q__3.i + sum.i * q__3.r;
00650 q__1.r = z__[i__4].r - q__2.r, q__1.i = z__[i__4].i -
00651 q__2.i;
00652 z__[i__3].r = q__1.r, z__[i__3].i = q__1.i;
00653
00654 }
00655 }
00656
00657 if (k == m && m > l) {
00658
00659
00660
00661
00662
00663
00664 q__1.r = 1.f - t1.r, q__1.i = 0.f - t1.i;
00665 temp.r = q__1.r, temp.i = q__1.i;
00666 r__1 = c_abs(&temp);
00667 q__1.r = temp.r / r__1, q__1.i = temp.i / r__1;
00668 temp.r = q__1.r, temp.i = q__1.i;
00669 i__2 = m + 1 + m * h_dim1;
00670 i__3 = m + 1 + m * h_dim1;
00671 r_cnjg(&q__2, &temp);
00672 q__1.r = h__[i__3].r * q__2.r - h__[i__3].i * q__2.i, q__1.i =
00673 h__[i__3].r * q__2.i + h__[i__3].i * q__2.r;
00674 h__[i__2].r = q__1.r, h__[i__2].i = q__1.i;
00675 if (m + 2 <= i__) {
00676 i__2 = m + 2 + (m + 1) * h_dim1;
00677 i__3 = m + 2 + (m + 1) * h_dim1;
00678 q__1.r = h__[i__3].r * temp.r - h__[i__3].i * temp.i,
00679 q__1.i = h__[i__3].r * temp.i + h__[i__3].i *
00680 temp.r;
00681 h__[i__2].r = q__1.r, h__[i__2].i = q__1.i;
00682 }
00683 i__2 = i__;
00684 for (j = m; j <= i__2; ++j) {
00685 if (j != m + 1) {
00686 if (i2 > j) {
00687 i__3 = i2 - j;
00688 cscal_(&i__3, &temp, &h__[j + (j + 1) * h_dim1],
00689 ldh);
00690 }
00691 i__3 = j - i1;
00692 r_cnjg(&q__1, &temp);
00693 cscal_(&i__3, &q__1, &h__[i1 + j * h_dim1], &c__1);
00694 if (*wantz) {
00695 r_cnjg(&q__1, &temp);
00696 cscal_(&nz, &q__1, &z__[*iloz + j * z_dim1], &
00697 c__1);
00698 }
00699 }
00700
00701 }
00702 }
00703
00704 }
00705
00706
00707
00708 i__1 = i__ + (i__ - 1) * h_dim1;
00709 temp.r = h__[i__1].r, temp.i = h__[i__1].i;
00710 if (r_imag(&temp) != 0.f) {
00711 rtemp = c_abs(&temp);
00712 i__1 = i__ + (i__ - 1) * h_dim1;
00713 h__[i__1].r = rtemp, h__[i__1].i = 0.f;
00714 q__1.r = temp.r / rtemp, q__1.i = temp.i / rtemp;
00715 temp.r = q__1.r, temp.i = q__1.i;
00716 if (i2 > i__) {
00717 i__1 = i2 - i__;
00718 r_cnjg(&q__1, &temp);
00719 cscal_(&i__1, &q__1, &h__[i__ + (i__ + 1) * h_dim1], ldh);
00720 }
00721 i__1 = i__ - i1;
00722 cscal_(&i__1, &temp, &h__[i1 + i__ * h_dim1], &c__1);
00723 if (*wantz) {
00724 cscal_(&nz, &temp, &z__[*iloz + i__ * z_dim1], &c__1);
00725 }
00726 }
00727
00728
00729 }
00730
00731
00732
00733 *info = i__;
00734 return 0;
00735
00736 L140:
00737
00738
00739
00740 i__1 = i__;
00741 i__2 = i__ + i__ * h_dim1;
00742 w[i__1].r = h__[i__2].r, w[i__1].i = h__[i__2].i;
00743
00744
00745
00746 i__ = l - 1;
00747 goto L30;
00748
00749 L150:
00750 return 0;
00751
00752
00753
00754 }