Update to 2.0.0 tree from current Fremantle build
[opencv] / 3rdparty / lapack / srot.c
1 #include "clapack.h"
2
3 /* Subroutine */ int srot_(integer *n, real *sx, integer *incx, real *sy, 
4         integer *incy, real *c__, real *s)
5 {
6     /* System generated locals */
7     integer i__1;
8
9     /* Local variables */
10     integer i__, ix, iy;
11     real stemp;
12
13 /*     .. Scalar Arguments .. */
14 /*     .. */
15 /*     .. Array Arguments .. */
16 /*     .. */
17
18 /*  Purpose */
19 /*  ======= */
20
21 /*     applies a plane rotation. */
22
23 /*  Further Details */
24 /*  =============== */
25
26 /*     jack dongarra, linpack, 3/11/78. */
27 /*     modified 12/3/93, array(1) declarations changed to array(*) */
28
29
30 /*     .. Local Scalars .. */
31 /*     .. */
32     /* Parameter adjustments */
33     --sy;
34     --sx;
35
36     /* Function Body */
37     if (*n <= 0) {
38         return 0;
39     }
40     if (*incx == 1 && *incy == 1) {
41         goto L20;
42     }
43
44 /*       code for unequal increments or equal increments not equal */
45 /*         to 1 */
46
47     ix = 1;
48     iy = 1;
49     if (*incx < 0) {
50         ix = (-(*n) + 1) * *incx + 1;
51     }
52     if (*incy < 0) {
53         iy = (-(*n) + 1) * *incy + 1;
54     }
55     i__1 = *n;
56     for (i__ = 1; i__ <= i__1; ++i__) {
57         stemp = *c__ * sx[ix] + *s * sy[iy];
58         sy[iy] = *c__ * sy[iy] - *s * sx[ix];
59         sx[ix] = stemp;
60         ix += *incx;
61         iy += *incy;
62 /* L10: */
63     }
64     return 0;
65
66 /*       code for both increments equal to 1 */
67
68 L20:
69     i__1 = *n;
70     for (i__ = 1; i__ <= i__1; ++i__) {
71         stemp = *c__ * sx[i__] + *s * sy[i__];
72         sy[i__] = *c__ * sy[i__] - *s * sx[i__];
73         sx[i__] = stemp;
74 /* L30: */
75     }
76     return 0;
77 } /* srot_ */