Debian Codegraph @

debian/external_deps/fetk/punc/src/blas/srot.c

raw
1 /* ./src_f77/srot.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 /* Subroutine */ int srot_(integer *n, real *sx, integer *incx, real *sy,
9 integer *incy, real *c__, real *s)
10 {
11 /* System generated locals */
12 integer i__1;
13
14 /* Local variables */
15 static integer i__, ix, iy;
16 static real stemp;
17
18
19 /* applies a plane rotation. */
20 /* jack dongarra, linpack, 3/11/78. */
21 /* modified 12/3/93, array(1) declarations changed to array(*) */
22
23
24 /* Parameter adjustments */
25 --sy;
26 --sx;
27
28 /* Function Body */
29 if (*n <= 0) {
30 return 0;
31 }
32 if (*incx == 1 && *incy == 1) {
33 goto L20;
34 }
35
36 /* code for unequal increments or equal increments not equal */
37 /* to 1 */
38
39 ix = 1;
40 iy = 1;
41 if (*incx < 0) {
42 ix = (-(*n) + 1) * *incx + 1;
43 }
44 if (*incy < 0) {
45 iy = (-(*n) + 1) * *incy + 1;
46 }
47 i__1 = *n;
48 for (i__ = 1; i__ <= i__1; ++i__) {
49 stemp = *c__ * sx[ix] + *s * sy[iy];
50 sy[iy] = *c__ * sy[iy] - *s * sx[ix];
51 sx[ix] = stemp;
52 ix += *incx;
53 iy += *incy;
54 /* L10: */
55 }
56 return 0;
57
58 /* code for both increments equal to 1 */
59
60 L20:
61 i__1 = *n;
62 for (i__ = 1; i__ <= i__1; ++i__) {
63 stemp = *c__ * sx[i__] + *s * sy[i__];
64 sy[i__] = *c__ * sy[i__] - *s * sx[i__];
65 sx[i__] = stemp;
66 /* L30: */
67 }
68 return 0;
69 } /* srot_ */
70