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


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