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


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