zlattp.c
Go to the documentation of this file.
00001 /* zlattp.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static integer c__5 = 5;
00019 static integer c__2 = 2;
00020 static integer c__1 = 1;
00021 static integer c__4 = 4;
00022 static doublereal c_b93 = 2.;
00023 
00024 /* Subroutine */ int zlattp_(integer *imat, char *uplo, char *trans, char *
00025         diag, integer *iseed, integer *n, doublecomplex *ap, doublecomplex *b, 
00026          doublecomplex *work, doublereal *rwork, integer *info)
00027 {
00028     /* System generated locals */
00029     integer i__1, i__2, i__3, i__4, i__5;
00030     doublereal d__1, d__2;
00031     doublecomplex z__1, z__2, z__3, z__4, z__5;
00032 
00033     /* Builtin functions */
00034     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00035     void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
00036     double pow_dd(doublereal *, doublereal *), sqrt(doublereal);
00037     void d_cnjg(doublecomplex *, doublecomplex *);
00038     double z_abs(doublecomplex *);
00039 
00040     /* Local variables */
00041     doublereal c__;
00042     integer i__, j;
00043     doublecomplex s;
00044     doublereal t, x, y, z__;
00045     integer jc;
00046     doublecomplex ra;
00047     integer jj;
00048     doublecomplex rb;
00049     integer jl, kl, jr, ku, iy, jx;
00050     doublereal ulp, sfac;
00051     integer mode;
00052     char path[3], dist[1];
00053     doublereal unfl, rexp;
00054     char type__[1];
00055     doublereal texp;
00056     extern /* Subroutine */ int zrot_(integer *, doublecomplex *, integer *, 
00057             doublecomplex *, integer *, doublereal *, doublecomplex *);
00058     doublecomplex star1, plus1, plus2;
00059     doublereal bscal;
00060     extern logical lsame_(char *, char *);
00061     doublereal tscal;
00062     doublecomplex ctemp;
00063     doublereal anorm, bnorm, tleft;
00064     logical upper;
00065     extern /* Subroutine */ int zrotg_(doublecomplex *, doublecomplex *, 
00066             doublereal *, doublecomplex *), zlatb4_(char *, integer *, 
00067             integer *, integer *, char *, integer *, integer *, doublereal *, 
00068             integer *, doublereal *, char *), dlabad_(
00069             doublereal *, doublereal *);
00070     extern doublereal dlamch_(char *);
00071     char packit[1];
00072     extern /* Subroutine */ int zdscal_(integer *, doublereal *, 
00073             doublecomplex *, integer *);
00074     doublereal bignum, cndnum;
00075     extern /* Subroutine */ int dlarnv_(integer *, integer *, integer *, 
00076             doublereal *);
00077     extern integer izamax_(integer *, doublecomplex *, integer *);
00078     extern /* Double Complex */ VOID zlarnd_(doublecomplex *, integer *, 
00079             integer *);
00080     integer jcnext, jcount;
00081     extern /* Subroutine */ int zlatms_(integer *, integer *, char *, integer 
00082             *, char *, doublereal *, integer *, doublereal *, doublereal *, 
00083             integer *, integer *, char *, doublecomplex *, integer *, 
00084             doublecomplex *, integer *);
00085     doublereal smlnum;
00086     extern /* Subroutine */ int zlarnv_(integer *, integer *, integer *, 
00087             doublecomplex *);
00088 
00089 
00090 /*  -- LAPACK test routine (version 3.1) -- */
00091 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00092 /*     November 2006 */
00093 
00094 /*     .. Scalar Arguments .. */
00095 /*     .. */
00096 /*     .. Array Arguments .. */
00097 /*     .. */
00098 
00099 /*  Purpose */
00100 /*  ======= */
00101 
00102 /*  ZLATTP generates a triangular test matrix in packed storage. */
00103 /*  IMAT and UPLO uniquely specify the properties of the test matrix, */
00104 /*  which is returned in the array AP. */
00105 
00106 /*  Arguments */
00107 /*  ========= */
00108 
00109 /*  IMAT    (input) INTEGER */
00110 /*          An integer key describing which matrix to generate for this */
00111 /*          path. */
00112 
00113 /*  UPLO    (input) CHARACTER*1 */
00114 /*          Specifies whether the matrix A will be upper or lower */
00115 /*          triangular. */
00116 /*          = 'U':  Upper triangular */
00117 /*          = 'L':  Lower triangular */
00118 
00119 /*  TRANS   (input) CHARACTER*1 */
00120 /*          Specifies whether the matrix or its transpose will be used. */
00121 /*          = 'N':  No transpose */
00122 /*          = 'T':  Transpose */
00123 /*          = 'C':  Conjugate transpose */
00124 
00125 /*  DIAG    (output) CHARACTER*1 */
00126 /*          Specifies whether or not the matrix A is unit triangular. */
00127 /*          = 'N':  Non-unit triangular */
00128 /*          = 'U':  Unit triangular */
00129 
00130 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00131 /*          The seed vector for the random number generator (used in */
00132 /*          ZLATMS).  Modified on exit. */
00133 
00134 /*  N       (input) INTEGER */
00135 /*          The order of the matrix to be generated. */
00136 
00137 /*  AP      (output) COMPLEX*16 array, dimension (N*(N+1)/2) */
00138 /*          The upper or lower triangular matrix A, packed columnwise in */
00139 /*          a linear array.  The j-th column of A is stored in the array */
00140 /*          AP as follows: */
00141 /*          if UPLO = 'U', AP((j-1)*j/2 + i) = A(i,j) for 1<=i<=j; */
00142 /*          if UPLO = 'L', */
00143 /*             AP((j-1)*(n-j) + j*(j+1)/2 + i-j) = A(i,j) for j<=i<=n. */
00144 
00145 /*  B       (output) COMPLEX*16 array, dimension (N) */
00146 /*          The right hand side vector, if IMAT > 10. */
00147 
00148 /*  WORK    (workspace) COMPLEX*16 array, dimension (2*N) */
00149 
00150 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension (N) */
00151 
00152 /*  INFO    (output) INTEGER */
00153 /*          = 0:  successful exit */
00154 /*          < 0:  if INFO = -i, the i-th argument had an illegal value */
00155 
00156 /*  ===================================================================== */
00157 
00158 /*     .. Parameters .. */
00159 /*     .. */
00160 /*     .. Local Scalars .. */
00161 /*     .. */
00162 /*     .. External Functions .. */
00163 /*     .. */
00164 /*     .. External Subroutines .. */
00165 /*     .. */
00166 /*     .. Intrinsic Functions .. */
00167 /*     .. */
00168 /*     .. Executable Statements .. */
00169 
00170     /* Parameter adjustments */
00171     --rwork;
00172     --work;
00173     --b;
00174     --ap;
00175     --iseed;
00176 
00177     /* Function Body */
00178     s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00179     s_copy(path + 1, "TP", (ftnlen)2, (ftnlen)2);
00180     unfl = dlamch_("Safe minimum");
00181     ulp = dlamch_("Epsilon") * dlamch_("Base");
00182     smlnum = unfl;
00183     bignum = (1. - ulp) / smlnum;
00184     dlabad_(&smlnum, &bignum);
00185     if (*imat >= 7 && *imat <= 10 || *imat == 18) {
00186         *(unsigned char *)diag = 'U';
00187     } else {
00188         *(unsigned char *)diag = 'N';
00189     }
00190     *info = 0;
00191 
00192 /*     Quick return if N.LE.0. */
00193 
00194     if (*n <= 0) {
00195         return 0;
00196     }
00197 
00198 /*     Call ZLATB4 to set parameters for CLATMS. */
00199 
00200     upper = lsame_(uplo, "U");
00201     if (upper) {
00202         zlatb4_(path, imat, n, n, type__, &kl, &ku, &anorm, &mode, &cndnum, 
00203                 dist);
00204         *(unsigned char *)packit = 'C';
00205     } else {
00206         i__1 = -(*imat);
00207         zlatb4_(path, &i__1, n, n, type__, &kl, &ku, &anorm, &mode, &cndnum, 
00208                 dist);
00209         *(unsigned char *)packit = 'R';
00210     }
00211 
00212 /*     IMAT <= 6:  Non-unit triangular matrix */
00213 
00214     if (*imat <= 6) {
00215         zlatms_(n, n, dist, &iseed[1], type__, &rwork[1], &mode, &cndnum, &
00216                 anorm, &kl, &ku, packit, &ap[1], n, &work[1], info);
00217 
00218 /*     IMAT > 6:  Unit triangular matrix */
00219 /*     The diagonal is deliberately set to something other than 1. */
00220 
00221 /*     IMAT = 7:  Matrix is the identity */
00222 
00223     } else if (*imat == 7) {
00224         if (upper) {
00225             jc = 1;
00226             i__1 = *n;
00227             for (j = 1; j <= i__1; ++j) {
00228                 i__2 = j - 1;
00229                 for (i__ = 1; i__ <= i__2; ++i__) {
00230                     i__3 = jc + i__ - 1;
00231                     ap[i__3].r = 0., ap[i__3].i = 0.;
00232 /* L10: */
00233                 }
00234                 i__2 = jc + j - 1;
00235                 ap[i__2].r = (doublereal) j, ap[i__2].i = 0.;
00236                 jc += j;
00237 /* L20: */
00238             }
00239         } else {
00240             jc = 1;
00241             i__1 = *n;
00242             for (j = 1; j <= i__1; ++j) {
00243                 i__2 = jc;
00244                 ap[i__2].r = (doublereal) j, ap[i__2].i = 0.;
00245                 i__2 = *n;
00246                 for (i__ = j + 1; i__ <= i__2; ++i__) {
00247                     i__3 = jc + i__ - j;
00248                     ap[i__3].r = 0., ap[i__3].i = 0.;
00249 /* L30: */
00250                 }
00251                 jc = jc + *n - j + 1;
00252 /* L40: */
00253             }
00254         }
00255 
00256 /*     IMAT > 7:  Non-trivial unit triangular matrix */
00257 
00258 /*     Generate a unit triangular matrix T with condition CNDNUM by */
00259 /*     forming a triangular matrix with known singular values and */
00260 /*     filling in the zero entries with Givens rotations. */
00261 
00262     } else if (*imat <= 10) {
00263         if (upper) {
00264             jc = 0;
00265             i__1 = *n;
00266             for (j = 1; j <= i__1; ++j) {
00267                 i__2 = j - 1;
00268                 for (i__ = 1; i__ <= i__2; ++i__) {
00269                     i__3 = jc + i__;
00270                     ap[i__3].r = 0., ap[i__3].i = 0.;
00271 /* L50: */
00272                 }
00273                 i__2 = jc + j;
00274                 ap[i__2].r = (doublereal) j, ap[i__2].i = 0.;
00275                 jc += j;
00276 /* L60: */
00277             }
00278         } else {
00279             jc = 1;
00280             i__1 = *n;
00281             for (j = 1; j <= i__1; ++j) {
00282                 i__2 = jc;
00283                 ap[i__2].r = (doublereal) j, ap[i__2].i = 0.;
00284                 i__2 = *n;
00285                 for (i__ = j + 1; i__ <= i__2; ++i__) {
00286                     i__3 = jc + i__ - j;
00287                     ap[i__3].r = 0., ap[i__3].i = 0.;
00288 /* L70: */
00289                 }
00290                 jc = jc + *n - j + 1;
00291 /* L80: */
00292             }
00293         }
00294 
00295 /*        Since the trace of a unit triangular matrix is 1, the product */
00296 /*        of its singular values must be 1.  Let s = sqrt(CNDNUM), */
00297 /*        x = sqrt(s) - 1/sqrt(s), y = sqrt(2/(n-2))*x, and z = x**2. */
00298 /*        The following triangular matrix has singular values s, 1, 1, */
00299 /*        ..., 1, 1/s: */
00300 
00301 /*        1  y  y  y  ...  y  y  z */
00302 /*           1  0  0  ...  0  0  y */
00303 /*              1  0  ...  0  0  y */
00304 /*                 .  ...  .  .  . */
00305 /*                     .   .  .  . */
00306 /*                         1  0  y */
00307 /*                            1  y */
00308 /*                               1 */
00309 
00310 /*        To fill in the zeros, we first multiply by a matrix with small */
00311 /*        condition number of the form */
00312 
00313 /*        1  0  0  0  0  ... */
00314 /*           1  +  *  0  0  ... */
00315 /*              1  +  0  0  0 */
00316 /*                 1  +  *  0  0 */
00317 /*                    1  +  0  0 */
00318 /*                       ... */
00319 /*                          1  +  0 */
00320 /*                             1  0 */
00321 /*                                1 */
00322 
00323 /*        Each element marked with a '*' is formed by taking the product */
00324 /*        of the adjacent elements marked with '+'.  The '*'s can be */
00325 /*        chosen freely, and the '+'s are chosen so that the inverse of */
00326 /*        T will have elements of the same magnitude as T.  If the *'s in */
00327 /*        both T and inv(T) have small magnitude, T is well conditioned. */
00328 /*        The two offdiagonals of T are stored in WORK. */
00329 
00330 /*        The product of these two matrices has the form */
00331 
00332 /*        1  y  y  y  y  y  .  y  y  z */
00333 /*           1  +  *  0  0  .  0  0  y */
00334 /*              1  +  0  0  .  0  0  y */
00335 /*                 1  +  *  .  .  .  . */
00336 /*                    1  +  .  .  .  . */
00337 /*                       .  .  .  .  . */
00338 /*                          .  .  .  . */
00339 /*                             1  +  y */
00340 /*                                1  y */
00341 /*                                   1 */
00342 
00343 /*        Now we multiply by Givens rotations, using the fact that */
00344 
00345 /*              [  c   s ] [  1   w ] [ -c  -s ] =  [  1  -w ] */
00346 /*              [ -s   c ] [  0   1 ] [  s  -c ]    [  0   1 ] */
00347 /*        and */
00348 /*              [ -c  -s ] [  1   0 ] [  c   s ] =  [  1   0 ] */
00349 /*              [  s  -c ] [  w   1 ] [ -s   c ]    [ -w   1 ] */
00350 
00351 /*        where c = w / sqrt(w**2+4) and s = 2 / sqrt(w**2+4). */
00352 
00353         zlarnd_(&z__2, &c__5, &iseed[1]);
00354         z__1.r = z__2.r * .25, z__1.i = z__2.i * .25;
00355         star1.r = z__1.r, star1.i = z__1.i;
00356         sfac = .5;
00357         zlarnd_(&z__2, &c__5, &iseed[1]);
00358         z__1.r = sfac * z__2.r, z__1.i = sfac * z__2.i;
00359         plus1.r = z__1.r, plus1.i = z__1.i;
00360         i__1 = *n;
00361         for (j = 1; j <= i__1; j += 2) {
00362             z_div(&z__1, &star1, &plus1);
00363             plus2.r = z__1.r, plus2.i = z__1.i;
00364             i__2 = j;
00365             work[i__2].r = plus1.r, work[i__2].i = plus1.i;
00366             i__2 = *n + j;
00367             work[i__2].r = star1.r, work[i__2].i = star1.i;
00368             if (j + 1 <= *n) {
00369                 i__2 = j + 1;
00370                 work[i__2].r = plus2.r, work[i__2].i = plus2.i;
00371                 i__2 = *n + j + 1;
00372                 work[i__2].r = 0., work[i__2].i = 0.;
00373                 z_div(&z__1, &star1, &plus2);
00374                 plus1.r = z__1.r, plus1.i = z__1.i;
00375                 zlarnd_(&z__1, &c__2, &iseed[1]);
00376                 rexp = z__1.r;
00377                 if (rexp < 0.) {
00378                     d__2 = 1. - rexp;
00379                     d__1 = -pow_dd(&sfac, &d__2);
00380                     zlarnd_(&z__2, &c__5, &iseed[1]);
00381                     z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00382                     star1.r = z__1.r, star1.i = z__1.i;
00383                 } else {
00384                     d__2 = rexp + 1.;
00385                     d__1 = pow_dd(&sfac, &d__2);
00386                     zlarnd_(&z__2, &c__5, &iseed[1]);
00387                     z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
00388                     star1.r = z__1.r, star1.i = z__1.i;
00389                 }
00390             }
00391 /* L90: */
00392         }
00393 
00394         x = sqrt(cndnum) - 1. / sqrt(cndnum);
00395         if (*n > 2) {
00396             y = sqrt(2. / (doublereal) (*n - 2)) * x;
00397         } else {
00398             y = 0.;
00399         }
00400         z__ = x * x;
00401 
00402         if (upper) {
00403 
00404 /*           Set the upper triangle of A with a unit triangular matrix */
00405 /*           of known condition number. */
00406 
00407             jc = 1;
00408             i__1 = *n;
00409             for (j = 2; j <= i__1; ++j) {
00410                 i__2 = jc + 1;
00411                 ap[i__2].r = y, ap[i__2].i = 0.;
00412                 if (j > 2) {
00413                     i__2 = jc + j - 1;
00414                     i__3 = j - 2;
00415                     ap[i__2].r = work[i__3].r, ap[i__2].i = work[i__3].i;
00416                 }
00417                 if (j > 3) {
00418                     i__2 = jc + j - 2;
00419                     i__3 = *n + j - 3;
00420                     ap[i__2].r = work[i__3].r, ap[i__2].i = work[i__3].i;
00421                 }
00422                 jc += j;
00423 /* L100: */
00424             }
00425             jc -= *n;
00426             i__1 = jc + 1;
00427             ap[i__1].r = z__, ap[i__1].i = 0.;
00428             i__1 = *n - 1;
00429             for (j = 2; j <= i__1; ++j) {
00430                 i__2 = jc + j;
00431                 ap[i__2].r = y, ap[i__2].i = 0.;
00432 /* L110: */
00433             }
00434         } else {
00435 
00436 /*           Set the lower triangle of A with a unit triangular matrix */
00437 /*           of known condition number. */
00438 
00439             i__1 = *n - 1;
00440             for (i__ = 2; i__ <= i__1; ++i__) {
00441                 i__2 = i__;
00442                 ap[i__2].r = y, ap[i__2].i = 0.;
00443 /* L120: */
00444             }
00445             i__1 = *n;
00446             ap[i__1].r = z__, ap[i__1].i = 0.;
00447             jc = *n + 1;
00448             i__1 = *n - 1;
00449             for (j = 2; j <= i__1; ++j) {
00450                 i__2 = jc + 1;
00451                 i__3 = j - 1;
00452                 ap[i__2].r = work[i__3].r, ap[i__2].i = work[i__3].i;
00453                 if (j < *n - 1) {
00454                     i__2 = jc + 2;
00455                     i__3 = *n + j - 1;
00456                     ap[i__2].r = work[i__3].r, ap[i__2].i = work[i__3].i;
00457                 }
00458                 i__2 = jc + *n - j;
00459                 ap[i__2].r = y, ap[i__2].i = 0.;
00460                 jc = jc + *n - j + 1;
00461 /* L130: */
00462             }
00463         }
00464 
00465 /*        Fill in the zeros using Givens rotations */
00466 
00467         if (upper) {
00468             jc = 1;
00469             i__1 = *n - 1;
00470             for (j = 1; j <= i__1; ++j) {
00471                 jcnext = jc + j;
00472                 i__2 = jcnext + j - 1;
00473                 ra.r = ap[i__2].r, ra.i = ap[i__2].i;
00474                 rb.r = 2., rb.i = 0.;
00475                 zrotg_(&ra, &rb, &c__, &s);
00476 
00477 /*              Multiply by [ c  s; -conjg(s)  c] on the left. */
00478 
00479                 if (*n > j + 1) {
00480                     jx = jcnext + j;
00481                     i__2 = *n;
00482                     for (i__ = j + 2; i__ <= i__2; ++i__) {
00483                         i__3 = jx + j;
00484                         z__2.r = c__ * ap[i__3].r, z__2.i = c__ * ap[i__3].i;
00485                         i__4 = jx + j + 1;
00486                         z__3.r = s.r * ap[i__4].r - s.i * ap[i__4].i, z__3.i =
00487                                  s.r * ap[i__4].i + s.i * ap[i__4].r;
00488                         z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
00489                         ctemp.r = z__1.r, ctemp.i = z__1.i;
00490                         i__3 = jx + j + 1;
00491                         d_cnjg(&z__4, &s);
00492                         z__3.r = -z__4.r, z__3.i = -z__4.i;
00493                         i__4 = jx + j;
00494                         z__2.r = z__3.r * ap[i__4].r - z__3.i * ap[i__4].i, 
00495                                 z__2.i = z__3.r * ap[i__4].i + z__3.i * ap[
00496                                 i__4].r;
00497                         i__5 = jx + j + 1;
00498                         z__5.r = c__ * ap[i__5].r, z__5.i = c__ * ap[i__5].i;
00499                         z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i;
00500                         ap[i__3].r = z__1.r, ap[i__3].i = z__1.i;
00501                         i__3 = jx + j;
00502                         ap[i__3].r = ctemp.r, ap[i__3].i = ctemp.i;
00503                         jx += i__;
00504 /* L140: */
00505                     }
00506                 }
00507 
00508 /*              Multiply by [-c -s;  conjg(s) -c] on the right. */
00509 
00510                 if (j > 1) {
00511                     i__2 = j - 1;
00512                     d__1 = -c__;
00513                     z__1.r = -s.r, z__1.i = -s.i;
00514                     zrot_(&i__2, &ap[jcnext], &c__1, &ap[jc], &c__1, &d__1, &
00515                             z__1);
00516                 }
00517 
00518 /*              Negate A(J,J+1). */
00519 
00520                 i__2 = jcnext + j - 1;
00521                 i__3 = jcnext + j - 1;
00522                 z__1.r = -ap[i__3].r, z__1.i = -ap[i__3].i;
00523                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00524                 jc = jcnext;
00525 /* L150: */
00526             }
00527         } else {
00528             jc = 1;
00529             i__1 = *n - 1;
00530             for (j = 1; j <= i__1; ++j) {
00531                 jcnext = jc + *n - j + 1;
00532                 i__2 = jc + 1;
00533                 ra.r = ap[i__2].r, ra.i = ap[i__2].i;
00534                 rb.r = 2., rb.i = 0.;
00535                 zrotg_(&ra, &rb, &c__, &s);
00536                 d_cnjg(&z__1, &s);
00537                 s.r = z__1.r, s.i = z__1.i;
00538 
00539 /*              Multiply by [ c -s;  conjg(s) c] on the right. */
00540 
00541                 if (*n > j + 1) {
00542                     i__2 = *n - j - 1;
00543                     z__1.r = -s.r, z__1.i = -s.i;
00544                     zrot_(&i__2, &ap[jcnext + 1], &c__1, &ap[jc + 2], &c__1, &
00545                             c__, &z__1);
00546                 }
00547 
00548 /*              Multiply by [-c  s; -conjg(s) -c] on the left. */
00549 
00550                 if (j > 1) {
00551                     jx = 1;
00552                     i__2 = j - 1;
00553                     for (i__ = 1; i__ <= i__2; ++i__) {
00554                         d__1 = -c__;
00555                         i__3 = jx + j - i__;
00556                         z__2.r = d__1 * ap[i__3].r, z__2.i = d__1 * ap[i__3]
00557                                 .i;
00558                         i__4 = jx + j - i__ + 1;
00559                         z__3.r = s.r * ap[i__4].r - s.i * ap[i__4].i, z__3.i =
00560                                  s.r * ap[i__4].i + s.i * ap[i__4].r;
00561                         z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
00562                         ctemp.r = z__1.r, ctemp.i = z__1.i;
00563                         i__3 = jx + j - i__ + 1;
00564                         d_cnjg(&z__4, &s);
00565                         z__3.r = -z__4.r, z__3.i = -z__4.i;
00566                         i__4 = jx + j - i__;
00567                         z__2.r = z__3.r * ap[i__4].r - z__3.i * ap[i__4].i, 
00568                                 z__2.i = z__3.r * ap[i__4].i + z__3.i * ap[
00569                                 i__4].r;
00570                         i__5 = jx + j - i__ + 1;
00571                         z__5.r = c__ * ap[i__5].r, z__5.i = c__ * ap[i__5].i;
00572                         z__1.r = z__2.r - z__5.r, z__1.i = z__2.i - z__5.i;
00573                         ap[i__3].r = z__1.r, ap[i__3].i = z__1.i;
00574                         i__3 = jx + j - i__;
00575                         ap[i__3].r = ctemp.r, ap[i__3].i = ctemp.i;
00576                         jx = jx + *n - i__ + 1;
00577 /* L160: */
00578                     }
00579                 }
00580 
00581 /*              Negate A(J+1,J). */
00582 
00583                 i__2 = jc + 1;
00584                 i__3 = jc + 1;
00585                 z__1.r = -ap[i__3].r, z__1.i = -ap[i__3].i;
00586                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00587                 jc = jcnext;
00588 /* L170: */
00589             }
00590         }
00591 
00592 /*     IMAT > 10:  Pathological test cases.  These triangular matrices */
00593 /*     are badly scaled or badly conditioned, so when used in solving a */
00594 /*     triangular system they may cause overflow in the solution vector. */
00595 
00596     } else if (*imat == 11) {
00597 
00598 /*        Type 11:  Generate a triangular matrix with elements between */
00599 /*        -1 and 1. Give the diagonal norm 2 to make it well-conditioned. */
00600 /*        Make the right hand side large so that it requires scaling. */
00601 
00602         if (upper) {
00603             jc = 1;
00604             i__1 = *n;
00605             for (j = 1; j <= i__1; ++j) {
00606                 i__2 = j - 1;
00607                 zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc]);
00608                 i__2 = jc + j - 1;
00609                 zlarnd_(&z__2, &c__5, &iseed[1]);
00610                 z__1.r = z__2.r * 2., z__1.i = z__2.i * 2.;
00611                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00612                 jc += j;
00613 /* L180: */
00614             }
00615         } else {
00616             jc = 1;
00617             i__1 = *n;
00618             for (j = 1; j <= i__1; ++j) {
00619                 if (j < *n) {
00620                     i__2 = *n - j;
00621                     zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc + 1]);
00622                 }
00623                 i__2 = jc;
00624                 zlarnd_(&z__2, &c__5, &iseed[1]);
00625                 z__1.r = z__2.r * 2., z__1.i = z__2.i * 2.;
00626                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00627                 jc = jc + *n - j + 1;
00628 /* L190: */
00629             }
00630         }
00631 
00632 /*        Set the right hand side so that the largest value is BIGNUM. */
00633 
00634         zlarnv_(&c__2, &iseed[1], n, &b[1]);
00635         iy = izamax_(n, &b[1], &c__1);
00636         bnorm = z_abs(&b[iy]);
00637         bscal = bignum / max(1.,bnorm);
00638         zdscal_(n, &bscal, &b[1], &c__1);
00639 
00640     } else if (*imat == 12) {
00641 
00642 /*        Type 12:  Make the first diagonal element in the solve small to */
00643 /*        cause immediate overflow when dividing by T(j,j). */
00644 /*        In type 12, the offdiagonal elements are small (CNORM(j) < 1). */
00645 
00646         zlarnv_(&c__2, &iseed[1], n, &b[1]);
00647 /* Computing MAX */
00648         d__1 = 1., d__2 = (doublereal) (*n - 1);
00649         tscal = 1. / max(d__1,d__2);
00650         if (upper) {
00651             jc = 1;
00652             i__1 = *n;
00653             for (j = 1; j <= i__1; ++j) {
00654                 i__2 = j - 1;
00655                 zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc]);
00656                 i__2 = j - 1;
00657                 zdscal_(&i__2, &tscal, &ap[jc], &c__1);
00658                 i__2 = jc + j - 1;
00659                 zlarnd_(&z__1, &c__5, &iseed[1]);
00660                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00661                 jc += j;
00662 /* L200: */
00663             }
00664             i__1 = *n * (*n + 1) / 2;
00665             i__2 = *n * (*n + 1) / 2;
00666             z__1.r = smlnum * ap[i__2].r, z__1.i = smlnum * ap[i__2].i;
00667             ap[i__1].r = z__1.r, ap[i__1].i = z__1.i;
00668         } else {
00669             jc = 1;
00670             i__1 = *n;
00671             for (j = 1; j <= i__1; ++j) {
00672                 i__2 = *n - j;
00673                 zlarnv_(&c__2, &iseed[1], &i__2, &ap[jc + 1]);
00674                 i__2 = *n - j;
00675                 zdscal_(&i__2, &tscal, &ap[jc + 1], &c__1);
00676                 i__2 = jc;
00677                 zlarnd_(&z__1, &c__5, &iseed[1]);
00678                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00679                 jc = jc + *n - j + 1;
00680 /* L210: */
00681             }
00682             z__1.r = smlnum * ap[1].r, z__1.i = smlnum * ap[1].i;
00683             ap[1].r = z__1.r, ap[1].i = z__1.i;
00684         }
00685 
00686     } else if (*imat == 13) {
00687 
00688 /*        Type 13:  Make the first diagonal element in the solve small to */
00689 /*        cause immediate overflow when dividing by T(j,j). */
00690 /*        In type 13, the offdiagonal elements are O(1) (CNORM(j) > 1). */
00691 
00692         zlarnv_(&c__2, &iseed[1], n, &b[1]);
00693         if (upper) {
00694             jc = 1;
00695             i__1 = *n;
00696             for (j = 1; j <= i__1; ++j) {
00697                 i__2 = j - 1;
00698                 zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc]);
00699                 i__2 = jc + j - 1;
00700                 zlarnd_(&z__1, &c__5, &iseed[1]);
00701                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00702                 jc += j;
00703 /* L220: */
00704             }
00705             i__1 = *n * (*n + 1) / 2;
00706             i__2 = *n * (*n + 1) / 2;
00707             z__1.r = smlnum * ap[i__2].r, z__1.i = smlnum * ap[i__2].i;
00708             ap[i__1].r = z__1.r, ap[i__1].i = z__1.i;
00709         } else {
00710             jc = 1;
00711             i__1 = *n;
00712             for (j = 1; j <= i__1; ++j) {
00713                 i__2 = *n - j;
00714                 zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc + 1]);
00715                 i__2 = jc;
00716                 zlarnd_(&z__1, &c__5, &iseed[1]);
00717                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00718                 jc = jc + *n - j + 1;
00719 /* L230: */
00720             }
00721             z__1.r = smlnum * ap[1].r, z__1.i = smlnum * ap[1].i;
00722             ap[1].r = z__1.r, ap[1].i = z__1.i;
00723         }
00724 
00725     } else if (*imat == 14) {
00726 
00727 /*        Type 14:  T is diagonal with small numbers on the diagonal to */
00728 /*        make the growth factor underflow, but a small right hand side */
00729 /*        chosen so that the solution does not overflow. */
00730 
00731         if (upper) {
00732             jcount = 1;
00733             jc = (*n - 1) * *n / 2 + 1;
00734             for (j = *n; j >= 1; --j) {
00735                 i__1 = j - 1;
00736                 for (i__ = 1; i__ <= i__1; ++i__) {
00737                     i__2 = jc + i__ - 1;
00738                     ap[i__2].r = 0., ap[i__2].i = 0.;
00739 /* L240: */
00740                 }
00741                 if (jcount <= 2) {
00742                     i__1 = jc + j - 1;
00743                     zlarnd_(&z__2, &c__5, &iseed[1]);
00744                     z__1.r = smlnum * z__2.r, z__1.i = smlnum * z__2.i;
00745                     ap[i__1].r = z__1.r, ap[i__1].i = z__1.i;
00746                 } else {
00747                     i__1 = jc + j - 1;
00748                     zlarnd_(&z__1, &c__5, &iseed[1]);
00749                     ap[i__1].r = z__1.r, ap[i__1].i = z__1.i;
00750                 }
00751                 ++jcount;
00752                 if (jcount > 4) {
00753                     jcount = 1;
00754                 }
00755                 jc = jc - j + 1;
00756 /* L250: */
00757             }
00758         } else {
00759             jcount = 1;
00760             jc = 1;
00761             i__1 = *n;
00762             for (j = 1; j <= i__1; ++j) {
00763                 i__2 = *n;
00764                 for (i__ = j + 1; i__ <= i__2; ++i__) {
00765                     i__3 = jc + i__ - j;
00766                     ap[i__3].r = 0., ap[i__3].i = 0.;
00767 /* L260: */
00768                 }
00769                 if (jcount <= 2) {
00770                     i__2 = jc;
00771                     zlarnd_(&z__2, &c__5, &iseed[1]);
00772                     z__1.r = smlnum * z__2.r, z__1.i = smlnum * z__2.i;
00773                     ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00774                 } else {
00775                     i__2 = jc;
00776                     zlarnd_(&z__1, &c__5, &iseed[1]);
00777                     ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00778                 }
00779                 ++jcount;
00780                 if (jcount > 4) {
00781                     jcount = 1;
00782                 }
00783                 jc = jc + *n - j + 1;
00784 /* L270: */
00785             }
00786         }
00787 
00788 /*        Set the right hand side alternately zero and small. */
00789 
00790         if (upper) {
00791             b[1].r = 0., b[1].i = 0.;
00792             for (i__ = *n; i__ >= 2; i__ += -2) {
00793                 i__1 = i__;
00794                 b[i__1].r = 0., b[i__1].i = 0.;
00795                 i__1 = i__ - 1;
00796                 zlarnd_(&z__2, &c__5, &iseed[1]);
00797                 z__1.r = smlnum * z__2.r, z__1.i = smlnum * z__2.i;
00798                 b[i__1].r = z__1.r, b[i__1].i = z__1.i;
00799 /* L280: */
00800             }
00801         } else {
00802             i__1 = *n;
00803             b[i__1].r = 0., b[i__1].i = 0.;
00804             i__1 = *n - 1;
00805             for (i__ = 1; i__ <= i__1; i__ += 2) {
00806                 i__2 = i__;
00807                 b[i__2].r = 0., b[i__2].i = 0.;
00808                 i__2 = i__ + 1;
00809                 zlarnd_(&z__2, &c__5, &iseed[1]);
00810                 z__1.r = smlnum * z__2.r, z__1.i = smlnum * z__2.i;
00811                 b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00812 /* L290: */
00813             }
00814         }
00815 
00816     } else if (*imat == 15) {
00817 
00818 /*        Type 15:  Make the diagonal elements small to cause gradual */
00819 /*        overflow when dividing by T(j,j).  To control the amount of */
00820 /*        scaling needed, the matrix is bidiagonal. */
00821 
00822 /* Computing MAX */
00823         d__1 = 1., d__2 = (doublereal) (*n - 1);
00824         texp = 1. / max(d__1,d__2);
00825         tscal = pow_dd(&smlnum, &texp);
00826         zlarnv_(&c__4, &iseed[1], n, &b[1]);
00827         if (upper) {
00828             jc = 1;
00829             i__1 = *n;
00830             for (j = 1; j <= i__1; ++j) {
00831                 i__2 = j - 2;
00832                 for (i__ = 1; i__ <= i__2; ++i__) {
00833                     i__3 = jc + i__ - 1;
00834                     ap[i__3].r = 0., ap[i__3].i = 0.;
00835 /* L300: */
00836                 }
00837                 if (j > 1) {
00838                     i__2 = jc + j - 2;
00839                     ap[i__2].r = -1., ap[i__2].i = -1.;
00840                 }
00841                 i__2 = jc + j - 1;
00842                 zlarnd_(&z__2, &c__5, &iseed[1]);
00843                 z__1.r = tscal * z__2.r, z__1.i = tscal * z__2.i;
00844                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00845                 jc += j;
00846 /* L310: */
00847             }
00848             i__1 = *n;
00849             b[i__1].r = 1., b[i__1].i = 1.;
00850         } else {
00851             jc = 1;
00852             i__1 = *n;
00853             for (j = 1; j <= i__1; ++j) {
00854                 i__2 = *n;
00855                 for (i__ = j + 2; i__ <= i__2; ++i__) {
00856                     i__3 = jc + i__ - j;
00857                     ap[i__3].r = 0., ap[i__3].i = 0.;
00858 /* L320: */
00859                 }
00860                 if (j < *n) {
00861                     i__2 = jc + 1;
00862                     ap[i__2].r = -1., ap[i__2].i = -1.;
00863                 }
00864                 i__2 = jc;
00865                 zlarnd_(&z__2, &c__5, &iseed[1]);
00866                 z__1.r = tscal * z__2.r, z__1.i = tscal * z__2.i;
00867                 ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00868                 jc = jc + *n - j + 1;
00869 /* L330: */
00870             }
00871             b[1].r = 1., b[1].i = 1.;
00872         }
00873 
00874     } else if (*imat == 16) {
00875 
00876 /*        Type 16:  One zero diagonal element. */
00877 
00878         iy = *n / 2 + 1;
00879         if (upper) {
00880             jc = 1;
00881             i__1 = *n;
00882             for (j = 1; j <= i__1; ++j) {
00883                 zlarnv_(&c__4, &iseed[1], &j, &ap[jc]);
00884                 if (j != iy) {
00885                     i__2 = jc + j - 1;
00886                     zlarnd_(&z__2, &c__5, &iseed[1]);
00887                     z__1.r = z__2.r * 2., z__1.i = z__2.i * 2.;
00888                     ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00889                 } else {
00890                     i__2 = jc + j - 1;
00891                     ap[i__2].r = 0., ap[i__2].i = 0.;
00892                 }
00893                 jc += j;
00894 /* L340: */
00895             }
00896         } else {
00897             jc = 1;
00898             i__1 = *n;
00899             for (j = 1; j <= i__1; ++j) {
00900                 i__2 = *n - j + 1;
00901                 zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc]);
00902                 if (j != iy) {
00903                     i__2 = jc;
00904                     zlarnd_(&z__2, &c__5, &iseed[1]);
00905                     z__1.r = z__2.r * 2., z__1.i = z__2.i * 2.;
00906                     ap[i__2].r = z__1.r, ap[i__2].i = z__1.i;
00907                 } else {
00908                     i__2 = jc;
00909                     ap[i__2].r = 0., ap[i__2].i = 0.;
00910                 }
00911                 jc = jc + *n - j + 1;
00912 /* L350: */
00913             }
00914         }
00915         zlarnv_(&c__2, &iseed[1], n, &b[1]);
00916         zdscal_(n, &c_b93, &b[1], &c__1);
00917 
00918     } else if (*imat == 17) {
00919 
00920 /*        Type 17:  Make the offdiagonal elements large to cause overflow */
00921 /*        when adding a column of T.  In the non-transposed case, the */
00922 /*        matrix is constructed to cause overflow when adding a column in */
00923 /*        every other step. */
00924 
00925         tscal = unfl / ulp;
00926         tscal = (1. - ulp) / tscal;
00927         i__1 = *n * (*n + 1) / 2;
00928         for (j = 1; j <= i__1; ++j) {
00929             i__2 = j;
00930             ap[i__2].r = 0., ap[i__2].i = 0.;
00931 /* L360: */
00932         }
00933         texp = 1.;
00934         if (upper) {
00935             jc = (*n - 1) * *n / 2 + 1;
00936             for (j = *n; j >= 2; j += -2) {
00937                 i__1 = jc;
00938                 d__1 = -tscal / (doublereal) (*n + 1);
00939                 ap[i__1].r = d__1, ap[i__1].i = 0.;
00940                 i__1 = jc + j - 1;
00941                 ap[i__1].r = 1., ap[i__1].i = 0.;
00942                 i__1 = j;
00943                 d__1 = texp * (1. - ulp);
00944                 b[i__1].r = d__1, b[i__1].i = 0.;
00945                 jc = jc - j + 1;
00946                 i__1 = jc;
00947                 d__1 = -(tscal / (doublereal) (*n + 1)) / (doublereal) (*n + 
00948                         2);
00949                 ap[i__1].r = d__1, ap[i__1].i = 0.;
00950                 i__1 = jc + j - 2;
00951                 ap[i__1].r = 1., ap[i__1].i = 0.;
00952                 i__1 = j - 1;
00953                 d__1 = texp * (doublereal) (*n * *n + *n - 1);
00954                 b[i__1].r = d__1, b[i__1].i = 0.;
00955                 texp *= 2.;
00956                 jc = jc - j + 2;
00957 /* L370: */
00958             }
00959             d__1 = (doublereal) (*n + 1) / (doublereal) (*n + 2) * tscal;
00960             b[1].r = d__1, b[1].i = 0.;
00961         } else {
00962             jc = 1;
00963             i__1 = *n - 1;
00964             for (j = 1; j <= i__1; j += 2) {
00965                 i__2 = jc + *n - j;
00966                 d__1 = -tscal / (doublereal) (*n + 1);
00967                 ap[i__2].r = d__1, ap[i__2].i = 0.;
00968                 i__2 = jc;
00969                 ap[i__2].r = 1., ap[i__2].i = 0.;
00970                 i__2 = j;
00971                 d__1 = texp * (1. - ulp);
00972                 b[i__2].r = d__1, b[i__2].i = 0.;
00973                 jc = jc + *n - j + 1;
00974                 i__2 = jc + *n - j - 1;
00975                 d__1 = -(tscal / (doublereal) (*n + 1)) / (doublereal) (*n + 
00976                         2);
00977                 ap[i__2].r = d__1, ap[i__2].i = 0.;
00978                 i__2 = jc;
00979                 ap[i__2].r = 1., ap[i__2].i = 0.;
00980                 i__2 = j + 1;
00981                 d__1 = texp * (doublereal) (*n * *n + *n - 1);
00982                 b[i__2].r = d__1, b[i__2].i = 0.;
00983                 texp *= 2.;
00984                 jc = jc + *n - j;
00985 /* L380: */
00986             }
00987             i__1 = *n;
00988             d__1 = (doublereal) (*n + 1) / (doublereal) (*n + 2) * tscal;
00989             b[i__1].r = d__1, b[i__1].i = 0.;
00990         }
00991 
00992     } else if (*imat == 18) {
00993 
00994 /*        Type 18:  Generate a unit triangular matrix with elements */
00995 /*        between -1 and 1, and make the right hand side large so that it */
00996 /*        requires scaling. */
00997 
00998         if (upper) {
00999             jc = 1;
01000             i__1 = *n;
01001             for (j = 1; j <= i__1; ++j) {
01002                 i__2 = j - 1;
01003                 zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc]);
01004                 i__2 = jc + j - 1;
01005                 ap[i__2].r = 0., ap[i__2].i = 0.;
01006                 jc += j;
01007 /* L390: */
01008             }
01009         } else {
01010             jc = 1;
01011             i__1 = *n;
01012             for (j = 1; j <= i__1; ++j) {
01013                 if (j < *n) {
01014                     i__2 = *n - j;
01015                     zlarnv_(&c__4, &iseed[1], &i__2, &ap[jc + 1]);
01016                 }
01017                 i__2 = jc;
01018                 ap[i__2].r = 0., ap[i__2].i = 0.;
01019                 jc = jc + *n - j + 1;
01020 /* L400: */
01021             }
01022         }
01023 
01024 /*        Set the right hand side so that the largest value is BIGNUM. */
01025 
01026         zlarnv_(&c__2, &iseed[1], n, &b[1]);
01027         iy = izamax_(n, &b[1], &c__1);
01028         bnorm = z_abs(&b[iy]);
01029         bscal = bignum / max(1.,bnorm);
01030         zdscal_(n, &bscal, &b[1], &c__1);
01031 
01032     } else if (*imat == 19) {
01033 
01034 /*        Type 19:  Generate a triangular matrix with elements between */
01035 /*        BIGNUM/(n-1) and BIGNUM so that at least one of the column */
01036 /*        norms will exceed BIGNUM. */
01037 /*        1/3/91:  ZLATPS no longer can handle this case */
01038 
01039 /* Computing MAX */
01040         d__1 = 1., d__2 = (doublereal) (*n - 1);
01041         tleft = bignum / max(d__1,d__2);
01042 /* Computing MAX */
01043         d__1 = 1., d__2 = (doublereal) (*n);
01044         tscal = bignum * ((doublereal) (*n - 1) / max(d__1,d__2));
01045         if (upper) {
01046             jc = 1;
01047             i__1 = *n;
01048             for (j = 1; j <= i__1; ++j) {
01049                 zlarnv_(&c__5, &iseed[1], &j, &ap[jc]);
01050                 dlarnv_(&c__1, &iseed[1], &j, &rwork[1]);
01051                 i__2 = j;
01052                 for (i__ = 1; i__ <= i__2; ++i__) {
01053                     i__3 = jc + i__ - 1;
01054                     i__4 = jc + i__ - 1;
01055                     d__1 = tleft + rwork[i__] * tscal;
01056                     z__1.r = d__1 * ap[i__4].r, z__1.i = d__1 * ap[i__4].i;
01057                     ap[i__3].r = z__1.r, ap[i__3].i = z__1.i;
01058 /* L410: */
01059                 }
01060                 jc += j;
01061 /* L420: */
01062             }
01063         } else {
01064             jc = 1;
01065             i__1 = *n;
01066             for (j = 1; j <= i__1; ++j) {
01067                 i__2 = *n - j + 1;
01068                 zlarnv_(&c__5, &iseed[1], &i__2, &ap[jc]);
01069                 i__2 = *n - j + 1;
01070                 dlarnv_(&c__1, &iseed[1], &i__2, &rwork[1]);
01071                 i__2 = *n;
01072                 for (i__ = j; i__ <= i__2; ++i__) {
01073                     i__3 = jc + i__ - j;
01074                     i__4 = jc + i__ - j;
01075                     d__1 = tleft + rwork[i__ - j + 1] * tscal;
01076                     z__1.r = d__1 * ap[i__4].r, z__1.i = d__1 * ap[i__4].i;
01077                     ap[i__3].r = z__1.r, ap[i__3].i = z__1.i;
01078 /* L430: */
01079                 }
01080                 jc = jc + *n - j + 1;
01081 /* L440: */
01082             }
01083         }
01084         zlarnv_(&c__2, &iseed[1], n, &b[1]);
01085         zdscal_(n, &c_b93, &b[1], &c__1);
01086     }
01087 
01088 /*     Flip the matrix across its counter-diagonal if the transpose will */
01089 /*     be used. */
01090 
01091     if (! lsame_(trans, "N")) {
01092         if (upper) {
01093             jj = 1;
01094             jr = *n * (*n + 1) / 2;
01095             i__1 = *n / 2;
01096             for (j = 1; j <= i__1; ++j) {
01097                 jl = jj;
01098                 i__2 = *n - j;
01099                 for (i__ = j; i__ <= i__2; ++i__) {
01100                     i__3 = jr - i__ + j;
01101                     t = ap[i__3].r;
01102                     i__3 = jr - i__ + j;
01103                     i__4 = jl;
01104                     ap[i__3].r = ap[i__4].r, ap[i__3].i = ap[i__4].i;
01105                     i__3 = jl;
01106                     ap[i__3].r = t, ap[i__3].i = 0.;
01107                     jl += i__;
01108 /* L450: */
01109                 }
01110                 jj = jj + j + 1;
01111                 jr -= *n - j + 1;
01112 /* L460: */
01113             }
01114         } else {
01115             jl = 1;
01116             jj = *n * (*n + 1) / 2;
01117             i__1 = *n / 2;
01118             for (j = 1; j <= i__1; ++j) {
01119                 jr = jj;
01120                 i__2 = *n - j;
01121                 for (i__ = j; i__ <= i__2; ++i__) {
01122                     i__3 = jl + i__ - j;
01123                     t = ap[i__3].r;
01124                     i__3 = jl + i__ - j;
01125                     i__4 = jr;
01126                     ap[i__3].r = ap[i__4].r, ap[i__3].i = ap[i__4].i;
01127                     i__3 = jr;
01128                     ap[i__3].r = t, ap[i__3].i = 0.;
01129                     jr -= i__;
01130 /* L470: */
01131                 }
01132                 jl = jl + *n - j + 1;
01133                 jj = jj - j - 1;
01134 /* L480: */
01135             }
01136         }
01137     }
01138 
01139     return 0;
01140 
01141 /*     End of ZLATTP */
01142 
01143 } /* zlattp_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:42