Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/lapack/single/slartg.c

raw symbols SCIP
1 /* lapack/single/slartg.f -- translated by f2c (version 20050501).
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 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 #include "v3p_netlib.h"cxx . . $ `<file>/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h`/
17
18 /* Initialization function just calls the function once so that its
19 runtime-initialized constants are initialized. After the first
20 call it is safe to call the function from multiple threads at
21 once. */
22 void v3p_netlib_slartg_initcxx . . $ v3p_netlib_slartg_init(d878ad36e69247c7).()
23 {
24 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! f=0, g=0, cs=0, sn=0, r=0;
25 slartg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:260:9`!(&f, &g, &cs, &sn, &r);
26 }
27
28 /*< SUBROUTINE SLARTG( F, G, CS, SN, R ) >*/
29 /* Subroutine */ int slartg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:260:9`!(realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *f, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *g, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *cs, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *sn, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *r__)
30 {
31 /* Initialized data */
32
33 static logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! first = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; /* runtime-initialized constant */
34
35 /* System generated locals */
36 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__1;
37 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! r__1, r__2;
38
39 /* Builtin functions */
40 double logcxx . . $ log(447c67c6676f75c3).(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!), pow_ricxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:20:9`!(realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *), sqrtcxx . . $ sqrt(447c67c6676f75c3).(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!);
41
42 /* Local variables */
43 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__;
44 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! f1, g1, eps, scale;
45 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! count;
46 static realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! safmn2, safmx2; /* runtime-initialized constant */
47 extern doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! slamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:253:9`!(char *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
48 static realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! safmin; /* runtime-initialized constant */
49
50
51 /* -- LAPACK auxiliary routine (version 3.0) -- */
52 /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
53 /* Courant Institute, Argonne National Lab, and Rice University */
54 /* September 30, 1994 */
55
56 /* .. Scalar Arguments .. */
57 /*< REAL CS, F, G, R, SN >*/
58 /* .. */
59
60 /* Purpose */
61 /* ======= */
62
63 /* SLARTG generate a plane rotation so that */
64
65 /* [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. */
66 /* [ -SN CS ] [ G ] [ 0 ] */
67
68 /* This is a slower, more accurate version of the BLAS1 routine SROTG, */
69 /* with the following other differences: */
70 /* F and G are unchanged on return. */
71 /* If G=0, then CS=1 and SN=0. */
72 /* If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any */
73 /* floating point operations (saves work in SBDSQR when */
74 /* there are zeros on the diagonal). */
75
76 /* If F exceeds G in magnitude, CS will be positive. */
77
78 /* Arguments */
79 /* ========= */
80
81 /* F (input) REAL */
82 /* The first component of vector to be rotated. */
83
84 /* G (input) REAL */
85 /* The second component of vector to be rotated. */
86
87 /* CS (output) REAL */
88 /* The cosine of the rotation. */
89
90 /* SN (output) REAL */
91 /* The sine of the rotation. */
92
93 /* R (output) REAL */
94 /* The nonzero component of the rotated vector. */
95
96 /* ===================================================================== */
97
98 /* .. Parameters .. */
99 /*< REAL ZERO >*/
100 /*< PARAMETER ( ZERO = 0.0E0 ) >*/
101 /*< REAL ONE >*/
102 /*< PARAMETER ( ONE = 1.0E0 ) >*/
103 /*< REAL TWO >*/
104 /*< PARAMETER ( TWO = 2.0E0 ) >*/
105 /* .. */
106 /* .. Local Scalars .. */
107 /*< LOGICAL FIRST >*/
108 /*< INTEGER COUNT, I >*/
109 /*< REAL EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE >*/
110 /* .. */
111 /* .. External Functions .. */
112 /*< REAL SLAMCH >*/
113 /*< EXTERNAL SLAMCH >*/
114 /* .. */
115 /* .. Intrinsic Functions .. */
116 /*< INTRINSIC ABS, INT, LOG, MAX, SQRT >*/
117 /* .. */
118 /* .. Save statement .. */
119 /*< SAVE FIRST, SAFMX2, SAFMIN, SAFMN2 >*/
120 /* .. */
121 /* .. Data statements .. */
122 /*< DATA FIRST / .TRUE. / >*/
123 /* .. */
124 /* .. Executable Statements .. */
125
126 /*< IF( FIRST ) THEN >*/
127 if (first) {
128 /*< FIRST = .FALSE. >*/
129 first = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!;
130 /*< SAFMIN = SLAMCH( 'S' ) >*/
131 safmin = slamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:253:9`!("S", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
132 /*< EPS = SLAMCH( 'E' ) >*/
133 eps = slamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:253:9`!("E", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
134 /*< >*/
135 r__1 = slamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:253:9`!("B", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1);
136 i__1 = (integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`!) (logcxx . . $ log(447c67c6676f75c3).(safmin / eps) / logcxx . . $ log(447c67c6676f75c3).(slamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:253:9`!("B", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1)) / (
137 float)2.);
138 safmn2 = pow_ricxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:20:9`!(&r__1, &i__1);
139 /*< SAFMX2 = ONE / SAFMN2 >*/
140 safmx2 = (float)1. / safmn2;
141 /*< END IF >*/
142 }
143 /*< IF( G.EQ.ZERO ) THEN >*/
144 if (*g == (float)0.) {
145 /*< CS = ONE >*/
146 *cs = (float)1.;
147 /*< SN = ZERO >*/
148 *sn = (float)0.;
149 /*< R = F >*/
150 *r__ = *f;
151 /*< ELSE IF( F.EQ.ZERO ) THEN >*/
152 } else if (*f == (float)0.) {
153 /*< CS = ZERO >*/
154 *cs = (float)0.;
155 /*< SN = ONE >*/
156 *sn = (float)1.;
157 /*< R = G >*/
158 *r__ = *g;
159 /*< ELSE >*/
160 } else {
161 /*< F1 = F >*/
162 f1 = *f;
163 /*< G1 = G >*/
164 g1 = *g;
165 /*< SCALE = MAX( ABS( F1 ), ABS( G1 ) ) >*/
166 /* Computing MAX */
167 r__1 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(f1), r__2 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(g1);
168 scale = dmaxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:162:9`!(r__1,r__2);
169 /*< IF( SCALE.GE.SAFMX2 ) THEN >*/
170 if (scale >= safmx2) {
171 /*< COUNT = 0 >*/
172 count = 0;
173 /*< 10 CONTINUE >*/
174 L10:
175 /*< COUNT = COUNT + 1 >*/
176 ++count;
177 /*< F1 = F1*SAFMN2 >*/
178 f1 *= safmn2;
179 /*< G1 = G1*SAFMN2 >*/
180 g1 *= safmn2;
181 /*< SCALE = MAX( ABS( F1 ), ABS( G1 ) ) >*/
182 /* Computing MAX */
183 r__1 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(f1), r__2 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(g1);
184 scale = dmaxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:162:9`!(r__1,r__2);
185 /*< >*/
186 if (scale >= safmx2) {
187 goto L10;
188 }
189 /*< R = SQRT( F1**2+G1**2 ) >*/
190 /* Computing 2nd power */
191 r__1 = f1;
192 /* Computing 2nd power */
193 r__2 = g1;
194 *r__ = sqrtcxx . . $ sqrt(447c67c6676f75c3).(r__1 * r__1 + r__2 * r__2);
195 /*< CS = F1 / R >*/
196 *cs = f1 / *r__;
197 /*< SN = G1 / R >*/
198 *sn = g1 / *r__;
199 /*< DO 20 I = 1, COUNT >*/
200 i__1 = count;
201 for (i__ = 1; i__ <= i__1; ++i__) {
202 /*< R = R*SAFMX2 >*/
203 *r__ *= safmx2;
204 /*< 20 CONTINUE >*/
205 /* L20: */
206 }
207 /*< ELSE IF( SCALE.LE.SAFMN2 ) THEN >*/
208 } else if (scale <= safmn2) {
209 /*< COUNT = 0 >*/
210 count = 0;
211 /*< 30 CONTINUE >*/
212 L30:
213 /*< COUNT = COUNT + 1 >*/
214 ++count;
215 /*< F1 = F1*SAFMX2 >*/
216 f1 *= safmx2;
217 /*< G1 = G1*SAFMX2 >*/
218 g1 *= safmx2;
219 /*< SCALE = MAX( ABS( F1 ), ABS( G1 ) ) >*/
220 /* Computing MAX */
221 r__1 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(f1), r__2 = dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(g1);
222 scale = dmaxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:162:9`!(r__1,r__2);
223 /*< >*/
224 if (scale <= safmn2) {
225 goto L30;
226 }
227 /*< R = SQRT( F1**2+G1**2 ) >*/
228 /* Computing 2nd power */
229 r__1 = f1;
230 /* Computing 2nd power */
231 r__2 = g1;
232 *r__ = sqrtcxx . . $ sqrt(447c67c6676f75c3).(r__1 * r__1 + r__2 * r__2);
233 /*< CS = F1 / R >*/
234 *cs = f1 / *r__;
235 /*< SN = G1 / R >*/
236 *sn = g1 / *r__;
237 /*< DO 40 I = 1, COUNT >*/
238 i__1 = count;
239 for (i__ = 1; i__ <= i__1; ++i__) {
240 /*< R = R*SAFMN2 >*/
241 *r__ *= safmn2;
242 /*< 40 CONTINUE >*/
243 /* L40: */
244 }
245 /*< ELSE >*/
246 } else {
247 /*< R = SQRT( F1**2+G1**2 ) >*/
248 /* Computing 2nd power */
249 r__1 = f1;
250 /* Computing 2nd power */
251 r__2 = g1;
252 *r__ = sqrtcxx . . $ sqrt(447c67c6676f75c3).(r__1 * r__1 + r__2 * r__2);
253 /*< CS = F1 / R >*/
254 *cs = f1 / *r__;
255 /*< SN = G1 / R >*/
256 *sn = g1 / *r__;
257 /*< END IF >*/
258 }
259 /*< IF( ABS( F ).GT.ABS( G ) .AND. CS.LT.ZERO ) THEN >*/
260 if (dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(*f) > dabscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:158:9`!(*g) && *cs < (float)0.) {
261 /*< CS = -CS >*/
262 *cs = -(*cs);
263 /*< SN = -SN >*/
264 *sn = -(*sn);
265 /*< R = -R >*/
266 *r__ = -(*r__);
267 /*< END IF >*/
268 }
269 /*< END IF >*/
270 }
271 /*< RETURN >*/
272 return 0;
273
274 /* End of SLARTG */
275
276 /*< END >*/
277 } /* slartg_ */
278
279 #ifdef __cplusplus
280 }
281 #endif