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


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