drotm.c
Go to the documentation of this file.
00001 /* drotm.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 drotm_(integer *n, doublereal *dx, integer *incx, 
00017         doublereal *dy, integer *incy, doublereal *dparam)
00018 {
00019     /* Initialized data */
00020 
00021     static doublereal zero = 0.;
00022     static doublereal two = 2.;
00023 
00024     /* System generated locals */
00025     integer i__1, i__2;
00026 
00027     /* Local variables */
00028     integer i__;
00029     doublereal w, z__;
00030     integer kx, ky;
00031     doublereal dh11, dh12, dh21, dh22, dflag;
00032     integer nsteps;
00033 
00034 /*     .. Scalar Arguments .. */
00035 /*     .. */
00036 /*     .. Array Arguments .. */
00037 /*     .. */
00038 
00039 /*  Purpose */
00040 /*  ======= */
00041 
00042 /*     APPLY THE MODIFIED GIVENS TRANSFORMATION, H, TO THE 2 BY N MATRIX */
00043 
00044 /*     (DX**T) , WHERE **T INDICATES TRANSPOSE. THE ELEMENTS OF DX ARE IN */
00045 /*     (DY**T) */
00046 
00047 /*     DX(LX+I*INCX), I = 0 TO N-1, WHERE LX = 1 IF INCX .GE. 0, ELSE */
00048 /*     LX = (-INCX)*N, AND SIMILARLY FOR SY USING LY AND INCY. */
00049 /*     WITH DPARAM(1)=DFLAG, H HAS ONE OF THE FOLLOWING FORMS.. */
00050 
00051 /*     DFLAG=-1.D0     DFLAG=0.D0        DFLAG=1.D0     DFLAG=-2.D0 */
00052 
00053 /*       (DH11  DH12)    (1.D0  DH12)    (DH11  1.D0)    (1.D0  0.D0) */
00054 /*     H=(          )    (          )    (          )    (          ) */
00055 /*       (DH21  DH22),   (DH21  1.D0),   (-1.D0 DH22),   (0.D0  1.D0). */
00056 /*     SEE DROTMG FOR A DESCRIPTION OF DATA STORAGE IN DPARAM. */
00057 
00058 /*  Arguments */
00059 /*  ========= */
00060 
00061 /*  N      (input) INTEGER */
00062 /*         number of elements in input vector(s) */
00063 
00064 /*  DX     (input/output) DOUBLE PRECISION array, dimension N */
00065 /*         double precision vector with N elements */
00066 
00067 /*  INCX   (input) INTEGER */
00068 /*         storage spacing between elements of DX */
00069 
00070 /*  DY     (input/output) DOUBLE PRECISION array, dimension N */
00071 /*         double precision vector with N elements */
00072 
00073 /*  INCY   (input) INTEGER */
00074 /*         storage spacing between elements of DY */
00075 
00076 /*  DPARAM (input/output)  DOUBLE PRECISION array, dimension 5 */
00077 /*     DPARAM(1)=DFLAG */
00078 /*     DPARAM(2)=DH11 */
00079 /*     DPARAM(3)=DH21 */
00080 /*     DPARAM(4)=DH12 */
00081 /*     DPARAM(5)=DH22 */
00082 
00083 /*  ===================================================================== */
00084 
00085 /*     .. Local Scalars .. */
00086 /*     .. */
00087 /*     .. Data statements .. */
00088     /* Parameter adjustments */
00089     --dparam;
00090     --dy;
00091     --dx;
00092 
00093     /* Function Body */
00094 /*     .. */
00095 
00096     dflag = dparam[1];
00097     if (*n <= 0 || dflag + two == zero) {
00098         goto L140;
00099     }
00100     if (! (*incx == *incy && *incx > 0)) {
00101         goto L70;
00102     }
00103 
00104     nsteps = *n * *incx;
00105     if (dflag < 0.) {
00106         goto L50;
00107     } else if (dflag == 0) {
00108         goto L10;
00109     } else {
00110         goto L30;
00111     }
00112 L10:
00113     dh12 = dparam[4];
00114     dh21 = dparam[3];
00115     i__1 = nsteps;
00116     i__2 = *incx;
00117     for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
00118         w = dx[i__];
00119         z__ = dy[i__];
00120         dx[i__] = w + z__ * dh12;
00121         dy[i__] = w * dh21 + z__;
00122 /* L20: */
00123     }
00124     goto L140;
00125 L30:
00126     dh11 = dparam[2];
00127     dh22 = dparam[5];
00128     i__2 = nsteps;
00129     i__1 = *incx;
00130     for (i__ = 1; i__1 < 0 ? i__ >= i__2 : i__ <= i__2; i__ += i__1) {
00131         w = dx[i__];
00132         z__ = dy[i__];
00133         dx[i__] = w * dh11 + z__;
00134         dy[i__] = -w + dh22 * z__;
00135 /* L40: */
00136     }
00137     goto L140;
00138 L50:
00139     dh11 = dparam[2];
00140     dh12 = dparam[4];
00141     dh21 = dparam[3];
00142     dh22 = dparam[5];
00143     i__1 = nsteps;
00144     i__2 = *incx;
00145     for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
00146         w = dx[i__];
00147         z__ = dy[i__];
00148         dx[i__] = w * dh11 + z__ * dh12;
00149         dy[i__] = w * dh21 + z__ * dh22;
00150 /* L60: */
00151     }
00152     goto L140;
00153 L70:
00154     kx = 1;
00155     ky = 1;
00156     if (*incx < 0) {
00157         kx = (1 - *n) * *incx + 1;
00158     }
00159     if (*incy < 0) {
00160         ky = (1 - *n) * *incy + 1;
00161     }
00162 
00163     if (dflag < 0.) {
00164         goto L120;
00165     } else if (dflag == 0) {
00166         goto L80;
00167     } else {
00168         goto L100;
00169     }
00170 L80:
00171     dh12 = dparam[4];
00172     dh21 = dparam[3];
00173     i__2 = *n;
00174     for (i__ = 1; i__ <= i__2; ++i__) {
00175         w = dx[kx];
00176         z__ = dy[ky];
00177         dx[kx] = w + z__ * dh12;
00178         dy[ky] = w * dh21 + z__;
00179         kx += *incx;
00180         ky += *incy;
00181 /* L90: */
00182     }
00183     goto L140;
00184 L100:
00185     dh11 = dparam[2];
00186     dh22 = dparam[5];
00187     i__2 = *n;
00188     for (i__ = 1; i__ <= i__2; ++i__) {
00189         w = dx[kx];
00190         z__ = dy[ky];
00191         dx[kx] = w * dh11 + z__;
00192         dy[ky] = -w + dh22 * z__;
00193         kx += *incx;
00194         ky += *incy;
00195 /* L110: */
00196     }
00197     goto L140;
00198 L120:
00199     dh11 = dparam[2];
00200     dh12 = dparam[4];
00201     dh21 = dparam[3];
00202     dh22 = dparam[5];
00203     i__2 = *n;
00204     for (i__ = 1; i__ <= i__2; ++i__) {
00205         w = dx[kx];
00206         z__ = dy[ky];
00207         dx[kx] = w * dh11 + z__ * dh12;
00208         dy[ky] = w * dh21 + z__ * dh22;
00209         kx += *incx;
00210         ky += *incy;
00211 /* L130: */
00212     }
00213 L140:
00214     return 0;
00215 } /* drotm_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:48