00001 00002 #include <basix/int.hpp> 00003 #include <basix/vector.hpp> 00004 #include <basix/port.hpp> 00005 #include <basix/literal.hpp> 00006 #include <numerix/integer.hpp> 00007 #include <numerix/modular.hpp> 00008 #include <numerix/modular_integer.hpp> 00009 #include <numerix/rational.hpp> 00010 #include <numerix/floating.hpp> 00011 #include <basix/double.hpp> 00012 #include <numerix/complex.hpp> 00013 #include <numerix/complex_double.hpp> 00014 #include <numerix/ball.hpp> 00015 #include <numerix/ball_complex.hpp> 00016 #include <basix/glue.hpp> 00017 00018 #define int_literal(x) as_int (as_string (x)) 00019 #define is_generic_literal is<literal> 00020 #define gen_literal_apply(f,v) gen (as<generic> (f), v) 00021 #define gen_literal_access(f,v) access (as<generic> (f), v) 00022 #define double_literal(x) as_double (as_string (x)) 00023 00024 namespace mmx { 00025 static mmx_ball(mmx_floating, mmx_floating) 00026 GLUE_1 (const mmx_floating &arg_1) { 00027 return make_mmx_ball (arg_1); 00028 } 00029 00030 static mmx_ball(mmx_floating, mmx_floating) 00031 GLUE_2 (const mmx_floating &arg_1, const mmx_floating &arg_2) { 00032 return make_mmx_ball (arg_1, arg_2); 00033 } 00034 00035 static mmx_ball(mmx_floating, mmx_floating) 00036 GLUE_3 (const mmx_floating &arg_1) { 00037 return make_mmx_ball (arg_1); 00038 } 00039 00040 static mmx_floating 00041 GLUE_4 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00042 return center (arg_1); 00043 } 00044 00045 static mmx_floating 00046 GLUE_5 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00047 return mmx_radius (arg_1); 00048 } 00049 00050 static mmx_ball(mmx_floating, mmx_floating) 00051 GLUE_6 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00052 return sharpen (arg_1); 00053 } 00054 00055 static mmx_ball(mmx_floating, mmx_floating) 00056 GLUE_7 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00057 return blur (arg_1, arg_2); 00058 } 00059 00060 static bool 00061 GLUE_8 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00062 return included (arg_1, arg_2); 00063 } 00064 00065 static mmx_ball(mmx_floating, mmx_floating) 00066 GLUE_9 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00067 return -arg_1; 00068 } 00069 00070 static mmx_ball(mmx_floating, mmx_floating) 00071 GLUE_10 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00072 return square (arg_1); 00073 } 00074 00075 static mmx_ball(mmx_floating, mmx_floating) 00076 GLUE_11 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00077 return invert (arg_1); 00078 } 00079 00080 static mmx_ball(mmx_floating, mmx_floating) 00081 GLUE_12 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00082 return arg_1 + arg_2; 00083 } 00084 00085 static mmx_ball(mmx_floating, mmx_floating) 00086 GLUE_13 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00087 return arg_1 - arg_2; 00088 } 00089 00090 static mmx_ball(mmx_floating, mmx_floating) 00091 GLUE_14 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00092 return arg_1 * arg_2; 00093 } 00094 00095 static mmx_ball(mmx_floating, mmx_floating) 00096 GLUE_15 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00097 return arg_1 + arg_2; 00098 } 00099 00100 static mmx_ball(mmx_floating, mmx_floating) 00101 GLUE_16 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00102 return arg_1 + arg_2; 00103 } 00104 00105 static mmx_ball(mmx_floating, mmx_floating) 00106 GLUE_17 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00107 return arg_1 - arg_2; 00108 } 00109 00110 static mmx_ball(mmx_floating, mmx_floating) 00111 GLUE_18 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00112 return arg_1 - arg_2; 00113 } 00114 00115 static mmx_ball(mmx_floating, mmx_floating) 00116 GLUE_19 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00117 return arg_1 * arg_2; 00118 } 00119 00120 static mmx_ball(mmx_floating, mmx_floating) 00121 GLUE_20 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00122 return arg_1 * arg_2; 00123 } 00124 00125 static mmx_ball(mmx_floating, mmx_floating) 00126 GLUE_21 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00127 return arg_1 / arg_2; 00128 } 00129 00130 static mmx_ball(mmx_floating, mmx_floating) 00131 GLUE_22 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00132 return arg_1 / arg_2; 00133 } 00134 00135 static mmx_ball(mmx_floating, mmx_floating) 00136 GLUE_23 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00137 return arg_1 / arg_2; 00138 } 00139 00140 static bool 00141 GLUE_24 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00142 return arg_1 == arg_2; 00143 } 00144 00145 static bool 00146 GLUE_25 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00147 return arg_1 != arg_2; 00148 } 00149 00150 static bool 00151 GLUE_26 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00152 return arg_1 == arg_2; 00153 } 00154 00155 static bool 00156 GLUE_27 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00157 return arg_1 != arg_2; 00158 } 00159 00160 static bool 00161 GLUE_28 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00162 return arg_1 == arg_2; 00163 } 00164 00165 static bool 00166 GLUE_29 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00167 return arg_1 != arg_2; 00168 } 00169 00170 static bool 00171 GLUE_30 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00172 return is_finite (arg_1); 00173 } 00174 00175 static bool 00176 GLUE_31 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00177 return is_infinite (arg_1); 00178 } 00179 00180 static bool 00181 GLUE_32 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00182 return is_nan (arg_1); 00183 } 00184 00185 static mmx_ball(mmx_floating, mmx_floating) 00186 GLUE_33 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00187 return times_infinity (arg_1); 00188 } 00189 00190 static int 00191 GLUE_34 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00192 return precision (arg_1); 00193 } 00194 00195 static mmx_ball(mmx_floating, mmx_floating) 00196 GLUE_35 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const int &arg_2) { 00197 return change_precision (arg_1, arg_2); 00198 } 00199 00200 static int 00201 GLUE_36 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00202 return exponent (arg_1); 00203 } 00204 00205 static double 00206 GLUE_37 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00207 return magnitude (arg_1); 00208 } 00209 00210 static mmx_ball(mmx_floating, mmx_floating) 00211 GLUE_38 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const int &arg_2) { 00212 return incexp2 (arg_1, arg_2); 00213 } 00214 00215 static mmx_ball(mmx_floating, mmx_floating) 00216 GLUE_39 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const int &arg_2) { 00217 return decexp2 (arg_1, arg_2); 00218 } 00219 00220 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00221 GLUE_40 (const complex<mmx_floating> &arg_1) { 00222 return make_mmx_ball (arg_1); 00223 } 00224 00225 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00226 GLUE_41 (const complex<mmx_floating> &arg_1, const mmx_floating &arg_2) { 00227 return make_mmx_ball (arg_1, arg_2); 00228 } 00229 00230 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00231 GLUE_42 (const complex<mmx_floating> &arg_1) { 00232 return make_mmx_ball (arg_1); 00233 } 00234 00235 static complex<mmx_floating> 00236 GLUE_43 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00237 return center (arg_1); 00238 } 00239 00240 static mmx_floating 00241 GLUE_44 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00242 return mmx_radius (arg_1); 00243 } 00244 00245 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00246 GLUE_45 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00247 return sharpen (arg_1); 00248 } 00249 00250 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00251 GLUE_46 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00252 return blur (arg_1, arg_2); 00253 } 00254 00255 static bool 00256 GLUE_47 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00257 return included (arg_1, arg_2); 00258 } 00259 00260 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00261 GLUE_48 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00262 return -arg_1; 00263 } 00264 00265 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00266 GLUE_49 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00267 return square (arg_1); 00268 } 00269 00270 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00271 GLUE_50 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00272 return invert (arg_1); 00273 } 00274 00275 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00276 GLUE_51 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00277 return arg_1 + arg_2; 00278 } 00279 00280 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00281 GLUE_52 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00282 return arg_1 - arg_2; 00283 } 00284 00285 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00286 GLUE_53 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00287 return arg_1 * arg_2; 00288 } 00289 00290 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00291 GLUE_54 (const complex<mmx_floating> &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00292 return arg_1 + arg_2; 00293 } 00294 00295 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00296 GLUE_55 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const complex<mmx_floating> &arg_2) { 00297 return arg_1 + arg_2; 00298 } 00299 00300 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00301 GLUE_56 (const complex<mmx_floating> &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00302 return arg_1 - arg_2; 00303 } 00304 00305 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00306 GLUE_57 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const complex<mmx_floating> &arg_2) { 00307 return arg_1 - arg_2; 00308 } 00309 00310 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00311 GLUE_58 (const complex<mmx_floating> &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00312 return arg_1 * arg_2; 00313 } 00314 00315 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00316 GLUE_59 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const complex<mmx_floating> &arg_2) { 00317 return arg_1 * arg_2; 00318 } 00319 00320 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00321 GLUE_60 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00322 return arg_1 / arg_2; 00323 } 00324 00325 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00326 GLUE_61 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const complex<mmx_floating> &arg_2) { 00327 return arg_1 / arg_2; 00328 } 00329 00330 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00331 GLUE_62 (const complex<mmx_floating> &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00332 return arg_1 / arg_2; 00333 } 00334 00335 static bool 00336 GLUE_63 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00337 return arg_1 == arg_2; 00338 } 00339 00340 static bool 00341 GLUE_64 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00342 return arg_1 != arg_2; 00343 } 00344 00345 static bool 00346 GLUE_65 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const complex<mmx_floating> &arg_2) { 00347 return arg_1 == arg_2; 00348 } 00349 00350 static bool 00351 GLUE_66 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const complex<mmx_floating> &arg_2) { 00352 return arg_1 != arg_2; 00353 } 00354 00355 static bool 00356 GLUE_67 (const complex<mmx_floating> &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00357 return arg_1 == arg_2; 00358 } 00359 00360 static bool 00361 GLUE_68 (const complex<mmx_floating> &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00362 return arg_1 != arg_2; 00363 } 00364 00365 static bool 00366 GLUE_69 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00367 return is_finite (arg_1); 00368 } 00369 00370 static bool 00371 GLUE_70 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00372 return is_infinite (arg_1); 00373 } 00374 00375 static bool 00376 GLUE_71 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00377 return is_nan (arg_1); 00378 } 00379 00380 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00381 GLUE_72 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00382 return times_infinity (arg_1); 00383 } 00384 00385 static int 00386 GLUE_73 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00387 return precision (arg_1); 00388 } 00389 00390 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00391 GLUE_74 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const int &arg_2) { 00392 return change_precision (arg_1, arg_2); 00393 } 00394 00395 static int 00396 GLUE_75 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00397 return exponent (arg_1); 00398 } 00399 00400 static double 00401 GLUE_76 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00402 return magnitude (arg_1); 00403 } 00404 00405 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00406 GLUE_77 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const int &arg_2) { 00407 return incexp2 (arg_1, arg_2); 00408 } 00409 00410 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00411 GLUE_78 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const int &arg_2) { 00412 return decexp2 (arg_1, arg_2); 00413 } 00414 00415 static mmx_ball(mmx_floating, mmx_floating) 00416 GLUE_79 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00417 return sqrt (arg_1); 00418 } 00419 00420 static mmx_ball(mmx_floating, mmx_floating) 00421 GLUE_80 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00422 return exp (arg_1); 00423 } 00424 00425 static mmx_ball(mmx_floating, mmx_floating) 00426 GLUE_81 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00427 return log (arg_1); 00428 } 00429 00430 static mmx_ball(mmx_floating, mmx_floating) 00431 GLUE_82 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00432 return pow (arg_1, arg_2); 00433 } 00434 00435 static mmx_ball(mmx_floating, mmx_floating) 00436 GLUE_83 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00437 return cos (arg_1); 00438 } 00439 00440 static mmx_ball(mmx_floating, mmx_floating) 00441 GLUE_84 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00442 return sin (arg_1); 00443 } 00444 00445 static mmx_ball(mmx_floating, mmx_floating) 00446 GLUE_85 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00447 return tan (arg_1); 00448 } 00449 00450 static mmx_ball(mmx_floating, mmx_floating) 00451 GLUE_86 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00452 return acos (arg_1); 00453 } 00454 00455 static mmx_ball(mmx_floating, mmx_floating) 00456 GLUE_87 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00457 return asin (arg_1); 00458 } 00459 00460 static mmx_ball(mmx_floating, mmx_floating) 00461 GLUE_88 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00462 return atan (arg_1); 00463 } 00464 00465 static mmx_ball(mmx_floating, mmx_floating) 00466 GLUE_89 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00467 return next_above (arg_1); 00468 } 00469 00470 static mmx_ball(mmx_floating, mmx_floating) 00471 GLUE_90 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00472 return next_below (arg_1); 00473 } 00474 00475 static bool 00476 GLUE_91 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00477 return arg_1 < arg_2; 00478 } 00479 00480 static bool 00481 GLUE_92 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00482 return arg_1 > arg_2; 00483 } 00484 00485 static bool 00486 GLUE_93 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00487 return arg_1 <= arg_2; 00488 } 00489 00490 static bool 00491 GLUE_94 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00492 return arg_1 >= arg_2; 00493 } 00494 00495 static bool 00496 GLUE_95 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00497 return arg_1 < arg_2; 00498 } 00499 00500 static bool 00501 GLUE_96 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00502 return arg_1 > arg_2; 00503 } 00504 00505 static bool 00506 GLUE_97 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00507 return arg_1 <= arg_2; 00508 } 00509 00510 static bool 00511 GLUE_98 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_floating &arg_2) { 00512 return arg_1 >= arg_2; 00513 } 00514 00515 static bool 00516 GLUE_99 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00517 return arg_1 < arg_2; 00518 } 00519 00520 static bool 00521 GLUE_100 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00522 return arg_1 > arg_2; 00523 } 00524 00525 static bool 00526 GLUE_101 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00527 return arg_1 <= arg_2; 00528 } 00529 00530 static bool 00531 GLUE_102 (const mmx_floating &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00532 return arg_1 >= arg_2; 00533 } 00534 00535 static mmx_ball(mmx_floating, mmx_floating) 00536 GLUE_103 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00537 return abs (arg_1); 00538 } 00539 00540 static mmx_ball(mmx_floating, mmx_floating) 00541 GLUE_104 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00542 return min (arg_1, arg_2); 00543 } 00544 00545 static mmx_ball(mmx_floating, mmx_floating) 00546 GLUE_105 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00547 return max (arg_1, arg_2); 00548 } 00549 00550 static mmx_ball(mmx_floating, mmx_floating) 00551 GLUE_106 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00552 return inf (arg_1, arg_2); 00553 } 00554 00555 static mmx_ball(mmx_floating, mmx_floating) 00556 GLUE_107 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00557 return sup (arg_1, arg_2); 00558 } 00559 00560 static mmx_ball(mmx_floating, mmx_floating) 00561 GLUE_108 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00562 return floor (arg_1); 00563 } 00564 00565 static mmx_ball(mmx_floating, mmx_floating) 00566 GLUE_109 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00567 return ceil (arg_1); 00568 } 00569 00570 static mmx_ball(mmx_floating, mmx_floating) 00571 GLUE_110 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00572 return trunc (arg_1); 00573 } 00574 00575 static mmx_ball(mmx_floating, mmx_floating) 00576 GLUE_111 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00577 return round (arg_1); 00578 } 00579 00580 static mmx_ball(mmx_floating, mmx_floating) 00581 GLUE_112 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00582 return Re (arg_1); 00583 } 00584 00585 static mmx_ball(mmx_floating, mmx_floating) 00586 GLUE_113 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00587 return Im (arg_1); 00588 } 00589 00590 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00591 GLUE_114 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00592 return conj (arg_1); 00593 } 00594 00595 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00596 GLUE_115 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00597 return times_i (arg_1); 00598 } 00599 00600 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00601 GLUE_116 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00602 return over_i (arg_1); 00603 } 00604 00605 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00606 GLUE_117 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00607 return gaussian (arg_1); 00608 } 00609 00610 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00611 GLUE_118 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00612 return gaussian (arg_1, arg_2); 00613 } 00614 00615 static mmx_ball(mmx_floating, mmx_floating) 00616 GLUE_119 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00617 return abs (arg_1); 00618 } 00619 00620 static mmx_ball(mmx_floating, mmx_floating) 00621 GLUE_120 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00622 return arg (arg_1); 00623 } 00624 00625 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00626 GLUE_121 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00627 return cmul (arg_1, arg_2); 00628 } 00629 00630 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00631 GLUE_122 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00632 return cmul (arg_1, arg_2); 00633 } 00634 00635 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00636 GLUE_123 (const mmx_ball(mmx_floating, mmx_floating) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00637 return cdiv (arg_1, arg_2); 00638 } 00639 00640 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00641 GLUE_124 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, mmx_floating) &arg_2) { 00642 return cdiv (arg_1, arg_2); 00643 } 00644 00645 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00646 GLUE_125 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00647 return sqrt (arg_1); 00648 } 00649 00650 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00651 GLUE_126 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00652 return exp (arg_1); 00653 } 00654 00655 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00656 GLUE_127 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00657 return log (arg_1); 00658 } 00659 00660 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00661 GLUE_128 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1, const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_2) { 00662 return pow (arg_1, arg_2); 00663 } 00664 00665 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00666 GLUE_129 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00667 return cos (arg_1); 00668 } 00669 00670 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00671 GLUE_130 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00672 return sin (arg_1); 00673 } 00674 00675 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00676 GLUE_131 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00677 return tan (arg_1); 00678 } 00679 00680 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00681 GLUE_132 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00682 return acos (arg_1); 00683 } 00684 00685 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00686 GLUE_133 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00687 return asin (arg_1); 00688 } 00689 00690 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00691 GLUE_134 (const mmx_ball(mmx_floating, complex<mmx_floating> ) &arg_1) { 00692 return atan (arg_1); 00693 } 00694 00695 static mmx_ball(mmx_floating, complex<mmx_floating> ) 00696 GLUE_135 (const mmx_ball(mmx_floating, mmx_floating) &arg_1) { 00697 return as<mmx_ball(mmx_floating, complex<mmx_floating> ) > (arg_1); 00698 } 00699 00700 void 00701 glue_ball_floating () { 00702 static bool done = false; 00703 if (done) return; 00704 done = true; 00705 call_glue (string ("glue_complex_floating")); 00706 call_glue (string ("glue_ball_double")); 00707 define_type<mmx_ball(mmx_floating, mmx_floating) > (gen (lit ("Ball"), lit ("Floating"), lit ("Floating"))); 00708 define_type<mmx_ball(mmx_floating, complex<mmx_floating> ) > (gen (lit ("Ball"), lit ("Floating"), gen (lit ("Complex"), lit ("Floating")))); 00709 define ("ball", GLUE_1); 00710 define ("ball", GLUE_2); 00711 define_converter ("upgrade", GLUE_3, PENALTY_INCLUSION); 00712 define ("center", GLUE_4); 00713 define ("radius", GLUE_5); 00714 define ("sharpen", GLUE_6); 00715 define ("blur", GLUE_7); 00716 define ("included?", GLUE_8); 00717 define ("-", GLUE_9); 00718 define ("square", GLUE_10); 00719 define ("invert", GLUE_11); 00720 define ("+", GLUE_12); 00721 define ("-", GLUE_13); 00722 define ("*", GLUE_14); 00723 define ("+", GLUE_15); 00724 define ("+", GLUE_16); 00725 define ("-", GLUE_17); 00726 define ("-", GLUE_18); 00727 define ("*", GLUE_19); 00728 define ("*", GLUE_20); 00729 define ("/", GLUE_21); 00730 define ("/", GLUE_22); 00731 define ("/", GLUE_23); 00732 define ("=", GLUE_24); 00733 define ("!=", GLUE_25); 00734 define ("=", GLUE_26); 00735 define ("!=", GLUE_27); 00736 define ("=", GLUE_28); 00737 define ("!=", GLUE_29); 00738 define ("finite?", GLUE_30); 00739 define ("infinite?", GLUE_31); 00740 define ("nan?", GLUE_32); 00741 define ("times_infinity", GLUE_33); 00742 define ("precision", GLUE_34); 00743 define ("change_precision", GLUE_35); 00744 define ("exponent", GLUE_36); 00745 define ("magnitude", GLUE_37); 00746 define ("increase_exponent", GLUE_38); 00747 define ("decrease_exponent", GLUE_39); 00748 define ("ball", GLUE_40); 00749 define ("ball", GLUE_41); 00750 define_converter ("upgrade", GLUE_42, PENALTY_INCLUSION); 00751 define ("center", GLUE_43); 00752 define ("radius", GLUE_44); 00753 define ("sharpen", GLUE_45); 00754 define ("blur", GLUE_46); 00755 define ("included?", GLUE_47); 00756 define ("-", GLUE_48); 00757 define ("square", GLUE_49); 00758 define ("invert", GLUE_50); 00759 define ("+", GLUE_51); 00760 define ("-", GLUE_52); 00761 define ("*", GLUE_53); 00762 define ("+", GLUE_54); 00763 define ("+", GLUE_55); 00764 define ("-", GLUE_56); 00765 define ("-", GLUE_57); 00766 define ("*", GLUE_58); 00767 define ("*", GLUE_59); 00768 define ("/", GLUE_60); 00769 define ("/", GLUE_61); 00770 define ("/", GLUE_62); 00771 define ("=", GLUE_63); 00772 define ("!=", GLUE_64); 00773 define ("=", GLUE_65); 00774 define ("!=", GLUE_66); 00775 define ("=", GLUE_67); 00776 define ("!=", GLUE_68); 00777 define ("finite?", GLUE_69); 00778 define ("infinite?", GLUE_70); 00779 define ("nan?", GLUE_71); 00780 define ("times_infinity", GLUE_72); 00781 define ("precision", GLUE_73); 00782 define ("change_precision", GLUE_74); 00783 define ("exponent", GLUE_75); 00784 define ("magnitude", GLUE_76); 00785 define ("increase_exponent", GLUE_77); 00786 define ("decrease_exponent", GLUE_78); 00787 define ("sqrt", GLUE_79); 00788 define ("exp", GLUE_80); 00789 define ("log", GLUE_81); 00790 define ("^", GLUE_82); 00791 define ("cos", GLUE_83); 00792 define ("sin", GLUE_84); 00793 define ("tan", GLUE_85); 00794 define ("arccos", GLUE_86); 00795 define ("arcsin", GLUE_87); 00796 define ("arctan", GLUE_88); 00797 define ("next_above", GLUE_89); 00798 define ("next_below", GLUE_90); 00799 define ("<", GLUE_91); 00800 define (">", GLUE_92); 00801 define ("<=", GLUE_93); 00802 define (">=", GLUE_94); 00803 define ("<", GLUE_95); 00804 define (">", GLUE_96); 00805 define ("<=", GLUE_97); 00806 define (">=", GLUE_98); 00807 define ("<", GLUE_99); 00808 define (">", GLUE_100); 00809 define ("<=", GLUE_101); 00810 define (">=", GLUE_102); 00811 define ("abs", GLUE_103); 00812 define ("min", GLUE_104); 00813 define ("max", GLUE_105); 00814 define ("inf", GLUE_106); 00815 define ("sup", GLUE_107); 00816 define ("floor", GLUE_108); 00817 define ("ceil", GLUE_109); 00818 define ("trunc", GLUE_110); 00819 define ("round", GLUE_111); 00820 define ("Re", GLUE_112); 00821 define ("Im", GLUE_113); 00822 define ("conj", GLUE_114); 00823 define ("times_i", GLUE_115); 00824 define ("over_i", GLUE_116); 00825 define ("complex", GLUE_117); 00826 define ("complex", GLUE_118); 00827 define ("abs", GLUE_119); 00828 define ("arg", GLUE_120); 00829 define ("*", GLUE_121); 00830 define ("*", GLUE_122); 00831 define ("/", GLUE_123); 00832 define ("/", GLUE_124); 00833 define ("sqrt", GLUE_125); 00834 define ("exp", GLUE_126); 00835 define ("log", GLUE_127); 00836 define ("^", GLUE_128); 00837 define ("cos", GLUE_129); 00838 define ("sin", GLUE_130); 00839 define ("tan", GLUE_131); 00840 define ("arccos", GLUE_132); 00841 define ("arcsin", GLUE_133); 00842 define ("arctan", GLUE_134); 00843 define_converter (":>", GLUE_135, PENALTY_HOMOMORPHISM); 00844 } 00845 }