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