/src/igraph/vendor/lapack/drot.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* -- translated by f2c (version 20191129). |
2 | | You must link the resulting object file with libf2c: |
3 | | on Microsoft Windows system, link with libf2c.lib; |
4 | | on Linux or Unix systems, link with .../path/to/libf2c.a -lm |
5 | | or, if you install libf2c.a in a standard place, with -lf2c -lm |
6 | | -- in that order, at the end of the command line, as in |
7 | | cc *.o -lf2c -lm |
8 | | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., |
9 | | |
10 | | http://www.netlib.org/f2c/libf2c.zip |
11 | | */ |
12 | | |
13 | | #include "f2c.h" |
14 | | |
15 | | /* > \brief \b DROT |
16 | | |
17 | | =========== DOCUMENTATION =========== |
18 | | |
19 | | Online html documentation available at |
20 | | http://www.netlib.org/lapack/explore-html/ |
21 | | |
22 | | Definition: |
23 | | =========== |
24 | | |
25 | | SUBROUTINE DROT(N,DX,INCX,DY,INCY,C,S) |
26 | | |
27 | | DOUBLE PRECISION C,S |
28 | | INTEGER INCX,INCY,N |
29 | | DOUBLE PRECISION DX(*),DY(*) |
30 | | |
31 | | |
32 | | > \par Purpose: |
33 | | ============= |
34 | | > |
35 | | > \verbatim |
36 | | > |
37 | | > DROT applies a plane rotation. |
38 | | > \endverbatim |
39 | | |
40 | | Arguments: |
41 | | ========== |
42 | | |
43 | | > \param[in] N |
44 | | > \verbatim |
45 | | > N is INTEGER |
46 | | > number of elements in input vector(s) |
47 | | > \endverbatim |
48 | | > |
49 | | > \param[in,out] DX |
50 | | > \verbatim |
51 | | > DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) ) |
52 | | > \endverbatim |
53 | | > |
54 | | > \param[in] INCX |
55 | | > \verbatim |
56 | | > INCX is INTEGER |
57 | | > storage spacing between elements of DX |
58 | | > \endverbatim |
59 | | > |
60 | | > \param[in,out] DY |
61 | | > \verbatim |
62 | | > DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) ) |
63 | | > \endverbatim |
64 | | > |
65 | | > \param[in] INCY |
66 | | > \verbatim |
67 | | > INCY is INTEGER |
68 | | > storage spacing between elements of DY |
69 | | > \endverbatim |
70 | | > |
71 | | > \param[in] C |
72 | | > \verbatim |
73 | | > C is DOUBLE PRECISION |
74 | | > \endverbatim |
75 | | > |
76 | | > \param[in] S |
77 | | > \verbatim |
78 | | > S is DOUBLE PRECISION |
79 | | > \endverbatim |
80 | | |
81 | | Authors: |
82 | | ======== |
83 | | |
84 | | > \author Univ. of Tennessee |
85 | | > \author Univ. of California Berkeley |
86 | | > \author Univ. of Colorado Denver |
87 | | > \author NAG Ltd. |
88 | | |
89 | | > \date November 2017 |
90 | | |
91 | | > \ingroup double_blas_level1 |
92 | | |
93 | | > \par Further Details: |
94 | | ===================== |
95 | | > |
96 | | > \verbatim |
97 | | > |
98 | | > jack dongarra, linpack, 3/11/78. |
99 | | > modified 12/3/93, array(1) declarations changed to array(*) |
100 | | > \endverbatim |
101 | | > |
102 | | ===================================================================== |
103 | | Subroutine */ int igraphdrot_(integer *n, doublereal *dx, integer *incx, |
104 | | doublereal *dy, integer *incy, doublereal *c__, doublereal *s) |
105 | 0 | { |
106 | | /* System generated locals */ |
107 | 0 | integer i__1; |
108 | | |
109 | | /* Local variables */ |
110 | 0 | integer i__, ix, iy; |
111 | 0 | doublereal dtemp; |
112 | | |
113 | | |
114 | | /* -- Reference BLAS level1 routine (version 3.8.0) -- |
115 | | -- Reference BLAS is a software package provided by Univ. of Tennessee, -- |
116 | | -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
117 | | November 2017 |
118 | | |
119 | | |
120 | | ===================================================================== |
121 | | |
122 | | Parameter adjustments */ |
123 | 0 | --dy; |
124 | 0 | --dx; |
125 | | |
126 | | /* Function Body */ |
127 | 0 | if (*n <= 0) { |
128 | 0 | return 0; |
129 | 0 | } |
130 | 0 | if (*incx == 1 && *incy == 1) { |
131 | | |
132 | | /* code for both increments equal to 1 */ |
133 | |
|
134 | 0 | i__1 = *n; |
135 | 0 | for (i__ = 1; i__ <= i__1; ++i__) { |
136 | 0 | dtemp = *c__ * dx[i__] + *s * dy[i__]; |
137 | 0 | dy[i__] = *c__ * dy[i__] - *s * dx[i__]; |
138 | 0 | dx[i__] = dtemp; |
139 | 0 | } |
140 | 0 | } else { |
141 | | |
142 | | /* code for unequal increments or equal increments not equal |
143 | | to 1 */ |
144 | |
|
145 | 0 | ix = 1; |
146 | 0 | iy = 1; |
147 | 0 | if (*incx < 0) { |
148 | 0 | ix = (-(*n) + 1) * *incx + 1; |
149 | 0 | } |
150 | 0 | if (*incy < 0) { |
151 | 0 | iy = (-(*n) + 1) * *incy + 1; |
152 | 0 | } |
153 | 0 | i__1 = *n; |
154 | 0 | for (i__ = 1; i__ <= i__1; ++i__) { |
155 | 0 | dtemp = *c__ * dx[ix] + *s * dy[iy]; |
156 | 0 | dy[iy] = *c__ * dy[iy] - *s * dx[ix]; |
157 | 0 | dx[ix] = dtemp; |
158 | 0 | ix += *incx; |
159 | 0 | iy += *incy; |
160 | 0 | } |
161 | 0 | } |
162 | 0 | return 0; |
163 | 0 | } /* igraphdrot_ */ |
164 | | |