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__2 = 2;
00019 static integer c__1 = 1;
00020 static real c_b36 = 2.f;
00021 static real c_b47 = 1.f;
00022 static integer c_n1 = -1;
00023
00024 int slattb_(integer *imat, char *uplo, char *trans, char *
00025 diag, integer *iseed, integer *n, integer *kd, real *ab, integer *
00026 ldab, real *b, real *work, integer *info)
00027 {
00028
00029 integer ab_dim1, ab_offset, i__1, i__2, i__3, i__4, i__5;
00030 real r__1, r__2;
00031 doublereal d__1, d__2;
00032
00033
00034 int s_copy(char *, char *, ftnlen, ftnlen);
00035 double sqrt(doublereal), r_sign(real *, real *), pow_dd(doublereal *,
00036 doublereal *);
00037
00038
00039 integer i__, j, kl, ku, iy;
00040 real ulp, sfac;
00041 integer ioff, mode, lenj;
00042 char path[3], dist[1];
00043 real unfl, rexp;
00044 char type__[1];
00045 real texp, star1, plus1, plus2, bscal;
00046 extern logical lsame_(char *, char *);
00047 extern int sscal_(integer *, real *, real *, integer *);
00048 real tscal, anorm, bnorm, tleft;
00049 logical upper;
00050 extern int scopy_(integer *, real *, integer *, real *,
00051 integer *), sswap_(integer *, real *, integer *, real *, integer *
00052 );
00053 real tnorm;
00054 extern int slatb4_(char *, integer *, integer *, integer
00055 *, char *, integer *, integer *, real *, integer *, real *, char *
00056 ), slabad_(real *, real *);
00057 extern doublereal slamch_(char *);
00058 char packit[1];
00059 real bignum;
00060 extern integer isamax_(integer *, real *, integer *);
00061 extern doublereal slarnd_(integer *, integer *);
00062 real cndnum;
00063 integer jcount;
00064 extern int slatms_(integer *, integer *, char *, integer
00065 *, char *, real *, integer *, real *, real *, integer *, integer *
00066 , char *, real *, integer *, real *, integer *), slarnv_(integer *, integer *, integer *, real *);
00067 real 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 --iseed;
00154 ab_dim1 = *ldab;
00155 ab_offset = 1 + ab_dim1;
00156 ab -= ab_offset;
00157 --b;
00158 --work;
00159
00160
00161 s_copy(path, "Single precision", (ftnlen)1, (ftnlen)16);
00162 s_copy(path + 1, "TB", (ftnlen)2, (ftnlen)2);
00163 unfl = slamch_("Safe minimum");
00164 ulp = slamch_("Epsilon") * slamch_("Base");
00165 smlnum = unfl;
00166 bignum = (1.f - ulp) / smlnum;
00167 slabad_(&smlnum, &bignum);
00168 if (*imat >= 6 && *imat <= 9 || *imat == 17) {
00169 *(unsigned char *)diag = 'U';
00170 } else {
00171 *(unsigned char *)diag = 'N';
00172 }
00173 *info = 0;
00174
00175
00176
00177 if (*n <= 0) {
00178 return 0;
00179 }
00180
00181
00182
00183 upper = lsame_(uplo, "U");
00184 if (upper) {
00185 slatb4_(path, imat, n, n, type__, &kl, &ku, &anorm, &mode, &cndnum,
00186 dist);
00187 ku = *kd;
00188
00189 i__1 = 0, i__2 = *kd - *n + 1;
00190 ioff = max(i__1,i__2) + 1;
00191 kl = 0;
00192 *(unsigned char *)packit = 'Q';
00193 } else {
00194 i__1 = -(*imat);
00195 slatb4_(path, &i__1, n, n, type__, &kl, &ku, &anorm, &mode, &cndnum,
00196 dist);
00197 kl = *kd;
00198 ioff = 1;
00199 ku = 0;
00200 *(unsigned char *)packit = 'B';
00201 }
00202
00203
00204
00205 if (*imat <= 5) {
00206 slatms_(n, n, dist, &iseed[1], type__, &b[1], &mode, &cndnum, &anorm,
00207 &kl, &ku, packit, &ab[ioff + ab_dim1], ldab, &work[1], info);
00208
00209
00210
00211
00212
00213
00214 } else if (*imat == 6) {
00215 if (upper) {
00216 i__1 = *n;
00217 for (j = 1; j <= i__1; ++j) {
00218
00219 i__2 = 1, i__3 = *kd + 2 - j;
00220 i__4 = *kd;
00221 for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) {
00222 ab[i__ + j * ab_dim1] = 0.f;
00223
00224 }
00225 ab[*kd + 1 + j * ab_dim1] = (real) j;
00226
00227 }
00228 } else {
00229 i__1 = *n;
00230 for (j = 1; j <= i__1; ++j) {
00231 ab[j * ab_dim1 + 1] = (real) j;
00232
00233 i__2 = *kd + 1, i__3 = *n - j + 1;
00234 i__4 = min(i__2,i__3);
00235 for (i__ = 2; i__ <= i__4; ++i__) {
00236 ab[i__ + j * ab_dim1] = 0.f;
00237
00238 }
00239
00240 }
00241 }
00242
00243
00244
00245
00246
00247
00248 } else if (*imat <= 9) {
00249 tnorm = sqrt(cndnum);
00250
00251
00252
00253 if (upper) {
00254 i__1 = *n;
00255 for (j = 1; j <= i__1; ++j) {
00256
00257 i__4 = 1, i__2 = *kd + 2 - j;
00258 i__3 = *kd;
00259 for (i__ = max(i__4,i__2); i__ <= i__3; ++i__) {
00260 ab[i__ + j * ab_dim1] = 0.f;
00261
00262 }
00263 ab[*kd + 1 + j * ab_dim1] = (real) j;
00264
00265 }
00266 } else {
00267 i__1 = *n;
00268 for (j = 1; j <= i__1; ++j) {
00269
00270 i__4 = *kd + 1, i__2 = *n - j + 1;
00271 i__3 = min(i__4,i__2);
00272 for (i__ = 2; i__ <= i__3; ++i__) {
00273 ab[i__ + j * ab_dim1] = 0.f;
00274
00275 }
00276 ab[j * ab_dim1 + 1] = (real) j;
00277
00278 }
00279 }
00280
00281
00282
00283
00284 if (*kd == 1) {
00285 if (upper) {
00286 r__1 = slarnd_(&c__2, &iseed[1]);
00287 ab[(ab_dim1 << 1) + 1] = r_sign(&tnorm, &r__1);
00288 lenj = (*n - 3) / 2;
00289 slarnv_(&c__2, &iseed[1], &lenj, &work[1]);
00290 i__1 = lenj;
00291 for (j = 1; j <= i__1; ++j) {
00292 ab[(j + 1 << 1) * ab_dim1 + 1] = tnorm * work[j];
00293
00294 }
00295 } else {
00296 r__1 = slarnd_(&c__2, &iseed[1]);
00297 ab[ab_dim1 + 2] = r_sign(&tnorm, &r__1);
00298 lenj = (*n - 3) / 2;
00299 slarnv_(&c__2, &iseed[1], &lenj, &work[1]);
00300 i__1 = lenj;
00301 for (j = 1; j <= i__1; ++j) {
00302 ab[((j << 1) + 1) * ab_dim1 + 2] = tnorm * work[j];
00303
00304 }
00305 }
00306 } else if (*kd > 1) {
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324 r__1 = slarnd_(&c__2, &iseed[1]);
00325 star1 = r_sign(&tnorm, &r__1);
00326 sfac = sqrt(tnorm);
00327 r__1 = slarnd_(&c__2, &iseed[1]);
00328 plus1 = r_sign(&sfac, &r__1);
00329 i__1 = *n;
00330 for (j = 1; j <= i__1; j += 2) {
00331 plus2 = star1 / plus1;
00332 work[j] = plus1;
00333 work[*n + j] = star1;
00334 if (j + 1 <= *n) {
00335 work[j + 1] = plus2;
00336 work[*n + j + 1] = 0.f;
00337 plus1 = star1 / plus2;
00338
00339
00340
00341
00342 rexp = slarnd_(&c__2, &iseed[1]);
00343 if (rexp < 0.f) {
00344 d__1 = (doublereal) sfac;
00345 d__2 = (doublereal) (1.f - rexp);
00346 star1 = -pow_dd(&d__1, &d__2);
00347 } else {
00348 d__1 = (doublereal) sfac;
00349 d__2 = (doublereal) (rexp + 1.f);
00350 star1 = pow_dd(&d__1, &d__2);
00351 }
00352 }
00353
00354 }
00355
00356
00357
00358 if (upper) {
00359 i__1 = *n - 1;
00360 scopy_(&i__1, &work[1], &c__1, &ab[*kd + (ab_dim1 << 1)],
00361 ldab);
00362 i__1 = *n - 2;
00363 scopy_(&i__1, &work[*n + 1], &c__1, &ab[*kd - 1 + ab_dim1 * 3]
00364 , ldab);
00365 } else {
00366 i__1 = *n - 1;
00367 scopy_(&i__1, &work[1], &c__1, &ab[ab_dim1 + 2], ldab);
00368 i__1 = *n - 2;
00369 scopy_(&i__1, &work[*n + 1], &c__1, &ab[ab_dim1 + 3], ldab);
00370 }
00371 }
00372
00373
00374
00375
00376
00377 } else if (*imat == 10) {
00378
00379
00380
00381
00382
00383 if (upper) {
00384 i__1 = *n;
00385 for (j = 1; j <= i__1; ++j) {
00386
00387 i__3 = j, i__4 = *kd + 1;
00388 lenj = min(i__3,i__4);
00389 slarnv_(&c__2, &iseed[1], &lenj, &ab[*kd + 2 - lenj + j *
00390 ab_dim1]);
00391 ab[*kd + 1 + j * ab_dim1] = r_sign(&c_b36, &ab[*kd + 1 + j *
00392 ab_dim1]);
00393
00394 }
00395 } else {
00396 i__1 = *n;
00397 for (j = 1; j <= i__1; ++j) {
00398
00399 i__3 = *n - j + 1, i__4 = *kd + 1;
00400 lenj = min(i__3,i__4);
00401 if (lenj > 0) {
00402 slarnv_(&c__2, &iseed[1], &lenj, &ab[j * ab_dim1 + 1]);
00403 }
00404 ab[j * ab_dim1 + 1] = r_sign(&c_b36, &ab[j * ab_dim1 + 1]);
00405
00406 }
00407 }
00408
00409
00410
00411 slarnv_(&c__2, &iseed[1], n, &b[1]);
00412 iy = isamax_(n, &b[1], &c__1);
00413 bnorm = (r__1 = b[iy], dabs(r__1));
00414 bscal = bignum / dmax(1.f,bnorm);
00415 sscal_(n, &bscal, &b[1], &c__1);
00416
00417 } else if (*imat == 11) {
00418
00419
00420
00421
00422
00423 slarnv_(&c__2, &iseed[1], n, &b[1]);
00424 tscal = 1.f / (real) (*kd + 1);
00425 if (upper) {
00426 i__1 = *n;
00427 for (j = 1; j <= i__1; ++j) {
00428
00429 i__3 = j, i__4 = *kd + 1;
00430 lenj = min(i__3,i__4);
00431 slarnv_(&c__2, &iseed[1], &lenj, &ab[*kd + 2 - lenj + j *
00432 ab_dim1]);
00433 i__3 = lenj - 1;
00434 sscal_(&i__3, &tscal, &ab[*kd + 2 - lenj + j * ab_dim1], &
00435 c__1);
00436 ab[*kd + 1 + j * ab_dim1] = r_sign(&c_b47, &ab[*kd + 1 + j *
00437 ab_dim1]);
00438
00439 }
00440 ab[*kd + 1 + *n * ab_dim1] = smlnum * ab[*kd + 1 + *n * ab_dim1];
00441 } else {
00442 i__1 = *n;
00443 for (j = 1; j <= i__1; ++j) {
00444
00445 i__3 = *n - j + 1, i__4 = *kd + 1;
00446 lenj = min(i__3,i__4);
00447 slarnv_(&c__2, &iseed[1], &lenj, &ab[j * ab_dim1 + 1]);
00448 if (lenj > 1) {
00449 i__3 = lenj - 1;
00450 sscal_(&i__3, &tscal, &ab[j * ab_dim1 + 2], &c__1);
00451 }
00452 ab[j * ab_dim1 + 1] = r_sign(&c_b47, &ab[j * ab_dim1 + 1]);
00453
00454 }
00455 ab[ab_dim1 + 1] = smlnum * ab[ab_dim1 + 1];
00456 }
00457
00458 } else if (*imat == 12) {
00459
00460
00461
00462
00463
00464 slarnv_(&c__2, &iseed[1], n, &b[1]);
00465 if (upper) {
00466 i__1 = *n;
00467 for (j = 1; j <= i__1; ++j) {
00468
00469 i__3 = j, i__4 = *kd + 1;
00470 lenj = min(i__3,i__4);
00471 slarnv_(&c__2, &iseed[1], &lenj, &ab[*kd + 2 - lenj + j *
00472 ab_dim1]);
00473 ab[*kd + 1 + j * ab_dim1] = r_sign(&c_b47, &ab[*kd + 1 + j *
00474 ab_dim1]);
00475
00476 }
00477 ab[*kd + 1 + *n * ab_dim1] = smlnum * ab[*kd + 1 + *n * ab_dim1];
00478 } else {
00479 i__1 = *n;
00480 for (j = 1; j <= i__1; ++j) {
00481
00482 i__3 = *n - j + 1, i__4 = *kd + 1;
00483 lenj = min(i__3,i__4);
00484 slarnv_(&c__2, &iseed[1], &lenj, &ab[j * ab_dim1 + 1]);
00485 ab[j * ab_dim1 + 1] = r_sign(&c_b47, &ab[j * ab_dim1 + 1]);
00486
00487 }
00488 ab[ab_dim1 + 1] = smlnum * ab[ab_dim1 + 1];
00489 }
00490
00491 } else if (*imat == 13) {
00492
00493
00494
00495
00496
00497 if (upper) {
00498 jcount = 1;
00499 for (j = *n; j >= 1; --j) {
00500
00501 i__1 = 1, i__3 = *kd + 1 - (j - 1);
00502 i__4 = *kd;
00503 for (i__ = max(i__1,i__3); i__ <= i__4; ++i__) {
00504 ab[i__ + j * ab_dim1] = 0.f;
00505
00506 }
00507 if (jcount <= 2) {
00508 ab[*kd + 1 + j * ab_dim1] = smlnum;
00509 } else {
00510 ab[*kd + 1 + j * ab_dim1] = 1.f;
00511 }
00512 ++jcount;
00513 if (jcount > 4) {
00514 jcount = 1;
00515 }
00516
00517 }
00518 } else {
00519 jcount = 1;
00520 i__4 = *n;
00521 for (j = 1; j <= i__4; ++j) {
00522
00523 i__3 = *n - j + 1, i__2 = *kd + 1;
00524 i__1 = min(i__3,i__2);
00525 for (i__ = 2; i__ <= i__1; ++i__) {
00526 ab[i__ + j * ab_dim1] = 0.f;
00527
00528 }
00529 if (jcount <= 2) {
00530 ab[j * ab_dim1 + 1] = smlnum;
00531 } else {
00532 ab[j * ab_dim1 + 1] = 1.f;
00533 }
00534 ++jcount;
00535 if (jcount > 4) {
00536 jcount = 1;
00537 }
00538
00539 }
00540 }
00541
00542
00543
00544 if (upper) {
00545 b[1] = 0.f;
00546 for (i__ = *n; i__ >= 2; i__ += -2) {
00547 b[i__] = 0.f;
00548 b[i__ - 1] = smlnum;
00549
00550 }
00551 } else {
00552 b[*n] = 0.f;
00553 i__4 = *n - 1;
00554 for (i__ = 1; i__ <= i__4; i__ += 2) {
00555 b[i__] = 0.f;
00556 b[i__ + 1] = smlnum;
00557
00558 }
00559 }
00560
00561 } else if (*imat == 14) {
00562
00563
00564
00565
00566
00567 texp = 1.f / (real) (*kd + 1);
00568 d__1 = (doublereal) smlnum;
00569 d__2 = (doublereal) texp;
00570 tscal = pow_dd(&d__1, &d__2);
00571 slarnv_(&c__2, &iseed[1], n, &b[1]);
00572 if (upper) {
00573 i__4 = *n;
00574 for (j = 1; j <= i__4; ++j) {
00575
00576 i__1 = 1, i__3 = *kd + 2 - j;
00577 i__2 = *kd;
00578 for (i__ = max(i__1,i__3); i__ <= i__2; ++i__) {
00579 ab[i__ + j * ab_dim1] = 0.f;
00580
00581 }
00582 if (j > 1 && *kd > 0) {
00583 ab[*kd + j * ab_dim1] = -1.f;
00584 }
00585 ab[*kd + 1 + j * ab_dim1] = tscal;
00586
00587 }
00588 b[*n] = 1.f;
00589 } else {
00590 i__4 = *n;
00591 for (j = 1; j <= i__4; ++j) {
00592
00593 i__1 = *n - j + 1, i__3 = *kd + 1;
00594 i__2 = min(i__1,i__3);
00595 for (i__ = 3; i__ <= i__2; ++i__) {
00596 ab[i__ + j * ab_dim1] = 0.f;
00597
00598 }
00599 if (j < *n && *kd > 0) {
00600 ab[j * ab_dim1 + 2] = -1.f;
00601 }
00602 ab[j * ab_dim1 + 1] = tscal;
00603
00604 }
00605 b[1] = 1.f;
00606 }
00607
00608 } else if (*imat == 15) {
00609
00610
00611
00612 iy = *n / 2 + 1;
00613 if (upper) {
00614 i__4 = *n;
00615 for (j = 1; j <= i__4; ++j) {
00616
00617 i__2 = j, i__1 = *kd + 1;
00618 lenj = min(i__2,i__1);
00619 slarnv_(&c__2, &iseed[1], &lenj, &ab[*kd + 2 - lenj + j *
00620 ab_dim1]);
00621 if (j != iy) {
00622 ab[*kd + 1 + j * ab_dim1] = r_sign(&c_b36, &ab[*kd + 1 +
00623 j * ab_dim1]);
00624 } else {
00625 ab[*kd + 1 + j * ab_dim1] = 0.f;
00626 }
00627
00628 }
00629 } else {
00630 i__4 = *n;
00631 for (j = 1; j <= i__4; ++j) {
00632
00633 i__2 = *n - j + 1, i__1 = *kd + 1;
00634 lenj = min(i__2,i__1);
00635 slarnv_(&c__2, &iseed[1], &lenj, &ab[j * ab_dim1 + 1]);
00636 if (j != iy) {
00637 ab[j * ab_dim1 + 1] = r_sign(&c_b36, &ab[j * ab_dim1 + 1])
00638 ;
00639 } else {
00640 ab[j * ab_dim1 + 1] = 0.f;
00641 }
00642
00643 }
00644 }
00645 slarnv_(&c__2, &iseed[1], n, &b[1]);
00646 sscal_(n, &c_b36, &b[1], &c__1);
00647
00648 } else if (*imat == 16) {
00649
00650
00651
00652
00653
00654
00655 tscal = unfl / ulp;
00656 tscal = (1.f - ulp) / tscal;
00657 i__4 = *n;
00658 for (j = 1; j <= i__4; ++j) {
00659 i__2 = *kd + 1;
00660 for (i__ = 1; i__ <= i__2; ++i__) {
00661 ab[i__ + j * ab_dim1] = 0.f;
00662
00663 }
00664
00665 }
00666 texp = 1.f;
00667 if (*kd > 0) {
00668 if (upper) {
00669 i__4 = -(*kd);
00670 for (j = *n; i__4 < 0 ? j >= 1 : j <= 1; j += i__4) {
00671
00672 i__1 = 1, i__3 = j - *kd + 1;
00673 i__2 = max(i__1,i__3);
00674 for (i__ = j; i__ >= i__2; i__ += -2) {
00675 ab[j - i__ + 1 + i__ * ab_dim1] = -tscal / (real) (*
00676 kd + 2);
00677 ab[*kd + 1 + i__ * ab_dim1] = 1.f;
00678 b[i__] = texp * (1.f - ulp);
00679
00680 i__1 = 1, i__3 = j - *kd + 1;
00681 if (i__ > max(i__1,i__3)) {
00682 ab[j - i__ + 2 + (i__ - 1) * ab_dim1] = -(tscal /
00683 (real) (*kd + 2)) / (real) (*kd + 3);
00684 ab[*kd + 1 + (i__ - 1) * ab_dim1] = 1.f;
00685 b[i__ - 1] = texp * (real) ((*kd + 1) * (*kd + 1)
00686 + *kd);
00687 }
00688 texp *= 2.f;
00689
00690 }
00691
00692 i__2 = 1, i__1 = j - *kd + 1;
00693 b[max(i__2,i__1)] = (real) (*kd + 2) / (real) (*kd + 3) *
00694 tscal;
00695
00696 }
00697 } else {
00698 i__4 = *n;
00699 i__2 = *kd;
00700 for (j = 1; i__2 < 0 ? j >= i__4 : j <= i__4; j += i__2) {
00701 texp = 1.f;
00702
00703 i__1 = *kd + 1, i__3 = *n - j + 1;
00704 lenj = min(i__1,i__3);
00705
00706 i__3 = *n, i__5 = j + *kd - 1;
00707 i__1 = min(i__3,i__5);
00708 for (i__ = j; i__ <= i__1; i__ += 2) {
00709 ab[lenj - (i__ - j) + j * ab_dim1] = -tscal / (real) (
00710 *kd + 2);
00711 ab[j * ab_dim1 + 1] = 1.f;
00712 b[j] = texp * (1.f - ulp);
00713
00714 i__3 = *n, i__5 = j + *kd - 1;
00715 if (i__ < min(i__3,i__5)) {
00716 ab[lenj - (i__ - j + 1) + (i__ + 1) * ab_dim1] =
00717 -(tscal / (real) (*kd + 2)) / (real) (*kd
00718 + 3);
00719 ab[(i__ + 1) * ab_dim1 + 1] = 1.f;
00720 b[i__ + 1] = texp * (real) ((*kd + 1) * (*kd + 1)
00721 + *kd);
00722 }
00723 texp *= 2.f;
00724
00725 }
00726
00727 i__1 = *n, i__3 = j + *kd - 1;
00728 b[min(i__1,i__3)] = (real) (*kd + 2) / (real) (*kd + 3) *
00729 tscal;
00730
00731 }
00732 }
00733 } else {
00734 i__2 = *n;
00735 for (j = 1; j <= i__2; ++j) {
00736 ab[j * ab_dim1 + 1] = 1.f;
00737 b[j] = (real) j;
00738
00739 }
00740 }
00741
00742 } else if (*imat == 17) {
00743
00744
00745
00746
00747
00748 if (upper) {
00749 i__2 = *n;
00750 for (j = 1; j <= i__2; ++j) {
00751
00752 i__4 = j - 1;
00753 lenj = min(i__4,*kd);
00754 slarnv_(&c__2, &iseed[1], &lenj, &ab[*kd + 1 - lenj + j *
00755 ab_dim1]);
00756 ab[*kd + 1 + j * ab_dim1] = (real) j;
00757
00758 }
00759 } else {
00760 i__2 = *n;
00761 for (j = 1; j <= i__2; ++j) {
00762
00763 i__4 = *n - j;
00764 lenj = min(i__4,*kd);
00765 if (lenj > 0) {
00766 slarnv_(&c__2, &iseed[1], &lenj, &ab[j * ab_dim1 + 2]);
00767 }
00768 ab[j * ab_dim1 + 1] = (real) j;
00769
00770 }
00771 }
00772
00773
00774
00775 slarnv_(&c__2, &iseed[1], n, &b[1]);
00776 iy = isamax_(n, &b[1], &c__1);
00777 bnorm = (r__1 = b[iy], dabs(r__1));
00778 bscal = bignum / dmax(1.f,bnorm);
00779 sscal_(n, &bscal, &b[1], &c__1);
00780
00781 } else if (*imat == 18) {
00782
00783
00784
00785
00786
00787
00788 r__1 = 1.f, r__2 = (real) (*kd);
00789 tleft = bignum / dmax(r__1,r__2);
00790 tscal = bignum * ((real) (*kd) / (real) (*kd + 1));
00791 if (upper) {
00792 i__2 = *n;
00793 for (j = 1; j <= i__2; ++j) {
00794
00795 i__4 = j, i__1 = *kd + 1;
00796 lenj = min(i__4,i__1);
00797 slarnv_(&c__2, &iseed[1], &lenj, &ab[*kd + 2 - lenj + j *
00798 ab_dim1]);
00799 i__4 = *kd + 1;
00800 for (i__ = *kd + 2 - lenj; i__ <= i__4; ++i__) {
00801 ab[i__ + j * ab_dim1] = r_sign(&tleft, &ab[i__ + j *
00802 ab_dim1]) + tscal * ab[i__ + j * ab_dim1];
00803
00804 }
00805
00806 }
00807 } else {
00808 i__2 = *n;
00809 for (j = 1; j <= i__2; ++j) {
00810
00811 i__4 = *n - j + 1, i__1 = *kd + 1;
00812 lenj = min(i__4,i__1);
00813 slarnv_(&c__2, &iseed[1], &lenj, &ab[j * ab_dim1 + 1]);
00814 i__4 = lenj;
00815 for (i__ = 1; i__ <= i__4; ++i__) {
00816 ab[i__ + j * ab_dim1] = r_sign(&tleft, &ab[i__ + j *
00817 ab_dim1]) + tscal * ab[i__ + j * ab_dim1];
00818
00819 }
00820
00821 }
00822 }
00823 slarnv_(&c__2, &iseed[1], n, &b[1]);
00824 sscal_(n, &c_b36, &b[1], &c__1);
00825 }
00826
00827
00828
00829 if (! lsame_(trans, "N")) {
00830 if (upper) {
00831 i__2 = *n / 2;
00832 for (j = 1; j <= i__2; ++j) {
00833
00834 i__4 = *n - (j << 1) + 1, i__1 = *kd + 1;
00835 lenj = min(i__4,i__1);
00836 i__4 = *ldab - 1;
00837 sswap_(&lenj, &ab[*kd + 1 + j * ab_dim1], &i__4, &ab[*kd + 2
00838 - lenj + (*n - j + 1) * ab_dim1], &c_n1);
00839
00840 }
00841 } else {
00842 i__2 = *n / 2;
00843 for (j = 1; j <= i__2; ++j) {
00844
00845 i__4 = *n - (j << 1) + 1, i__1 = *kd + 1;
00846 lenj = min(i__4,i__1);
00847 i__4 = -(*ldab) + 1;
00848 sswap_(&lenj, &ab[j * ab_dim1 + 1], &c__1, &ab[lenj + (*n - j
00849 + 2 - lenj) * ab_dim1], &i__4);
00850
00851 }
00852 }
00853 }
00854
00855 return 0;
00856
00857
00858
00859 }