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