Mercurial > octave-nkf
comparison libinterp/corefcn/betainc.cc @ 20593:c41595061186
eliminate more simple uses of error_state
* betainc.cc, file-io.cc, ov-class.cc, ov-struct.cc:
Eliminate simple uses of error_state.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 05 Oct 2015 23:09:54 -0400 |
parents | 4f45eaf83908 |
children |
comparison
equal
deleted
inserted
replaced
20592:56fee8f84fe7 | 20593:c41595061186 |
---|---|
85 | 85 |
86 if (a_arg.is_scalar_type ()) | 86 if (a_arg.is_scalar_type ()) |
87 { | 87 { |
88 float a = a_arg.float_value (); | 88 float a = a_arg.float_value (); |
89 | 89 |
90 if (! error_state) | 90 if (b_arg.is_scalar_type ()) |
91 { | 91 { |
92 if (b_arg.is_scalar_type ()) | 92 float b = b_arg.float_value (); |
93 { | 93 |
94 float b = b_arg.float_value (); | 94 retval = betainc (x, a, b); |
95 | 95 } |
96 if (! error_state) | 96 else |
97 retval = betainc (x, a, b); | 97 { |
98 } | 98 Array<float> b = b_arg.float_array_value (); |
99 else | 99 |
100 { | 100 retval = betainc (x, a, b); |
101 Array<float> b = b_arg.float_array_value (); | |
102 | |
103 if (! error_state) | |
104 retval = betainc (x, a, b); | |
105 } | |
106 } | 101 } |
107 } | 102 } |
108 else | 103 else |
109 { | 104 { |
110 Array<float> a = a_arg.float_array_value (); | 105 Array<float> a = a_arg.float_array_value (); |
111 | 106 |
112 if (! error_state) | 107 if (b_arg.is_scalar_type ()) |
113 { | 108 { |
114 if (b_arg.is_scalar_type ()) | 109 float b = b_arg.float_value (); |
115 { | 110 |
116 float b = b_arg.float_value (); | 111 retval = betainc (x, a, b); |
117 | 112 } |
118 if (! error_state) | 113 else |
119 retval = betainc (x, a, b); | 114 { |
120 } | 115 Array<float> b = b_arg.float_array_value (); |
121 else | 116 |
122 { | 117 retval = betainc (x, a, b); |
123 Array<float> b = b_arg.float_array_value (); | |
124 | |
125 if (! error_state) | |
126 retval = betainc (x, a, b); | |
127 } | |
128 } | 118 } |
129 } | 119 } |
130 } | 120 } |
131 else | 121 else |
132 { | 122 { |
134 | 124 |
135 if (a_arg.is_scalar_type ()) | 125 if (a_arg.is_scalar_type ()) |
136 { | 126 { |
137 float a = a_arg.float_value (); | 127 float a = a_arg.float_value (); |
138 | 128 |
139 if (! error_state) | 129 if (b_arg.is_scalar_type ()) |
140 { | 130 { |
141 if (b_arg.is_scalar_type ()) | 131 float b = b_arg.float_value (); |
142 { | 132 |
143 float b = b_arg.float_value (); | 133 retval = betainc (x, a, b); |
144 | 134 } |
145 if (! error_state) | 135 else |
146 retval = betainc (x, a, b); | 136 { |
147 } | 137 Array<float> b = b_arg.float_array_value (); |
148 else | 138 |
149 { | 139 retval = betainc (x, a, b); |
150 Array<float> b = b_arg.float_array_value (); | |
151 | |
152 if (! error_state) | |
153 retval = betainc (x, a, b); | |
154 } | |
155 } | 140 } |
156 } | 141 } |
157 else | 142 else |
158 { | 143 { |
159 Array<float> a = a_arg.float_array_value (); | 144 Array<float> a = a_arg.float_array_value (); |
160 | 145 |
161 if (! error_state) | 146 if (b_arg.is_scalar_type ()) |
162 { | 147 { |
163 if (b_arg.is_scalar_type ()) | 148 float b = b_arg.float_value (); |
164 { | 149 |
165 float b = b_arg.float_value (); | 150 retval = betainc (x, a, b); |
166 | 151 } |
167 if (! error_state) | 152 else |
168 retval = betainc (x, a, b); | 153 { |
169 } | 154 Array<float> b = b_arg.float_array_value (); |
170 else | 155 |
171 { | 156 retval = betainc (x, a, b); |
172 Array<float> b = b_arg.float_array_value (); | |
173 | |
174 if (! error_state) | |
175 retval = betainc (x, a, b); | |
176 } | |
177 } | 157 } |
178 } | 158 } |
179 } | 159 } |
180 } | 160 } |
181 else | 161 else |
186 | 166 |
187 if (a_arg.is_scalar_type ()) | 167 if (a_arg.is_scalar_type ()) |
188 { | 168 { |
189 double a = a_arg.double_value (); | 169 double a = a_arg.double_value (); |
190 | 170 |
191 if (! error_state) | 171 if (b_arg.is_scalar_type ()) |
192 { | 172 { |
193 if (b_arg.is_scalar_type ()) | 173 double b = b_arg.double_value (); |
194 { | 174 |
195 double b = b_arg.double_value (); | 175 retval = betainc (x, a, b); |
196 | 176 } |
197 if (! error_state) | 177 else |
198 retval = betainc (x, a, b); | 178 { |
199 } | 179 Array<double> b = b_arg.array_value (); |
200 else | 180 |
201 { | 181 retval = betainc (x, a, b); |
202 Array<double> b = b_arg.array_value (); | |
203 | |
204 if (! error_state) | |
205 retval = betainc (x, a, b); | |
206 } | |
207 } | 182 } |
208 } | 183 } |
209 else | 184 else |
210 { | 185 { |
211 Array<double> a = a_arg.array_value (); | 186 Array<double> a = a_arg.array_value (); |
212 | 187 |
213 if (! error_state) | 188 if (b_arg.is_scalar_type ()) |
214 { | 189 { |
215 if (b_arg.is_scalar_type ()) | 190 double b = b_arg.double_value (); |
216 { | 191 |
217 double b = b_arg.double_value (); | 192 retval = betainc (x, a, b); |
218 | 193 } |
219 if (! error_state) | 194 else |
220 retval = betainc (x, a, b); | 195 { |
221 } | 196 Array<double> b = b_arg.array_value (); |
222 else | 197 |
223 { | 198 retval = betainc (x, a, b); |
224 Array<double> b = b_arg.array_value (); | |
225 | |
226 if (! error_state) | |
227 retval = betainc (x, a, b); | |
228 } | |
229 } | 199 } |
230 } | 200 } |
231 } | 201 } |
232 else | 202 else |
233 { | 203 { |
235 | 205 |
236 if (a_arg.is_scalar_type ()) | 206 if (a_arg.is_scalar_type ()) |
237 { | 207 { |
238 double a = a_arg.double_value (); | 208 double a = a_arg.double_value (); |
239 | 209 |
240 if (! error_state) | 210 if (b_arg.is_scalar_type ()) |
241 { | 211 { |
242 if (b_arg.is_scalar_type ()) | 212 double b = b_arg.double_value (); |
243 { | 213 |
244 double b = b_arg.double_value (); | 214 retval = betainc (x, a, b); |
245 | 215 } |
246 if (! error_state) | 216 else |
247 retval = betainc (x, a, b); | 217 { |
248 } | 218 Array<double> b = b_arg.array_value (); |
249 else | 219 |
250 { | 220 retval = betainc (x, a, b); |
251 Array<double> b = b_arg.array_value (); | |
252 | |
253 if (! error_state) | |
254 retval = betainc (x, a, b); | |
255 } | |
256 } | 221 } |
257 } | 222 } |
258 else | 223 else |
259 { | 224 { |
260 Array<double> a = a_arg.array_value (); | 225 Array<double> a = a_arg.array_value (); |
261 | 226 |
262 if (! error_state) | 227 if (b_arg.is_scalar_type ()) |
263 { | 228 { |
264 if (b_arg.is_scalar_type ()) | 229 double b = b_arg.double_value (); |
265 { | 230 |
266 double b = b_arg.double_value (); | 231 retval = betainc (x, a, b); |
267 | 232 } |
268 if (! error_state) | 233 else |
269 retval = betainc (x, a, b); | 234 { |
270 } | 235 Array<double> b = b_arg.array_value (); |
271 else | 236 |
272 { | 237 retval = betainc (x, a, b); |
273 Array<double> b = b_arg.array_value (); | |
274 | |
275 if (! error_state) | |
276 retval = betainc (x, a, b); | |
277 } | |
278 } | 238 } |
279 } | 239 } |
280 } | 240 } |
281 } | 241 } |
282 } | 242 } |
358 | 318 |
359 if (a_arg.is_scalar_type ()) | 319 if (a_arg.is_scalar_type ()) |
360 { | 320 { |
361 double a = a_arg.double_value (); | 321 double a = a_arg.double_value (); |
362 | 322 |
363 if (! error_state) | 323 if (b_arg.is_scalar_type ()) |
364 { | 324 { |
365 if (b_arg.is_scalar_type ()) | 325 double b = b_arg.double_value (); |
366 { | 326 |
367 double b = b_arg.double_value (); | 327 retval = betaincinv (x, a, b); |
368 | 328 } |
369 if (! error_state) | 329 else |
370 retval = betaincinv (x, a, b); | 330 { |
371 } | 331 Array<double> b = b_arg.array_value (); |
372 else | 332 |
373 { | 333 retval = betaincinv (x, a, b); |
374 Array<double> b = b_arg.array_value (); | |
375 | |
376 if (! error_state) | |
377 retval = betaincinv (x, a, b); | |
378 } | |
379 } | 334 } |
380 } | 335 } |
381 else | 336 else |
382 { | 337 { |
383 Array<double> a = a_arg.array_value (); | 338 Array<double> a = a_arg.array_value (); |
384 | 339 |
385 if (! error_state) | 340 if (b_arg.is_scalar_type ()) |
386 { | 341 { |
387 if (b_arg.is_scalar_type ()) | 342 double b = b_arg.double_value (); |
388 { | 343 |
389 double b = b_arg.double_value (); | 344 retval = betaincinv (x, a, b); |
390 | 345 } |
391 if (! error_state) | 346 else |
392 retval = betaincinv (x, a, b); | 347 { |
393 } | 348 Array<double> b = b_arg.array_value (); |
394 else | 349 |
395 { | 350 retval = betaincinv (x, a, b); |
396 Array<double> b = b_arg.array_value (); | |
397 | |
398 if (! error_state) | |
399 retval = betaincinv (x, a, b); | |
400 } | |
401 } | 351 } |
402 } | 352 } |
403 } | 353 } |
404 else | 354 else |
405 { | 355 { |
407 | 357 |
408 if (a_arg.is_scalar_type ()) | 358 if (a_arg.is_scalar_type ()) |
409 { | 359 { |
410 double a = a_arg.double_value (); | 360 double a = a_arg.double_value (); |
411 | 361 |
412 if (! error_state) | 362 if (b_arg.is_scalar_type ()) |
413 { | 363 { |
414 if (b_arg.is_scalar_type ()) | 364 double b = b_arg.double_value (); |
415 { | 365 |
416 double b = b_arg.double_value (); | 366 retval = betaincinv (x, a, b); |
417 | 367 } |
418 if (! error_state) | 368 else |
419 retval = betaincinv (x, a, b); | 369 { |
420 } | 370 Array<double> b = b_arg.array_value (); |
421 else | 371 |
422 { | 372 retval = betaincinv (x, a, b); |
423 Array<double> b = b_arg.array_value (); | |
424 | |
425 if (! error_state) | |
426 retval = betaincinv (x, a, b); | |
427 } | |
428 } | 373 } |
429 } | 374 } |
430 else | 375 else |
431 { | 376 { |
432 Array<double> a = a_arg.array_value (); | 377 Array<double> a = a_arg.array_value (); |
433 | 378 |
434 if (! error_state) | 379 if (b_arg.is_scalar_type ()) |
435 { | 380 { |
436 if (b_arg.is_scalar_type ()) | 381 double b = b_arg.double_value (); |
437 { | 382 |
438 double b = b_arg.double_value (); | 383 retval = betaincinv (x, a, b); |
439 | 384 } |
440 if (! error_state) | 385 else |
441 retval = betaincinv (x, a, b); | 386 { |
442 } | 387 Array<double> b = b_arg.array_value (); |
443 else | 388 |
444 { | 389 retval = betaincinv (x, a, b); |
445 Array<double> b = b_arg.array_value (); | |
446 | |
447 if (! error_state) | |
448 retval = betaincinv (x, a, b); | |
449 } | |
450 } | 390 } |
451 } | 391 } |
452 } | 392 } |
453 | 393 |
454 // FIXME: It would be better to have an algorithm for betaincinv which | 394 // FIXME: It would be better to have an algorithm for betaincinv which |