slar2v.c
Go to the documentation of this file.
00001 /* slar2v.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 slar2v_(integer *n, real *x, real *y, real *z__, integer 
00017         *incx, real *c__, real *s, integer *incc)
00018 {
00019     /* System generated locals */
00020     integer i__1;
00021 
00022     /* Local variables */
00023     integer i__;
00024     real t1, t2, t3, t4, t5, t6;
00025     integer ic;
00026     real ci, si;
00027     integer ix;
00028     real xi, yi, zi;
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 /*  SLAR2V applies a vector of real plane rotations from both sides to */
00044 /*  a sequence of 2-by-2 real symmetric matrices, defined by the elements */
00045 /*  of the vectors x, y and z. For i = 1,2,...,n */
00046 
00047 /*     ( x(i)  z(i) ) := (  c(i)  s(i) ) ( x(i)  z(i) ) ( c(i) -s(i) ) */
00048 /*     ( z(i)  y(i) )    ( -s(i)  c(i) ) ( z(i)  y(i) ) ( s(i)  c(i) ) */
00049 
00050 /*  Arguments */
00051 /*  ========= */
00052 
00053 /*  N       (input) INTEGER */
00054 /*          The number of plane rotations to be applied. */
00055 
00056 /*  X       (input/output) REAL array, */
00057 /*                         dimension (1+(N-1)*INCX) */
00058 /*          The vector x. */
00059 
00060 /*  Y       (input/output) REAL array, */
00061 /*                         dimension (1+(N-1)*INCX) */
00062 /*          The vector y. */
00063 
00064 /*  Z       (input/output) REAL array, */
00065 /*                         dimension (1+(N-1)*INCX) */
00066 /*          The vector z. */
00067 
00068 /*  INCX    (input) INTEGER */
00069 /*          The increment between elements of X, Y and Z. INCX > 0. */
00070 
00071 /*  C       (input) REAL array, dimension (1+(N-1)*INCC) */
00072 /*          The cosines of the plane rotations. */
00073 
00074 /*  S       (input) REAL array, dimension (1+(N-1)*INCC) */
00075 /*          The sines of the plane rotations. */
00076 
00077 /*  INCC    (input) INTEGER */
00078 /*          The increment between elements of C and S. INCC > 0. */
00079 
00080 /*  ===================================================================== */
00081 
00082 /*     .. Local Scalars .. */
00083 /*     .. */
00084 /*     .. Executable Statements .. */
00085 
00086     /* Parameter adjustments */
00087     --s;
00088     --c__;
00089     --z__;
00090     --y;
00091     --x;
00092 
00093     /* Function Body */
00094     ix = 1;
00095     ic = 1;
00096     i__1 = *n;
00097     for (i__ = 1; i__ <= i__1; ++i__) {
00098         xi = x[ix];
00099         yi = y[ix];
00100         zi = z__[ix];
00101         ci = c__[ic];
00102         si = s[ic];
00103         t1 = si * zi;
00104         t2 = ci * zi;
00105         t3 = t2 - si * xi;
00106         t4 = t2 + si * yi;
00107         t5 = ci * xi + t1;
00108         t6 = ci * yi - t1;
00109         x[ix] = ci * t5 + si * t4;
00110         y[ix] = ci * t6 - si * t3;
00111         z__[ix] = ci * t4 - si * t5;
00112         ix += *incx;
00113         ic += *incc;
00114 /* L10: */
00115     }
00116 
00117 /*     End of SLAR2V */
00118 
00119     return 0;
00120 } /* slar2v_ */


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