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_b48 = 1.f;
00022
00023 int slattp_(integer *imat, char *uplo, char *trans, char *
00024 diag, integer *iseed, integer *n, real *a, real *b, real *work,
00025 integer *info)
00026 {
00027
00028 integer i__1, i__2;
00029 real r__1, r__2;
00030 doublereal d__1, d__2;
00031
00032
00033 int s_copy(char *, char *, ftnlen, ftnlen);
00034 double pow_dd(doublereal *, doublereal *), sqrt(doublereal), r_sign(real *
00035 , real *);
00036
00037
00038 real c__;
00039 integer i__, j;
00040 real s, t, x, y, z__;
00041 integer jc;
00042 real ra;
00043 integer jj;
00044 real rb;
00045 integer jl, kl, jr, ku, iy, jx;
00046 real ulp, sfac;
00047 integer mode;
00048 char path[3], dist[1];
00049 real unfl, rexp;
00050 char type__[1];
00051 real texp;
00052 extern int srot_(integer *, real *, integer *, real *,
00053 integer *, real *, real *);
00054 real star1, plus1, plus2, bscal;
00055 extern logical lsame_(char *, char *);
00056 extern int sscal_(integer *, real *, real *, integer *);
00057 real tscal, anorm, bnorm, tleft, stemp;
00058 logical upper;
00059 extern int srotg_(real *, real *, real *, real *),
00060 slatb4_(char *, integer *, integer *, integer *, char *, integer *
00061 , integer *, real *, integer *, real *, char *), slabad_(real *, real *);
00062 extern doublereal slamch_(char *);
00063 char packit[1];
00064 real bignum;
00065 extern integer isamax_(integer *, real *, integer *);
00066 extern doublereal slarnd_(integer *, integer *);
00067 real cndnum;
00068 integer jcnext, jcount;
00069 extern int slatms_(integer *, integer *, char *, integer
00070 *, char *, real *, integer *, real *, real *, integer *, integer *
00071 , char *, real *, integer *, real *, integer *), slarnv_(integer *, integer *, integer *, real *);
00072 real smlnum;
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 --work;
00155 --b;
00156 --a;
00157 --iseed;
00158
00159
00160 s_copy(path, "Single precision", (ftnlen)1, (ftnlen)16);
00161 s_copy(path + 1, "TP", (ftnlen)2, (ftnlen)2);
00162 unfl = slamch_("Safe minimum");
00163 ulp = slamch_("Epsilon") * slamch_("Base");
00164 smlnum = unfl;
00165 bignum = (1.f - ulp) / smlnum;
00166 slabad_(&smlnum, &bignum);
00167 if (*imat >= 7 && *imat <= 10 || *imat == 18) {
00168 *(unsigned char *)diag = 'U';
00169 } else {
00170 *(unsigned char *)diag = 'N';
00171 }
00172 *info = 0;
00173
00174
00175
00176 if (*n <= 0) {
00177 return 0;
00178 }
00179
00180
00181
00182 upper = lsame_(uplo, "U");
00183 if (upper) {
00184 slatb4_(path, imat, n, n, type__, &kl, &ku, &anorm, &mode, &cndnum,
00185 dist);
00186 *(unsigned char *)packit = 'C';
00187 } else {
00188 i__1 = -(*imat);
00189 slatb4_(path, &i__1, n, n, type__, &kl, &ku, &anorm, &mode, &cndnum,
00190 dist);
00191 *(unsigned char *)packit = 'R';
00192 }
00193
00194
00195
00196 if (*imat <= 6) {
00197 slatms_(n, n, dist, &iseed[1], type__, &b[1], &mode, &cndnum, &anorm,
00198 &kl, &ku, packit, &a[1], n, &work[1], info);
00199
00200
00201
00202
00203
00204
00205 } else if (*imat == 7) {
00206 if (upper) {
00207 jc = 1;
00208 i__1 = *n;
00209 for (j = 1; j <= i__1; ++j) {
00210 i__2 = j - 1;
00211 for (i__ = 1; i__ <= i__2; ++i__) {
00212 a[jc + i__ - 1] = 0.f;
00213
00214 }
00215 a[jc + j - 1] = (real) j;
00216 jc += j;
00217
00218 }
00219 } else {
00220 jc = 1;
00221 i__1 = *n;
00222 for (j = 1; j <= i__1; ++j) {
00223 a[jc] = (real) j;
00224 i__2 = *n;
00225 for (i__ = j + 1; i__ <= i__2; ++i__) {
00226 a[jc + i__ - j] = 0.f;
00227
00228 }
00229 jc = jc + *n - j + 1;
00230
00231 }
00232 }
00233
00234
00235
00236
00237
00238
00239
00240 } else if (*imat <= 10) {
00241 if (upper) {
00242 jc = 0;
00243 i__1 = *n;
00244 for (j = 1; j <= i__1; ++j) {
00245 i__2 = j - 1;
00246 for (i__ = 1; i__ <= i__2; ++i__) {
00247 a[jc + i__] = 0.f;
00248
00249 }
00250 a[jc + j] = (real) j;
00251 jc += j;
00252
00253 }
00254 } else {
00255 jc = 1;
00256 i__1 = *n;
00257 for (j = 1; j <= i__1; ++j) {
00258 a[jc] = (real) j;
00259 i__2 = *n;
00260 for (i__ = j + 1; i__ <= i__2; ++i__) {
00261 a[jc + i__ - j] = 0.f;
00262
00263 }
00264 jc = jc + *n - j + 1;
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 star1 = .25f;
00328 sfac = .5f;
00329 plus1 = sfac;
00330 i__1 = *n;
00331 for (j = 1; j <= i__1; j += 2) {
00332 plus2 = star1 / plus1;
00333 work[j] = plus1;
00334 work[*n + j] = star1;
00335 if (j + 1 <= *n) {
00336 work[j + 1] = plus2;
00337 work[*n + j + 1] = 0.f;
00338 plus1 = star1 / plus2;
00339 rexp = slarnd_(&c__2, &iseed[1]);
00340 d__1 = (doublereal) sfac;
00341 d__2 = (doublereal) rexp;
00342 star1 *= pow_dd(&d__1, &d__2);
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 x = sqrt(cndnum) - 1.f / sqrt(cndnum);
00357 if (*n > 2) {
00358 y = sqrt(2.f / (real) (*n - 2)) * x;
00359 } else {
00360 y = 0.f;
00361 }
00362 z__ = x * x;
00363
00364 if (upper) {
00365
00366
00367
00368
00369 jc = 1;
00370 i__1 = *n;
00371 for (j = 2; j <= i__1; ++j) {
00372 a[jc + 1] = y;
00373 if (j > 2) {
00374 a[jc + j - 1] = work[j - 2];
00375 }
00376 if (j > 3) {
00377 a[jc + j - 2] = work[*n + j - 3];
00378 }
00379 jc += j;
00380
00381 }
00382 jc -= *n;
00383 a[jc + 1] = z__;
00384 i__1 = *n - 1;
00385 for (j = 2; j <= i__1; ++j) {
00386 a[jc + j] = y;
00387
00388 }
00389 } else {
00390
00391
00392
00393
00394 i__1 = *n - 1;
00395 for (i__ = 2; i__ <= i__1; ++i__) {
00396 a[i__] = y;
00397
00398 }
00399 a[*n] = z__;
00400 jc = *n + 1;
00401 i__1 = *n - 1;
00402 for (j = 2; j <= i__1; ++j) {
00403 a[jc + 1] = work[j - 1];
00404 if (j < *n - 1) {
00405 a[jc + 2] = work[*n + j - 1];
00406 }
00407 a[jc + *n - j] = y;
00408 jc = jc + *n - j + 1;
00409
00410 }
00411 }
00412
00413
00414
00415 if (upper) {
00416 jc = 1;
00417 i__1 = *n - 1;
00418 for (j = 1; j <= i__1; ++j) {
00419 jcnext = jc + j;
00420 ra = a[jcnext + j - 1];
00421 rb = 2.f;
00422 srotg_(&ra, &rb, &c__, &s);
00423
00424
00425
00426 if (*n > j + 1) {
00427 jx = jcnext + j;
00428 i__2 = *n;
00429 for (i__ = j + 2; i__ <= i__2; ++i__) {
00430 stemp = c__ * a[jx + j] + s * a[jx + j + 1];
00431 a[jx + j + 1] = -s * a[jx + j] + c__ * a[jx + j + 1];
00432 a[jx + j] = stemp;
00433 jx += i__;
00434
00435 }
00436 }
00437
00438
00439
00440 if (j > 1) {
00441 i__2 = j - 1;
00442 r__1 = -c__;
00443 r__2 = -s;
00444 srot_(&i__2, &a[jcnext], &c__1, &a[jc], &c__1, &r__1, &
00445 r__2);
00446 }
00447
00448
00449
00450 a[jcnext + j - 1] = -a[jcnext + j - 1];
00451 jc = jcnext;
00452
00453 }
00454 } else {
00455 jc = 1;
00456 i__1 = *n - 1;
00457 for (j = 1; j <= i__1; ++j) {
00458 jcnext = jc + *n - j + 1;
00459 ra = a[jc + 1];
00460 rb = 2.f;
00461 srotg_(&ra, &rb, &c__, &s);
00462
00463
00464
00465 if (*n > j + 1) {
00466 i__2 = *n - j - 1;
00467 r__1 = -s;
00468 srot_(&i__2, &a[jcnext + 1], &c__1, &a[jc + 2], &c__1, &
00469 c__, &r__1);
00470 }
00471
00472
00473
00474 if (j > 1) {
00475 jx = 1;
00476 i__2 = j - 1;
00477 for (i__ = 1; i__ <= i__2; ++i__) {
00478 stemp = -c__ * a[jx + j - i__] + s * a[jx + j - i__ +
00479 1];
00480 a[jx + j - i__ + 1] = -s * a[jx + j - i__] - c__ * a[
00481 jx + j - i__ + 1];
00482 a[jx + j - i__] = stemp;
00483 jx = jx + *n - i__ + 1;
00484
00485 }
00486 }
00487
00488
00489
00490 a[jc + 1] = -a[jc + 1];
00491 jc = jcnext;
00492
00493 }
00494 }
00495
00496
00497
00498
00499
00500 } else if (*imat == 11) {
00501
00502
00503
00504
00505
00506 if (upper) {
00507 jc = 1;
00508 i__1 = *n;
00509 for (j = 1; j <= i__1; ++j) {
00510 slarnv_(&c__2, &iseed[1], &j, &a[jc]);
00511 a[jc + j - 1] = r_sign(&c_b36, &a[jc + j - 1]);
00512 jc += j;
00513
00514 }
00515 } else {
00516 jc = 1;
00517 i__1 = *n;
00518 for (j = 1; j <= i__1; ++j) {
00519 i__2 = *n - j + 1;
00520 slarnv_(&c__2, &iseed[1], &i__2, &a[jc]);
00521 a[jc] = r_sign(&c_b36, &a[jc]);
00522 jc = jc + *n - j + 1;
00523
00524 }
00525 }
00526
00527
00528
00529 slarnv_(&c__2, &iseed[1], n, &b[1]);
00530 iy = isamax_(n, &b[1], &c__1);
00531 bnorm = (r__1 = b[iy], dabs(r__1));
00532 bscal = bignum / dmax(1.f,bnorm);
00533 sscal_(n, &bscal, &b[1], &c__1);
00534
00535 } else if (*imat == 12) {
00536
00537
00538
00539
00540
00541 slarnv_(&c__2, &iseed[1], n, &b[1]);
00542
00543 r__1 = 1.f, r__2 = (real) (*n - 1);
00544 tscal = 1.f / dmax(r__1,r__2);
00545 if (upper) {
00546 jc = 1;
00547 i__1 = *n;
00548 for (j = 1; j <= i__1; ++j) {
00549 i__2 = j - 1;
00550 slarnv_(&c__2, &iseed[1], &i__2, &a[jc]);
00551 i__2 = j - 1;
00552 sscal_(&i__2, &tscal, &a[jc], &c__1);
00553 r__1 = slarnd_(&c__2, &iseed[1]);
00554 a[jc + j - 1] = r_sign(&c_b48, &r__1);
00555 jc += j;
00556
00557 }
00558 a[*n * (*n + 1) / 2] = smlnum;
00559 } else {
00560 jc = 1;
00561 i__1 = *n;
00562 for (j = 1; j <= i__1; ++j) {
00563 i__2 = *n - j;
00564 slarnv_(&c__2, &iseed[1], &i__2, &a[jc + 1]);
00565 i__2 = *n - j;
00566 sscal_(&i__2, &tscal, &a[jc + 1], &c__1);
00567 r__1 = slarnd_(&c__2, &iseed[1]);
00568 a[jc] = r_sign(&c_b48, &r__1);
00569 jc = jc + *n - j + 1;
00570
00571 }
00572 a[1] = smlnum;
00573 }
00574
00575 } else if (*imat == 13) {
00576
00577
00578
00579
00580
00581 slarnv_(&c__2, &iseed[1], n, &b[1]);
00582 if (upper) {
00583 jc = 1;
00584 i__1 = *n;
00585 for (j = 1; j <= i__1; ++j) {
00586 i__2 = j - 1;
00587 slarnv_(&c__2, &iseed[1], &i__2, &a[jc]);
00588 r__1 = slarnd_(&c__2, &iseed[1]);
00589 a[jc + j - 1] = r_sign(&c_b48, &r__1);
00590 jc += j;
00591
00592 }
00593 a[*n * (*n + 1) / 2] = smlnum;
00594 } else {
00595 jc = 1;
00596 i__1 = *n;
00597 for (j = 1; j <= i__1; ++j) {
00598 i__2 = *n - j;
00599 slarnv_(&c__2, &iseed[1], &i__2, &a[jc + 1]);
00600 r__1 = slarnd_(&c__2, &iseed[1]);
00601 a[jc] = r_sign(&c_b48, &r__1);
00602 jc = jc + *n - j + 1;
00603
00604 }
00605 a[1] = smlnum;
00606 }
00607
00608 } else if (*imat == 14) {
00609
00610
00611
00612
00613
00614 if (upper) {
00615 jcount = 1;
00616 jc = (*n - 1) * *n / 2 + 1;
00617 for (j = *n; j >= 1; --j) {
00618 i__1 = j - 1;
00619 for (i__ = 1; i__ <= i__1; ++i__) {
00620 a[jc + i__ - 1] = 0.f;
00621
00622 }
00623 if (jcount <= 2) {
00624 a[jc + j - 1] = smlnum;
00625 } else {
00626 a[jc + j - 1] = 1.f;
00627 }
00628 ++jcount;
00629 if (jcount > 4) {
00630 jcount = 1;
00631 }
00632 jc = jc - j + 1;
00633
00634 }
00635 } else {
00636 jcount = 1;
00637 jc = 1;
00638 i__1 = *n;
00639 for (j = 1; j <= i__1; ++j) {
00640 i__2 = *n;
00641 for (i__ = j + 1; i__ <= i__2; ++i__) {
00642 a[jc + i__ - j] = 0.f;
00643
00644 }
00645 if (jcount <= 2) {
00646 a[jc] = smlnum;
00647 } else {
00648 a[jc] = 1.f;
00649 }
00650 ++jcount;
00651 if (jcount > 4) {
00652 jcount = 1;
00653 }
00654 jc = jc + *n - j + 1;
00655
00656 }
00657 }
00658
00659
00660
00661 if (upper) {
00662 b[1] = 0.f;
00663 for (i__ = *n; i__ >= 2; i__ += -2) {
00664 b[i__] = 0.f;
00665 b[i__ - 1] = smlnum;
00666
00667 }
00668 } else {
00669 b[*n] = 0.f;
00670 i__1 = *n - 1;
00671 for (i__ = 1; i__ <= i__1; i__ += 2) {
00672 b[i__] = 0.f;
00673 b[i__ + 1] = smlnum;
00674
00675 }
00676 }
00677
00678 } else if (*imat == 15) {
00679
00680
00681
00682
00683
00684
00685 r__1 = 1.f, r__2 = (real) (*n - 1);
00686 texp = 1.f / dmax(r__1,r__2);
00687 d__1 = (doublereal) smlnum;
00688 d__2 = (doublereal) texp;
00689 tscal = pow_dd(&d__1, &d__2);
00690 slarnv_(&c__2, &iseed[1], n, &b[1]);
00691 if (upper) {
00692 jc = 1;
00693 i__1 = *n;
00694 for (j = 1; j <= i__1; ++j) {
00695 i__2 = j - 2;
00696 for (i__ = 1; i__ <= i__2; ++i__) {
00697 a[jc + i__ - 1] = 0.f;
00698
00699 }
00700 if (j > 1) {
00701 a[jc + j - 2] = -1.f;
00702 }
00703 a[jc + j - 1] = tscal;
00704 jc += j;
00705
00706 }
00707 b[*n] = 1.f;
00708 } else {
00709 jc = 1;
00710 i__1 = *n;
00711 for (j = 1; j <= i__1; ++j) {
00712 i__2 = *n;
00713 for (i__ = j + 2; i__ <= i__2; ++i__) {
00714 a[jc + i__ - j] = 0.f;
00715
00716 }
00717 if (j < *n) {
00718 a[jc + 1] = -1.f;
00719 }
00720 a[jc] = tscal;
00721 jc = jc + *n - j + 1;
00722
00723 }
00724 b[1] = 1.f;
00725 }
00726
00727 } else if (*imat == 16) {
00728
00729
00730
00731 iy = *n / 2 + 1;
00732 if (upper) {
00733 jc = 1;
00734 i__1 = *n;
00735 for (j = 1; j <= i__1; ++j) {
00736 slarnv_(&c__2, &iseed[1], &j, &a[jc]);
00737 if (j != iy) {
00738 a[jc + j - 1] = r_sign(&c_b36, &a[jc + j - 1]);
00739 } else {
00740 a[jc + j - 1] = 0.f;
00741 }
00742 jc += j;
00743
00744 }
00745 } else {
00746 jc = 1;
00747 i__1 = *n;
00748 for (j = 1; j <= i__1; ++j) {
00749 i__2 = *n - j + 1;
00750 slarnv_(&c__2, &iseed[1], &i__2, &a[jc]);
00751 if (j != iy) {
00752 a[jc] = r_sign(&c_b36, &a[jc]);
00753 } else {
00754 a[jc] = 0.f;
00755 }
00756 jc = jc + *n - j + 1;
00757
00758 }
00759 }
00760 slarnv_(&c__2, &iseed[1], n, &b[1]);
00761 sscal_(n, &c_b36, &b[1], &c__1);
00762
00763 } else if (*imat == 17) {
00764
00765
00766
00767
00768
00769
00770 tscal = unfl / ulp;
00771 tscal = (1.f - ulp) / tscal;
00772 i__1 = *n * (*n + 1) / 2;
00773 for (j = 1; j <= i__1; ++j) {
00774 a[j] = 0.f;
00775
00776 }
00777 texp = 1.f;
00778 if (upper) {
00779 jc = (*n - 1) * *n / 2 + 1;
00780 for (j = *n; j >= 2; j += -2) {
00781 a[jc] = -tscal / (real) (*n + 1);
00782 a[jc + j - 1] = 1.f;
00783 b[j] = texp * (1.f - ulp);
00784 jc = jc - j + 1;
00785 a[jc] = -(tscal / (real) (*n + 1)) / (real) (*n + 2);
00786 a[jc + j - 2] = 1.f;
00787 b[j - 1] = texp * (real) (*n * *n + *n - 1);
00788 texp *= 2.f;
00789 jc = jc - j + 2;
00790
00791 }
00792 b[1] = (real) (*n + 1) / (real) (*n + 2) * tscal;
00793 } else {
00794 jc = 1;
00795 i__1 = *n - 1;
00796 for (j = 1; j <= i__1; j += 2) {
00797 a[jc + *n - j] = -tscal / (real) (*n + 1);
00798 a[jc] = 1.f;
00799 b[j] = texp * (1.f - ulp);
00800 jc = jc + *n - j + 1;
00801 a[jc + *n - j - 1] = -(tscal / (real) (*n + 1)) / (real) (*n
00802 + 2);
00803 a[jc] = 1.f;
00804 b[j + 1] = texp * (real) (*n * *n + *n - 1);
00805 texp *= 2.f;
00806 jc = jc + *n - j;
00807
00808 }
00809 b[*n] = (real) (*n + 1) / (real) (*n + 2) * tscal;
00810 }
00811
00812 } else if (*imat == 18) {
00813
00814
00815
00816
00817
00818 if (upper) {
00819 jc = 1;
00820 i__1 = *n;
00821 for (j = 1; j <= i__1; ++j) {
00822 i__2 = j - 1;
00823 slarnv_(&c__2, &iseed[1], &i__2, &a[jc]);
00824 a[jc + j - 1] = 0.f;
00825 jc += j;
00826
00827 }
00828 } else {
00829 jc = 1;
00830 i__1 = *n;
00831 for (j = 1; j <= i__1; ++j) {
00832 if (j < *n) {
00833 i__2 = *n - j;
00834 slarnv_(&c__2, &iseed[1], &i__2, &a[jc + 1]);
00835 }
00836 a[jc] = 0.f;
00837 jc = jc + *n - j + 1;
00838
00839 }
00840 }
00841
00842
00843
00844 slarnv_(&c__2, &iseed[1], n, &b[1]);
00845 iy = isamax_(n, &b[1], &c__1);
00846 bnorm = (r__1 = b[iy], dabs(r__1));
00847 bscal = bignum / dmax(1.f,bnorm);
00848 sscal_(n, &bscal, &b[1], &c__1);
00849
00850 } else if (*imat == 19) {
00851
00852
00853
00854
00855
00856
00857 r__1 = 1.f, r__2 = (real) (*n - 1);
00858 tleft = bignum / dmax(r__1,r__2);
00859
00860 r__1 = 1.f, r__2 = (real) (*n);
00861 tscal = bignum * ((real) (*n - 1) / dmax(r__1,r__2));
00862 if (upper) {
00863 jc = 1;
00864 i__1 = *n;
00865 for (j = 1; j <= i__1; ++j) {
00866 slarnv_(&c__2, &iseed[1], &j, &a[jc]);
00867 i__2 = j;
00868 for (i__ = 1; i__ <= i__2; ++i__) {
00869 a[jc + i__ - 1] = r_sign(&tleft, &a[jc + i__ - 1]) +
00870 tscal * a[jc + i__ - 1];
00871
00872 }
00873 jc += j;
00874
00875 }
00876 } else {
00877 jc = 1;
00878 i__1 = *n;
00879 for (j = 1; j <= i__1; ++j) {
00880 i__2 = *n - j + 1;
00881 slarnv_(&c__2, &iseed[1], &i__2, &a[jc]);
00882 i__2 = *n;
00883 for (i__ = j; i__ <= i__2; ++i__) {
00884 a[jc + i__ - j] = r_sign(&tleft, &a[jc + i__ - j]) +
00885 tscal * a[jc + i__ - j];
00886
00887 }
00888 jc = jc + *n - j + 1;
00889
00890 }
00891 }
00892 slarnv_(&c__2, &iseed[1], n, &b[1]);
00893 sscal_(n, &c_b36, &b[1], &c__1);
00894 }
00895
00896
00897
00898
00899 if (! lsame_(trans, "N")) {
00900 if (upper) {
00901 jj = 1;
00902 jr = *n * (*n + 1) / 2;
00903 i__1 = *n / 2;
00904 for (j = 1; j <= i__1; ++j) {
00905 jl = jj;
00906 i__2 = *n - j;
00907 for (i__ = j; i__ <= i__2; ++i__) {
00908 t = a[jr - i__ + j];
00909 a[jr - i__ + j] = a[jl];
00910 a[jl] = t;
00911 jl += i__;
00912
00913 }
00914 jj = jj + j + 1;
00915 jr -= *n - j + 1;
00916
00917 }
00918 } else {
00919 jl = 1;
00920 jj = *n * (*n + 1) / 2;
00921 i__1 = *n / 2;
00922 for (j = 1; j <= i__1; ++j) {
00923 jr = jj;
00924 i__2 = *n - j;
00925 for (i__ = j; i__ <= i__2; ++i__) {
00926 t = a[jl + i__ - j];
00927 a[jl + i__ - j] = a[jr];
00928 a[jr] = t;
00929 jr -= i__;
00930
00931 }
00932 jl = jl + *n - j + 1;
00933 jj = jj - j - 1;
00934
00935 }
00936 }
00937 }
00938
00939 return 0;
00940
00941
00942
00943 }