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 complex c_b1 = {0.f,0.f};
00019 static complex c_b2 = {1.f,0.f};
00020 static integer c__6 = 6;
00021 static integer c_n1 = -1;
00022 static integer c__1 = 1;
00023 static integer c__0 = 0;
00024 static real c_b78 = 0.f;
00025
00026 int cgelss_(integer *m, integer *n, integer *nrhs, complex *
00027 a, integer *lda, complex *b, integer *ldb, real *s, real *rcond,
00028 integer *rank, complex *work, integer *lwork, real *rwork, integer *
00029 info)
00030 {
00031
00032 integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3;
00033 real r__1;
00034
00035
00036 integer i__, bl, ie, il, mm;
00037 real eps, thr, anrm, bnrm;
00038 integer itau;
00039 complex vdum[1];
00040 extern int cgemm_(char *, char *, integer *, integer *,
00041 integer *, complex *, complex *, integer *, complex *, integer *,
00042 complex *, complex *, integer *);
00043 integer iascl, ibscl;
00044 extern int cgemv_(char *, integer *, integer *, complex *
00045 , complex *, integer *, complex *, integer *, complex *, complex *
00046 , integer *);
00047 integer chunk;
00048 real sfmin;
00049 extern int ccopy_(integer *, complex *, integer *,
00050 complex *, integer *);
00051 integer minmn, maxmn, itaup, itauq, mnthr, iwork;
00052 extern int cgebrd_(integer *, integer *, complex *,
00053 integer *, real *, real *, complex *, complex *, complex *,
00054 integer *, integer *), slabad_(real *, real *);
00055 extern doublereal clange_(char *, integer *, integer *, complex *,
00056 integer *, real *);
00057 extern int cgelqf_(integer *, integer *, complex *,
00058 integer *, complex *, complex *, integer *, integer *), clascl_(
00059 char *, integer *, integer *, real *, real *, integer *, integer *
00060 , complex *, integer *, integer *), cgeqrf_(integer *,
00061 integer *, complex *, integer *, complex *, complex *, integer *,
00062 integer *);
00063 extern doublereal slamch_(char *);
00064 extern int clacpy_(char *, integer *, integer *, complex
00065 *, integer *, complex *, integer *), claset_(char *,
00066 integer *, integer *, complex *, complex *, complex *, integer *), xerbla_(char *, integer *), cbdsqr_(char *,
00067 integer *, integer *, integer *, integer *, real *, real *,
00068 complex *, integer *, complex *, integer *, complex *, integer *,
00069 real *, integer *);
00070 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
00071 integer *, integer *);
00072 real bignum;
00073 extern int cungbr_(char *, integer *, integer *, integer
00074 *, complex *, integer *, complex *, complex *, integer *, integer
00075 *), slascl_(char *, integer *, integer *, real *, real *,
00076 integer *, integer *, real *, integer *, integer *),
00077 cunmbr_(char *, char *, char *, integer *, integer *, integer *,
00078 complex *, integer *, complex *, complex *, integer *, complex *,
00079 integer *, integer *), csrscl_(integer *,
00080 real *, complex *, integer *), slaset_(char *, integer *, integer
00081 *, real *, real *, real *, integer *), cunmlq_(char *,
00082 char *, integer *, integer *, integer *, complex *, integer *,
00083 complex *, complex *, integer *, complex *, integer *, integer *);
00084 integer ldwork;
00085 extern int cunmqr_(char *, char *, integer *, integer *,
00086 integer *, complex *, integer *, complex *, complex *, integer *,
00087 complex *, integer *, integer *);
00088 integer minwrk, maxwrk;
00089 real smlnum;
00090 integer irwork;
00091 logical lquery;
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 a_dim1 = *lda;
00209 a_offset = 1 + a_dim1;
00210 a -= a_offset;
00211 b_dim1 = *ldb;
00212 b_offset = 1 + b_dim1;
00213 b -= b_offset;
00214 --s;
00215 --work;
00216 --rwork;
00217
00218
00219 *info = 0;
00220 minmn = min(*m,*n);
00221 maxmn = max(*m,*n);
00222 lquery = *lwork == -1;
00223 if (*m < 0) {
00224 *info = -1;
00225 } else if (*n < 0) {
00226 *info = -2;
00227 } else if (*nrhs < 0) {
00228 *info = -3;
00229 } else if (*lda < max(1,*m)) {
00230 *info = -5;
00231 } else if (*ldb < max(1,maxmn)) {
00232 *info = -7;
00233 }
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 if (*info == 0) {
00244 minwrk = 1;
00245 maxwrk = 1;
00246 if (minmn > 0) {
00247 mm = *m;
00248 mnthr = ilaenv_(&c__6, "CGELSS", " ", m, n, nrhs, &c_n1);
00249 if (*m >= *n && *m >= mnthr) {
00250
00251
00252
00253
00254 mm = *n;
00255
00256 i__1 = maxwrk, i__2 = *n + *n * ilaenv_(&c__1, "CGEQRF",
00257 " ", m, n, &c_n1, &c_n1);
00258 maxwrk = max(i__1,i__2);
00259
00260 i__1 = maxwrk, i__2 = *n + *nrhs * ilaenv_(&c__1, "CUNMQR",
00261 "LC", m, nrhs, n, &c_n1);
00262 maxwrk = max(i__1,i__2);
00263 }
00264 if (*m >= *n) {
00265
00266
00267
00268
00269 i__1 = maxwrk, i__2 = (*n << 1) + (mm + *n) * ilaenv_(&c__1,
00270 "CGEBRD", " ", &mm, n, &c_n1, &c_n1);
00271 maxwrk = max(i__1,i__2);
00272
00273 i__1 = maxwrk, i__2 = (*n << 1) + *nrhs * ilaenv_(&c__1,
00274 "CUNMBR", "QLC", &mm, nrhs, n, &c_n1);
00275 maxwrk = max(i__1,i__2);
00276
00277 i__1 = maxwrk, i__2 = (*n << 1) + (*n - 1) * ilaenv_(&c__1,
00278 "CUNGBR", "P", n, n, n, &c_n1);
00279 maxwrk = max(i__1,i__2);
00280
00281 i__1 = maxwrk, i__2 = *n * *nrhs;
00282 maxwrk = max(i__1,i__2);
00283 minwrk = (*n << 1) + max(*nrhs,*m);
00284 }
00285 if (*n > *m) {
00286 minwrk = (*m << 1) + max(*nrhs,*n);
00287 if (*n >= mnthr) {
00288
00289
00290
00291
00292 maxwrk = *m + *m * ilaenv_(&c__1, "CGELQF", " ", m, n, &
00293 c_n1, &c_n1);
00294
00295 i__1 = maxwrk, i__2 = *m * 3 + *m * *m + (*m << 1) *
00296 ilaenv_(&c__1, "CGEBRD", " ", m, m, &c_n1, &c_n1);
00297 maxwrk = max(i__1,i__2);
00298
00299 i__1 = maxwrk, i__2 = *m * 3 + *m * *m + *nrhs * ilaenv_(&
00300 c__1, "CUNMBR", "QLC", m, nrhs, m, &c_n1);
00301 maxwrk = max(i__1,i__2);
00302
00303 i__1 = maxwrk, i__2 = *m * 3 + *m * *m + (*m - 1) *
00304 ilaenv_(&c__1, "CUNGBR", "P", m, m, m, &c_n1);
00305 maxwrk = max(i__1,i__2);
00306 if (*nrhs > 1) {
00307
00308 i__1 = maxwrk, i__2 = *m * *m + *m + *m * *nrhs;
00309 maxwrk = max(i__1,i__2);
00310 } else {
00311
00312 i__1 = maxwrk, i__2 = *m * *m + (*m << 1);
00313 maxwrk = max(i__1,i__2);
00314 }
00315
00316 i__1 = maxwrk, i__2 = *m + *nrhs * ilaenv_(&c__1, "CUNMLQ"
00317 , "LC", n, nrhs, m, &c_n1);
00318 maxwrk = max(i__1,i__2);
00319 } else {
00320
00321
00322
00323 maxwrk = (*m << 1) + (*n + *m) * ilaenv_(&c__1, "CGEBRD",
00324 " ", m, n, &c_n1, &c_n1);
00325
00326 i__1 = maxwrk, i__2 = (*m << 1) + *nrhs * ilaenv_(&c__1,
00327 "CUNMBR", "QLC", m, nrhs, m, &c_n1);
00328 maxwrk = max(i__1,i__2);
00329
00330 i__1 = maxwrk, i__2 = (*m << 1) + *m * ilaenv_(&c__1,
00331 "CUNGBR", "P", m, n, m, &c_n1);
00332 maxwrk = max(i__1,i__2);
00333
00334 i__1 = maxwrk, i__2 = *n * *nrhs;
00335 maxwrk = max(i__1,i__2);
00336 }
00337 }
00338 maxwrk = max(minwrk,maxwrk);
00339 }
00340 work[1].r = (real) maxwrk, work[1].i = 0.f;
00341
00342 if (*lwork < minwrk && ! lquery) {
00343 *info = -12;
00344 }
00345 }
00346
00347 if (*info != 0) {
00348 i__1 = -(*info);
00349 xerbla_("CGELSS", &i__1);
00350 return 0;
00351 } else if (lquery) {
00352 return 0;
00353 }
00354
00355
00356
00357 if (*m == 0 || *n == 0) {
00358 *rank = 0;
00359 return 0;
00360 }
00361
00362
00363
00364 eps = slamch_("P");
00365 sfmin = slamch_("S");
00366 smlnum = sfmin / eps;
00367 bignum = 1.f / smlnum;
00368 slabad_(&smlnum, &bignum);
00369
00370
00371
00372 anrm = clange_("M", m, n, &a[a_offset], lda, &rwork[1]);
00373 iascl = 0;
00374 if (anrm > 0.f && anrm < smlnum) {
00375
00376
00377
00378 clascl_("G", &c__0, &c__0, &anrm, &smlnum, m, n, &a[a_offset], lda,
00379 info);
00380 iascl = 1;
00381 } else if (anrm > bignum) {
00382
00383
00384
00385 clascl_("G", &c__0, &c__0, &anrm, &bignum, m, n, &a[a_offset], lda,
00386 info);
00387 iascl = 2;
00388 } else if (anrm == 0.f) {
00389
00390
00391
00392 i__1 = max(*m,*n);
00393 claset_("F", &i__1, nrhs, &c_b1, &c_b1, &b[b_offset], ldb);
00394 slaset_("F", &minmn, &c__1, &c_b78, &c_b78, &s[1], &minmn);
00395 *rank = 0;
00396 goto L70;
00397 }
00398
00399
00400
00401 bnrm = clange_("M", m, nrhs, &b[b_offset], ldb, &rwork[1]);
00402 ibscl = 0;
00403 if (bnrm > 0.f && bnrm < smlnum) {
00404
00405
00406
00407 clascl_("G", &c__0, &c__0, &bnrm, &smlnum, m, nrhs, &b[b_offset], ldb,
00408 info);
00409 ibscl = 1;
00410 } else if (bnrm > bignum) {
00411
00412
00413
00414 clascl_("G", &c__0, &c__0, &bnrm, &bignum, m, nrhs, &b[b_offset], ldb,
00415 info);
00416 ibscl = 2;
00417 }
00418
00419
00420
00421 if (*m >= *n) {
00422
00423
00424
00425 mm = *m;
00426 if (*m >= mnthr) {
00427
00428
00429
00430 mm = *n;
00431 itau = 1;
00432 iwork = itau + *n;
00433
00434
00435
00436
00437
00438 i__1 = *lwork - iwork + 1;
00439 cgeqrf_(m, n, &a[a_offset], lda, &work[itau], &work[iwork], &i__1,
00440 info);
00441
00442
00443
00444
00445
00446 i__1 = *lwork - iwork + 1;
00447 cunmqr_("L", "C", m, nrhs, n, &a[a_offset], lda, &work[itau], &b[
00448 b_offset], ldb, &work[iwork], &i__1, info);
00449
00450
00451
00452 if (*n > 1) {
00453 i__1 = *n - 1;
00454 i__2 = *n - 1;
00455 claset_("L", &i__1, &i__2, &c_b1, &c_b1, &a[a_dim1 + 2], lda);
00456 }
00457 }
00458
00459 ie = 1;
00460 itauq = 1;
00461 itaup = itauq + *n;
00462 iwork = itaup + *n;
00463
00464
00465
00466
00467
00468 i__1 = *lwork - iwork + 1;
00469 cgebrd_(&mm, n, &a[a_offset], lda, &s[1], &rwork[ie], &work[itauq], &
00470 work[itaup], &work[iwork], &i__1, info);
00471
00472
00473
00474
00475
00476 i__1 = *lwork - iwork + 1;
00477 cunmbr_("Q", "L", "C", &mm, nrhs, n, &a[a_offset], lda, &work[itauq],
00478 &b[b_offset], ldb, &work[iwork], &i__1, info);
00479
00480
00481
00482
00483
00484 i__1 = *lwork - iwork + 1;
00485 cungbr_("P", n, n, n, &a[a_offset], lda, &work[itaup], &work[iwork], &
00486 i__1, info);
00487 irwork = ie + *n;
00488
00489
00490
00491
00492
00493
00494
00495 cbdsqr_("U", n, n, &c__0, nrhs, &s[1], &rwork[ie], &a[a_offset], lda,
00496 vdum, &c__1, &b[b_offset], ldb, &rwork[irwork], info);
00497 if (*info != 0) {
00498 goto L70;
00499 }
00500
00501
00502
00503
00504 r__1 = *rcond * s[1];
00505 thr = dmax(r__1,sfmin);
00506 if (*rcond < 0.f) {
00507
00508 r__1 = eps * s[1];
00509 thr = dmax(r__1,sfmin);
00510 }
00511 *rank = 0;
00512 i__1 = *n;
00513 for (i__ = 1; i__ <= i__1; ++i__) {
00514 if (s[i__] > thr) {
00515 csrscl_(nrhs, &s[i__], &b[i__ + b_dim1], ldb);
00516 ++(*rank);
00517 } else {
00518 claset_("F", &c__1, nrhs, &c_b1, &c_b1, &b[i__ + b_dim1], ldb);
00519 }
00520
00521 }
00522
00523
00524
00525
00526
00527 if (*lwork >= *ldb * *nrhs && *nrhs > 1) {
00528 cgemm_("C", "N", n, nrhs, n, &c_b2, &a[a_offset], lda, &b[
00529 b_offset], ldb, &c_b1, &work[1], ldb);
00530 clacpy_("G", n, nrhs, &work[1], ldb, &b[b_offset], ldb)
00531 ;
00532 } else if (*nrhs > 1) {
00533 chunk = *lwork / *n;
00534 i__1 = *nrhs;
00535 i__2 = chunk;
00536 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
00537
00538 i__3 = *nrhs - i__ + 1;
00539 bl = min(i__3,chunk);
00540 cgemm_("C", "N", n, &bl, n, &c_b2, &a[a_offset], lda, &b[i__ *
00541 b_dim1 + 1], ldb, &c_b1, &work[1], n);
00542 clacpy_("G", n, &bl, &work[1], n, &b[i__ * b_dim1 + 1], ldb);
00543
00544 }
00545 } else {
00546 cgemv_("C", n, n, &c_b2, &a[a_offset], lda, &b[b_offset], &c__1, &
00547 c_b1, &work[1], &c__1);
00548 ccopy_(n, &work[1], &c__1, &b[b_offset], &c__1);
00549 }
00550
00551 } else {
00552
00553 i__2 = max(*m,*nrhs), i__1 = *n - (*m << 1);
00554 if (*n >= mnthr && *lwork >= *m * 3 + *m * *m + max(i__2,i__1)) {
00555
00556
00557
00558
00559
00560
00561 ldwork = *m;
00562
00563 i__2 = max(*m,*nrhs), i__1 = *n - (*m << 1);
00564 if (*lwork >= *m * 3 + *m * *lda + max(i__2,i__1)) {
00565 ldwork = *lda;
00566 }
00567 itau = 1;
00568 iwork = *m + 1;
00569
00570
00571
00572
00573
00574 i__2 = *lwork - iwork + 1;
00575 cgelqf_(m, n, &a[a_offset], lda, &work[itau], &work[iwork], &i__2,
00576 info);
00577 il = iwork;
00578
00579
00580
00581 clacpy_("L", m, m, &a[a_offset], lda, &work[il], &ldwork);
00582 i__2 = *m - 1;
00583 i__1 = *m - 1;
00584 claset_("U", &i__2, &i__1, &c_b1, &c_b1, &work[il + ldwork], &
00585 ldwork);
00586 ie = 1;
00587 itauq = il + ldwork * *m;
00588 itaup = itauq + *m;
00589 iwork = itaup + *m;
00590
00591
00592
00593
00594
00595 i__2 = *lwork - iwork + 1;
00596 cgebrd_(m, m, &work[il], &ldwork, &s[1], &rwork[ie], &work[itauq],
00597 &work[itaup], &work[iwork], &i__2, info);
00598
00599
00600
00601
00602
00603 i__2 = *lwork - iwork + 1;
00604 cunmbr_("Q", "L", "C", m, nrhs, m, &work[il], &ldwork, &work[
00605 itauq], &b[b_offset], ldb, &work[iwork], &i__2, info);
00606
00607
00608
00609
00610
00611 i__2 = *lwork - iwork + 1;
00612 cungbr_("P", m, m, m, &work[il], &ldwork, &work[itaup], &work[
00613 iwork], &i__2, info);
00614 irwork = ie + *m;
00615
00616
00617
00618
00619
00620
00621
00622 cbdsqr_("U", m, m, &c__0, nrhs, &s[1], &rwork[ie], &work[il], &
00623 ldwork, &a[a_offset], lda, &b[b_offset], ldb, &rwork[
00624 irwork], info);
00625 if (*info != 0) {
00626 goto L70;
00627 }
00628
00629
00630
00631
00632 r__1 = *rcond * s[1];
00633 thr = dmax(r__1,sfmin);
00634 if (*rcond < 0.f) {
00635
00636 r__1 = eps * s[1];
00637 thr = dmax(r__1,sfmin);
00638 }
00639 *rank = 0;
00640 i__2 = *m;
00641 for (i__ = 1; i__ <= i__2; ++i__) {
00642 if (s[i__] > thr) {
00643 csrscl_(nrhs, &s[i__], &b[i__ + b_dim1], ldb);
00644 ++(*rank);
00645 } else {
00646 claset_("F", &c__1, nrhs, &c_b1, &c_b1, &b[i__ + b_dim1],
00647 ldb);
00648 }
00649
00650 }
00651 iwork = il + *m * ldwork;
00652
00653
00654
00655
00656
00657 if (*lwork >= *ldb * *nrhs + iwork - 1 && *nrhs > 1) {
00658 cgemm_("C", "N", m, nrhs, m, &c_b2, &work[il], &ldwork, &b[
00659 b_offset], ldb, &c_b1, &work[iwork], ldb);
00660 clacpy_("G", m, nrhs, &work[iwork], ldb, &b[b_offset], ldb);
00661 } else if (*nrhs > 1) {
00662 chunk = (*lwork - iwork + 1) / *m;
00663 i__2 = *nrhs;
00664 i__1 = chunk;
00665 for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ +=
00666 i__1) {
00667
00668 i__3 = *nrhs - i__ + 1;
00669 bl = min(i__3,chunk);
00670 cgemm_("C", "N", m, &bl, m, &c_b2, &work[il], &ldwork, &b[
00671 i__ * b_dim1 + 1], ldb, &c_b1, &work[iwork], m);
00672 clacpy_("G", m, &bl, &work[iwork], m, &b[i__ * b_dim1 + 1]
00673 , ldb);
00674
00675 }
00676 } else {
00677 cgemv_("C", m, m, &c_b2, &work[il], &ldwork, &b[b_dim1 + 1], &
00678 c__1, &c_b1, &work[iwork], &c__1);
00679 ccopy_(m, &work[iwork], &c__1, &b[b_dim1 + 1], &c__1);
00680 }
00681
00682
00683
00684 i__1 = *n - *m;
00685 claset_("F", &i__1, nrhs, &c_b1, &c_b1, &b[*m + 1 + b_dim1], ldb);
00686 iwork = itau + *m;
00687
00688
00689
00690
00691
00692 i__1 = *lwork - iwork + 1;
00693 cunmlq_("L", "C", n, nrhs, m, &a[a_offset], lda, &work[itau], &b[
00694 b_offset], ldb, &work[iwork], &i__1, info);
00695
00696 } else {
00697
00698
00699
00700 ie = 1;
00701 itauq = 1;
00702 itaup = itauq + *m;
00703 iwork = itaup + *m;
00704
00705
00706
00707
00708
00709 i__1 = *lwork - iwork + 1;
00710 cgebrd_(m, n, &a[a_offset], lda, &s[1], &rwork[ie], &work[itauq],
00711 &work[itaup], &work[iwork], &i__1, info);
00712
00713
00714
00715
00716
00717 i__1 = *lwork - iwork + 1;
00718 cunmbr_("Q", "L", "C", m, nrhs, n, &a[a_offset], lda, &work[itauq]
00719 , &b[b_offset], ldb, &work[iwork], &i__1, info);
00720
00721
00722
00723
00724
00725 i__1 = *lwork - iwork + 1;
00726 cungbr_("P", m, n, m, &a[a_offset], lda, &work[itaup], &work[
00727 iwork], &i__1, info);
00728 irwork = ie + *m;
00729
00730
00731
00732
00733
00734
00735
00736 cbdsqr_("L", m, n, &c__0, nrhs, &s[1], &rwork[ie], &a[a_offset],
00737 lda, vdum, &c__1, &b[b_offset], ldb, &rwork[irwork], info);
00738 if (*info != 0) {
00739 goto L70;
00740 }
00741
00742
00743
00744
00745 r__1 = *rcond * s[1];
00746 thr = dmax(r__1,sfmin);
00747 if (*rcond < 0.f) {
00748
00749 r__1 = eps * s[1];
00750 thr = dmax(r__1,sfmin);
00751 }
00752 *rank = 0;
00753 i__1 = *m;
00754 for (i__ = 1; i__ <= i__1; ++i__) {
00755 if (s[i__] > thr) {
00756 csrscl_(nrhs, &s[i__], &b[i__ + b_dim1], ldb);
00757 ++(*rank);
00758 } else {
00759 claset_("F", &c__1, nrhs, &c_b1, &c_b1, &b[i__ + b_dim1],
00760 ldb);
00761 }
00762
00763 }
00764
00765
00766
00767
00768
00769 if (*lwork >= *ldb * *nrhs && *nrhs > 1) {
00770 cgemm_("C", "N", n, nrhs, m, &c_b2, &a[a_offset], lda, &b[
00771 b_offset], ldb, &c_b1, &work[1], ldb);
00772 clacpy_("G", n, nrhs, &work[1], ldb, &b[b_offset], ldb);
00773 } else if (*nrhs > 1) {
00774 chunk = *lwork / *n;
00775 i__1 = *nrhs;
00776 i__2 = chunk;
00777 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ +=
00778 i__2) {
00779
00780 i__3 = *nrhs - i__ + 1;
00781 bl = min(i__3,chunk);
00782 cgemm_("C", "N", n, &bl, m, &c_b2, &a[a_offset], lda, &b[
00783 i__ * b_dim1 + 1], ldb, &c_b1, &work[1], n);
00784 clacpy_("F", n, &bl, &work[1], n, &b[i__ * b_dim1 + 1],
00785 ldb);
00786
00787 }
00788 } else {
00789 cgemv_("C", m, n, &c_b2, &a[a_offset], lda, &b[b_offset], &
00790 c__1, &c_b1, &work[1], &c__1);
00791 ccopy_(n, &work[1], &c__1, &b[b_offset], &c__1);
00792 }
00793 }
00794 }
00795
00796
00797
00798 if (iascl == 1) {
00799 clascl_("G", &c__0, &c__0, &anrm, &smlnum, n, nrhs, &b[b_offset], ldb,
00800 info);
00801 slascl_("G", &c__0, &c__0, &smlnum, &anrm, &minmn, &c__1, &s[1], &
00802 minmn, info);
00803 } else if (iascl == 2) {
00804 clascl_("G", &c__0, &c__0, &anrm, &bignum, n, nrhs, &b[b_offset], ldb,
00805 info);
00806 slascl_("G", &c__0, &c__0, &bignum, &anrm, &minmn, &c__1, &s[1], &
00807 minmn, info);
00808 }
00809 if (ibscl == 1) {
00810 clascl_("G", &c__0, &c__0, &smlnum, &bnrm, n, nrhs, &b[b_offset], ldb,
00811 info);
00812 } else if (ibscl == 2) {
00813 clascl_("G", &c__0, &c__0, &bignum, &bnrm, n, nrhs, &b[b_offset], ldb,
00814 info);
00815 }
00816 L70:
00817 work[1].r = (real) maxwrk, work[1].i = 0.f;
00818 return 0;
00819
00820
00821
00822 }