zlagtm.c
Go to the documentation of this file.
00001 /* zlagtm.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 /* Subroutine */ int zlagtm_(char *trans, integer *n, integer *nrhs, 
00017         doublereal *alpha, doublecomplex *dl, doublecomplex *d__, 
00018         doublecomplex *du, doublecomplex *x, integer *ldx, doublereal *beta, 
00019         doublecomplex *b, integer *ldb)
00020 {
00021     /* System generated locals */
00022     integer b_dim1, b_offset, x_dim1, x_offset, i__1, i__2, i__3, i__4, i__5, 
00023             i__6, i__7, i__8, i__9, i__10;
00024     doublecomplex z__1, z__2, z__3, z__4, z__5, z__6, z__7, z__8, z__9;
00025 
00026     /* Builtin functions */
00027     void d_cnjg(doublecomplex *, doublecomplex *);
00028 
00029     /* Local variables */
00030     integer i__, j;
00031     extern logical lsame_(char *, char *);
00032 
00033 
00034 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00035 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00036 /*     November 2006 */
00037 
00038 /*     .. Scalar Arguments .. */
00039 /*     .. */
00040 /*     .. Array Arguments .. */
00041 /*     .. */
00042 
00043 /*  Purpose */
00044 /*  ======= */
00045 
00046 /*  ZLAGTM performs a matrix-vector product of the form */
00047 
00048 /*     B := alpha * A * X + beta * B */
00049 
00050 /*  where A is a tridiagonal matrix of order N, B and X are N by NRHS */
00051 /*  matrices, and alpha and beta are real scalars, each of which may be */
00052 /*  0., 1., or -1. */
00053 
00054 /*  Arguments */
00055 /*  ========= */
00056 
00057 /*  TRANS   (input) CHARACTER*1 */
00058 /*          Specifies the operation applied to A. */
00059 /*          = 'N':  No transpose, B := alpha * A * X + beta * B */
00060 /*          = 'T':  Transpose,    B := alpha * A**T * X + beta * B */
00061 /*          = 'C':  Conjugate transpose, B := alpha * A**H * X + beta * B */
00062 
00063 /*  N       (input) INTEGER */
00064 /*          The order of the matrix A.  N >= 0. */
00065 
00066 /*  NRHS    (input) INTEGER */
00067 /*          The number of right hand sides, i.e., the number of columns */
00068 /*          of the matrices X and B. */
00069 
00070 /*  ALPHA   (input) DOUBLE PRECISION */
00071 /*          The scalar alpha.  ALPHA must be 0., 1., or -1.; otherwise, */
00072 /*          it is assumed to be 0. */
00073 
00074 /*  DL      (input) COMPLEX*16 array, dimension (N-1) */
00075 /*          The (n-1) sub-diagonal elements of T. */
00076 
00077 /*  D       (input) COMPLEX*16 array, dimension (N) */
00078 /*          The diagonal elements of T. */
00079 
00080 /*  DU      (input) COMPLEX*16 array, dimension (N-1) */
00081 /*          The (n-1) super-diagonal elements of T. */
00082 
00083 /*  X       (input) COMPLEX*16 array, dimension (LDX,NRHS) */
00084 /*          The N by NRHS matrix X. */
00085 /*  LDX     (input) INTEGER */
00086 /*          The leading dimension of the array X.  LDX >= max(N,1). */
00087 
00088 /*  BETA    (input) DOUBLE PRECISION */
00089 /*          The scalar beta.  BETA must be 0., 1., or -1.; otherwise, */
00090 /*          it is assumed to be 1. */
00091 
00092 /*  B       (input/output) COMPLEX*16 array, dimension (LDB,NRHS) */
00093 /*          On entry, the N by NRHS matrix B. */
00094 /*          On exit, B is overwritten by the matrix expression */
00095 /*          B := alpha * A * X + beta * B. */
00096 
00097 /*  LDB     (input) INTEGER */
00098 /*          The leading dimension of the array B.  LDB >= max(N,1). */
00099 
00100 /*  ===================================================================== */
00101 
00102 /*     .. Parameters .. */
00103 /*     .. */
00104 /*     .. Local Scalars .. */
00105 /*     .. */
00106 /*     .. External Functions .. */
00107 /*     .. */
00108 /*     .. Intrinsic Functions .. */
00109 /*     .. */
00110 /*     .. Executable Statements .. */
00111 
00112     /* Parameter adjustments */
00113     --dl;
00114     --d__;
00115     --du;
00116     x_dim1 = *ldx;
00117     x_offset = 1 + x_dim1;
00118     x -= x_offset;
00119     b_dim1 = *ldb;
00120     b_offset = 1 + b_dim1;
00121     b -= b_offset;
00122 
00123     /* Function Body */
00124     if (*n == 0) {
00125         return 0;
00126     }
00127 
00128 /*     Multiply B by BETA if BETA.NE.1. */
00129 
00130     if (*beta == 0.) {
00131         i__1 = *nrhs;
00132         for (j = 1; j <= i__1; ++j) {
00133             i__2 = *n;
00134             for (i__ = 1; i__ <= i__2; ++i__) {
00135                 i__3 = i__ + j * b_dim1;
00136                 b[i__3].r = 0., b[i__3].i = 0.;
00137 /* L10: */
00138             }
00139 /* L20: */
00140         }
00141     } else if (*beta == -1.) {
00142         i__1 = *nrhs;
00143         for (j = 1; j <= i__1; ++j) {
00144             i__2 = *n;
00145             for (i__ = 1; i__ <= i__2; ++i__) {
00146                 i__3 = i__ + j * b_dim1;
00147                 i__4 = i__ + j * b_dim1;
00148                 z__1.r = -b[i__4].r, z__1.i = -b[i__4].i;
00149                 b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00150 /* L30: */
00151             }
00152 /* L40: */
00153         }
00154     }
00155 
00156     if (*alpha == 1.) {
00157         if (lsame_(trans, "N")) {
00158 
00159 /*           Compute B := B + A*X */
00160 
00161             i__1 = *nrhs;
00162             for (j = 1; j <= i__1; ++j) {
00163                 if (*n == 1) {
00164                     i__2 = j * b_dim1 + 1;
00165                     i__3 = j * b_dim1 + 1;
00166                     i__4 = j * x_dim1 + 1;
00167                     z__2.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00168                             z__2.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00169                             .r;
00170                     z__1.r = b[i__3].r + z__2.r, z__1.i = b[i__3].i + z__2.i;
00171                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00172                 } else {
00173                     i__2 = j * b_dim1 + 1;
00174                     i__3 = j * b_dim1 + 1;
00175                     i__4 = j * x_dim1 + 1;
00176                     z__3.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00177                             z__3.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00178                             .r;
00179                     z__2.r = b[i__3].r + z__3.r, z__2.i = b[i__3].i + z__3.i;
00180                     i__5 = j * x_dim1 + 2;
00181                     z__4.r = du[1].r * x[i__5].r - du[1].i * x[i__5].i, 
00182                             z__4.i = du[1].r * x[i__5].i + du[1].i * x[i__5]
00183                             .r;
00184                     z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
00185                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00186                     i__2 = *n + j * b_dim1;
00187                     i__3 = *n + j * b_dim1;
00188                     i__4 = *n - 1;
00189                     i__5 = *n - 1 + j * x_dim1;
00190                     z__3.r = dl[i__4].r * x[i__5].r - dl[i__4].i * x[i__5].i, 
00191                             z__3.i = dl[i__4].r * x[i__5].i + dl[i__4].i * x[
00192                             i__5].r;
00193                     z__2.r = b[i__3].r + z__3.r, z__2.i = b[i__3].i + z__3.i;
00194                     i__6 = *n;
00195                     i__7 = *n + j * x_dim1;
00196                     z__4.r = d__[i__6].r * x[i__7].r - d__[i__6].i * x[i__7]
00197                             .i, z__4.i = d__[i__6].r * x[i__7].i + d__[i__6]
00198                             .i * x[i__7].r;
00199                     z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
00200                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00201                     i__2 = *n - 1;
00202                     for (i__ = 2; i__ <= i__2; ++i__) {
00203                         i__3 = i__ + j * b_dim1;
00204                         i__4 = i__ + j * b_dim1;
00205                         i__5 = i__ - 1;
00206                         i__6 = i__ - 1 + j * x_dim1;
00207                         z__4.r = dl[i__5].r * x[i__6].r - dl[i__5].i * x[i__6]
00208                                 .i, z__4.i = dl[i__5].r * x[i__6].i + dl[i__5]
00209                                 .i * x[i__6].r;
00210                         z__3.r = b[i__4].r + z__4.r, z__3.i = b[i__4].i + 
00211                                 z__4.i;
00212                         i__7 = i__;
00213                         i__8 = i__ + j * x_dim1;
00214                         z__5.r = d__[i__7].r * x[i__8].r - d__[i__7].i * x[
00215                                 i__8].i, z__5.i = d__[i__7].r * x[i__8].i + 
00216                                 d__[i__7].i * x[i__8].r;
00217                         z__2.r = z__3.r + z__5.r, z__2.i = z__3.i + z__5.i;
00218                         i__9 = i__;
00219                         i__10 = i__ + 1 + j * x_dim1;
00220                         z__6.r = du[i__9].r * x[i__10].r - du[i__9].i * x[
00221                                 i__10].i, z__6.i = du[i__9].r * x[i__10].i + 
00222                                 du[i__9].i * x[i__10].r;
00223                         z__1.r = z__2.r + z__6.r, z__1.i = z__2.i + z__6.i;
00224                         b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00225 /* L50: */
00226                     }
00227                 }
00228 /* L60: */
00229             }
00230         } else if (lsame_(trans, "T")) {
00231 
00232 /*           Compute B := B + A**T * X */
00233 
00234             i__1 = *nrhs;
00235             for (j = 1; j <= i__1; ++j) {
00236                 if (*n == 1) {
00237                     i__2 = j * b_dim1 + 1;
00238                     i__3 = j * b_dim1 + 1;
00239                     i__4 = j * x_dim1 + 1;
00240                     z__2.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00241                             z__2.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00242                             .r;
00243                     z__1.r = b[i__3].r + z__2.r, z__1.i = b[i__3].i + z__2.i;
00244                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00245                 } else {
00246                     i__2 = j * b_dim1 + 1;
00247                     i__3 = j * b_dim1 + 1;
00248                     i__4 = j * x_dim1 + 1;
00249                     z__3.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00250                             z__3.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00251                             .r;
00252                     z__2.r = b[i__3].r + z__3.r, z__2.i = b[i__3].i + z__3.i;
00253                     i__5 = j * x_dim1 + 2;
00254                     z__4.r = dl[1].r * x[i__5].r - dl[1].i * x[i__5].i, 
00255                             z__4.i = dl[1].r * x[i__5].i + dl[1].i * x[i__5]
00256                             .r;
00257                     z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
00258                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00259                     i__2 = *n + j * b_dim1;
00260                     i__3 = *n + j * b_dim1;
00261                     i__4 = *n - 1;
00262                     i__5 = *n - 1 + j * x_dim1;
00263                     z__3.r = du[i__4].r * x[i__5].r - du[i__4].i * x[i__5].i, 
00264                             z__3.i = du[i__4].r * x[i__5].i + du[i__4].i * x[
00265                             i__5].r;
00266                     z__2.r = b[i__3].r + z__3.r, z__2.i = b[i__3].i + z__3.i;
00267                     i__6 = *n;
00268                     i__7 = *n + j * x_dim1;
00269                     z__4.r = d__[i__6].r * x[i__7].r - d__[i__6].i * x[i__7]
00270                             .i, z__4.i = d__[i__6].r * x[i__7].i + d__[i__6]
00271                             .i * x[i__7].r;
00272                     z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
00273                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00274                     i__2 = *n - 1;
00275                     for (i__ = 2; i__ <= i__2; ++i__) {
00276                         i__3 = i__ + j * b_dim1;
00277                         i__4 = i__ + j * b_dim1;
00278                         i__5 = i__ - 1;
00279                         i__6 = i__ - 1 + j * x_dim1;
00280                         z__4.r = du[i__5].r * x[i__6].r - du[i__5].i * x[i__6]
00281                                 .i, z__4.i = du[i__5].r * x[i__6].i + du[i__5]
00282                                 .i * x[i__6].r;
00283                         z__3.r = b[i__4].r + z__4.r, z__3.i = b[i__4].i + 
00284                                 z__4.i;
00285                         i__7 = i__;
00286                         i__8 = i__ + j * x_dim1;
00287                         z__5.r = d__[i__7].r * x[i__8].r - d__[i__7].i * x[
00288                                 i__8].i, z__5.i = d__[i__7].r * x[i__8].i + 
00289                                 d__[i__7].i * x[i__8].r;
00290                         z__2.r = z__3.r + z__5.r, z__2.i = z__3.i + z__5.i;
00291                         i__9 = i__;
00292                         i__10 = i__ + 1 + j * x_dim1;
00293                         z__6.r = dl[i__9].r * x[i__10].r - dl[i__9].i * x[
00294                                 i__10].i, z__6.i = dl[i__9].r * x[i__10].i + 
00295                                 dl[i__9].i * x[i__10].r;
00296                         z__1.r = z__2.r + z__6.r, z__1.i = z__2.i + z__6.i;
00297                         b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00298 /* L70: */
00299                     }
00300                 }
00301 /* L80: */
00302             }
00303         } else if (lsame_(trans, "C")) {
00304 
00305 /*           Compute B := B + A**H * X */
00306 
00307             i__1 = *nrhs;
00308             for (j = 1; j <= i__1; ++j) {
00309                 if (*n == 1) {
00310                     i__2 = j * b_dim1 + 1;
00311                     i__3 = j * b_dim1 + 1;
00312                     d_cnjg(&z__3, &d__[1]);
00313                     i__4 = j * x_dim1 + 1;
00314                     z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i, z__2.i =
00315                              z__3.r * x[i__4].i + z__3.i * x[i__4].r;
00316                     z__1.r = b[i__3].r + z__2.r, z__1.i = b[i__3].i + z__2.i;
00317                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00318                 } else {
00319                     i__2 = j * b_dim1 + 1;
00320                     i__3 = j * b_dim1 + 1;
00321                     d_cnjg(&z__4, &d__[1]);
00322                     i__4 = j * x_dim1 + 1;
00323                     z__3.r = z__4.r * x[i__4].r - z__4.i * x[i__4].i, z__3.i =
00324                              z__4.r * x[i__4].i + z__4.i * x[i__4].r;
00325                     z__2.r = b[i__3].r + z__3.r, z__2.i = b[i__3].i + z__3.i;
00326                     d_cnjg(&z__6, &dl[1]);
00327                     i__5 = j * x_dim1 + 2;
00328                     z__5.r = z__6.r * x[i__5].r - z__6.i * x[i__5].i, z__5.i =
00329                              z__6.r * x[i__5].i + z__6.i * x[i__5].r;
00330                     z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i;
00331                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00332                     i__2 = *n + j * b_dim1;
00333                     i__3 = *n + j * b_dim1;
00334                     d_cnjg(&z__4, &du[*n - 1]);
00335                     i__4 = *n - 1 + j * x_dim1;
00336                     z__3.r = z__4.r * x[i__4].r - z__4.i * x[i__4].i, z__3.i =
00337                              z__4.r * x[i__4].i + z__4.i * x[i__4].r;
00338                     z__2.r = b[i__3].r + z__3.r, z__2.i = b[i__3].i + z__3.i;
00339                     d_cnjg(&z__6, &d__[*n]);
00340                     i__5 = *n + j * x_dim1;
00341                     z__5.r = z__6.r * x[i__5].r - z__6.i * x[i__5].i, z__5.i =
00342                              z__6.r * x[i__5].i + z__6.i * x[i__5].r;
00343                     z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i;
00344                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00345                     i__2 = *n - 1;
00346                     for (i__ = 2; i__ <= i__2; ++i__) {
00347                         i__3 = i__ + j * b_dim1;
00348                         i__4 = i__ + j * b_dim1;
00349                         d_cnjg(&z__5, &du[i__ - 1]);
00350                         i__5 = i__ - 1 + j * x_dim1;
00351                         z__4.r = z__5.r * x[i__5].r - z__5.i * x[i__5].i, 
00352                                 z__4.i = z__5.r * x[i__5].i + z__5.i * x[i__5]
00353                                 .r;
00354                         z__3.r = b[i__4].r + z__4.r, z__3.i = b[i__4].i + 
00355                                 z__4.i;
00356                         d_cnjg(&z__7, &d__[i__]);
00357                         i__6 = i__ + j * x_dim1;
00358                         z__6.r = z__7.r * x[i__6].r - z__7.i * x[i__6].i, 
00359                                 z__6.i = z__7.r * x[i__6].i + z__7.i * x[i__6]
00360                                 .r;
00361                         z__2.r = z__3.r + z__6.r, z__2.i = z__3.i + z__6.i;
00362                         d_cnjg(&z__9, &dl[i__]);
00363                         i__7 = i__ + 1 + j * x_dim1;
00364                         z__8.r = z__9.r * x[i__7].r - z__9.i * x[i__7].i, 
00365                                 z__8.i = z__9.r * x[i__7].i + z__9.i * x[i__7]
00366                                 .r;
00367                         z__1.r = z__2.r + z__8.r, z__1.i = z__2.i + z__8.i;
00368                         b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00369 /* L90: */
00370                     }
00371                 }
00372 /* L100: */
00373             }
00374         }
00375     } else if (*alpha == -1.) {
00376         if (lsame_(trans, "N")) {
00377 
00378 /*           Compute B := B - A*X */
00379 
00380             i__1 = *nrhs;
00381             for (j = 1; j <= i__1; ++j) {
00382                 if (*n == 1) {
00383                     i__2 = j * b_dim1 + 1;
00384                     i__3 = j * b_dim1 + 1;
00385                     i__4 = j * x_dim1 + 1;
00386                     z__2.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00387                             z__2.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00388                             .r;
00389                     z__1.r = b[i__3].r - z__2.r, z__1.i = b[i__3].i - z__2.i;
00390                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00391                 } else {
00392                     i__2 = j * b_dim1 + 1;
00393                     i__3 = j * b_dim1 + 1;
00394                     i__4 = j * x_dim1 + 1;
00395                     z__3.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00396                             z__3.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00397                             .r;
00398                     z__2.r = b[i__3].r - z__3.r, z__2.i = b[i__3].i - z__3.i;
00399                     i__5 = j * x_dim1 + 2;
00400                     z__4.r = du[1].r * x[i__5].r - du[1].i * x[i__5].i, 
00401                             z__4.i = du[1].r * x[i__5].i + du[1].i * x[i__5]
00402                             .r;
00403                     z__1.r = z__2.r - z__4.r, z__1.i = z__2.i - z__4.i;
00404                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00405                     i__2 = *n + j * b_dim1;
00406                     i__3 = *n + j * b_dim1;
00407                     i__4 = *n - 1;
00408                     i__5 = *n - 1 + j * x_dim1;
00409                     z__3.r = dl[i__4].r * x[i__5].r - dl[i__4].i * x[i__5].i, 
00410                             z__3.i = dl[i__4].r * x[i__5].i + dl[i__4].i * x[
00411                             i__5].r;
00412                     z__2.r = b[i__3].r - z__3.r, z__2.i = b[i__3].i - z__3.i;
00413                     i__6 = *n;
00414                     i__7 = *n + j * x_dim1;
00415                     z__4.r = d__[i__6].r * x[i__7].r - d__[i__6].i * x[i__7]
00416                             .i, z__4.i = d__[i__6].r * x[i__7].i + d__[i__6]
00417                             .i * x[i__7].r;
00418                     z__1.r = z__2.r - z__4.r, z__1.i = z__2.i - z__4.i;
00419                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00420                     i__2 = *n - 1;
00421                     for (i__ = 2; i__ <= i__2; ++i__) {
00422                         i__3 = i__ + j * b_dim1;
00423                         i__4 = i__ + j * b_dim1;
00424                         i__5 = i__ - 1;
00425                         i__6 = i__ - 1 + j * x_dim1;
00426                         z__4.r = dl[i__5].r * x[i__6].r - dl[i__5].i * x[i__6]
00427                                 .i, z__4.i = dl[i__5].r * x[i__6].i + dl[i__5]
00428                                 .i * x[i__6].r;
00429                         z__3.r = b[i__4].r - z__4.r, z__3.i = b[i__4].i - 
00430                                 z__4.i;
00431                         i__7 = i__;
00432                         i__8 = i__ + j * x_dim1;
00433                         z__5.r = d__[i__7].r * x[i__8].r - d__[i__7].i * x[
00434                                 i__8].i, z__5.i = d__[i__7].r * x[i__8].i + 
00435                                 d__[i__7].i * x[i__8].r;
00436                         z__2.r = z__3.r - z__5.r, z__2.i = z__3.i - z__5.i;
00437                         i__9 = i__;
00438                         i__10 = i__ + 1 + j * x_dim1;
00439                         z__6.r = du[i__9].r * x[i__10].r - du[i__9].i * x[
00440                                 i__10].i, z__6.i = du[i__9].r * x[i__10].i + 
00441                                 du[i__9].i * x[i__10].r;
00442                         z__1.r = z__2.r - z__6.r, z__1.i = z__2.i - z__6.i;
00443                         b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00444 /* L110: */
00445                     }
00446                 }
00447 /* L120: */
00448             }
00449         } else if (lsame_(trans, "T")) {
00450 
00451 /*           Compute B := B - A'*X */
00452 
00453             i__1 = *nrhs;
00454             for (j = 1; j <= i__1; ++j) {
00455                 if (*n == 1) {
00456                     i__2 = j * b_dim1 + 1;
00457                     i__3 = j * b_dim1 + 1;
00458                     i__4 = j * x_dim1 + 1;
00459                     z__2.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00460                             z__2.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00461                             .r;
00462                     z__1.r = b[i__3].r - z__2.r, z__1.i = b[i__3].i - z__2.i;
00463                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00464                 } else {
00465                     i__2 = j * b_dim1 + 1;
00466                     i__3 = j * b_dim1 + 1;
00467                     i__4 = j * x_dim1 + 1;
00468                     z__3.r = d__[1].r * x[i__4].r - d__[1].i * x[i__4].i, 
00469                             z__3.i = d__[1].r * x[i__4].i + d__[1].i * x[i__4]
00470                             .r;
00471                     z__2.r = b[i__3].r - z__3.r, z__2.i = b[i__3].i - z__3.i;
00472                     i__5 = j * x_dim1 + 2;
00473                     z__4.r = dl[1].r * x[i__5].r - dl[1].i * x[i__5].i, 
00474                             z__4.i = dl[1].r * x[i__5].i + dl[1].i * x[i__5]
00475                             .r;
00476                     z__1.r = z__2.r - z__4.r, z__1.i = z__2.i - z__4.i;
00477                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00478                     i__2 = *n + j * b_dim1;
00479                     i__3 = *n + j * b_dim1;
00480                     i__4 = *n - 1;
00481                     i__5 = *n - 1 + j * x_dim1;
00482                     z__3.r = du[i__4].r * x[i__5].r - du[i__4].i * x[i__5].i, 
00483                             z__3.i = du[i__4].r * x[i__5].i + du[i__4].i * x[
00484                             i__5].r;
00485                     z__2.r = b[i__3].r - z__3.r, z__2.i = b[i__3].i - z__3.i;
00486                     i__6 = *n;
00487                     i__7 = *n + j * x_dim1;
00488                     z__4.r = d__[i__6].r * x[i__7].r - d__[i__6].i * x[i__7]
00489                             .i, z__4.i = d__[i__6].r * x[i__7].i + d__[i__6]
00490                             .i * x[i__7].r;
00491                     z__1.r = z__2.r - z__4.r, z__1.i = z__2.i - z__4.i;
00492                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00493                     i__2 = *n - 1;
00494                     for (i__ = 2; i__ <= i__2; ++i__) {
00495                         i__3 = i__ + j * b_dim1;
00496                         i__4 = i__ + j * b_dim1;
00497                         i__5 = i__ - 1;
00498                         i__6 = i__ - 1 + j * x_dim1;
00499                         z__4.r = du[i__5].r * x[i__6].r - du[i__5].i * x[i__6]
00500                                 .i, z__4.i = du[i__5].r * x[i__6].i + du[i__5]
00501                                 .i * x[i__6].r;
00502                         z__3.r = b[i__4].r - z__4.r, z__3.i = b[i__4].i - 
00503                                 z__4.i;
00504                         i__7 = i__;
00505                         i__8 = i__ + j * x_dim1;
00506                         z__5.r = d__[i__7].r * x[i__8].r - d__[i__7].i * x[
00507                                 i__8].i, z__5.i = d__[i__7].r * x[i__8].i + 
00508                                 d__[i__7].i * x[i__8].r;
00509                         z__2.r = z__3.r - z__5.r, z__2.i = z__3.i - z__5.i;
00510                         i__9 = i__;
00511                         i__10 = i__ + 1 + j * x_dim1;
00512                         z__6.r = dl[i__9].r * x[i__10].r - dl[i__9].i * x[
00513                                 i__10].i, z__6.i = dl[i__9].r * x[i__10].i + 
00514                                 dl[i__9].i * x[i__10].r;
00515                         z__1.r = z__2.r - z__6.r, z__1.i = z__2.i - z__6.i;
00516                         b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00517 /* L130: */
00518                     }
00519                 }
00520 /* L140: */
00521             }
00522         } else if (lsame_(trans, "C")) {
00523 
00524 /*           Compute B := B - A'*X */
00525 
00526             i__1 = *nrhs;
00527             for (j = 1; j <= i__1; ++j) {
00528                 if (*n == 1) {
00529                     i__2 = j * b_dim1 + 1;
00530                     i__3 = j * b_dim1 + 1;
00531                     d_cnjg(&z__3, &d__[1]);
00532                     i__4 = j * x_dim1 + 1;
00533                     z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i, z__2.i =
00534                              z__3.r * x[i__4].i + z__3.i * x[i__4].r;
00535                     z__1.r = b[i__3].r - z__2.r, z__1.i = b[i__3].i - z__2.i;
00536                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00537                 } else {
00538                     i__2 = j * b_dim1 + 1;
00539                     i__3 = j * b_dim1 + 1;
00540                     d_cnjg(&z__4, &d__[1]);
00541                     i__4 = j * x_dim1 + 1;
00542                     z__3.r = z__4.r * x[i__4].r - z__4.i * x[i__4].i, z__3.i =
00543                              z__4.r * x[i__4].i + z__4.i * x[i__4].r;
00544                     z__2.r = b[i__3].r - z__3.r, z__2.i = b[i__3].i - z__3.i;
00545                     d_cnjg(&z__6, &dl[1]);
00546                     i__5 = j * x_dim1 + 2;
00547                     z__5.r = z__6.r * x[i__5].r - z__6.i * x[i__5].i, z__5.i =
00548                              z__6.r * x[i__5].i + z__6.i * x[i__5].r;
00549                     z__1.r = z__2.r - z__5.r, z__1.i = z__2.i - z__5.i;
00550                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00551                     i__2 = *n + j * b_dim1;
00552                     i__3 = *n + j * b_dim1;
00553                     d_cnjg(&z__4, &du[*n - 1]);
00554                     i__4 = *n - 1 + j * x_dim1;
00555                     z__3.r = z__4.r * x[i__4].r - z__4.i * x[i__4].i, z__3.i =
00556                              z__4.r * x[i__4].i + z__4.i * x[i__4].r;
00557                     z__2.r = b[i__3].r - z__3.r, z__2.i = b[i__3].i - z__3.i;
00558                     d_cnjg(&z__6, &d__[*n]);
00559                     i__5 = *n + j * x_dim1;
00560                     z__5.r = z__6.r * x[i__5].r - z__6.i * x[i__5].i, z__5.i =
00561                              z__6.r * x[i__5].i + z__6.i * x[i__5].r;
00562                     z__1.r = z__2.r - z__5.r, z__1.i = z__2.i - z__5.i;
00563                     b[i__2].r = z__1.r, b[i__2].i = z__1.i;
00564                     i__2 = *n - 1;
00565                     for (i__ = 2; i__ <= i__2; ++i__) {
00566                         i__3 = i__ + j * b_dim1;
00567                         i__4 = i__ + j * b_dim1;
00568                         d_cnjg(&z__5, &du[i__ - 1]);
00569                         i__5 = i__ - 1 + j * x_dim1;
00570                         z__4.r = z__5.r * x[i__5].r - z__5.i * x[i__5].i, 
00571                                 z__4.i = z__5.r * x[i__5].i + z__5.i * x[i__5]
00572                                 .r;
00573                         z__3.r = b[i__4].r - z__4.r, z__3.i = b[i__4].i - 
00574                                 z__4.i;
00575                         d_cnjg(&z__7, &d__[i__]);
00576                         i__6 = i__ + j * x_dim1;
00577                         z__6.r = z__7.r * x[i__6].r - z__7.i * x[i__6].i, 
00578                                 z__6.i = z__7.r * x[i__6].i + z__7.i * x[i__6]
00579                                 .r;
00580                         z__2.r = z__3.r - z__6.r, z__2.i = z__3.i - z__6.i;
00581                         d_cnjg(&z__9, &dl[i__]);
00582                         i__7 = i__ + 1 + j * x_dim1;
00583                         z__8.r = z__9.r * x[i__7].r - z__9.i * x[i__7].i, 
00584                                 z__8.i = z__9.r * x[i__7].i + z__9.i * x[i__7]
00585                                 .r;
00586                         z__1.r = z__2.r - z__8.r, z__1.i = z__2.i - z__8.i;
00587                         b[i__3].r = z__1.r, b[i__3].i = z__1.i;
00588 /* L150: */
00589                     }
00590                 }
00591 /* L160: */
00592             }
00593         }
00594     }
00595     return 0;
00596 
00597 /*     End of ZLAGTM */
00598 
00599 } /* zlagtm_ */


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