00001 /* clartv.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 clartv_(integer *n, complex *x, integer *incx, complex * 00017 y, integer *incy, real *c__, complex *s, integer *incc) 00018 { 00019 /* System generated locals */ 00020 integer i__1, i__2, i__3, i__4; 00021 complex q__1, q__2, q__3, q__4; 00022 00023 /* Builtin functions */ 00024 void r_cnjg(complex *, complex *); 00025 00026 /* Local variables */ 00027 integer i__, ic, ix, iy; 00028 complex xi, yi; 00029 00030 00031 /* -- LAPACK auxiliary routine (version 3.2) -- */ 00032 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 00033 /* November 2006 */ 00034 00035 /* .. Scalar Arguments .. */ 00036 /* .. */ 00037 /* .. Array Arguments .. */ 00038 /* .. */ 00039 00040 /* Purpose */ 00041 /* ======= */ 00042 00043 /* CLARTV applies a vector of complex plane rotations with real cosines */ 00044 /* to elements of the complex vectors x and y. For i = 1,2,...,n */ 00045 00046 /* ( x(i) ) := ( c(i) s(i) ) ( x(i) ) */ 00047 /* ( y(i) ) ( -conjg(s(i)) c(i) ) ( y(i) ) */ 00048 00049 /* Arguments */ 00050 /* ========= */ 00051 00052 /* N (input) INTEGER */ 00053 /* The number of plane rotations to be applied. */ 00054 00055 /* X (input/output) COMPLEX array, dimension (1+(N-1)*INCX) */ 00056 /* The vector x. */ 00057 00058 /* INCX (input) INTEGER */ 00059 /* The increment between elements of X. INCX > 0. */ 00060 00061 /* Y (input/output) COMPLEX array, dimension (1+(N-1)*INCY) */ 00062 /* The vector y. */ 00063 00064 /* INCY (input) INTEGER */ 00065 /* The increment between elements of Y. INCY > 0. */ 00066 00067 /* C (input) REAL array, dimension (1+(N-1)*INCC) */ 00068 /* The cosines of the plane rotations. */ 00069 00070 /* S (input) COMPLEX array, dimension (1+(N-1)*INCC) */ 00071 /* The sines of the plane rotations. */ 00072 00073 /* INCC (input) INTEGER */ 00074 /* The increment between elements of C and S. INCC > 0. */ 00075 00076 /* ===================================================================== */ 00077 00078 /* .. Local Scalars .. */ 00079 /* .. */ 00080 /* .. Intrinsic Functions .. */ 00081 /* .. */ 00082 /* .. Executable Statements .. */ 00083 00084 /* Parameter adjustments */ 00085 --s; 00086 --c__; 00087 --y; 00088 --x; 00089 00090 /* Function Body */ 00091 ix = 1; 00092 iy = 1; 00093 ic = 1; 00094 i__1 = *n; 00095 for (i__ = 1; i__ <= i__1; ++i__) { 00096 i__2 = ix; 00097 xi.r = x[i__2].r, xi.i = x[i__2].i; 00098 i__2 = iy; 00099 yi.r = y[i__2].r, yi.i = y[i__2].i; 00100 i__2 = ix; 00101 i__3 = ic; 00102 q__2.r = c__[i__3] * xi.r, q__2.i = c__[i__3] * xi.i; 00103 i__4 = ic; 00104 q__3.r = s[i__4].r * yi.r - s[i__4].i * yi.i, q__3.i = s[i__4].r * 00105 yi.i + s[i__4].i * yi.r; 00106 q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; 00107 x[i__2].r = q__1.r, x[i__2].i = q__1.i; 00108 i__2 = iy; 00109 i__3 = ic; 00110 q__2.r = c__[i__3] * yi.r, q__2.i = c__[i__3] * yi.i; 00111 r_cnjg(&q__4, &s[ic]); 00112 q__3.r = q__4.r * xi.r - q__4.i * xi.i, q__3.i = q__4.r * xi.i + 00113 q__4.i * xi.r; 00114 q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i; 00115 y[i__2].r = q__1.r, y[i__2].i = q__1.i; 00116 ix += *incx; 00117 iy += *incy; 00118 ic += *incc; 00119 /* L10: */ 00120 } 00121 return 0; 00122 00123 /* End of CLARTV */ 00124 00125 } /* clartv_ */