Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/lapack/util/ieeeck.c

raw symbols SCIP
1 /* lapack/util/ieeeck.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 /*< INTEGER FUNCTION IEEECK( ISPEC, ZERO, ONE ) >*/
19 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! ieeeck_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:180:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ispec, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *zero, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *one)
20 {
21 /* System generated locals */
22 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! ret_val;
23
24 /* Local variables */
25 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! nan1, nan2, nan3, nan4, nan5, nan6, neginf, posinf, negzro, newzro;
26
27
28 /* -- LAPACK auxiliary routine (version 3.0) -- */
29 /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
30 /* Courant Institute, Argonne National Lab, and Rice University */
31 /* June 30, 1998 */
32
33 /* .. Scalar Arguments .. */
34 /*< INTEGER ISPEC >*/
35 /*< REAL ONE, ZERO >*/
36 /* .. */
37
38 /* Purpose */
39 /* ======= */
40
41 /* IEEECK is called from the ILAENV to verify that Infinity and */
42 /* possibly NaN arithmetic is safe (i.e. will not trap). */
43
44 /* Arguments */
45 /* ========= */
46
47 /* ISPEC (input) INTEGER */
48 /* Specifies whether to test just for inifinity arithmetic */
49 /* or whether to test for infinity and NaN arithmetic. */
50 /* = 0: Verify infinity arithmetic only. */
51 /* = 1: Verify infinity and NaN arithmetic. */
52
53 /* ZERO (input) REAL */
54 /* Must contain the value 0.0 */
55 /* This is passed to prevent the compiler from optimizing */
56 /* away this code. */
57
58 /* ONE (input) REAL */
59 /* Must contain the value 1.0 */
60 /* This is passed to prevent the compiler from optimizing */
61 /* away this code. */
62
63 /* RETURN VALUE: INTEGER */
64 /* = 0: Arithmetic failed to produce the correct answers */
65 /* = 1: Arithmetic produced the correct answers */
66
67 /* .. Local Scalars .. */
68 /*< >*/
69 /* .. */
70 /* .. Executable Statements .. */
71 /*< IEEECK = 1 >*/
72 ret_val = 1;
73
74 /*< POSINF = ONE / ZERO >*/
75 posinf = *one / *zero;
76 /*< IF( POSINF.LE.ONE ) THEN >*/
77 if (posinf <= *one) {
78 /*< IEEECK = 0 >*/
79 ret_val = 0;
80 /*< RETURN >*/
81 return ret_val;
82 /*< END IF >*/
83 }
84
85 /*< NEGINF = -ONE / ZERO >*/
86 neginf = -(*one) / *zero;
87 /*< IF( NEGINF.GE.ZERO ) THEN >*/
88 if (neginf >= *zero) {
89 /*< IEEECK = 0 >*/
90 ret_val = 0;
91 /*< RETURN >*/
92 return ret_val;
93 /*< END IF >*/
94 }
95
96 /*< NEGZRO = ONE / ( NEGINF+ONE ) >*/
97 negzro = *one / (neginf + *one);
98 /*< IF( NEGZRO.NE.ZERO ) THEN >*/
99 if (negzro != *zero) {
100 /*< IEEECK = 0 >*/
101 ret_val = 0;
102 /*< RETURN >*/
103 return ret_val;
104 /*< END IF >*/
105 }
106
107 /*< NEGINF = ONE / NEGZRO >*/
108 neginf = *one / negzro;
109 /*< IF( NEGINF.GE.ZERO ) THEN >*/
110 if (neginf >= *zero) {
111 /*< IEEECK = 0 >*/
112 ret_val = 0;
113 /*< RETURN >*/
114 return ret_val;
115 /*< END IF >*/
116 }
117
118 /*< NEWZRO = NEGZRO + ZERO >*/
119 newzro = negzro + *zero;
120 /*< IF( NEWZRO.NE.ZERO ) THEN >*/
121 if (newzro != *zero) {
122 /*< IEEECK = 0 >*/
123 ret_val = 0;
124 /*< RETURN >*/
125 return ret_val;
126 /*< END IF >*/
127 }
128
129 /*< POSINF = ONE / NEWZRO >*/
130 posinf = *one / newzro;
131 /*< IF( POSINF.LE.ONE ) THEN >*/
132 if (posinf <= *one) {
133 /*< IEEECK = 0 >*/
134 ret_val = 0;
135 /*< RETURN >*/
136 return ret_val;
137 /*< END IF >*/
138 }
139
140 /*< NEGINF = NEGINF*POSINF >*/
141 neginf *= posinf;
142 /*< IF( NEGINF.GE.ZERO ) THEN >*/
143 if (neginf >= *zero) {
144 /*< IEEECK = 0 >*/
145 ret_val = 0;
146 /*< RETURN >*/
147 return ret_val;
148 /*< END IF >*/
149 }
150
151 /*< POSINF = POSINF*POSINF >*/
152 posinf *= posinf;
153 /*< IF( POSINF.LE.ONE ) THEN >*/
154 if (posinf <= *one) {
155 /*< IEEECK = 0 >*/
156 ret_val = 0;
157 /*< RETURN >*/
158 return ret_val;
159 /*< END IF >*/
160 }
161
162
163
164
165 /* Return if we were only asked to check infinity arithmetic */
166
167 /*< >*/
168 if (*ispec == 0) {
169 return ret_val;
170 }
171
172 /*< NAN1 = POSINF + NEGINF >*/
173 nan1 = posinf + neginf;
174
175 /*< NAN2 = POSINF / NEGINF >*/
176 nan2 = posinf / neginf;
177
178 /*< NAN3 = POSINF / POSINF >*/
179 nan3 = posinf / posinf;
180
181 /*< NAN4 = POSINF*ZERO >*/
182 nan4 = posinf * *zero;
183
184 /*< NAN5 = NEGINF*NEGZRO >*/
185 nan5 = neginf * negzro;
186
187 /*< NAN6 = NAN5*0.0 >*/
188 nan6 = nan5 * (float)0.;
189
190 /*< IF( NAN1.EQ.NAN1 ) THEN >*/
191 if (nan1 == nan1) {
192 /*< IEEECK = 0 >*/
193 ret_val = 0;
194 /*< RETURN >*/
195 return ret_val;
196 /*< END IF >*/
197 }
198
199 /*< IF( NAN2.EQ.NAN2 ) THEN >*/
200 if (nan2 == nan2) {
201 /*< IEEECK = 0 >*/
202 ret_val = 0;
203 /*< RETURN >*/
204 return ret_val;
205 /*< END IF >*/
206 }
207
208 /*< IF( NAN3.EQ.NAN3 ) THEN >*/
209 if (nan3 == nan3) {
210 /*< IEEECK = 0 >*/
211 ret_val = 0;
212 /*< RETURN >*/
213 return ret_val;
214 /*< END IF >*/
215 }
216
217 /*< IF( NAN4.EQ.NAN4 ) THEN >*/
218 if (nan4 == nan4) {
219 /*< IEEECK = 0 >*/
220 ret_val = 0;
221 /*< RETURN >*/
222 return ret_val;
223 /*< END IF >*/
224 }
225
226 /*< IF( NAN5.EQ.NAN5 ) THEN >*/
227 if (nan5 == nan5) {
228 /*< IEEECK = 0 >*/
229 ret_val = 0;
230 /*< RETURN >*/
231 return ret_val;
232 /*< END IF >*/
233 }
234
235 /*< IF( NAN6.EQ.NAN6 ) THEN >*/
236 if (nan6 == nan6) {
237 /*< IEEECK = 0 >*/
238 ret_val = 0;
239 /*< RETURN >*/
240 return ret_val;
241 /*< END IF >*/
242 }
243
244 /*< RETURN >*/
245 return ret_val;
246 /*< END >*/
247 } /* ieeeck_ */
248
249 #ifdef __cplusplus
250 }
251 #endif