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 integer c__1 = 1;
00020 static integer c__5 = 5;
00021 static logical c_true = TRUE_;
00022 static logical c_false = FALSE_;
00023
00024 int zlatmt_(integer *m, integer *n, char *dist, integer *
00025 iseed, char *sym, doublereal *d__, integer *mode, doublereal *cond,
00026 doublereal *dmax__, integer *rank, integer *kl, integer *ku, char *
00027 pack, doublecomplex *a, integer *lda, doublecomplex *work, integer *
00028 info)
00029 {
00030
00031 integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6;
00032 doublereal d__1, d__2, d__3;
00033 doublecomplex z__1, z__2, z__3;
00034 logical L__1;
00035
00036
00037 double cos(doublereal), sin(doublereal);
00038 void d_cnjg(doublecomplex *, doublecomplex *);
00039
00040
00041 doublecomplex c__;
00042 integer i__, j, k;
00043 doublecomplex s;
00044 integer ic, jc, nc, il;
00045 doublecomplex ct;
00046 integer ir, jr, mr;
00047 doublecomplex st;
00048 integer ir1, ir2, jch, llb, jkl, jku, uub, ilda, icol;
00049 doublereal temp;
00050 logical csym;
00051 integer irow, isym;
00052 doublereal alpha, angle, realc;
00053 integer ipack, ioffg;
00054 extern int dscal_(integer *, doublereal *, doublereal *,
00055 integer *);
00056 extern logical lsame_(char *, char *);
00057 integer iinfo, idist, mnmin;
00058 doublecomplex extra;
00059 integer iskew;
00060 doublecomplex dummy, ztemp;
00061 extern int dlatm7_(integer *, doublereal *, integer *,
00062 integer *, integer *, doublereal *, integer *, integer *, integer
00063 *);
00064 integer iendch, ipackg, minlda;
00065 extern doublereal dlarnd_(integer *, integer *);
00066 extern int zlagge_(integer *, integer *, integer *,
00067 integer *, doublereal *, doublecomplex *, integer *, integer *,
00068 doublecomplex *, integer *), zlaghe_(integer *, integer *,
00069 doublereal *, doublecomplex *, integer *, integer *,
00070 doublecomplex *, integer *), xerbla_(char *, integer *);
00071 integer ioffst, irsign;
00072 logical givens, iltemp;
00073 extern VOID zlarnd_(doublecomplex *, integer *,
00074 integer *);
00075 extern int zlaset_(char *, integer *, integer *,
00076 doublecomplex *, doublecomplex *, doublecomplex *, integer *), zlartg_(doublecomplex *, doublecomplex *, doublereal *,
00077 doublecomplex *, doublecomplex *);
00078 logical ilextr;
00079 extern int zlagsy_(integer *, integer *, doublereal *,
00080 doublecomplex *, integer *, integer *, doublecomplex *, integer *)
00081 ;
00082 integer isympk;
00083 logical topdwn;
00084 extern int zlarot_(logical *, logical *, logical *,
00085 integer *, doublecomplex *, doublecomplex *, doublecomplex *,
00086 integer *, doublecomplex *, doublecomplex *);
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
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 --iseed;
00364 --d__;
00365 a_dim1 = *lda;
00366 a_offset = 1 + a_dim1;
00367 a -= a_offset;
00368 --work;
00369
00370
00371 *info = 0;
00372
00373
00374
00375 if (*m == 0 || *n == 0) {
00376 return 0;
00377 }
00378
00379
00380
00381 if (lsame_(dist, "U")) {
00382 idist = 1;
00383 } else if (lsame_(dist, "S")) {
00384 idist = 2;
00385 } else if (lsame_(dist, "N")) {
00386 idist = 3;
00387 } else {
00388 idist = -1;
00389 }
00390
00391
00392
00393 if (lsame_(sym, "N")) {
00394 isym = 1;
00395 irsign = 0;
00396 csym = FALSE_;
00397 } else if (lsame_(sym, "P")) {
00398 isym = 2;
00399 irsign = 0;
00400 csym = FALSE_;
00401 } else if (lsame_(sym, "S")) {
00402 isym = 2;
00403 irsign = 0;
00404 csym = TRUE_;
00405 } else if (lsame_(sym, "H")) {
00406 isym = 2;
00407 irsign = 1;
00408 csym = FALSE_;
00409 } else {
00410 isym = -1;
00411 }
00412
00413
00414
00415 isympk = 0;
00416 if (lsame_(pack, "N")) {
00417 ipack = 0;
00418 } else if (lsame_(pack, "U")) {
00419 ipack = 1;
00420 isympk = 1;
00421 } else if (lsame_(pack, "L")) {
00422 ipack = 2;
00423 isympk = 1;
00424 } else if (lsame_(pack, "C")) {
00425 ipack = 3;
00426 isympk = 2;
00427 } else if (lsame_(pack, "R")) {
00428 ipack = 4;
00429 isympk = 3;
00430 } else if (lsame_(pack, "B")) {
00431 ipack = 5;
00432 isympk = 3;
00433 } else if (lsame_(pack, "Q")) {
00434 ipack = 6;
00435 isympk = 2;
00436 } else if (lsame_(pack, "Z")) {
00437 ipack = 7;
00438 } else {
00439 ipack = -1;
00440 }
00441
00442
00443
00444 mnmin = min(*m,*n);
00445
00446 i__1 = *kl, i__2 = *m - 1;
00447 llb = min(i__1,i__2);
00448
00449 i__1 = *ku, i__2 = *n - 1;
00450 uub = min(i__1,i__2);
00451
00452 i__1 = *m, i__2 = *n + llb;
00453 mr = min(i__1,i__2);
00454
00455 i__1 = *n, i__2 = *m + uub;
00456 nc = min(i__1,i__2);
00457
00458 if (ipack == 5 || ipack == 6) {
00459 minlda = uub + 1;
00460 } else if (ipack == 7) {
00461 minlda = llb + uub + 1;
00462 } else {
00463 minlda = *m;
00464 }
00465
00466
00467
00468
00469 givens = FALSE_;
00470 if (isym == 1) {
00471
00472 i__1 = 1, i__2 = mr + nc;
00473 if ((doublereal) (llb + uub) < (doublereal) max(i__1,i__2) * .3) {
00474 givens = TRUE_;
00475 }
00476 } else {
00477 if (llb << 1 < *m) {
00478 givens = TRUE_;
00479 }
00480 }
00481 if (*lda < *m && *lda >= minlda) {
00482 givens = TRUE_;
00483 }
00484
00485
00486
00487 if (*m < 0) {
00488 *info = -1;
00489 } else if (*m != *n && isym != 1) {
00490 *info = -1;
00491 } else if (*n < 0) {
00492 *info = -2;
00493 } else if (idist == -1) {
00494 *info = -3;
00495 } else if (isym == -1) {
00496 *info = -5;
00497 } else if (abs(*mode) > 6) {
00498 *info = -7;
00499 } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.) {
00500 *info = -8;
00501 } else if (*kl < 0) {
00502 *info = -10;
00503 } else if (*ku < 0 || isym != 1 && *kl != *ku) {
00504 *info = -11;
00505 } else if (ipack == -1 || isympk == 1 && isym == 1 || isympk == 2 && isym
00506 == 1 && *kl > 0 || isympk == 3 && isym == 1 && *ku > 0 || isympk
00507 != 0 && *m != *n) {
00508 *info = -12;
00509 } else if (*lda < max(1,minlda)) {
00510 *info = -14;
00511 }
00512
00513 if (*info != 0) {
00514 i__1 = -(*info);
00515 xerbla_("ZLATMT", &i__1);
00516 return 0;
00517 }
00518
00519
00520
00521 for (i__ = 1; i__ <= 4; ++i__) {
00522 iseed[i__] = (i__1 = iseed[i__], abs(i__1)) % 4096;
00523
00524 }
00525
00526 if (iseed[4] % 2 != 1) {
00527 ++iseed[4];
00528 }
00529
00530
00531
00532
00533
00534 dlatm7_(mode, cond, &irsign, &idist, &iseed[1], &d__[1], &mnmin, rank, &
00535 iinfo);
00536 if (iinfo != 0) {
00537 *info = 1;
00538 return 0;
00539 }
00540
00541
00542
00543
00544 if (abs(d__[1]) <= (d__1 = d__[*rank], abs(d__1))) {
00545 topdwn = TRUE_;
00546 } else {
00547 topdwn = FALSE_;
00548 }
00549
00550 if (*mode != 0 && abs(*mode) != 6) {
00551
00552
00553
00554 temp = abs(d__[1]);
00555 i__1 = *rank;
00556 for (i__ = 2; i__ <= i__1; ++i__) {
00557
00558 d__2 = temp, d__3 = (d__1 = d__[i__], abs(d__1));
00559 temp = max(d__2,d__3);
00560
00561 }
00562
00563 if (temp > 0.) {
00564 alpha = *dmax__ / temp;
00565 } else {
00566 *info = 2;
00567 return 0;
00568 }
00569
00570 dscal_(rank, &alpha, &d__[1], &c__1);
00571
00572 }
00573
00574 zlaset_("Full", lda, n, &c_b1, &c_b1, &a[a_offset], lda);
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585 if (ipack > 4) {
00586 ilda = *lda - 1;
00587 iskew = 1;
00588 if (ipack > 5) {
00589 ioffst = uub + 1;
00590 } else {
00591 ioffst = 1;
00592 }
00593 } else {
00594 ilda = *lda;
00595 iskew = 0;
00596 ioffst = 0;
00597 }
00598
00599
00600
00601
00602
00603 ipackg = 0;
00604
00605
00606
00607
00608 if (llb == 0 && uub == 0) {
00609 i__1 = mnmin;
00610 for (j = 1; j <= i__1; ++j) {
00611 i__2 = (1 - iskew) * j + ioffst + j * a_dim1;
00612 i__3 = j;
00613 z__1.r = d__[i__3], z__1.i = 0.;
00614 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00615
00616 }
00617
00618 if (ipack <= 2 || ipack >= 5) {
00619 ipackg = ipack;
00620 }
00621
00622 } else if (givens) {
00623
00624
00625
00626
00627 if (isym == 1) {
00628
00629
00630
00631 if (ipack > 4) {
00632 ipackg = ipack;
00633 } else {
00634 ipackg = 0;
00635 }
00636
00637 i__1 = mnmin;
00638 for (j = 1; j <= i__1; ++j) {
00639 i__2 = (1 - iskew) * j + ioffst + j * a_dim1;
00640 i__3 = j;
00641 z__1.r = d__[i__3], z__1.i = 0.;
00642 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00643
00644 }
00645
00646 if (topdwn) {
00647 jkl = 0;
00648 i__1 = uub;
00649 for (jku = 1; jku <= i__1; ++jku) {
00650
00651
00652
00653
00654
00655
00656
00657 i__3 = *m + jku;
00658 i__2 = min(i__3,*n) + jkl - 1;
00659 for (jr = 1; jr <= i__2; ++jr) {
00660 extra.r = 0., extra.i = 0.;
00661 angle = dlarnd_(&c__1, &iseed[1]) *
00662 6.2831853071795864769252867663;
00663 d__1 = cos(angle);
00664 zlarnd_(&z__2, &c__5, &iseed[1]);
00665 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00666 c__.r = z__1.r, c__.i = z__1.i;
00667 d__1 = sin(angle);
00668 zlarnd_(&z__2, &c__5, &iseed[1]);
00669 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00670 s.r = z__1.r, s.i = z__1.i;
00671
00672 i__3 = 1, i__4 = jr - jkl;
00673 icol = max(i__3,i__4);
00674 if (jr < *m) {
00675
00676 i__3 = *n, i__4 = jr + jku;
00677 il = min(i__3,i__4) + 1 - icol;
00678 L__1 = jr > jkl;
00679 zlarot_(&c_true, &L__1, &c_false, &il, &c__, &s, &
00680 a[jr - iskew * icol + ioffst + icol *
00681 a_dim1], &ilda, &extra, &dummy);
00682 }
00683
00684
00685
00686 ir = jr;
00687 ic = icol;
00688 i__3 = -jkl - jku;
00689 for (jch = jr - jkl; i__3 < 0 ? jch >= 1 : jch <= 1;
00690 jch += i__3) {
00691 if (ir < *m) {
00692 zlartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst
00693 + (ic + 1) * a_dim1], &extra, &realc,
00694 &s, &dummy);
00695 d__1 = dlarnd_(&c__5, &iseed[1]);
00696 dummy.r = d__1, dummy.i = 0.;
00697 z__2.r = realc * dummy.r, z__2.i = realc *
00698 dummy.i;
00699 d_cnjg(&z__1, &z__2);
00700 c__.r = z__1.r, c__.i = z__1.i;
00701 z__3.r = -s.r, z__3.i = -s.i;
00702 z__2.r = z__3.r * dummy.r - z__3.i * dummy.i,
00703 z__2.i = z__3.r * dummy.i + z__3.i *
00704 dummy.r;
00705 d_cnjg(&z__1, &z__2);
00706 s.r = z__1.r, s.i = z__1.i;
00707 }
00708
00709 i__4 = 1, i__5 = jch - jku;
00710 irow = max(i__4,i__5);
00711 il = ir + 2 - irow;
00712 ztemp.r = 0., ztemp.i = 0.;
00713 iltemp = jch > jku;
00714 zlarot_(&c_false, &iltemp, &c_true, &il, &c__, &s,
00715 &a[irow - iskew * ic + ioffst + ic *
00716 a_dim1], &ilda, &ztemp, &extra);
00717 if (iltemp) {
00718 zlartg_(&a[irow + 1 - iskew * (ic + 1) +
00719 ioffst + (ic + 1) * a_dim1], &ztemp, &
00720 realc, &s, &dummy);
00721 zlarnd_(&z__1, &c__5, &iseed[1]);
00722 dummy.r = z__1.r, dummy.i = z__1.i;
00723 z__2.r = realc * dummy.r, z__2.i = realc *
00724 dummy.i;
00725 d_cnjg(&z__1, &z__2);
00726 c__.r = z__1.r, c__.i = z__1.i;
00727 z__3.r = -s.r, z__3.i = -s.i;
00728 z__2.r = z__3.r * dummy.r - z__3.i * dummy.i,
00729 z__2.i = z__3.r * dummy.i + z__3.i *
00730 dummy.r;
00731 d_cnjg(&z__1, &z__2);
00732 s.r = z__1.r, s.i = z__1.i;
00733
00734
00735 i__4 = 1, i__5 = jch - jku - jkl;
00736 icol = max(i__4,i__5);
00737 il = ic + 2 - icol;
00738 extra.r = 0., extra.i = 0.;
00739 L__1 = jch > jku + jkl;
00740 zlarot_(&c_true, &L__1, &c_true, &il, &c__, &
00741 s, &a[irow - iskew * icol + ioffst +
00742 icol * a_dim1], &ilda, &extra, &ztemp)
00743 ;
00744 ic = icol;
00745 ir = irow;
00746 }
00747
00748 }
00749
00750 }
00751
00752 }
00753
00754 jku = uub;
00755 i__1 = llb;
00756 for (jkl = 1; jkl <= i__1; ++jkl) {
00757
00758
00759
00760
00761 i__3 = *n + jkl;
00762 i__2 = min(i__3,*m) + jku - 1;
00763 for (jc = 1; jc <= i__2; ++jc) {
00764 extra.r = 0., extra.i = 0.;
00765 angle = dlarnd_(&c__1, &iseed[1]) *
00766 6.2831853071795864769252867663;
00767 d__1 = cos(angle);
00768 zlarnd_(&z__2, &c__5, &iseed[1]);
00769 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00770 c__.r = z__1.r, c__.i = z__1.i;
00771 d__1 = sin(angle);
00772 zlarnd_(&z__2, &c__5, &iseed[1]);
00773 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00774 s.r = z__1.r, s.i = z__1.i;
00775
00776 i__3 = 1, i__4 = jc - jku;
00777 irow = max(i__3,i__4);
00778 if (jc < *n) {
00779
00780 i__3 = *m, i__4 = jc + jkl;
00781 il = min(i__3,i__4) + 1 - irow;
00782 L__1 = jc > jku;
00783 zlarot_(&c_false, &L__1, &c_false, &il, &c__, &s,
00784 &a[irow - iskew * jc + ioffst + jc *
00785 a_dim1], &ilda, &extra, &dummy);
00786 }
00787
00788
00789
00790 ic = jc;
00791 ir = irow;
00792 i__3 = -jkl - jku;
00793 for (jch = jc - jku; i__3 < 0 ? jch >= 1 : jch <= 1;
00794 jch += i__3) {
00795 if (ic < *n) {
00796 zlartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst
00797 + (ic + 1) * a_dim1], &extra, &realc,
00798 &s, &dummy);
00799 zlarnd_(&z__1, &c__5, &iseed[1]);
00800 dummy.r = z__1.r, dummy.i = z__1.i;
00801 z__2.r = realc * dummy.r, z__2.i = realc *
00802 dummy.i;
00803 d_cnjg(&z__1, &z__2);
00804 c__.r = z__1.r, c__.i = z__1.i;
00805 z__3.r = -s.r, z__3.i = -s.i;
00806 z__2.r = z__3.r * dummy.r - z__3.i * dummy.i,
00807 z__2.i = z__3.r * dummy.i + z__3.i *
00808 dummy.r;
00809 d_cnjg(&z__1, &z__2);
00810 s.r = z__1.r, s.i = z__1.i;
00811 }
00812
00813 i__4 = 1, i__5 = jch - jkl;
00814 icol = max(i__4,i__5);
00815 il = ic + 2 - icol;
00816 ztemp.r = 0., ztemp.i = 0.;
00817 iltemp = jch > jkl;
00818 zlarot_(&c_true, &iltemp, &c_true, &il, &c__, &s,
00819 &a[ir - iskew * icol + ioffst + icol *
00820 a_dim1], &ilda, &ztemp, &extra);
00821 if (iltemp) {
00822 zlartg_(&a[ir + 1 - iskew * (icol + 1) +
00823 ioffst + (icol + 1) * a_dim1], &ztemp,
00824 &realc, &s, &dummy);
00825 zlarnd_(&z__1, &c__5, &iseed[1]);
00826 dummy.r = z__1.r, dummy.i = z__1.i;
00827 z__2.r = realc * dummy.r, z__2.i = realc *
00828 dummy.i;
00829 d_cnjg(&z__1, &z__2);
00830 c__.r = z__1.r, c__.i = z__1.i;
00831 z__3.r = -s.r, z__3.i = -s.i;
00832 z__2.r = z__3.r * dummy.r - z__3.i * dummy.i,
00833 z__2.i = z__3.r * dummy.i + z__3.i *
00834 dummy.r;
00835 d_cnjg(&z__1, &z__2);
00836 s.r = z__1.r, s.i = z__1.i;
00837
00838 i__4 = 1, i__5 = jch - jkl - jku;
00839 irow = max(i__4,i__5);
00840 il = ir + 2 - irow;
00841 extra.r = 0., extra.i = 0.;
00842 L__1 = jch > jkl + jku;
00843 zlarot_(&c_false, &L__1, &c_true, &il, &c__, &
00844 s, &a[irow - iskew * icol + ioffst +
00845 icol * a_dim1], &ilda, &extra, &ztemp)
00846 ;
00847 ic = icol;
00848 ir = irow;
00849 }
00850
00851 }
00852
00853 }
00854
00855 }
00856
00857 } else {
00858
00859
00860
00861 jkl = 0;
00862 i__1 = uub;
00863 for (jku = 1; jku <= i__1; ++jku) {
00864
00865
00866
00867
00868
00869
00870
00871 i__2 = *m, i__3 = *n + jkl;
00872 iendch = min(i__2,i__3) - 1;
00873
00874 i__2 = *m + jku;
00875 i__3 = 1 - jkl;
00876 for (jc = min(i__2,*n) - 1; jc >= i__3; --jc) {
00877 extra.r = 0., extra.i = 0.;
00878 angle = dlarnd_(&c__1, &iseed[1]) *
00879 6.2831853071795864769252867663;
00880 d__1 = cos(angle);
00881 zlarnd_(&z__2, &c__5, &iseed[1]);
00882 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00883 c__.r = z__1.r, c__.i = z__1.i;
00884 d__1 = sin(angle);
00885 zlarnd_(&z__2, &c__5, &iseed[1]);
00886 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00887 s.r = z__1.r, s.i = z__1.i;
00888
00889 i__2 = 1, i__4 = jc - jku + 1;
00890 irow = max(i__2,i__4);
00891 if (jc > 0) {
00892
00893 i__2 = *m, i__4 = jc + jkl + 1;
00894 il = min(i__2,i__4) + 1 - irow;
00895 L__1 = jc + jkl < *m;
00896 zlarot_(&c_false, &c_false, &L__1, &il, &c__, &s,
00897 &a[irow - iskew * jc + ioffst + jc *
00898 a_dim1], &ilda, &dummy, &extra);
00899 }
00900
00901
00902
00903 ic = jc;
00904 i__2 = iendch;
00905 i__4 = jkl + jku;
00906 for (jch = jc + jkl; i__4 < 0 ? jch >= i__2 : jch <=
00907 i__2; jch += i__4) {
00908 ilextr = ic > 0;
00909 if (ilextr) {
00910 zlartg_(&a[jch - iskew * ic + ioffst + ic *
00911 a_dim1], &extra, &realc, &s, &dummy);
00912 zlarnd_(&z__1, &c__5, &iseed[1]);
00913 dummy.r = z__1.r, dummy.i = z__1.i;
00914 z__1.r = realc * dummy.r, z__1.i = realc *
00915 dummy.i;
00916 c__.r = z__1.r, c__.i = z__1.i;
00917 z__1.r = s.r * dummy.r - s.i * dummy.i,
00918 z__1.i = s.r * dummy.i + s.i *
00919 dummy.r;
00920 s.r = z__1.r, s.i = z__1.i;
00921 }
00922 ic = max(1,ic);
00923
00924 i__5 = *n - 1, i__6 = jch + jku;
00925 icol = min(i__5,i__6);
00926 iltemp = jch + jku < *n;
00927 ztemp.r = 0., ztemp.i = 0.;
00928 i__5 = icol + 2 - ic;
00929 zlarot_(&c_true, &ilextr, &iltemp, &i__5, &c__, &
00930 s, &a[jch - iskew * ic + ioffst + ic *
00931 a_dim1], &ilda, &extra, &ztemp);
00932 if (iltemp) {
00933 zlartg_(&a[jch - iskew * icol + ioffst + icol
00934 * a_dim1], &ztemp, &realc, &s, &dummy)
00935 ;
00936 zlarnd_(&z__1, &c__5, &iseed[1]);
00937 dummy.r = z__1.r, dummy.i = z__1.i;
00938 z__1.r = realc * dummy.r, z__1.i = realc *
00939 dummy.i;
00940 c__.r = z__1.r, c__.i = z__1.i;
00941 z__1.r = s.r * dummy.r - s.i * dummy.i,
00942 z__1.i = s.r * dummy.i + s.i *
00943 dummy.r;
00944 s.r = z__1.r, s.i = z__1.i;
00945
00946 i__5 = iendch, i__6 = jch + jkl + jku;
00947 il = min(i__5,i__6) + 2 - jch;
00948 extra.r = 0., extra.i = 0.;
00949 L__1 = jch + jkl + jku <= iendch;
00950 zlarot_(&c_false, &c_true, &L__1, &il, &c__, &
00951 s, &a[jch - iskew * icol + ioffst +
00952 icol * a_dim1], &ilda, &ztemp, &extra)
00953 ;
00954 ic = icol;
00955 }
00956
00957 }
00958
00959 }
00960
00961 }
00962
00963 jku = uub;
00964 i__1 = llb;
00965 for (jkl = 1; jkl <= i__1; ++jkl) {
00966
00967
00968
00969
00970
00971
00972
00973 i__3 = *n, i__4 = *m + jku;
00974 iendch = min(i__3,i__4) - 1;
00975
00976 i__3 = *n + jkl;
00977 i__4 = 1 - jku;
00978 for (jr = min(i__3,*m) - 1; jr >= i__4; --jr) {
00979 extra.r = 0., extra.i = 0.;
00980 angle = dlarnd_(&c__1, &iseed[1]) *
00981 6.2831853071795864769252867663;
00982 d__1 = cos(angle);
00983 zlarnd_(&z__2, &c__5, &iseed[1]);
00984 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00985 c__.r = z__1.r, c__.i = z__1.i;
00986 d__1 = sin(angle);
00987 zlarnd_(&z__2, &c__5, &iseed[1]);
00988 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00989 s.r = z__1.r, s.i = z__1.i;
00990
00991 i__3 = 1, i__2 = jr - jkl + 1;
00992 icol = max(i__3,i__2);
00993 if (jr > 0) {
00994
00995 i__3 = *n, i__2 = jr + jku + 1;
00996 il = min(i__3,i__2) + 1 - icol;
00997 L__1 = jr + jku < *n;
00998 zlarot_(&c_true, &c_false, &L__1, &il, &c__, &s, &
00999 a[jr - iskew * icol + ioffst + icol *
01000 a_dim1], &ilda, &dummy, &extra);
01001 }
01002
01003
01004
01005 ir = jr;
01006 i__3 = iendch;
01007 i__2 = jkl + jku;
01008 for (jch = jr + jku; i__2 < 0 ? jch >= i__3 : jch <=
01009 i__3; jch += i__2) {
01010 ilextr = ir > 0;
01011 if (ilextr) {
01012 zlartg_(&a[ir - iskew * jch + ioffst + jch *
01013 a_dim1], &extra, &realc, &s, &dummy);
01014 zlarnd_(&z__1, &c__5, &iseed[1]);
01015 dummy.r = z__1.r, dummy.i = z__1.i;
01016 z__1.r = realc * dummy.r, z__1.i = realc *
01017 dummy.i;
01018 c__.r = z__1.r, c__.i = z__1.i;
01019 z__1.r = s.r * dummy.r - s.i * dummy.i,
01020 z__1.i = s.r * dummy.i + s.i *
01021 dummy.r;
01022 s.r = z__1.r, s.i = z__1.i;
01023 }
01024 ir = max(1,ir);
01025
01026 i__5 = *m - 1, i__6 = jch + jkl;
01027 irow = min(i__5,i__6);
01028 iltemp = jch + jkl < *m;
01029 ztemp.r = 0., ztemp.i = 0.;
01030 i__5 = irow + 2 - ir;
01031 zlarot_(&c_false, &ilextr, &iltemp, &i__5, &c__, &
01032 s, &a[ir - iskew * jch + ioffst + jch *
01033 a_dim1], &ilda, &extra, &ztemp);
01034 if (iltemp) {
01035 zlartg_(&a[irow - iskew * jch + ioffst + jch *
01036 a_dim1], &ztemp, &realc, &s, &dummy);
01037 zlarnd_(&z__1, &c__5, &iseed[1]);
01038 dummy.r = z__1.r, dummy.i = z__1.i;
01039 z__1.r = realc * dummy.r, z__1.i = realc *
01040 dummy.i;
01041 c__.r = z__1.r, c__.i = z__1.i;
01042 z__1.r = s.r * dummy.r - s.i * dummy.i,
01043 z__1.i = s.r * dummy.i + s.i *
01044 dummy.r;
01045 s.r = z__1.r, s.i = z__1.i;
01046
01047 i__5 = iendch, i__6 = jch + jkl + jku;
01048 il = min(i__5,i__6) + 2 - jch;
01049 extra.r = 0., extra.i = 0.;
01050 L__1 = jch + jkl + jku <= iendch;
01051 zlarot_(&c_true, &c_true, &L__1, &il, &c__, &
01052 s, &a[irow - iskew * jch + ioffst +
01053 jch * a_dim1], &ilda, &ztemp, &extra);
01054 ir = irow;
01055 }
01056
01057 }
01058
01059 }
01060
01061 }
01062
01063 }
01064
01065 } else {
01066
01067
01068
01069
01070 ipackg = ipack;
01071 ioffg = ioffst;
01072
01073 if (topdwn) {
01074
01075
01076
01077 if (ipack >= 5) {
01078 ipackg = 6;
01079 ioffg = uub + 1;
01080 } else {
01081 ipackg = 1;
01082 }
01083
01084 i__1 = mnmin;
01085 for (j = 1; j <= i__1; ++j) {
01086 i__4 = (1 - iskew) * j + ioffg + j * a_dim1;
01087 i__2 = j;
01088 z__1.r = d__[i__2], z__1.i = 0.;
01089 a[i__4].r = z__1.r, a[i__4].i = z__1.i;
01090
01091 }
01092
01093 i__1 = uub;
01094 for (k = 1; k <= i__1; ++k) {
01095 i__4 = *n - 1;
01096 for (jc = 1; jc <= i__4; ++jc) {
01097
01098 i__2 = 1, i__3 = jc - k;
01099 irow = max(i__2,i__3);
01100
01101 i__2 = jc + 1, i__3 = k + 2;
01102 il = min(i__2,i__3);
01103 extra.r = 0., extra.i = 0.;
01104 i__2 = jc - iskew * (jc + 1) + ioffg + (jc + 1) *
01105 a_dim1;
01106 ztemp.r = a[i__2].r, ztemp.i = a[i__2].i;
01107 angle = dlarnd_(&c__1, &iseed[1]) *
01108 6.2831853071795864769252867663;
01109 d__1 = cos(angle);
01110 zlarnd_(&z__2, &c__5, &iseed[1]);
01111 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
01112 c__.r = z__1.r, c__.i = z__1.i;
01113 d__1 = sin(angle);
01114 zlarnd_(&z__2, &c__5, &iseed[1]);
01115 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
01116 s.r = z__1.r, s.i = z__1.i;
01117 if (csym) {
01118 ct.r = c__.r, ct.i = c__.i;
01119 st.r = s.r, st.i = s.i;
01120 } else {
01121 d_cnjg(&z__1, &ztemp);
01122 ztemp.r = z__1.r, ztemp.i = z__1.i;
01123 d_cnjg(&z__1, &c__);
01124 ct.r = z__1.r, ct.i = z__1.i;
01125 d_cnjg(&z__1, &s);
01126 st.r = z__1.r, st.i = z__1.i;
01127 }
01128 L__1 = jc > k;
01129 zlarot_(&c_false, &L__1, &c_true, &il, &c__, &s, &a[
01130 irow - iskew * jc + ioffg + jc * a_dim1], &
01131 ilda, &extra, &ztemp);
01132
01133 i__3 = k, i__5 = *n - jc;
01134 i__2 = min(i__3,i__5) + 1;
01135 zlarot_(&c_true, &c_true, &c_false, &i__2, &ct, &st, &
01136 a[(1 - iskew) * jc + ioffg + jc * a_dim1], &
01137 ilda, &ztemp, &dummy);
01138
01139
01140
01141 icol = jc;
01142 i__2 = -k;
01143 for (jch = jc - k; i__2 < 0 ? jch >= 1 : jch <= 1;
01144 jch += i__2) {
01145 zlartg_(&a[jch + 1 - iskew * (icol + 1) + ioffg +
01146 (icol + 1) * a_dim1], &extra, &realc, &s,
01147 &dummy);
01148 zlarnd_(&z__1, &c__5, &iseed[1]);
01149 dummy.r = z__1.r, dummy.i = z__1.i;
01150 z__2.r = realc * dummy.r, z__2.i = realc *
01151 dummy.i;
01152 d_cnjg(&z__1, &z__2);
01153 c__.r = z__1.r, c__.i = z__1.i;
01154 z__3.r = -s.r, z__3.i = -s.i;
01155 z__2.r = z__3.r * dummy.r - z__3.i * dummy.i,
01156 z__2.i = z__3.r * dummy.i + z__3.i *
01157 dummy.r;
01158 d_cnjg(&z__1, &z__2);
01159 s.r = z__1.r, s.i = z__1.i;
01160 i__3 = jch - iskew * (jch + 1) + ioffg + (jch + 1)
01161 * a_dim1;
01162 ztemp.r = a[i__3].r, ztemp.i = a[i__3].i;
01163 if (csym) {
01164 ct.r = c__.r, ct.i = c__.i;
01165 st.r = s.r, st.i = s.i;
01166 } else {
01167 d_cnjg(&z__1, &ztemp);
01168 ztemp.r = z__1.r, ztemp.i = z__1.i;
01169 d_cnjg(&z__1, &c__);
01170 ct.r = z__1.r, ct.i = z__1.i;
01171 d_cnjg(&z__1, &s);
01172 st.r = z__1.r, st.i = z__1.i;
01173 }
01174 i__3 = k + 2;
01175 zlarot_(&c_true, &c_true, &c_true, &i__3, &c__, &
01176 s, &a[(1 - iskew) * jch + ioffg + jch *
01177 a_dim1], &ilda, &ztemp, &extra);
01178
01179 i__3 = 1, i__5 = jch - k;
01180 irow = max(i__3,i__5);
01181
01182 i__3 = jch + 1, i__5 = k + 2;
01183 il = min(i__3,i__5);
01184 extra.r = 0., extra.i = 0.;
01185 L__1 = jch > k;
01186 zlarot_(&c_false, &L__1, &c_true, &il, &ct, &st, &
01187 a[irow - iskew * jch + ioffg + jch *
01188 a_dim1], &ilda, &extra, &ztemp);
01189 icol = jch;
01190
01191 }
01192
01193 }
01194
01195 }
01196
01197
01198
01199
01200 if (ipack != ipackg && ipack != 3) {
01201 i__1 = *n;
01202 for (jc = 1; jc <= i__1; ++jc) {
01203 irow = ioffst - iskew * jc;
01204 if (csym) {
01205
01206 i__2 = *n, i__3 = jc + uub;
01207 i__4 = min(i__2,i__3);
01208 for (jr = jc; jr <= i__4; ++jr) {
01209 i__2 = jr + irow + jc * a_dim1;
01210 i__3 = jc - iskew * jr + ioffg + jr * a_dim1;
01211 a[i__2].r = a[i__3].r, a[i__2].i = a[i__3].i;
01212
01213 }
01214 } else {
01215
01216 i__2 = *n, i__3 = jc + uub;
01217 i__4 = min(i__2,i__3);
01218 for (jr = jc; jr <= i__4; ++jr) {
01219 i__2 = jr + irow + jc * a_dim1;
01220 d_cnjg(&z__1, &a[jc - iskew * jr + ioffg + jr
01221 * a_dim1]);
01222 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
01223
01224 }
01225 }
01226
01227 }
01228 if (ipack == 5) {
01229 i__1 = *n;
01230 for (jc = *n - uub + 1; jc <= i__1; ++jc) {
01231 i__4 = uub + 1;
01232 for (jr = *n + 2 - jc; jr <= i__4; ++jr) {
01233 i__2 = jr + jc * a_dim1;
01234 a[i__2].r = 0., a[i__2].i = 0.;
01235
01236 }
01237
01238 }
01239 }
01240 if (ipackg == 6) {
01241 ipackg = ipack;
01242 } else {
01243 ipackg = 0;
01244 }
01245 }
01246 } else {
01247
01248
01249
01250 if (ipack >= 5) {
01251 ipackg = 5;
01252 if (ipack == 6) {
01253 ioffg = 1;
01254 }
01255 } else {
01256 ipackg = 2;
01257 }
01258
01259 i__1 = mnmin;
01260 for (j = 1; j <= i__1; ++j) {
01261 i__4 = (1 - iskew) * j + ioffg + j * a_dim1;
01262 i__2 = j;
01263 z__1.r = d__[i__2], z__1.i = 0.;
01264 a[i__4].r = z__1.r, a[i__4].i = z__1.i;
01265
01266 }
01267
01268 i__1 = uub;
01269 for (k = 1; k <= i__1; ++k) {
01270 for (jc = *n - 1; jc >= 1; --jc) {
01271
01272 i__4 = *n + 1 - jc, i__2 = k + 2;
01273 il = min(i__4,i__2);
01274 extra.r = 0., extra.i = 0.;
01275 i__4 = (1 - iskew) * jc + 1 + ioffg + jc * a_dim1;
01276 ztemp.r = a[i__4].r, ztemp.i = a[i__4].i;
01277 angle = dlarnd_(&c__1, &iseed[1]) *
01278 6.2831853071795864769252867663;
01279 d__1 = cos(angle);
01280 zlarnd_(&z__2, &c__5, &iseed[1]);
01281 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
01282 c__.r = z__1.r, c__.i = z__1.i;
01283 d__1 = sin(angle);
01284 zlarnd_(&z__2, &c__5, &iseed[1]);
01285 z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
01286 s.r = z__1.r, s.i = z__1.i;
01287 if (csym) {
01288 ct.r = c__.r, ct.i = c__.i;
01289 st.r = s.r, st.i = s.i;
01290 } else {
01291 d_cnjg(&z__1, &ztemp);
01292 ztemp.r = z__1.r, ztemp.i = z__1.i;
01293 d_cnjg(&z__1, &c__);
01294 ct.r = z__1.r, ct.i = z__1.i;
01295 d_cnjg(&z__1, &s);
01296 st.r = z__1.r, st.i = z__1.i;
01297 }
01298 L__1 = *n - jc > k;
01299 zlarot_(&c_false, &c_true, &L__1, &il, &c__, &s, &a[(
01300 1 - iskew) * jc + ioffg + jc * a_dim1], &ilda,
01301 &ztemp, &extra);
01302
01303 i__4 = 1, i__2 = jc - k + 1;
01304 icol = max(i__4,i__2);
01305 i__4 = jc + 2 - icol;
01306 zlarot_(&c_true, &c_false, &c_true, &i__4, &ct, &st, &
01307 a[jc - iskew * icol + ioffg + icol * a_dim1],
01308 &ilda, &dummy, &ztemp);
01309
01310
01311
01312 icol = jc;
01313 i__4 = *n - 1;
01314 i__2 = k;
01315 for (jch = jc + k; i__2 < 0 ? jch >= i__4 : jch <=
01316 i__4; jch += i__2) {
01317 zlartg_(&a[jch - iskew * icol + ioffg + icol *
01318 a_dim1], &extra, &realc, &s, &dummy);
01319 zlarnd_(&z__1, &c__5, &iseed[1]);
01320 dummy.r = z__1.r, dummy.i = z__1.i;
01321 z__1.r = realc * dummy.r, z__1.i = realc *
01322 dummy.i;
01323 c__.r = z__1.r, c__.i = z__1.i;
01324 z__1.r = s.r * dummy.r - s.i * dummy.i, z__1.i =
01325 s.r * dummy.i + s.i * dummy.r;
01326 s.r = z__1.r, s.i = z__1.i;
01327 i__3 = (1 - iskew) * jch + 1 + ioffg + jch *
01328 a_dim1;
01329 ztemp.r = a[i__3].r, ztemp.i = a[i__3].i;
01330 if (csym) {
01331 ct.r = c__.r, ct.i = c__.i;
01332 st.r = s.r, st.i = s.i;
01333 } else {
01334 d_cnjg(&z__1, &ztemp);
01335 ztemp.r = z__1.r, ztemp.i = z__1.i;
01336 d_cnjg(&z__1, &c__);
01337 ct.r = z__1.r, ct.i = z__1.i;
01338 d_cnjg(&z__1, &s);
01339 st.r = z__1.r, st.i = z__1.i;
01340 }
01341 i__3 = k + 2;
01342 zlarot_(&c_true, &c_true, &c_true, &i__3, &c__, &
01343 s, &a[jch - iskew * icol + ioffg + icol *
01344 a_dim1], &ilda, &extra, &ztemp);
01345
01346 i__3 = *n + 1 - jch, i__5 = k + 2;
01347 il = min(i__3,i__5);
01348 extra.r = 0., extra.i = 0.;
01349 L__1 = *n - jch > k;
01350 zlarot_(&c_false, &c_true, &L__1, &il, &ct, &st, &
01351 a[(1 - iskew) * jch + ioffg + jch *
01352 a_dim1], &ilda, &ztemp, &extra);
01353 icol = jch;
01354
01355 }
01356
01357 }
01358
01359 }
01360
01361
01362
01363
01364 if (ipack != ipackg && ipack != 4) {
01365 for (jc = *n; jc >= 1; --jc) {
01366 irow = ioffst - iskew * jc;
01367 if (csym) {
01368
01369 i__2 = 1, i__4 = jc - uub;
01370 i__1 = max(i__2,i__4);
01371 for (jr = jc; jr >= i__1; --jr) {
01372 i__2 = jr + irow + jc * a_dim1;
01373 i__4 = jc - iskew * jr + ioffg + jr * a_dim1;
01374 a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i;
01375
01376 }
01377 } else {
01378
01379 i__2 = 1, i__4 = jc - uub;
01380 i__1 = max(i__2,i__4);
01381 for (jr = jc; jr >= i__1; --jr) {
01382 i__2 = jr + irow + jc * a_dim1;
01383 d_cnjg(&z__1, &a[jc - iskew * jr + ioffg + jr
01384 * a_dim1]);
01385 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
01386
01387 }
01388 }
01389
01390 }
01391 if (ipack == 6) {
01392 i__1 = uub;
01393 for (jc = 1; jc <= i__1; ++jc) {
01394 i__2 = uub + 1 - jc;
01395 for (jr = 1; jr <= i__2; ++jr) {
01396 i__4 = jr + jc * a_dim1;
01397 a[i__4].r = 0., a[i__4].i = 0.;
01398
01399 }
01400
01401 }
01402 }
01403 if (ipackg == 5) {
01404 ipackg = ipack;
01405 } else {
01406 ipackg = 0;
01407 }
01408 }
01409 }
01410
01411
01412
01413 if (! csym) {
01414 i__1 = *n;
01415 for (jc = 1; jc <= i__1; ++jc) {
01416 irow = ioffst + (1 - iskew) * jc;
01417 i__2 = irow + jc * a_dim1;
01418 i__4 = irow + jc * a_dim1;
01419 d__1 = a[i__4].r;
01420 z__1.r = d__1, z__1.i = 0.;
01421 a[i__2].r = z__1.r, a[i__2].i = z__1.i;
01422
01423 }
01424 }
01425
01426 }
01427
01428 } else {
01429
01430
01431
01432
01433
01434
01435
01436
01437 if (isym == 1) {
01438
01439
01440
01441 zlagge_(&mr, &nc, &llb, &uub, &d__[1], &a[a_offset], lda, &iseed[
01442 1], &work[1], &iinfo);
01443 } else {
01444
01445
01446
01447
01448 if (csym) {
01449 zlagsy_(m, &llb, &d__[1], &a[a_offset], lda, &iseed[1], &work[
01450 1], &iinfo);
01451 } else {
01452 zlaghe_(m, &llb, &d__[1], &a[a_offset], lda, &iseed[1], &work[
01453 1], &iinfo);
01454 }
01455 }
01456
01457 if (iinfo != 0) {
01458 *info = 3;
01459 return 0;
01460 }
01461 }
01462
01463
01464
01465 if (ipack != ipackg) {
01466 if (ipack == 1) {
01467
01468
01469
01470 i__1 = *m;
01471 for (j = 1; j <= i__1; ++j) {
01472 i__2 = *m;
01473 for (i__ = j + 1; i__ <= i__2; ++i__) {
01474 i__4 = i__ + j * a_dim1;
01475 a[i__4].r = 0., a[i__4].i = 0.;
01476
01477 }
01478
01479 }
01480
01481 } else if (ipack == 2) {
01482
01483
01484
01485 i__1 = *m;
01486 for (j = 2; j <= i__1; ++j) {
01487 i__2 = j - 1;
01488 for (i__ = 1; i__ <= i__2; ++i__) {
01489 i__4 = i__ + j * a_dim1;
01490 a[i__4].r = 0., a[i__4].i = 0.;
01491
01492 }
01493
01494 }
01495
01496 } else if (ipack == 3) {
01497
01498
01499
01500 icol = 1;
01501 irow = 0;
01502 i__1 = *m;
01503 for (j = 1; j <= i__1; ++j) {
01504 i__2 = j;
01505 for (i__ = 1; i__ <= i__2; ++i__) {
01506 ++irow;
01507 if (irow > *lda) {
01508 irow = 1;
01509 ++icol;
01510 }
01511 i__4 = irow + icol * a_dim1;
01512 i__3 = i__ + j * a_dim1;
01513 a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i;
01514
01515 }
01516
01517 }
01518
01519 } else if (ipack == 4) {
01520
01521
01522
01523 icol = 1;
01524 irow = 0;
01525 i__1 = *m;
01526 for (j = 1; j <= i__1; ++j) {
01527 i__2 = *m;
01528 for (i__ = j; i__ <= i__2; ++i__) {
01529 ++irow;
01530 if (irow > *lda) {
01531 irow = 1;
01532 ++icol;
01533 }
01534 i__4 = irow + icol * a_dim1;
01535 i__3 = i__ + j * a_dim1;
01536 a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i;
01537
01538 }
01539
01540 }
01541
01542 } else if (ipack >= 5) {
01543
01544
01545
01546
01547
01548 if (ipack == 5) {
01549 uub = 0;
01550 }
01551 if (ipack == 6) {
01552 llb = 0;
01553 }
01554
01555 i__1 = uub;
01556 for (j = 1; j <= i__1; ++j) {
01557
01558 i__2 = j + llb;
01559 for (i__ = min(i__2,*m); i__ >= 1; --i__) {
01560 i__2 = i__ - j + uub + 1 + j * a_dim1;
01561 i__4 = i__ + j * a_dim1;
01562 a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i;
01563
01564 }
01565
01566 }
01567
01568 i__1 = *n;
01569 for (j = uub + 2; j <= i__1; ++j) {
01570
01571 i__4 = j + llb;
01572 i__2 = min(i__4,*m);
01573 for (i__ = j - uub; i__ <= i__2; ++i__) {
01574 i__4 = i__ - j + uub + 1 + j * a_dim1;
01575 i__3 = i__ + j * a_dim1;
01576 a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i;
01577
01578 }
01579
01580 }
01581 }
01582
01583
01584
01585
01586
01587
01588 if (ipack == 3 || ipack == 4) {
01589 i__1 = *m;
01590 for (jc = icol; jc <= i__1; ++jc) {
01591 i__2 = *lda;
01592 for (jr = irow + 1; jr <= i__2; ++jr) {
01593 i__4 = jr + jc * a_dim1;
01594 a[i__4].r = 0., a[i__4].i = 0.;
01595
01596 }
01597 irow = 0;
01598
01599 }
01600
01601 } else if (ipack >= 5) {
01602
01603
01604
01605
01606
01607
01608
01609 ir1 = uub + llb + 2;
01610 ir2 = uub + *m + 2;
01611 i__1 = *n;
01612 for (jc = 1; jc <= i__1; ++jc) {
01613 i__2 = uub + 1 - jc;
01614 for (jr = 1; jr <= i__2; ++jr) {
01615 i__4 = jr + jc * a_dim1;
01616 a[i__4].r = 0., a[i__4].i = 0.;
01617
01618 }
01619
01620
01621 i__3 = ir1, i__5 = ir2 - jc;
01622 i__2 = 1, i__4 = min(i__3,i__5);
01623 i__6 = *lda;
01624 for (jr = max(i__2,i__4); jr <= i__6; ++jr) {
01625 i__2 = jr + jc * a_dim1;
01626 a[i__2].r = 0., a[i__2].i = 0.;
01627
01628 }
01629
01630 }
01631 }
01632 }
01633
01634 return 0;
01635
01636
01637
01638 }