zaxpy.c
Go to the documentation of this file.
00001 /* zaxpy.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 zaxpy_(integer *n, doublecomplex *za, doublecomplex *zx, 
00017         integer *incx, doublecomplex *zy, integer *incy)
00018 {
00019     /* System generated locals */
00020     integer i__1, i__2, i__3, i__4;
00021     doublecomplex z__1, z__2;
00022 
00023     /* Local variables */
00024     integer i__, ix, iy;
00025     extern doublereal dcabs1_(doublecomplex *);
00026 
00027 /*     .. Scalar Arguments .. */
00028 /*     .. */
00029 /*     .. Array Arguments .. */
00030 /*     .. */
00031 
00032 /*  Purpose */
00033 /*  ======= */
00034 
00035 /*     constant times a vector plus a vector. */
00036 /*     jack dongarra, 3/11/78. */
00037 /*     modified 12/3/93, array(1) declarations changed to array(*) */
00038 
00039 /*     .. Local Scalars .. */
00040 /*     .. */
00041 /*     .. External Functions .. */
00042 /*     .. */
00043     /* Parameter adjustments */
00044     --zy;
00045     --zx;
00046 
00047     /* Function Body */
00048     if (*n <= 0) {
00049         return 0;
00050     }
00051     if (dcabs1_(za) == 0.) {
00052         return 0;
00053     }
00054     if (*incx == 1 && *incy == 1) {
00055         goto L20;
00056     }
00057 
00058 /*        code for unequal increments or equal increments */
00059 /*          not equal to 1 */
00060 
00061     ix = 1;
00062     iy = 1;
00063     if (*incx < 0) {
00064         ix = (-(*n) + 1) * *incx + 1;
00065     }
00066     if (*incy < 0) {
00067         iy = (-(*n) + 1) * *incy + 1;
00068     }
00069     i__1 = *n;
00070     for (i__ = 1; i__ <= i__1; ++i__) {
00071         i__2 = iy;
00072         i__3 = iy;
00073         i__4 = ix;
00074         z__2.r = za->r * zx[i__4].r - za->i * zx[i__4].i, z__2.i = za->r * zx[
00075                 i__4].i + za->i * zx[i__4].r;
00076         z__1.r = zy[i__3].r + z__2.r, z__1.i = zy[i__3].i + z__2.i;
00077         zy[i__2].r = z__1.r, zy[i__2].i = z__1.i;
00078         ix += *incx;
00079         iy += *incy;
00080 /* L10: */
00081     }
00082     return 0;
00083 
00084 /*        code for both increments equal to 1 */
00085 
00086 L20:
00087     i__1 = *n;
00088     for (i__ = 1; i__ <= i__1; ++i__) {
00089         i__2 = i__;
00090         i__3 = i__;
00091         i__4 = i__;
00092         z__2.r = za->r * zx[i__4].r - za->i * zx[i__4].i, z__2.i = za->r * zx[
00093                 i__4].i + za->i * zx[i__4].r;
00094         z__1.r = zy[i__3].r + z__2.r, z__1.i = zy[i__3].i + z__2.i;
00095         zy[i__2].r = z__1.r, zy[i__2].i = z__1.i;
00096 /* L30: */
00097     }
00098     return 0;
00099 } /* zaxpy_ */


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