00001 /* cla_wwaddw.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 cla_wwaddw__(integer *n, complex *x, complex *y, complex 00017 *w) 00018 { 00019 /* System generated locals */ 00020 integer i__1, i__2, i__3, i__4, i__5; 00021 complex q__1, q__2, q__3; 00022 00023 /* Local variables */ 00024 integer i__; 00025 complex s; 00026 00027 00028 /* -- LAPACK routine (version 3.2) -- */ 00029 /* -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */ 00030 /* -- Jason Riedy of Univ. of California Berkeley. -- */ 00031 /* -- November 2008 -- */ 00032 00033 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 00034 /* -- Univ. of California Berkeley and NAG Ltd. -- */ 00035 00036 /* .. */ 00037 /* .. Scalar Arguments .. */ 00038 /* .. */ 00039 /* .. Array Arguments .. */ 00040 /* .. */ 00041 00042 /* Purpose */ 00043 /* ======= */ 00044 00045 /* CLA_WWADDW adds a vector W into a doubled-single vector (X, Y). */ 00046 00047 /* This works for all extant IBM's hex and binary floating point */ 00048 /* arithmetics, but not for decimal. */ 00049 00050 /* Arguments */ 00051 /* ========= */ 00052 00053 /* N (input) INTEGER */ 00054 /* The length of vectors X, Y, and W. */ 00055 00056 /* X, Y (input/output) COMPLEX array, length N */ 00057 /* The doubled-single accumulation vector. */ 00058 00059 /* W (input) COMPLEX array, length N */ 00060 /* The vector to be added. */ 00061 /* .. */ 00062 /* .. Local Scalars .. */ 00063 /* .. */ 00064 /* .. Executable Statements .. */ 00065 00066 /* Parameter adjustments */ 00067 --w; 00068 --y; 00069 --x; 00070 00071 /* Function Body */ 00072 i__1 = *n; 00073 for (i__ = 1; i__ <= i__1; ++i__) { 00074 i__2 = i__; 00075 i__3 = i__; 00076 q__1.r = x[i__2].r + w[i__3].r, q__1.i = x[i__2].i + w[i__3].i; 00077 s.r = q__1.r, s.i = q__1.i; 00078 q__2.r = s.r + s.r, q__2.i = s.i + s.i; 00079 q__1.r = q__2.r - s.r, q__1.i = q__2.i - s.i; 00080 s.r = q__1.r, s.i = q__1.i; 00081 i__2 = i__; 00082 i__3 = i__; 00083 q__3.r = x[i__3].r - s.r, q__3.i = x[i__3].i - s.i; 00084 i__4 = i__; 00085 q__2.r = q__3.r + w[i__4].r, q__2.i = q__3.i + w[i__4].i; 00086 i__5 = i__; 00087 q__1.r = q__2.r + y[i__5].r, q__1.i = q__2.i + y[i__5].i; 00088 y[i__2].r = q__1.r, y[i__2].i = q__1.i; 00089 i__2 = i__; 00090 x[i__2].r = s.r, x[i__2].i = s.i; 00091 /* L10: */ 00092 } 00093 return 0; 00094 } /* cla_wwaddw__ */