clacrt.c
Go to the documentation of this file.
00001 /* clacrt.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 clacrt_(integer *n, complex *cx, integer *incx, complex *
00017         cy, integer *incy, complex *c__, complex *s)
00018 {
00019     /* System generated locals */
00020     integer i__1, i__2, i__3, i__4;
00021     complex q__1, q__2, q__3;
00022 
00023     /* Local variables */
00024     integer i__, ix, iy;
00025     complex ctemp;
00026 
00027 
00028 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00029 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00030 /*     November 2006 */
00031 
00032 /*     .. Scalar Arguments .. */
00033 /*     .. */
00034 /*     .. Array Arguments .. */
00035 /*     .. */
00036 
00037 /*  Purpose */
00038 /*  ======= */
00039 
00040 /*  CLACRT performs the operation */
00041 
00042 /*     (  c  s )( x )  ==> ( x ) */
00043 /*     ( -s  c )( y )      ( y ) */
00044 
00045 /*  where c and s are complex and the vectors x and y are complex. */
00046 
00047 /*  Arguments */
00048 /*  ========= */
00049 
00050 /*  N       (input) INTEGER */
00051 /*          The number of elements in the vectors CX and CY. */
00052 
00053 /*  CX      (input/output) COMPLEX array, dimension (N) */
00054 /*          On input, the vector x. */
00055 /*          On output, CX is overwritten with c*x + s*y. */
00056 
00057 /*  INCX    (input) INTEGER */
00058 /*          The increment between successive values of CX.  INCX <> 0. */
00059 
00060 /*  CY      (input/output) COMPLEX array, dimension (N) */
00061 /*          On input, the vector y. */
00062 /*          On output, CY is overwritten with -s*x + c*y. */
00063 
00064 /*  INCY    (input) INTEGER */
00065 /*          The increment between successive values of CY.  INCY <> 0. */
00066 
00067 /*  C       (input) COMPLEX */
00068 /*  S       (input) COMPLEX */
00069 /*          C and S define the matrix */
00070 /*             [  C   S  ]. */
00071 /*             [ -S   C  ] */
00072 
00073 /* ===================================================================== */
00074 
00075 /*     .. Local Scalars .. */
00076 /*     .. */
00077 /*     .. Executable Statements .. */
00078 
00079     /* Parameter adjustments */
00080     --cy;
00081     --cx;
00082 
00083     /* Function Body */
00084     if (*n <= 0) {
00085         return 0;
00086     }
00087     if (*incx == 1 && *incy == 1) {
00088         goto L20;
00089     }
00090 
00091 /*     Code for unequal increments or equal increments not equal to 1 */
00092 
00093     ix = 1;
00094     iy = 1;
00095     if (*incx < 0) {
00096         ix = (-(*n) + 1) * *incx + 1;
00097     }
00098     if (*incy < 0) {
00099         iy = (-(*n) + 1) * *incy + 1;
00100     }
00101     i__1 = *n;
00102     for (i__ = 1; i__ <= i__1; ++i__) {
00103         i__2 = ix;
00104         q__2.r = c__->r * cx[i__2].r - c__->i * cx[i__2].i, q__2.i = c__->r * 
00105                 cx[i__2].i + c__->i * cx[i__2].r;
00106         i__3 = iy;
00107         q__3.r = s->r * cy[i__3].r - s->i * cy[i__3].i, q__3.i = s->r * cy[
00108                 i__3].i + s->i * cy[i__3].r;
00109         q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00110         ctemp.r = q__1.r, ctemp.i = q__1.i;
00111         i__2 = iy;
00112         i__3 = iy;
00113         q__2.r = c__->r * cy[i__3].r - c__->i * cy[i__3].i, q__2.i = c__->r * 
00114                 cy[i__3].i + c__->i * cy[i__3].r;
00115         i__4 = ix;
00116         q__3.r = s->r * cx[i__4].r - s->i * cx[i__4].i, q__3.i = s->r * cx[
00117                 i__4].i + s->i * cx[i__4].r;
00118         q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
00119         cy[i__2].r = q__1.r, cy[i__2].i = q__1.i;
00120         i__2 = ix;
00121         cx[i__2].r = ctemp.r, cx[i__2].i = ctemp.i;
00122         ix += *incx;
00123         iy += *incy;
00124 /* L10: */
00125     }
00126     return 0;
00127 
00128 /*     Code for both increments equal to 1 */
00129 
00130 L20:
00131     i__1 = *n;
00132     for (i__ = 1; i__ <= i__1; ++i__) {
00133         i__2 = i__;
00134         q__2.r = c__->r * cx[i__2].r - c__->i * cx[i__2].i, q__2.i = c__->r * 
00135                 cx[i__2].i + c__->i * cx[i__2].r;
00136         i__3 = i__;
00137         q__3.r = s->r * cy[i__3].r - s->i * cy[i__3].i, q__3.i = s->r * cy[
00138                 i__3].i + s->i * cy[i__3].r;
00139         q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
00140         ctemp.r = q__1.r, ctemp.i = q__1.i;
00141         i__2 = i__;
00142         i__3 = i__;
00143         q__2.r = c__->r * cy[i__3].r - c__->i * cy[i__3].i, q__2.i = c__->r * 
00144                 cy[i__3].i + c__->i * cy[i__3].r;
00145         i__4 = i__;
00146         q__3.r = s->r * cx[i__4].r - s->i * cx[i__4].i, q__3.i = s->r * cx[
00147                 i__4].i + s->i * cx[i__4].r;
00148         q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
00149         cy[i__2].r = q__1.r, cy[i__2].i = q__1.i;
00150         i__2 = i__;
00151         cx[i__2].r = ctemp.r, cx[i__2].i = ctemp.i;
00152 /* L30: */
00153     }
00154     return 0;
00155 } /* clacrt_ */


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