zlasr.c
Go to the documentation of this file.
00001 /* zlasr.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 zlasr_(char *side, char *pivot, char *direct, integer *m, 
00017          integer *n, doublereal *c__, doublereal *s, doublecomplex *a, 
00018         integer *lda)
00019 {
00020     /* System generated locals */
00021     integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
00022     doublecomplex z__1, z__2, z__3;
00023 
00024     /* Local variables */
00025     integer i__, j, info;
00026     doublecomplex temp;
00027     extern logical lsame_(char *, char *);
00028     doublereal ctemp, stemp;
00029     extern /* Subroutine */ int xerbla_(char *, integer *);
00030 
00031 
00032 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00033 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00034 /*     November 2006 */
00035 
00036 /*     .. Scalar Arguments .. */
00037 /*     .. */
00038 /*     .. Array Arguments .. */
00039 /*     .. */
00040 
00041 /*  Purpose */
00042 /*  ======= */
00043 
00044 /*  ZLASR applies a sequence of real plane rotations to a complex matrix */
00045 /*  A, from either the left or the right. */
00046 
00047 /*  When SIDE = 'L', the transformation takes the form */
00048 
00049 /*     A := P*A */
00050 
00051 /*  and when SIDE = 'R', the transformation takes the form */
00052 
00053 /*     A := A*P**T */
00054 
00055 /*  where P is an orthogonal matrix consisting of a sequence of z plane */
00056 /*  rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', */
00057 /*  and P**T is the transpose of P. */
00058 
00059 /*  When DIRECT = 'F' (Forward sequence), then */
00060 
00061 /*     P = P(z-1) * ... * P(2) * P(1) */
00062 
00063 /*  and when DIRECT = 'B' (Backward sequence), then */
00064 
00065 /*     P = P(1) * P(2) * ... * P(z-1) */
00066 
00067 /*  where P(k) is a plane rotation matrix defined by the 2-by-2 rotation */
00068 
00069 /*     R(k) = (  c(k)  s(k) ) */
00070 /*          = ( -s(k)  c(k) ). */
00071 
00072 /*  When PIVOT = 'V' (Variable pivot), the rotation is performed */
00073 /*  for the plane (k,k+1), i.e., P(k) has the form */
00074 
00075 /*     P(k) = (  1                                            ) */
00076 /*            (       ...                                     ) */
00077 /*            (              1                                ) */
00078 /*            (                   c(k)  s(k)                  ) */
00079 /*            (                  -s(k)  c(k)                  ) */
00080 /*            (                                1              ) */
00081 /*            (                                     ...       ) */
00082 /*            (                                            1  ) */
00083 
00084 /*  where R(k) appears as a rank-2 modification to the identity matrix in */
00085 /*  rows and columns k and k+1. */
00086 
00087 /*  When PIVOT = 'T' (Top pivot), the rotation is performed for the */
00088 /*  plane (1,k+1), so P(k) has the form */
00089 
00090 /*     P(k) = (  c(k)                    s(k)                 ) */
00091 /*            (         1                                     ) */
00092 /*            (              ...                              ) */
00093 /*            (                     1                         ) */
00094 /*            ( -s(k)                    c(k)                 ) */
00095 /*            (                                 1             ) */
00096 /*            (                                      ...      ) */
00097 /*            (                                             1 ) */
00098 
00099 /*  where R(k) appears in rows and columns 1 and k+1. */
00100 
00101 /*  Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is */
00102 /*  performed for the plane (k,z), giving P(k) the form */
00103 
00104 /*     P(k) = ( 1                                             ) */
00105 /*            (      ...                                      ) */
00106 /*            (             1                                 ) */
00107 /*            (                  c(k)                    s(k) ) */
00108 /*            (                         1                     ) */
00109 /*            (                              ...              ) */
00110 /*            (                                     1         ) */
00111 /*            (                 -s(k)                    c(k) ) */
00112 
00113 /*  where R(k) appears in rows and columns k and z.  The rotations are */
00114 /*  performed without ever forming P(k) explicitly. */
00115 
00116 /*  Arguments */
00117 /*  ========= */
00118 
00119 /*  SIDE    (input) CHARACTER*1 */
00120 /*          Specifies whether the plane rotation matrix P is applied to */
00121 /*          A on the left or the right. */
00122 /*          = 'L':  Left, compute A := P*A */
00123 /*          = 'R':  Right, compute A:= A*P**T */
00124 
00125 /*  PIVOT   (input) CHARACTER*1 */
00126 /*          Specifies the plane for which P(k) is a plane rotation */
00127 /*          matrix. */
00128 /*          = 'V':  Variable pivot, the plane (k,k+1) */
00129 /*          = 'T':  Top pivot, the plane (1,k+1) */
00130 /*          = 'B':  Bottom pivot, the plane (k,z) */
00131 
00132 /*  DIRECT  (input) CHARACTER*1 */
00133 /*          Specifies whether P is a forward or backward sequence of */
00134 /*          plane rotations. */
00135 /*          = 'F':  Forward, P = P(z-1)*...*P(2)*P(1) */
00136 /*          = 'B':  Backward, P = P(1)*P(2)*...*P(z-1) */
00137 
00138 /*  M       (input) INTEGER */
00139 /*          The number of rows of the matrix A.  If m <= 1, an immediate */
00140 /*          return is effected. */
00141 
00142 /*  N       (input) INTEGER */
00143 /*          The number of columns of the matrix A.  If n <= 1, an */
00144 /*          immediate return is effected. */
00145 
00146 /*  C       (input) DOUBLE PRECISION array, dimension */
00147 /*                  (M-1) if SIDE = 'L' */
00148 /*                  (N-1) if SIDE = 'R' */
00149 /*          The cosines c(k) of the plane rotations. */
00150 
00151 /*  S       (input) DOUBLE PRECISION array, dimension */
00152 /*                  (M-1) if SIDE = 'L' */
00153 /*                  (N-1) if SIDE = 'R' */
00154 /*          The sines s(k) of the plane rotations.  The 2-by-2 plane */
00155 /*          rotation part of the matrix P(k), R(k), has the form */
00156 /*          R(k) = (  c(k)  s(k) ) */
00157 /*                 ( -s(k)  c(k) ). */
00158 
00159 /*  A       (input/output) COMPLEX*16 array, dimension (LDA,N) */
00160 /*          The M-by-N matrix A.  On exit, A is overwritten by P*A if */
00161 /*          SIDE = 'R' or by A*P**T if SIDE = 'L'. */
00162 
00163 /*  LDA     (input) INTEGER */
00164 /*          The leading dimension of the array A.  LDA >= max(1,M). */
00165 
00166 /*  ===================================================================== */
00167 
00168 /*     .. Parameters .. */
00169 /*     .. */
00170 /*     .. Local Scalars .. */
00171 /*     .. */
00172 /*     .. Intrinsic Functions .. */
00173 /*     .. */
00174 /*     .. External Functions .. */
00175 /*     .. */
00176 /*     .. External Subroutines .. */
00177 /*     .. */
00178 /*     .. Executable Statements .. */
00179 
00180 /*     Test the input parameters */
00181 
00182     /* Parameter adjustments */
00183     --c__;
00184     --s;
00185     a_dim1 = *lda;
00186     a_offset = 1 + a_dim1;
00187     a -= a_offset;
00188 
00189     /* Function Body */
00190     info = 0;
00191     if (! (lsame_(side, "L") || lsame_(side, "R"))) {
00192         info = 1;
00193     } else if (! (lsame_(pivot, "V") || lsame_(pivot, 
00194             "T") || lsame_(pivot, "B"))) {
00195         info = 2;
00196     } else if (! (lsame_(direct, "F") || lsame_(direct, 
00197             "B"))) {
00198         info = 3;
00199     } else if (*m < 0) {
00200         info = 4;
00201     } else if (*n < 0) {
00202         info = 5;
00203     } else if (*lda < max(1,*m)) {
00204         info = 9;
00205     }
00206     if (info != 0) {
00207         xerbla_("ZLASR ", &info);
00208         return 0;
00209     }
00210 
00211 /*     Quick return if possible */
00212 
00213     if (*m == 0 || *n == 0) {
00214         return 0;
00215     }
00216     if (lsame_(side, "L")) {
00217 
00218 /*        Form  P * A */
00219 
00220         if (lsame_(pivot, "V")) {
00221             if (lsame_(direct, "F")) {
00222                 i__1 = *m - 1;
00223                 for (j = 1; j <= i__1; ++j) {
00224                     ctemp = c__[j];
00225                     stemp = s[j];
00226                     if (ctemp != 1. || stemp != 0.) {
00227                         i__2 = *n;
00228                         for (i__ = 1; i__ <= i__2; ++i__) {
00229                             i__3 = j + 1 + i__ * a_dim1;
00230                             temp.r = a[i__3].r, temp.i = a[i__3].i;
00231                             i__3 = j + 1 + i__ * a_dim1;
00232                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00233                             i__4 = j + i__ * a_dim1;
00234                             z__3.r = stemp * a[i__4].r, z__3.i = stemp * a[
00235                                     i__4].i;
00236                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00237                                     z__3.i;
00238                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00239                             i__3 = j + i__ * a_dim1;
00240                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00241                             i__4 = j + i__ * a_dim1;
00242                             z__3.r = ctemp * a[i__4].r, z__3.i = ctemp * a[
00243                                     i__4].i;
00244                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00245                                     z__3.i;
00246                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00247 /* L10: */
00248                         }
00249                     }
00250 /* L20: */
00251                 }
00252             } else if (lsame_(direct, "B")) {
00253                 for (j = *m - 1; j >= 1; --j) {
00254                     ctemp = c__[j];
00255                     stemp = s[j];
00256                     if (ctemp != 1. || stemp != 0.) {
00257                         i__1 = *n;
00258                         for (i__ = 1; i__ <= i__1; ++i__) {
00259                             i__2 = j + 1 + i__ * a_dim1;
00260                             temp.r = a[i__2].r, temp.i = a[i__2].i;
00261                             i__2 = j + 1 + i__ * a_dim1;
00262                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00263                             i__3 = j + i__ * a_dim1;
00264                             z__3.r = stemp * a[i__3].r, z__3.i = stemp * a[
00265                                     i__3].i;
00266                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00267                                     z__3.i;
00268                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00269                             i__2 = j + i__ * a_dim1;
00270                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00271                             i__3 = j + i__ * a_dim1;
00272                             z__3.r = ctemp * a[i__3].r, z__3.i = ctemp * a[
00273                                     i__3].i;
00274                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00275                                     z__3.i;
00276                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00277 /* L30: */
00278                         }
00279                     }
00280 /* L40: */
00281                 }
00282             }
00283         } else if (lsame_(pivot, "T")) {
00284             if (lsame_(direct, "F")) {
00285                 i__1 = *m;
00286                 for (j = 2; j <= i__1; ++j) {
00287                     ctemp = c__[j - 1];
00288                     stemp = s[j - 1];
00289                     if (ctemp != 1. || stemp != 0.) {
00290                         i__2 = *n;
00291                         for (i__ = 1; i__ <= i__2; ++i__) {
00292                             i__3 = j + i__ * a_dim1;
00293                             temp.r = a[i__3].r, temp.i = a[i__3].i;
00294                             i__3 = j + i__ * a_dim1;
00295                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00296                             i__4 = i__ * a_dim1 + 1;
00297                             z__3.r = stemp * a[i__4].r, z__3.i = stemp * a[
00298                                     i__4].i;
00299                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00300                                     z__3.i;
00301                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00302                             i__3 = i__ * a_dim1 + 1;
00303                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00304                             i__4 = i__ * a_dim1 + 1;
00305                             z__3.r = ctemp * a[i__4].r, z__3.i = ctemp * a[
00306                                     i__4].i;
00307                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00308                                     z__3.i;
00309                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00310 /* L50: */
00311                         }
00312                     }
00313 /* L60: */
00314                 }
00315             } else if (lsame_(direct, "B")) {
00316                 for (j = *m; j >= 2; --j) {
00317                     ctemp = c__[j - 1];
00318                     stemp = s[j - 1];
00319                     if (ctemp != 1. || stemp != 0.) {
00320                         i__1 = *n;
00321                         for (i__ = 1; i__ <= i__1; ++i__) {
00322                             i__2 = j + i__ * a_dim1;
00323                             temp.r = a[i__2].r, temp.i = a[i__2].i;
00324                             i__2 = j + i__ * a_dim1;
00325                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00326                             i__3 = i__ * a_dim1 + 1;
00327                             z__3.r = stemp * a[i__3].r, z__3.i = stemp * a[
00328                                     i__3].i;
00329                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00330                                     z__3.i;
00331                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00332                             i__2 = i__ * a_dim1 + 1;
00333                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00334                             i__3 = i__ * a_dim1 + 1;
00335                             z__3.r = ctemp * a[i__3].r, z__3.i = ctemp * a[
00336                                     i__3].i;
00337                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00338                                     z__3.i;
00339                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00340 /* L70: */
00341                         }
00342                     }
00343 /* L80: */
00344                 }
00345             }
00346         } else if (lsame_(pivot, "B")) {
00347             if (lsame_(direct, "F")) {
00348                 i__1 = *m - 1;
00349                 for (j = 1; j <= i__1; ++j) {
00350                     ctemp = c__[j];
00351                     stemp = s[j];
00352                     if (ctemp != 1. || stemp != 0.) {
00353                         i__2 = *n;
00354                         for (i__ = 1; i__ <= i__2; ++i__) {
00355                             i__3 = j + i__ * a_dim1;
00356                             temp.r = a[i__3].r, temp.i = a[i__3].i;
00357                             i__3 = j + i__ * a_dim1;
00358                             i__4 = *m + i__ * a_dim1;
00359                             z__2.r = stemp * a[i__4].r, z__2.i = stemp * a[
00360                                     i__4].i;
00361                             z__3.r = ctemp * temp.r, z__3.i = ctemp * temp.i;
00362                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00363                                     z__3.i;
00364                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00365                             i__3 = *m + i__ * a_dim1;
00366                             i__4 = *m + i__ * a_dim1;
00367                             z__2.r = ctemp * a[i__4].r, z__2.i = ctemp * a[
00368                                     i__4].i;
00369                             z__3.r = stemp * temp.r, z__3.i = stemp * temp.i;
00370                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00371                                     z__3.i;
00372                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00373 /* L90: */
00374                         }
00375                     }
00376 /* L100: */
00377                 }
00378             } else if (lsame_(direct, "B")) {
00379                 for (j = *m - 1; j >= 1; --j) {
00380                     ctemp = c__[j];
00381                     stemp = s[j];
00382                     if (ctemp != 1. || stemp != 0.) {
00383                         i__1 = *n;
00384                         for (i__ = 1; i__ <= i__1; ++i__) {
00385                             i__2 = j + i__ * a_dim1;
00386                             temp.r = a[i__2].r, temp.i = a[i__2].i;
00387                             i__2 = j + i__ * a_dim1;
00388                             i__3 = *m + i__ * a_dim1;
00389                             z__2.r = stemp * a[i__3].r, z__2.i = stemp * a[
00390                                     i__3].i;
00391                             z__3.r = ctemp * temp.r, z__3.i = ctemp * temp.i;
00392                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00393                                     z__3.i;
00394                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00395                             i__2 = *m + i__ * a_dim1;
00396                             i__3 = *m + i__ * a_dim1;
00397                             z__2.r = ctemp * a[i__3].r, z__2.i = ctemp * a[
00398                                     i__3].i;
00399                             z__3.r = stemp * temp.r, z__3.i = stemp * temp.i;
00400                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00401                                     z__3.i;
00402                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00403 /* L110: */
00404                         }
00405                     }
00406 /* L120: */
00407                 }
00408             }
00409         }
00410     } else if (lsame_(side, "R")) {
00411 
00412 /*        Form A * P' */
00413 
00414         if (lsame_(pivot, "V")) {
00415             if (lsame_(direct, "F")) {
00416                 i__1 = *n - 1;
00417                 for (j = 1; j <= i__1; ++j) {
00418                     ctemp = c__[j];
00419                     stemp = s[j];
00420                     if (ctemp != 1. || stemp != 0.) {
00421                         i__2 = *m;
00422                         for (i__ = 1; i__ <= i__2; ++i__) {
00423                             i__3 = i__ + (j + 1) * a_dim1;
00424                             temp.r = a[i__3].r, temp.i = a[i__3].i;
00425                             i__3 = i__ + (j + 1) * a_dim1;
00426                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00427                             i__4 = i__ + j * a_dim1;
00428                             z__3.r = stemp * a[i__4].r, z__3.i = stemp * a[
00429                                     i__4].i;
00430                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00431                                     z__3.i;
00432                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00433                             i__3 = i__ + j * a_dim1;
00434                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00435                             i__4 = i__ + j * a_dim1;
00436                             z__3.r = ctemp * a[i__4].r, z__3.i = ctemp * a[
00437                                     i__4].i;
00438                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00439                                     z__3.i;
00440                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00441 /* L130: */
00442                         }
00443                     }
00444 /* L140: */
00445                 }
00446             } else if (lsame_(direct, "B")) {
00447                 for (j = *n - 1; j >= 1; --j) {
00448                     ctemp = c__[j];
00449                     stemp = s[j];
00450                     if (ctemp != 1. || stemp != 0.) {
00451                         i__1 = *m;
00452                         for (i__ = 1; i__ <= i__1; ++i__) {
00453                             i__2 = i__ + (j + 1) * a_dim1;
00454                             temp.r = a[i__2].r, temp.i = a[i__2].i;
00455                             i__2 = i__ + (j + 1) * a_dim1;
00456                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00457                             i__3 = i__ + j * a_dim1;
00458                             z__3.r = stemp * a[i__3].r, z__3.i = stemp * a[
00459                                     i__3].i;
00460                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00461                                     z__3.i;
00462                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00463                             i__2 = i__ + j * a_dim1;
00464                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00465                             i__3 = i__ + j * a_dim1;
00466                             z__3.r = ctemp * a[i__3].r, z__3.i = ctemp * a[
00467                                     i__3].i;
00468                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00469                                     z__3.i;
00470                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00471 /* L150: */
00472                         }
00473                     }
00474 /* L160: */
00475                 }
00476             }
00477         } else if (lsame_(pivot, "T")) {
00478             if (lsame_(direct, "F")) {
00479                 i__1 = *n;
00480                 for (j = 2; j <= i__1; ++j) {
00481                     ctemp = c__[j - 1];
00482                     stemp = s[j - 1];
00483                     if (ctemp != 1. || stemp != 0.) {
00484                         i__2 = *m;
00485                         for (i__ = 1; i__ <= i__2; ++i__) {
00486                             i__3 = i__ + j * a_dim1;
00487                             temp.r = a[i__3].r, temp.i = a[i__3].i;
00488                             i__3 = i__ + j * a_dim1;
00489                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00490                             i__4 = i__ + a_dim1;
00491                             z__3.r = stemp * a[i__4].r, z__3.i = stemp * a[
00492                                     i__4].i;
00493                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00494                                     z__3.i;
00495                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00496                             i__3 = i__ + a_dim1;
00497                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00498                             i__4 = i__ + a_dim1;
00499                             z__3.r = ctemp * a[i__4].r, z__3.i = ctemp * a[
00500                                     i__4].i;
00501                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00502                                     z__3.i;
00503                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00504 /* L170: */
00505                         }
00506                     }
00507 /* L180: */
00508                 }
00509             } else if (lsame_(direct, "B")) {
00510                 for (j = *n; j >= 2; --j) {
00511                     ctemp = c__[j - 1];
00512                     stemp = s[j - 1];
00513                     if (ctemp != 1. || stemp != 0.) {
00514                         i__1 = *m;
00515                         for (i__ = 1; i__ <= i__1; ++i__) {
00516                             i__2 = i__ + j * a_dim1;
00517                             temp.r = a[i__2].r, temp.i = a[i__2].i;
00518                             i__2 = i__ + j * a_dim1;
00519                             z__2.r = ctemp * temp.r, z__2.i = ctemp * temp.i;
00520                             i__3 = i__ + a_dim1;
00521                             z__3.r = stemp * a[i__3].r, z__3.i = stemp * a[
00522                                     i__3].i;
00523                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00524                                     z__3.i;
00525                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00526                             i__2 = i__ + a_dim1;
00527                             z__2.r = stemp * temp.r, z__2.i = stemp * temp.i;
00528                             i__3 = i__ + a_dim1;
00529                             z__3.r = ctemp * a[i__3].r, z__3.i = ctemp * a[
00530                                     i__3].i;
00531                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00532                                     z__3.i;
00533                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00534 /* L190: */
00535                         }
00536                     }
00537 /* L200: */
00538                 }
00539             }
00540         } else if (lsame_(pivot, "B")) {
00541             if (lsame_(direct, "F")) {
00542                 i__1 = *n - 1;
00543                 for (j = 1; j <= i__1; ++j) {
00544                     ctemp = c__[j];
00545                     stemp = s[j];
00546                     if (ctemp != 1. || stemp != 0.) {
00547                         i__2 = *m;
00548                         for (i__ = 1; i__ <= i__2; ++i__) {
00549                             i__3 = i__ + j * a_dim1;
00550                             temp.r = a[i__3].r, temp.i = a[i__3].i;
00551                             i__3 = i__ + j * a_dim1;
00552                             i__4 = i__ + *n * a_dim1;
00553                             z__2.r = stemp * a[i__4].r, z__2.i = stemp * a[
00554                                     i__4].i;
00555                             z__3.r = ctemp * temp.r, z__3.i = ctemp * temp.i;
00556                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00557                                     z__3.i;
00558                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00559                             i__3 = i__ + *n * a_dim1;
00560                             i__4 = i__ + *n * a_dim1;
00561                             z__2.r = ctemp * a[i__4].r, z__2.i = ctemp * a[
00562                                     i__4].i;
00563                             z__3.r = stemp * temp.r, z__3.i = stemp * temp.i;
00564                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00565                                     z__3.i;
00566                             a[i__3].r = z__1.r, a[i__3].i = z__1.i;
00567 /* L210: */
00568                         }
00569                     }
00570 /* L220: */
00571                 }
00572             } else if (lsame_(direct, "B")) {
00573                 for (j = *n - 1; j >= 1; --j) {
00574                     ctemp = c__[j];
00575                     stemp = s[j];
00576                     if (ctemp != 1. || stemp != 0.) {
00577                         i__1 = *m;
00578                         for (i__ = 1; i__ <= i__1; ++i__) {
00579                             i__2 = i__ + j * a_dim1;
00580                             temp.r = a[i__2].r, temp.i = a[i__2].i;
00581                             i__2 = i__ + j * a_dim1;
00582                             i__3 = i__ + *n * a_dim1;
00583                             z__2.r = stemp * a[i__3].r, z__2.i = stemp * a[
00584                                     i__3].i;
00585                             z__3.r = ctemp * temp.r, z__3.i = ctemp * temp.i;
00586                             z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + 
00587                                     z__3.i;
00588                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00589                             i__2 = i__ + *n * a_dim1;
00590                             i__3 = i__ + *n * a_dim1;
00591                             z__2.r = ctemp * a[i__3].r, z__2.i = ctemp * a[
00592                                     i__3].i;
00593                             z__3.r = stemp * temp.r, z__3.i = stemp * temp.i;
00594                             z__1.r = z__2.r - z__3.r, z__1.i = z__2.i - 
00595                                     z__3.i;
00596                             a[i__2].r = z__1.r, a[i__2].i = z__1.i;
00597 /* L230: */
00598                         }
00599                     }
00600 /* L240: */
00601                 }
00602             }
00603         }
00604     }
00605 
00606     return 0;
00607 
00608 /*     End of ZLASR */
00609 
00610 } /* zlasr_ */


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