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__8 = 8;
00019 static integer c__1 = 1;
00020 static real c_b27 = -1.f;
00021 static real c_b42 = 1.f;
00022 static real c_b56 = 0.f;
00023
00024 int stgsy2_(char *trans, integer *ijob, integer *m, integer *
00025 n, real *a, integer *lda, real *b, integer *ldb, real *c__, integer *
00026 ldc, real *d__, integer *ldd, real *e, integer *lde, real *f, integer
00027 *ldf, real *scale, real *rdsum, real *rdscal, integer *iwork, integer
00028 *pq, integer *info)
00029 {
00030
00031 integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, d_dim1,
00032 d_offset, e_dim1, e_offset, f_dim1, f_offset, i__1, i__2, i__3;
00033
00034
00035 integer i__, j, k, p, q;
00036 real z__[64] ;
00037 integer ie, je, mb, nb, ii, jj, is, js;
00038 real rhs[8];
00039 integer isp1, jsp1;
00040 extern int sger_(integer *, integer *, real *, real *,
00041 integer *, real *, integer *, real *, integer *);
00042 integer ierr, zdim, ipiv[8], jpiv[8];
00043 real alpha;
00044 extern logical lsame_(char *, char *);
00045 extern int sscal_(integer *, real *, real *, integer *),
00046 sgemm_(char *, char *, integer *, integer *, integer *, real *,
00047 real *, integer *, real *, integer *, real *, real *, integer *), sgemv_(char *, integer *, integer *, real *,
00048 real *, integer *, real *, integer *, real *, real *, integer *), scopy_(integer *, real *, integer *, real *, integer *),
00049 saxpy_(integer *, real *, real *, integer *, real *, integer *),
00050 sgesc2_(integer *, real *, integer *, real *, integer *, integer *
00051 , real *), sgetc2_(integer *, real *, integer *, integer *,
00052 integer *, integer *);
00053 real scaloc;
00054 extern int slatdf_(integer *, integer *, real *, integer
00055 *, real *, real *, real *, integer *, integer *), xerbla_(char *,
00056 integer *), slaset_(char *, integer *, integer *, real *,
00057 real *, real *, integer *);
00058 logical notran;
00059
00060
00061
00062
00063
00064
00065
00066
00067
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
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 a_dim1 = *lda;
00246 a_offset = 1 + a_dim1;
00247 a -= a_offset;
00248 b_dim1 = *ldb;
00249 b_offset = 1 + b_dim1;
00250 b -= b_offset;
00251 c_dim1 = *ldc;
00252 c_offset = 1 + c_dim1;
00253 c__ -= c_offset;
00254 d_dim1 = *ldd;
00255 d_offset = 1 + d_dim1;
00256 d__ -= d_offset;
00257 e_dim1 = *lde;
00258 e_offset = 1 + e_dim1;
00259 e -= e_offset;
00260 f_dim1 = *ldf;
00261 f_offset = 1 + f_dim1;
00262 f -= f_offset;
00263 --iwork;
00264
00265
00266 *info = 0;
00267 ierr = 0;
00268 notran = lsame_(trans, "N");
00269 if (! notran && ! lsame_(trans, "T")) {
00270 *info = -1;
00271 } else if (notran) {
00272 if (*ijob < 0 || *ijob > 2) {
00273 *info = -2;
00274 }
00275 }
00276 if (*info == 0) {
00277 if (*m <= 0) {
00278 *info = -3;
00279 } else if (*n <= 0) {
00280 *info = -4;
00281 } else if (*lda < max(1,*m)) {
00282 *info = -5;
00283 } else if (*ldb < max(1,*n)) {
00284 *info = -8;
00285 } else if (*ldc < max(1,*m)) {
00286 *info = -10;
00287 } else if (*ldd < max(1,*m)) {
00288 *info = -12;
00289 } else if (*lde < max(1,*n)) {
00290 *info = -14;
00291 } else if (*ldf < max(1,*m)) {
00292 *info = -16;
00293 }
00294 }
00295 if (*info != 0) {
00296 i__1 = -(*info);
00297 xerbla_("STGSY2", &i__1);
00298 return 0;
00299 }
00300
00301
00302
00303 *pq = 0;
00304 p = 0;
00305 i__ = 1;
00306 L10:
00307 if (i__ > *m) {
00308 goto L20;
00309 }
00310 ++p;
00311 iwork[p] = i__;
00312 if (i__ == *m) {
00313 goto L20;
00314 }
00315 if (a[i__ + 1 + i__ * a_dim1] != 0.f) {
00316 i__ += 2;
00317 } else {
00318 ++i__;
00319 }
00320 goto L10;
00321 L20:
00322 iwork[p + 1] = *m + 1;
00323
00324
00325
00326 q = p + 1;
00327 j = 1;
00328 L30:
00329 if (j > *n) {
00330 goto L40;
00331 }
00332 ++q;
00333 iwork[q] = j;
00334 if (j == *n) {
00335 goto L40;
00336 }
00337 if (b[j + 1 + j * b_dim1] != 0.f) {
00338 j += 2;
00339 } else {
00340 ++j;
00341 }
00342 goto L30;
00343 L40:
00344 iwork[q + 1] = *n + 1;
00345 *pq = p * (q - p - 1);
00346
00347 if (notran) {
00348
00349
00350
00351
00352
00353
00354 *scale = 1.f;
00355 scaloc = 1.f;
00356 i__1 = q;
00357 for (j = p + 2; j <= i__1; ++j) {
00358 js = iwork[j];
00359 jsp1 = js + 1;
00360 je = iwork[j + 1] - 1;
00361 nb = je - js + 1;
00362 for (i__ = p; i__ >= 1; --i__) {
00363
00364 is = iwork[i__];
00365 isp1 = is + 1;
00366 ie = iwork[i__ + 1] - 1;
00367 mb = ie - is + 1;
00368 zdim = mb * nb << 1;
00369
00370 if (mb == 1 && nb == 1) {
00371
00372
00373
00374 z__[0] = a[is + is * a_dim1];
00375 z__[1] = d__[is + is * d_dim1];
00376 z__[8] = -b[js + js * b_dim1];
00377 z__[9] = -e[js + js * e_dim1];
00378
00379
00380
00381 rhs[0] = c__[is + js * c_dim1];
00382 rhs[1] = f[is + js * f_dim1];
00383
00384
00385
00386 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00387 if (ierr > 0) {
00388 *info = ierr;
00389 }
00390
00391 if (*ijob == 0) {
00392 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00393 if (scaloc != 1.f) {
00394 i__2 = *n;
00395 for (k = 1; k <= i__2; ++k) {
00396 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &
00397 c__1);
00398 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00399
00400 }
00401 *scale *= scaloc;
00402 }
00403 } else {
00404 slatdf_(ijob, &zdim, z__, &c__8, rhs, rdsum, rdscal,
00405 ipiv, jpiv);
00406 }
00407
00408
00409
00410 c__[is + js * c_dim1] = rhs[0];
00411 f[is + js * f_dim1] = rhs[1];
00412
00413
00414
00415
00416 if (i__ > 1) {
00417 alpha = -rhs[0];
00418 i__2 = is - 1;
00419 saxpy_(&i__2, &alpha, &a[is * a_dim1 + 1], &c__1, &
00420 c__[js * c_dim1 + 1], &c__1);
00421 i__2 = is - 1;
00422 saxpy_(&i__2, &alpha, &d__[is * d_dim1 + 1], &c__1, &
00423 f[js * f_dim1 + 1], &c__1);
00424 }
00425 if (j < q) {
00426 i__2 = *n - je;
00427 saxpy_(&i__2, &rhs[1], &b[js + (je + 1) * b_dim1],
00428 ldb, &c__[is + (je + 1) * c_dim1], ldc);
00429 i__2 = *n - je;
00430 saxpy_(&i__2, &rhs[1], &e[js + (je + 1) * e_dim1],
00431 lde, &f[is + (je + 1) * f_dim1], ldf);
00432 }
00433
00434 } else if (mb == 1 && nb == 2) {
00435
00436
00437
00438 z__[0] = a[is + is * a_dim1];
00439 z__[1] = 0.f;
00440 z__[2] = d__[is + is * d_dim1];
00441 z__[3] = 0.f;
00442
00443 z__[8] = 0.f;
00444 z__[9] = a[is + is * a_dim1];
00445 z__[10] = 0.f;
00446 z__[11] = d__[is + is * d_dim1];
00447
00448 z__[16] = -b[js + js * b_dim1];
00449 z__[17] = -b[js + jsp1 * b_dim1];
00450 z__[18] = -e[js + js * e_dim1];
00451 z__[19] = -e[js + jsp1 * e_dim1];
00452
00453 z__[24] = -b[jsp1 + js * b_dim1];
00454 z__[25] = -b[jsp1 + jsp1 * b_dim1];
00455 z__[26] = 0.f;
00456 z__[27] = -e[jsp1 + jsp1 * e_dim1];
00457
00458
00459
00460 rhs[0] = c__[is + js * c_dim1];
00461 rhs[1] = c__[is + jsp1 * c_dim1];
00462 rhs[2] = f[is + js * f_dim1];
00463 rhs[3] = f[is + jsp1 * f_dim1];
00464
00465
00466
00467 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00468 if (ierr > 0) {
00469 *info = ierr;
00470 }
00471
00472 if (*ijob == 0) {
00473 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00474 if (scaloc != 1.f) {
00475 i__2 = *n;
00476 for (k = 1; k <= i__2; ++k) {
00477 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &
00478 c__1);
00479 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00480
00481 }
00482 *scale *= scaloc;
00483 }
00484 } else {
00485 slatdf_(ijob, &zdim, z__, &c__8, rhs, rdsum, rdscal,
00486 ipiv, jpiv);
00487 }
00488
00489
00490
00491 c__[is + js * c_dim1] = rhs[0];
00492 c__[is + jsp1 * c_dim1] = rhs[1];
00493 f[is + js * f_dim1] = rhs[2];
00494 f[is + jsp1 * f_dim1] = rhs[3];
00495
00496
00497
00498
00499 if (i__ > 1) {
00500 i__2 = is - 1;
00501 sger_(&i__2, &nb, &c_b27, &a[is * a_dim1 + 1], &c__1,
00502 rhs, &c__1, &c__[js * c_dim1 + 1], ldc);
00503 i__2 = is - 1;
00504 sger_(&i__2, &nb, &c_b27, &d__[is * d_dim1 + 1], &
00505 c__1, rhs, &c__1, &f[js * f_dim1 + 1], ldf);
00506 }
00507 if (j < q) {
00508 i__2 = *n - je;
00509 saxpy_(&i__2, &rhs[2], &b[js + (je + 1) * b_dim1],
00510 ldb, &c__[is + (je + 1) * c_dim1], ldc);
00511 i__2 = *n - je;
00512 saxpy_(&i__2, &rhs[2], &e[js + (je + 1) * e_dim1],
00513 lde, &f[is + (je + 1) * f_dim1], ldf);
00514 i__2 = *n - je;
00515 saxpy_(&i__2, &rhs[3], &b[jsp1 + (je + 1) * b_dim1],
00516 ldb, &c__[is + (je + 1) * c_dim1], ldc);
00517 i__2 = *n - je;
00518 saxpy_(&i__2, &rhs[3], &e[jsp1 + (je + 1) * e_dim1],
00519 lde, &f[is + (je + 1) * f_dim1], ldf);
00520 }
00521
00522 } else if (mb == 2 && nb == 1) {
00523
00524
00525
00526 z__[0] = a[is + is * a_dim1];
00527 z__[1] = a[isp1 + is * a_dim1];
00528 z__[2] = d__[is + is * d_dim1];
00529 z__[3] = 0.f;
00530
00531 z__[8] = a[is + isp1 * a_dim1];
00532 z__[9] = a[isp1 + isp1 * a_dim1];
00533 z__[10] = d__[is + isp1 * d_dim1];
00534 z__[11] = d__[isp1 + isp1 * d_dim1];
00535
00536 z__[16] = -b[js + js * b_dim1];
00537 z__[17] = 0.f;
00538 z__[18] = -e[js + js * e_dim1];
00539 z__[19] = 0.f;
00540
00541 z__[24] = 0.f;
00542 z__[25] = -b[js + js * b_dim1];
00543 z__[26] = 0.f;
00544 z__[27] = -e[js + js * e_dim1];
00545
00546
00547
00548 rhs[0] = c__[is + js * c_dim1];
00549 rhs[1] = c__[isp1 + js * c_dim1];
00550 rhs[2] = f[is + js * f_dim1];
00551 rhs[3] = f[isp1 + js * f_dim1];
00552
00553
00554
00555 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00556 if (ierr > 0) {
00557 *info = ierr;
00558 }
00559 if (*ijob == 0) {
00560 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00561 if (scaloc != 1.f) {
00562 i__2 = *n;
00563 for (k = 1; k <= i__2; ++k) {
00564 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &
00565 c__1);
00566 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00567
00568 }
00569 *scale *= scaloc;
00570 }
00571 } else {
00572 slatdf_(ijob, &zdim, z__, &c__8, rhs, rdsum, rdscal,
00573 ipiv, jpiv);
00574 }
00575
00576
00577
00578 c__[is + js * c_dim1] = rhs[0];
00579 c__[isp1 + js * c_dim1] = rhs[1];
00580 f[is + js * f_dim1] = rhs[2];
00581 f[isp1 + js * f_dim1] = rhs[3];
00582
00583
00584
00585
00586 if (i__ > 1) {
00587 i__2 = is - 1;
00588 sgemv_("N", &i__2, &mb, &c_b27, &a[is * a_dim1 + 1],
00589 lda, rhs, &c__1, &c_b42, &c__[js * c_dim1 + 1]
00590 , &c__1);
00591 i__2 = is - 1;
00592 sgemv_("N", &i__2, &mb, &c_b27, &d__[is * d_dim1 + 1],
00593 ldd, rhs, &c__1, &c_b42, &f[js * f_dim1 + 1],
00594 &c__1);
00595 }
00596 if (j < q) {
00597 i__2 = *n - je;
00598 sger_(&mb, &i__2, &c_b42, &rhs[2], &c__1, &b[js + (je
00599 + 1) * b_dim1], ldb, &c__[is + (je + 1) *
00600 c_dim1], ldc);
00601 i__2 = *n - je;
00602 sger_(&mb, &i__2, &c_b42, &rhs[2], &c__1, &e[js + (je
00603 + 1) * e_dim1], lde, &f[is + (je + 1) *
00604 f_dim1], ldf);
00605 }
00606
00607 } else if (mb == 2 && nb == 2) {
00608
00609
00610
00611 slaset_("F", &c__8, &c__8, &c_b56, &c_b56, z__, &c__8);
00612
00613 z__[0] = a[is + is * a_dim1];
00614 z__[1] = a[isp1 + is * a_dim1];
00615 z__[4] = d__[is + is * d_dim1];
00616
00617 z__[8] = a[is + isp1 * a_dim1];
00618 z__[9] = a[isp1 + isp1 * a_dim1];
00619 z__[12] = d__[is + isp1 * d_dim1];
00620 z__[13] = d__[isp1 + isp1 * d_dim1];
00621
00622 z__[18] = a[is + is * a_dim1];
00623 z__[19] = a[isp1 + is * a_dim1];
00624 z__[22] = d__[is + is * d_dim1];
00625
00626 z__[26] = a[is + isp1 * a_dim1];
00627 z__[27] = a[isp1 + isp1 * a_dim1];
00628 z__[30] = d__[is + isp1 * d_dim1];
00629 z__[31] = d__[isp1 + isp1 * d_dim1];
00630
00631 z__[32] = -b[js + js * b_dim1];
00632 z__[34] = -b[js + jsp1 * b_dim1];
00633 z__[36] = -e[js + js * e_dim1];
00634 z__[38] = -e[js + jsp1 * e_dim1];
00635
00636 z__[41] = -b[js + js * b_dim1];
00637 z__[43] = -b[js + jsp1 * b_dim1];
00638 z__[45] = -e[js + js * e_dim1];
00639 z__[47] = -e[js + jsp1 * e_dim1];
00640
00641 z__[48] = -b[jsp1 + js * b_dim1];
00642 z__[50] = -b[jsp1 + jsp1 * b_dim1];
00643 z__[54] = -e[jsp1 + jsp1 * e_dim1];
00644
00645 z__[57] = -b[jsp1 + js * b_dim1];
00646 z__[59] = -b[jsp1 + jsp1 * b_dim1];
00647 z__[63] = -e[jsp1 + jsp1 * e_dim1];
00648
00649
00650
00651 k = 1;
00652 ii = mb * nb + 1;
00653 i__2 = nb - 1;
00654 for (jj = 0; jj <= i__2; ++jj) {
00655 scopy_(&mb, &c__[is + (js + jj) * c_dim1], &c__1, &
00656 rhs[k - 1], &c__1);
00657 scopy_(&mb, &f[is + (js + jj) * f_dim1], &c__1, &rhs[
00658 ii - 1], &c__1);
00659 k += mb;
00660 ii += mb;
00661
00662 }
00663
00664
00665
00666 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00667 if (ierr > 0) {
00668 *info = ierr;
00669 }
00670 if (*ijob == 0) {
00671 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00672 if (scaloc != 1.f) {
00673 i__2 = *n;
00674 for (k = 1; k <= i__2; ++k) {
00675 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &
00676 c__1);
00677 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00678
00679 }
00680 *scale *= scaloc;
00681 }
00682 } else {
00683 slatdf_(ijob, &zdim, z__, &c__8, rhs, rdsum, rdscal,
00684 ipiv, jpiv);
00685 }
00686
00687
00688
00689 k = 1;
00690 ii = mb * nb + 1;
00691 i__2 = nb - 1;
00692 for (jj = 0; jj <= i__2; ++jj) {
00693 scopy_(&mb, &rhs[k - 1], &c__1, &c__[is + (js + jj) *
00694 c_dim1], &c__1);
00695 scopy_(&mb, &rhs[ii - 1], &c__1, &f[is + (js + jj) *
00696 f_dim1], &c__1);
00697 k += mb;
00698 ii += mb;
00699
00700 }
00701
00702
00703
00704
00705 if (i__ > 1) {
00706 i__2 = is - 1;
00707 sgemm_("N", "N", &i__2, &nb, &mb, &c_b27, &a[is *
00708 a_dim1 + 1], lda, rhs, &mb, &c_b42, &c__[js *
00709 c_dim1 + 1], ldc);
00710 i__2 = is - 1;
00711 sgemm_("N", "N", &i__2, &nb, &mb, &c_b27, &d__[is *
00712 d_dim1 + 1], ldd, rhs, &mb, &c_b42, &f[js *
00713 f_dim1 + 1], ldf);
00714 }
00715 if (j < q) {
00716 k = mb * nb + 1;
00717 i__2 = *n - je;
00718 sgemm_("N", "N", &mb, &i__2, &nb, &c_b42, &rhs[k - 1],
00719 &mb, &b[js + (je + 1) * b_dim1], ldb, &c_b42,
00720 &c__[is + (je + 1) * c_dim1], ldc);
00721 i__2 = *n - je;
00722 sgemm_("N", "N", &mb, &i__2, &nb, &c_b42, &rhs[k - 1],
00723 &mb, &e[js + (je + 1) * e_dim1], lde, &c_b42,
00724 &f[is + (je + 1) * f_dim1], ldf);
00725 }
00726
00727 }
00728
00729
00730 }
00731
00732 }
00733 } else {
00734
00735
00736
00737
00738
00739
00740 *scale = 1.f;
00741 scaloc = 1.f;
00742 i__1 = p;
00743 for (i__ = 1; i__ <= i__1; ++i__) {
00744
00745 is = iwork[i__];
00746 isp1 = is + 1;
00747 ie = iwork[i__ + 1] - 1;
00748 mb = ie - is + 1;
00749 i__2 = p + 2;
00750 for (j = q; j >= i__2; --j) {
00751
00752 js = iwork[j];
00753 jsp1 = js + 1;
00754 je = iwork[j + 1] - 1;
00755 nb = je - js + 1;
00756 zdim = mb * nb << 1;
00757 if (mb == 1 && nb == 1) {
00758
00759
00760
00761 z__[0] = a[is + is * a_dim1];
00762 z__[1] = -b[js + js * b_dim1];
00763 z__[8] = d__[is + is * d_dim1];
00764 z__[9] = -e[js + js * e_dim1];
00765
00766
00767
00768 rhs[0] = c__[is + js * c_dim1];
00769 rhs[1] = f[is + js * f_dim1];
00770
00771
00772
00773 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00774 if (ierr > 0) {
00775 *info = ierr;
00776 }
00777
00778 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00779 if (scaloc != 1.f) {
00780 i__3 = *n;
00781 for (k = 1; k <= i__3; ++k) {
00782 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &c__1);
00783 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00784
00785 }
00786 *scale *= scaloc;
00787 }
00788
00789
00790
00791 c__[is + js * c_dim1] = rhs[0];
00792 f[is + js * f_dim1] = rhs[1];
00793
00794
00795
00796
00797 if (j > p + 2) {
00798 alpha = rhs[0];
00799 i__3 = js - 1;
00800 saxpy_(&i__3, &alpha, &b[js * b_dim1 + 1], &c__1, &f[
00801 is + f_dim1], ldf);
00802 alpha = rhs[1];
00803 i__3 = js - 1;
00804 saxpy_(&i__3, &alpha, &e[js * e_dim1 + 1], &c__1, &f[
00805 is + f_dim1], ldf);
00806 }
00807 if (i__ < p) {
00808 alpha = -rhs[0];
00809 i__3 = *m - ie;
00810 saxpy_(&i__3, &alpha, &a[is + (ie + 1) * a_dim1], lda,
00811 &c__[ie + 1 + js * c_dim1], &c__1);
00812 alpha = -rhs[1];
00813 i__3 = *m - ie;
00814 saxpy_(&i__3, &alpha, &d__[is + (ie + 1) * d_dim1],
00815 ldd, &c__[ie + 1 + js * c_dim1], &c__1);
00816 }
00817
00818 } else if (mb == 1 && nb == 2) {
00819
00820
00821
00822 z__[0] = a[is + is * a_dim1];
00823 z__[1] = 0.f;
00824 z__[2] = -b[js + js * b_dim1];
00825 z__[3] = -b[jsp1 + js * b_dim1];
00826
00827 z__[8] = 0.f;
00828 z__[9] = a[is + is * a_dim1];
00829 z__[10] = -b[js + jsp1 * b_dim1];
00830 z__[11] = -b[jsp1 + jsp1 * b_dim1];
00831
00832 z__[16] = d__[is + is * d_dim1];
00833 z__[17] = 0.f;
00834 z__[18] = -e[js + js * e_dim1];
00835 z__[19] = 0.f;
00836
00837 z__[24] = 0.f;
00838 z__[25] = d__[is + is * d_dim1];
00839 z__[26] = -e[js + jsp1 * e_dim1];
00840 z__[27] = -e[jsp1 + jsp1 * e_dim1];
00841
00842
00843
00844 rhs[0] = c__[is + js * c_dim1];
00845 rhs[1] = c__[is + jsp1 * c_dim1];
00846 rhs[2] = f[is + js * f_dim1];
00847 rhs[3] = f[is + jsp1 * f_dim1];
00848
00849
00850
00851 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00852 if (ierr > 0) {
00853 *info = ierr;
00854 }
00855 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00856 if (scaloc != 1.f) {
00857 i__3 = *n;
00858 for (k = 1; k <= i__3; ++k) {
00859 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &c__1);
00860 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00861
00862 }
00863 *scale *= scaloc;
00864 }
00865
00866
00867
00868 c__[is + js * c_dim1] = rhs[0];
00869 c__[is + jsp1 * c_dim1] = rhs[1];
00870 f[is + js * f_dim1] = rhs[2];
00871 f[is + jsp1 * f_dim1] = rhs[3];
00872
00873
00874
00875
00876 if (j > p + 2) {
00877 i__3 = js - 1;
00878 saxpy_(&i__3, rhs, &b[js * b_dim1 + 1], &c__1, &f[is
00879 + f_dim1], ldf);
00880 i__3 = js - 1;
00881 saxpy_(&i__3, &rhs[1], &b[jsp1 * b_dim1 + 1], &c__1, &
00882 f[is + f_dim1], ldf);
00883 i__3 = js - 1;
00884 saxpy_(&i__3, &rhs[2], &e[js * e_dim1 + 1], &c__1, &f[
00885 is + f_dim1], ldf);
00886 i__3 = js - 1;
00887 saxpy_(&i__3, &rhs[3], &e[jsp1 * e_dim1 + 1], &c__1, &
00888 f[is + f_dim1], ldf);
00889 }
00890 if (i__ < p) {
00891 i__3 = *m - ie;
00892 sger_(&i__3, &nb, &c_b27, &a[is + (ie + 1) * a_dim1],
00893 lda, rhs, &c__1, &c__[ie + 1 + js * c_dim1],
00894 ldc);
00895 i__3 = *m - ie;
00896 sger_(&i__3, &nb, &c_b27, &d__[is + (ie + 1) * d_dim1]
00897 , ldd, &rhs[2], &c__1, &c__[ie + 1 + js *
00898 c_dim1], ldc);
00899 }
00900
00901 } else if (mb == 2 && nb == 1) {
00902
00903
00904
00905 z__[0] = a[is + is * a_dim1];
00906 z__[1] = a[is + isp1 * a_dim1];
00907 z__[2] = -b[js + js * b_dim1];
00908 z__[3] = 0.f;
00909
00910 z__[8] = a[isp1 + is * a_dim1];
00911 z__[9] = a[isp1 + isp1 * a_dim1];
00912 z__[10] = 0.f;
00913 z__[11] = -b[js + js * b_dim1];
00914
00915 z__[16] = d__[is + is * d_dim1];
00916 z__[17] = d__[is + isp1 * d_dim1];
00917 z__[18] = -e[js + js * e_dim1];
00918 z__[19] = 0.f;
00919
00920 z__[24] = 0.f;
00921 z__[25] = d__[isp1 + isp1 * d_dim1];
00922 z__[26] = 0.f;
00923 z__[27] = -e[js + js * e_dim1];
00924
00925
00926
00927 rhs[0] = c__[is + js * c_dim1];
00928 rhs[1] = c__[isp1 + js * c_dim1];
00929 rhs[2] = f[is + js * f_dim1];
00930 rhs[3] = f[isp1 + js * f_dim1];
00931
00932
00933
00934 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
00935 if (ierr > 0) {
00936 *info = ierr;
00937 }
00938
00939 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
00940 if (scaloc != 1.f) {
00941 i__3 = *n;
00942 for (k = 1; k <= i__3; ++k) {
00943 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &c__1);
00944 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
00945
00946 }
00947 *scale *= scaloc;
00948 }
00949
00950
00951
00952 c__[is + js * c_dim1] = rhs[0];
00953 c__[isp1 + js * c_dim1] = rhs[1];
00954 f[is + js * f_dim1] = rhs[2];
00955 f[isp1 + js * f_dim1] = rhs[3];
00956
00957
00958
00959
00960 if (j > p + 2) {
00961 i__3 = js - 1;
00962 sger_(&mb, &i__3, &c_b42, rhs, &c__1, &b[js * b_dim1
00963 + 1], &c__1, &f[is + f_dim1], ldf);
00964 i__3 = js - 1;
00965 sger_(&mb, &i__3, &c_b42, &rhs[2], &c__1, &e[js *
00966 e_dim1 + 1], &c__1, &f[is + f_dim1], ldf);
00967 }
00968 if (i__ < p) {
00969 i__3 = *m - ie;
00970 sgemv_("T", &mb, &i__3, &c_b27, &a[is + (ie + 1) *
00971 a_dim1], lda, rhs, &c__1, &c_b42, &c__[ie + 1
00972 + js * c_dim1], &c__1);
00973 i__3 = *m - ie;
00974 sgemv_("T", &mb, &i__3, &c_b27, &d__[is + (ie + 1) *
00975 d_dim1], ldd, &rhs[2], &c__1, &c_b42, &c__[ie
00976 + 1 + js * c_dim1], &c__1);
00977 }
00978
00979 } else if (mb == 2 && nb == 2) {
00980
00981
00982
00983 slaset_("F", &c__8, &c__8, &c_b56, &c_b56, z__, &c__8);
00984
00985 z__[0] = a[is + is * a_dim1];
00986 z__[1] = a[is + isp1 * a_dim1];
00987 z__[4] = -b[js + js * b_dim1];
00988 z__[6] = -b[jsp1 + js * b_dim1];
00989
00990 z__[8] = a[isp1 + is * a_dim1];
00991 z__[9] = a[isp1 + isp1 * a_dim1];
00992 z__[13] = -b[js + js * b_dim1];
00993 z__[15] = -b[jsp1 + js * b_dim1];
00994
00995 z__[18] = a[is + is * a_dim1];
00996 z__[19] = a[is + isp1 * a_dim1];
00997 z__[20] = -b[js + jsp1 * b_dim1];
00998 z__[22] = -b[jsp1 + jsp1 * b_dim1];
00999
01000 z__[26] = a[isp1 + is * a_dim1];
01001 z__[27] = a[isp1 + isp1 * a_dim1];
01002 z__[29] = -b[js + jsp1 * b_dim1];
01003 z__[31] = -b[jsp1 + jsp1 * b_dim1];
01004
01005 z__[32] = d__[is + is * d_dim1];
01006 z__[33] = d__[is + isp1 * d_dim1];
01007 z__[36] = -e[js + js * e_dim1];
01008
01009 z__[41] = d__[isp1 + isp1 * d_dim1];
01010 z__[45] = -e[js + js * e_dim1];
01011
01012 z__[50] = d__[is + is * d_dim1];
01013 z__[51] = d__[is + isp1 * d_dim1];
01014 z__[52] = -e[js + jsp1 * e_dim1];
01015 z__[54] = -e[jsp1 + jsp1 * e_dim1];
01016
01017 z__[59] = d__[isp1 + isp1 * d_dim1];
01018 z__[61] = -e[js + jsp1 * e_dim1];
01019 z__[63] = -e[jsp1 + jsp1 * e_dim1];
01020
01021
01022
01023 k = 1;
01024 ii = mb * nb + 1;
01025 i__3 = nb - 1;
01026 for (jj = 0; jj <= i__3; ++jj) {
01027 scopy_(&mb, &c__[is + (js + jj) * c_dim1], &c__1, &
01028 rhs[k - 1], &c__1);
01029 scopy_(&mb, &f[is + (js + jj) * f_dim1], &c__1, &rhs[
01030 ii - 1], &c__1);
01031 k += mb;
01032 ii += mb;
01033
01034 }
01035
01036
01037
01038
01039 sgetc2_(&zdim, z__, &c__8, ipiv, jpiv, &ierr);
01040 if (ierr > 0) {
01041 *info = ierr;
01042 }
01043
01044 sgesc2_(&zdim, z__, &c__8, rhs, ipiv, jpiv, &scaloc);
01045 if (scaloc != 1.f) {
01046 i__3 = *n;
01047 for (k = 1; k <= i__3; ++k) {
01048 sscal_(m, &scaloc, &c__[k * c_dim1 + 1], &c__1);
01049 sscal_(m, &scaloc, &f[k * f_dim1 + 1], &c__1);
01050
01051 }
01052 *scale *= scaloc;
01053 }
01054
01055
01056
01057 k = 1;
01058 ii = mb * nb + 1;
01059 i__3 = nb - 1;
01060 for (jj = 0; jj <= i__3; ++jj) {
01061 scopy_(&mb, &rhs[k - 1], &c__1, &c__[is + (js + jj) *
01062 c_dim1], &c__1);
01063 scopy_(&mb, &rhs[ii - 1], &c__1, &f[is + (js + jj) *
01064 f_dim1], &c__1);
01065 k += mb;
01066 ii += mb;
01067
01068 }
01069
01070
01071
01072
01073 if (j > p + 2) {
01074 i__3 = js - 1;
01075 sgemm_("N", "T", &mb, &i__3, &nb, &c_b42, &c__[is +
01076 js * c_dim1], ldc, &b[js * b_dim1 + 1], ldb, &
01077 c_b42, &f[is + f_dim1], ldf);
01078 i__3 = js - 1;
01079 sgemm_("N", "T", &mb, &i__3, &nb, &c_b42, &f[is + js *
01080 f_dim1], ldf, &e[js * e_dim1 + 1], lde, &
01081 c_b42, &f[is + f_dim1], ldf);
01082 }
01083 if (i__ < p) {
01084 i__3 = *m - ie;
01085 sgemm_("T", "N", &i__3, &nb, &mb, &c_b27, &a[is + (ie
01086 + 1) * a_dim1], lda, &c__[is + js * c_dim1],
01087 ldc, &c_b42, &c__[ie + 1 + js * c_dim1], ldc);
01088 i__3 = *m - ie;
01089 sgemm_("T", "N", &i__3, &nb, &mb, &c_b27, &d__[is + (
01090 ie + 1) * d_dim1], ldd, &f[is + js * f_dim1],
01091 ldf, &c_b42, &c__[ie + 1 + js * c_dim1], ldc);
01092 }
01093
01094 }
01095
01096
01097 }
01098
01099 }
01100
01101 }
01102 return 0;
01103
01104
01105
01106 }