Debian Codegraph @

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

raw
1 /* ./src_f77/drot.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 drot_(integer *n, doublereal *dx, integer *incx,
9 doublereal *dy, integer *incy, doublereal *c__, doublereal *s)
10 {
11 /* System generated locals */
12 integer i__1;
13
14 /* Local variables */
15 static integer i__, ix, iy;
16 static doublereal dtemp;
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 --dy;
26 --dx;
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 dtemp = *c__ * dx[ix] + *s * dy[iy];
50 dy[iy] = *c__ * dy[iy] - *s * dx[ix];
51 dx[ix] = dtemp;
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 dtemp = *c__ * dx[i__] + *s * dy[i__];
64 dy[i__] = *c__ * dy[i__] - *s * dx[i__];
65 dx[i__] = dtemp;
66 /* L30: */
67 }
68 return 0;
69 } /* drot_ */
70