clar2v.c
Go to the documentation of this file.
00001 /* clar2v.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 clar2v_(integer *n, complex *x, complex *y, complex *z__, 
00017          integer *incx, real *c__, complex *s, integer *incc)
00018 {
00019     /* System generated locals */
00020     integer i__1, i__2;
00021     real r__1;
00022     complex q__1, q__2, q__3, q__4, q__5;
00023 
00024     /* Builtin functions */
00025     double r_imag(complex *);
00026     void r_cnjg(complex *, complex *);
00027 
00028     /* Local variables */
00029     integer i__;
00030     complex t2, t3, t4;
00031     real t5, t6;
00032     integer ic;
00033     real ci;
00034     complex si;
00035     integer ix;
00036     real xi, yi;
00037     complex zi;
00038     real t1i, t1r, sii, zii, sir, zir;
00039 
00040 
00041 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00042 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00043 /*     November 2006 */
00044 
00045 /*     .. Scalar Arguments .. */
00046 /*     .. */
00047 /*     .. Array Arguments .. */
00048 /*     .. */
00049 
00050 /*  Purpose */
00051 /*  ======= */
00052 
00053 /*  CLAR2V applies a vector of complex plane rotations with real cosines */
00054 /*  from both sides to a sequence of 2-by-2 complex Hermitian matrices, */
00055 /*  defined by the elements of the vectors x, y and z. For i = 1,2,...,n */
00056 
00057 /*     (       x(i)  z(i) ) := */
00058 /*     ( conjg(z(i)) y(i) ) */
00059 
00060 /*       (  c(i) conjg(s(i)) ) (       x(i)  z(i) ) ( c(i) -conjg(s(i)) ) */
00061 /*       ( -s(i)       c(i)  ) ( conjg(z(i)) y(i) ) ( s(i)        c(i)  ) */
00062 
00063 /*  Arguments */
00064 /*  ========= */
00065 
00066 /*  N       (input) INTEGER */
00067 /*          The number of plane rotations to be applied. */
00068 
00069 /*  X       (input/output) COMPLEX array, dimension (1+(N-1)*INCX) */
00070 /*          The vector x; the elements of x are assumed to be real. */
00071 
00072 /*  Y       (input/output) COMPLEX array, dimension (1+(N-1)*INCX) */
00073 /*          The vector y; the elements of y are assumed to be real. */
00074 
00075 /*  Z       (input/output) COMPLEX array, dimension (1+(N-1)*INCX) */
00076 /*          The vector z. */
00077 
00078 /*  INCX    (input) INTEGER */
00079 /*          The increment between elements of X, Y and Z. INCX > 0. */
00080 
00081 /*  C       (input) REAL array, dimension (1+(N-1)*INCC) */
00082 /*          The cosines of the plane rotations. */
00083 
00084 /*  S       (input) COMPLEX array, dimension (1+(N-1)*INCC) */
00085 /*          The sines of the plane rotations. */
00086 
00087 /*  INCC    (input) INTEGER */
00088 /*          The increment between elements of C and S. INCC > 0. */
00089 
00090 /*  ===================================================================== */
00091 
00092 /*     .. Local Scalars .. */
00093 /*     .. */
00094 /*     .. Intrinsic Functions .. */
00095 /*     .. */
00096 /*     .. Executable Statements .. */
00097 
00098     /* Parameter adjustments */
00099     --s;
00100     --c__;
00101     --z__;
00102     --y;
00103     --x;
00104 
00105     /* Function Body */
00106     ix = 1;
00107     ic = 1;
00108     i__1 = *n;
00109     for (i__ = 1; i__ <= i__1; ++i__) {
00110         i__2 = ix;
00111         xi = x[i__2].r;
00112         i__2 = ix;
00113         yi = y[i__2].r;
00114         i__2 = ix;
00115         zi.r = z__[i__2].r, zi.i = z__[i__2].i;
00116         zir = zi.r;
00117         zii = r_imag(&zi);
00118         ci = c__[ic];
00119         i__2 = ic;
00120         si.r = s[i__2].r, si.i = s[i__2].i;
00121         sir = si.r;
00122         sii = r_imag(&si);
00123         t1r = sir * zir - sii * zii;
00124         t1i = sir * zii + sii * zir;
00125         q__1.r = ci * zi.r, q__1.i = ci * zi.i;
00126         t2.r = q__1.r, t2.i = q__1.i;
00127         r_cnjg(&q__3, &si);
00128         q__2.r = xi * q__3.r, q__2.i = xi * q__3.i;
00129         q__1.r = t2.r - q__2.r, q__1.i = t2.i - q__2.i;
00130         t3.r = q__1.r, t3.i = q__1.i;
00131         r_cnjg(&q__2, &t2);
00132         q__3.r = yi * si.r, q__3.i = yi * si.i;
00133         q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00134         t4.r = q__1.r, t4.i = q__1.i;
00135         t5 = ci * xi + t1r;
00136         t6 = ci * yi - t1r;
00137         i__2 = ix;
00138         r__1 = ci * t5 + (sir * t4.r + sii * r_imag(&t4));
00139         x[i__2].r = r__1, x[i__2].i = 0.f;
00140         i__2 = ix;
00141         r__1 = ci * t6 - (sir * t3.r - sii * r_imag(&t3));
00142         y[i__2].r = r__1, y[i__2].i = 0.f;
00143         i__2 = ix;
00144         q__2.r = ci * t3.r, q__2.i = ci * t3.i;
00145         r_cnjg(&q__4, &si);
00146         q__5.r = t6, q__5.i = t1i;
00147         q__3.r = q__4.r * q__5.r - q__4.i * q__5.i, q__3.i = q__4.r * q__5.i 
00148                 + q__4.i * q__5.r;
00149         q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00150         z__[i__2].r = q__1.r, z__[i__2].i = q__1.i;
00151         ix += *incx;
00152         ic += *incc;
00153 /* L10: */
00154     }
00155     return 0;
00156 
00157 /*     End of CLAR2V */
00158 
00159 } /* clar2v_ */


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