srot.c
Go to the documentation of this file.
00001 /* srot.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 srot_(integer *n, real *sx, integer *incx, real *sy, 
00017         integer *incy, real *c__, real *s)
00018 {
00019     /* System generated locals */
00020     integer i__1;
00021 
00022     /* Local variables */
00023     integer i__, ix, iy;
00024     real stemp;
00025 
00026 /*     .. Scalar Arguments .. */
00027 /*     .. */
00028 /*     .. Array Arguments .. */
00029 /*     .. */
00030 
00031 /*  Purpose */
00032 /*  ======= */
00033 
00034 /*     applies a plane rotation. */
00035 
00036 /*  Further Details */
00037 /*  =============== */
00038 
00039 /*     jack dongarra, linpack, 3/11/78. */
00040 /*     modified 12/3/93, array(1) declarations changed to array(*) */
00041 
00042 
00043 /*     .. Local Scalars .. */
00044 /*     .. */
00045     /* Parameter adjustments */
00046     --sy;
00047     --sx;
00048 
00049     /* Function Body */
00050     if (*n <= 0) {
00051         return 0;
00052     }
00053     if (*incx == 1 && *incy == 1) {
00054         goto L20;
00055     }
00056 
00057 /*       code for unequal increments or equal increments not equal */
00058 /*         to 1 */
00059 
00060     ix = 1;
00061     iy = 1;
00062     if (*incx < 0) {
00063         ix = (-(*n) + 1) * *incx + 1;
00064     }
00065     if (*incy < 0) {
00066         iy = (-(*n) + 1) * *incy + 1;
00067     }
00068     i__1 = *n;
00069     for (i__ = 1; i__ <= i__1; ++i__) {
00070         stemp = *c__ * sx[ix] + *s * sy[iy];
00071         sy[iy] = *c__ * sy[iy] - *s * sx[ix];
00072         sx[ix] = stemp;
00073         ix += *incx;
00074         iy += *incy;
00075 /* L10: */
00076     }
00077     return 0;
00078 
00079 /*       code for both increments equal to 1 */
00080 
00081 L20:
00082     i__1 = *n;
00083     for (i__ = 1; i__ <= i__1; ++i__) {
00084         stemp = *c__ * sx[i__] + *s * sy[i__];
00085         sy[i__] = *c__ * sy[i__] - *s * sx[i__];
00086         sx[i__] = stemp;
00087 /* L30: */
00088     }
00089     return 0;
00090 } /* srot_ */


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