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


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