numerix_doc 0.4
|
00001 00002 #include <basix/double.hpp> 00003 #include <numerix/integer.hpp> 00004 #include <numerix/rational.hpp> 00005 #include <numerix/complex.hpp> 00006 #include <numerix/complex_double.hpp> 00007 #include <numerix/tangent.hpp> 00008 #include <basix/glue.hpp> 00009 00010 #define double_literal(x) as_double (as_string (x)) 00011 00012 namespace mmx { 00013 static tangent<double, double> 00014 GLUE_1 (const double &arg_1) { 00015 return tangent<double, double > (arg_1); 00016 } 00017 00018 static tangent<double, double> 00019 GLUE_2 (const double &arg_1) { 00020 return tangent<double, double > (arg_1); 00021 } 00022 00023 static tangent<double, double> 00024 GLUE_3 (const double &arg_1, const double &arg_2) { 00025 return tangent<double, double > (arg_1, arg_2); 00026 } 00027 00028 static double 00029 GLUE_4 (const tangent<double, double> &arg_1) { 00030 return base (arg_1); 00031 } 00032 00033 static double 00034 GLUE_5 (const tangent<double, double> &arg_1) { 00035 return slope (arg_1); 00036 } 00037 00038 static tangent<double, double> 00039 GLUE_6 (const tangent<double, double> &arg_1) { 00040 return -arg_1; 00041 } 00042 00043 static tangent<double, double> 00044 GLUE_7 (const tangent<double, double> &arg_1) { 00045 return square (arg_1); 00046 } 00047 00048 static tangent<double, double> 00049 GLUE_8 (const tangent<double, double> &arg_1, const tangent<double, double> &arg_2) { 00050 return arg_1 + arg_2; 00051 } 00052 00053 static tangent<double, double> 00054 GLUE_9 (const tangent<double, double> &arg_1, const tangent<double, double> &arg_2) { 00055 return arg_1 - arg_2; 00056 } 00057 00058 static tangent<double, double> 00059 GLUE_10 (const tangent<double, double> &arg_1, const tangent<double, double> &arg_2) { 00060 return arg_1 * arg_2; 00061 } 00062 00063 static tangent<double, double> 00064 GLUE_11 (const tangent<double, double> &arg_1, const tangent<double, double> &arg_2) { 00065 return arg_1 / arg_2; 00066 } 00067 00068 static tangent<double, double> 00069 GLUE_12 (const tangent<double, double> &arg_1) { 00070 return sqrt (arg_1); 00071 } 00072 00073 static tangent<double, double> 00074 GLUE_13 (const tangent<double, double> &arg_1) { 00075 return exp (arg_1); 00076 } 00077 00078 static tangent<double, double> 00079 GLUE_14 (const tangent<double, double> &arg_1) { 00080 return log (arg_1); 00081 } 00082 00083 static tangent<double, double> 00084 GLUE_15 (const tangent<double, double> &arg_1, const tangent<double, double> &arg_2) { 00085 return pow (arg_1, arg_2); 00086 } 00087 00088 static tangent<double, double> 00089 GLUE_16 (const tangent<double, double> &arg_1) { 00090 return cos (arg_1); 00091 } 00092 00093 static tangent<double, double> 00094 GLUE_17 (const tangent<double, double> &arg_1) { 00095 return sin (arg_1); 00096 } 00097 00098 static tangent<double, double> 00099 GLUE_18 (const tangent<double, double> &arg_1) { 00100 return tan (arg_1); 00101 } 00102 00103 static tangent<double, double> 00104 GLUE_19 (const tangent<double, double> &arg_1) { 00105 return acos (arg_1); 00106 } 00107 00108 static tangent<double, double> 00109 GLUE_20 (const tangent<double, double> &arg_1) { 00110 return asin (arg_1); 00111 } 00112 00113 static tangent<double, double> 00114 GLUE_21 (const tangent<double, double> &arg_1) { 00115 return atan (arg_1); 00116 } 00117 00118 static bool 00119 GLUE_22 (const tangent<double, double> &arg_1) { 00120 return is_finite (arg_1); 00121 } 00122 00123 static bool 00124 GLUE_23 (const tangent<double, double> &arg_1) { 00125 return is_infinite (arg_1); 00126 } 00127 00128 static bool 00129 GLUE_24 (const tangent<double, double> &arg_1) { 00130 return is_nan (arg_1); 00131 } 00132 00133 static tangent<double, double> 00134 GLUE_25 (const tangent<double, double> &arg_1) { 00135 return times_infinity (arg_1); 00136 } 00137 00138 static int 00139 GLUE_26 (const tangent<double, double> &arg_1) { 00140 return precision (arg_1); 00141 } 00142 00143 static int 00144 GLUE_27 (const tangent<double, double> &arg_1) { 00145 return exponent (arg_1); 00146 } 00147 00148 static double 00149 GLUE_28 (const tangent<double, double> &arg_1) { 00150 return magnitude (arg_1); 00151 } 00152 00153 static tangent<double, double> 00154 GLUE_29 (const tangent<double, double> &arg_1, const int &arg_2) { 00155 return incexp2 (arg_1, arg_2); 00156 } 00157 00158 static tangent<double, double> 00159 GLUE_30 (const tangent<double, double> &arg_1, const int &arg_2) { 00160 return decexp2 (arg_1, arg_2); 00161 } 00162 00163 static tangent<generic, generic> 00164 GLUE_31 (const tangent<double, double> &arg_1) { 00165 return as<tangent<generic, generic> > (arg_1); 00166 } 00167 00168 static tangent<double, double> 00169 GLUE_32 (const tangent<rational, rational> &arg_1) { 00170 return as<tangent<double, double> > (arg_1); 00171 } 00172 00173 static tangent<complex<double> , complex<double> > 00174 GLUE_33 (const complex<double> &arg_1) { 00175 return tangent<complex<double>, complex<double> > (arg_1); 00176 } 00177 00178 static tangent<complex<double> , complex<double> > 00179 GLUE_34 (const complex<double> &arg_1) { 00180 return tangent<complex<double>, complex<double> > (arg_1); 00181 } 00182 00183 static tangent<complex<double> , complex<double> > 00184 GLUE_35 (const complex<double> &arg_1, const complex<double> &arg_2) { 00185 return tangent<complex<double>, complex<double> > (arg_1, arg_2); 00186 } 00187 00188 static complex<double> 00189 GLUE_36 (const tangent<complex<double> , complex<double> > &arg_1) { 00190 return base (arg_1); 00191 } 00192 00193 static complex<double> 00194 GLUE_37 (const tangent<complex<double> , complex<double> > &arg_1) { 00195 return slope (arg_1); 00196 } 00197 00198 static tangent<complex<double> , complex<double> > 00199 GLUE_38 (const tangent<complex<double> , complex<double> > &arg_1) { 00200 return -arg_1; 00201 } 00202 00203 static tangent<complex<double> , complex<double> > 00204 GLUE_39 (const tangent<complex<double> , complex<double> > &arg_1) { 00205 return square (arg_1); 00206 } 00207 00208 static tangent<complex<double> , complex<double> > 00209 GLUE_40 (const tangent<complex<double> , complex<double> > &arg_1, const tangent<complex<double> , complex<double> > &arg_2) { 00210 return arg_1 + arg_2; 00211 } 00212 00213 static tangent<complex<double> , complex<double> > 00214 GLUE_41 (const tangent<complex<double> , complex<double> > &arg_1, const tangent<complex<double> , complex<double> > &arg_2) { 00215 return arg_1 - arg_2; 00216 } 00217 00218 static tangent<complex<double> , complex<double> > 00219 GLUE_42 (const tangent<complex<double> , complex<double> > &arg_1, const tangent<complex<double> , complex<double> > &arg_2) { 00220 return arg_1 * arg_2; 00221 } 00222 00223 static tangent<complex<double> , complex<double> > 00224 GLUE_43 (const tangent<complex<double> , complex<double> > &arg_1, const tangent<complex<double> , complex<double> > &arg_2) { 00225 return arg_1 / arg_2; 00226 } 00227 00228 static tangent<complex<double> , complex<double> > 00229 GLUE_44 (const tangent<complex<double> , complex<double> > &arg_1) { 00230 return sqrt (arg_1); 00231 } 00232 00233 static tangent<complex<double> , complex<double> > 00234 GLUE_45 (const tangent<complex<double> , complex<double> > &arg_1) { 00235 return exp (arg_1); 00236 } 00237 00238 static tangent<complex<double> , complex<double> > 00239 GLUE_46 (const tangent<complex<double> , complex<double> > &arg_1) { 00240 return log (arg_1); 00241 } 00242 00243 static tangent<complex<double> , complex<double> > 00244 GLUE_47 (const tangent<complex<double> , complex<double> > &arg_1, const tangent<complex<double> , complex<double> > &arg_2) { 00245 return pow (arg_1, arg_2); 00246 } 00247 00248 static tangent<complex<double> , complex<double> > 00249 GLUE_48 (const tangent<complex<double> , complex<double> > &arg_1) { 00250 return cos (arg_1); 00251 } 00252 00253 static tangent<complex<double> , complex<double> > 00254 GLUE_49 (const tangent<complex<double> , complex<double> > &arg_1) { 00255 return sin (arg_1); 00256 } 00257 00258 static tangent<complex<double> , complex<double> > 00259 GLUE_50 (const tangent<complex<double> , complex<double> > &arg_1) { 00260 return tan (arg_1); 00261 } 00262 00263 static tangent<complex<double> , complex<double> > 00264 GLUE_51 (const tangent<complex<double> , complex<double> > &arg_1) { 00265 return acos (arg_1); 00266 } 00267 00268 static tangent<complex<double> , complex<double> > 00269 GLUE_52 (const tangent<complex<double> , complex<double> > &arg_1) { 00270 return asin (arg_1); 00271 } 00272 00273 static tangent<complex<double> , complex<double> > 00274 GLUE_53 (const tangent<complex<double> , complex<double> > &arg_1) { 00275 return atan (arg_1); 00276 } 00277 00278 static bool 00279 GLUE_54 (const tangent<complex<double> , complex<double> > &arg_1) { 00280 return is_finite (arg_1); 00281 } 00282 00283 static bool 00284 GLUE_55 (const tangent<complex<double> , complex<double> > &arg_1) { 00285 return is_infinite (arg_1); 00286 } 00287 00288 static bool 00289 GLUE_56 (const tangent<complex<double> , complex<double> > &arg_1) { 00290 return is_nan (arg_1); 00291 } 00292 00293 static tangent<complex<double> , complex<double> > 00294 GLUE_57 (const tangent<complex<double> , complex<double> > &arg_1) { 00295 return times_infinity (arg_1); 00296 } 00297 00298 static int 00299 GLUE_58 (const tangent<complex<double> , complex<double> > &arg_1) { 00300 return precision (arg_1); 00301 } 00302 00303 static int 00304 GLUE_59 (const tangent<complex<double> , complex<double> > &arg_1) { 00305 return exponent (arg_1); 00306 } 00307 00308 static double 00309 GLUE_60 (const tangent<complex<double> , complex<double> > &arg_1) { 00310 return magnitude (arg_1); 00311 } 00312 00313 static tangent<complex<double> , complex<double> > 00314 GLUE_61 (const tangent<complex<double> , complex<double> > &arg_1, const int &arg_2) { 00315 return incexp2 (arg_1, arg_2); 00316 } 00317 00318 static tangent<complex<double> , complex<double> > 00319 GLUE_62 (const tangent<complex<double> , complex<double> > &arg_1, const int &arg_2) { 00320 return decexp2 (arg_1, arg_2); 00321 } 00322 00323 static tangent<complex<double> , complex<double> > 00324 GLUE_63 (const tangent<double, double> &arg_1) { 00325 return as<tangent<complex<double> , complex<double> > > (arg_1); 00326 } 00327 00328 static tangent<complex<double> , complex<double> > 00329 GLUE_64 (const tangent<rational, rational> &arg_1) { 00330 return as<tangent<complex<double> , complex<double> > > (arg_1); 00331 } 00332 00333 static tangent<complex<double> , complex<double> > 00334 GLUE_65 (const tangent<complex<rational> , complex<rational> > &arg_1) { 00335 return as<tangent<complex<double> , complex<double> > > (arg_1); 00336 } 00337 00338 static tangent<generic, generic> 00339 GLUE_66 (const tangent<complex<double> , complex<double> > &arg_1) { 00340 return as<tangent<generic, generic> > (arg_1); 00341 } 00342 00343 void 00344 glue_tangent_double () { 00345 static bool done = false; 00346 if (done) return; 00347 done = true; 00348 call_glue (string ("glue_complex_double")); 00349 call_glue (string ("glue_tangent_rational")); 00350 define_type<tangent<double, double> > (gen (lit ("Tangent"), lit ("Double"), lit ("Double"))); 00351 define ("tangent", GLUE_1); 00352 define_converter ("upgrade", GLUE_2, PENALTY_HOMOMORPHISM); 00353 define ("tangent", GLUE_3); 00354 define ("base", GLUE_4); 00355 define ("slope", GLUE_5); 00356 define ("-", GLUE_6); 00357 define ("square", GLUE_7); 00358 define ("+", GLUE_8); 00359 define ("-", GLUE_9); 00360 define ("*", GLUE_10); 00361 define ("/", GLUE_11); 00362 define ("sqrt", GLUE_12); 00363 define ("exp", GLUE_13); 00364 define ("log", GLUE_14); 00365 define ("^", GLUE_15); 00366 define ("cos", GLUE_16); 00367 define ("sin", GLUE_17); 00368 define ("tan", GLUE_18); 00369 define ("arccos", GLUE_19); 00370 define ("arcsin", GLUE_20); 00371 define ("arctan", GLUE_21); 00372 define ("finite?", GLUE_22); 00373 define ("infinite?", GLUE_23); 00374 define ("nan?", GLUE_24); 00375 define ("times_infinity", GLUE_25); 00376 define ("precision", GLUE_26); 00377 define ("exponent", GLUE_27); 00378 define ("magnitude", GLUE_28); 00379 define ("increase_exponent", GLUE_29); 00380 define ("decrease_exponent", GLUE_30); 00381 define_converter (":>", GLUE_31, PENALTY_PROMOTE_GENERIC); 00382 define_converter (":>", GLUE_32, PENALTY_INCLUSION); 00383 define_type<tangent<complex<double> , complex<double> > > (gen (lit ("Tangent"), gen (lit ("Complex"), lit ("Double")), gen (lit ("Complex"), lit ("Double")))); 00384 define ("tangent", GLUE_33); 00385 define_converter ("upgrade", GLUE_34, PENALTY_HOMOMORPHISM); 00386 define ("tangent", GLUE_35); 00387 define ("base", GLUE_36); 00388 define ("slope", GLUE_37); 00389 define ("-", GLUE_38); 00390 define ("square", GLUE_39); 00391 define ("+", GLUE_40); 00392 define ("-", GLUE_41); 00393 define ("*", GLUE_42); 00394 define ("/", GLUE_43); 00395 define ("sqrt", GLUE_44); 00396 define ("exp", GLUE_45); 00397 define ("log", GLUE_46); 00398 define ("^", GLUE_47); 00399 define ("cos", GLUE_48); 00400 define ("sin", GLUE_49); 00401 define ("tan", GLUE_50); 00402 define ("arccos", GLUE_51); 00403 define ("arcsin", GLUE_52); 00404 define ("arctan", GLUE_53); 00405 define ("finite?", GLUE_54); 00406 define ("infinite?", GLUE_55); 00407 define ("nan?", GLUE_56); 00408 define ("times_infinity", GLUE_57); 00409 define ("precision", GLUE_58); 00410 define ("exponent", GLUE_59); 00411 define ("magnitude", GLUE_60); 00412 define ("increase_exponent", GLUE_61); 00413 define ("decrease_exponent", GLUE_62); 00414 define_converter (":>", GLUE_63, PENALTY_HOMOMORPHISM); 00415 define_converter (":>", GLUE_64, PENALTY_HOMOMORPHISM); 00416 define_converter (":>", GLUE_65, PENALTY_INCLUSION); 00417 define_converter (":>", GLUE_66, PENALTY_PROMOTE_GENERIC); 00418 } 00419 }