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


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