00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ONCE_FPARSER_AUX_H_
00013 #define ONCE_FPARSER_AUX_H_
00014
00015 #include <cmath>
00016 #include <cstring>
00017
00018 #ifdef FP_SUPPORT_MPFR_FLOAT_TYPE
00019 #include "mpfr/MpfrFloat.h"
00020 #endif
00021
00022 #ifdef FP_SUPPORT_GMP_INT_TYPE
00023 #include "mpfr/GmpInt.h"
00024 #endif
00025
00026 #ifdef ONCE_FPARSER_H_
00027 namespace FUNCTIONPARSERTYPES
00028 {
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 template<typename ValueT>
00041 inline ValueT fp_pow_with_exp_log(const ValueT& x, const ValueT& y)
00042 {
00043
00044 return fp_exp(fp_log(x) * y);
00045 }
00046
00047 template<typename ValueT>
00048 inline ValueT fp_powi(ValueT x, unsigned long y)
00049 {
00050
00051 ValueT result(1);
00052 while(y != 0)
00053 {
00054 if(y & 1) { result *= x; y -= 1; }
00055 else { x *= x; y /= 2; }
00056 }
00057 return result;
00058 }
00059
00060 template<typename ValueT>
00061 ValueT fp_pow(const ValueT& x, const ValueT& y)
00062 {
00063 if(x == ValueT(1)) return ValueT(1);
00064
00065
00066 if(IsIntegerConst(y))
00067 {
00068
00069
00070 if(y >= ValueT(0))
00071 return fp_powi(x, (long)y);
00072 else
00073 return ValueT(1) / fp_powi(x, -(long)y);
00074 }
00075
00076 if(y >= ValueT(0))
00077 {
00078
00079
00080 if(x > ValueT(0)) return fp_pow_with_exp_log(x, y);
00081 if(x == ValueT(0)) return ValueT(0);
00082
00083
00084
00085 if(!IsIntegerConst(y*ValueT(16)))
00086 return -fp_pow_with_exp_log(-x, y);
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 }
00112 else
00113 {
00114
00115 if(x > ValueT(0)) return fp_pow_with_exp_log(ValueT(1) / x, -y);
00116 if(x < ValueT(0))
00117 {
00118 if(!IsIntegerConst(y*ValueT(-16)))
00119 return -fp_pow_with_exp_log(ValueT(-1) / x, -y);
00120
00121 }
00122
00123 }
00124
00125
00126
00127
00128 return fp_pow_base(x, y);
00129 }
00130
00131
00132
00133
00134 inline double fp_abs(double x) { return fabs(x); }
00135 inline double fp_acos(double x) { return acos(x); }
00136 inline double fp_asin(double x) { return asin(x); }
00137 inline double fp_atan(double x) { return atan(x); }
00138 inline double fp_atan2(double x, double y) { return atan2(x, y); }
00139 #ifdef FP_SUPPORT_CBRT
00140 inline double fp_cbrt(double x) { return cbrt(x); }
00141 #else
00142 inline double fp_cbrt(double x) { return x>0 ? exp(log( x)/3.0)
00143 : x<0 ? -exp(log(-x)/3.0)
00144 : 0.0; }
00145 #endif
00146 inline double fp_ceil(double x) { return ceil(x); }
00147 inline double fp_cos(double x) { return cos(x); }
00148 inline double fp_cosh(double x) { return cosh(x); }
00149 inline double fp_exp(double x) { return exp(x); }
00150 inline double fp_floor(double x) { return floor(x); }
00151 inline double fp_int(double x) { return floor(x + .5); }
00152 inline double fp_log(double x) { return log(x); }
00153 inline double fp_log10(double x)
00154 { return log(x) *
00155 0.434294481903251827651128918916605082294397005803666566; }
00156 inline double fp_mod(double x, double y) { return fmod(x, y); }
00157 inline double fp_sin(double x) { return sin(x); }
00158 inline double fp_sinh(double x) { return sinh(x); }
00159 inline double fp_sqrt(double x) { return sqrt(x); }
00160 inline double fp_tan(double x) { return tan(x); }
00161 inline double fp_tanh(double x) { return tanh(x); }
00162
00163 #ifndef FP_SUPPORT_ASINH
00164 inline double fp_asinh(double x) { return log(x + sqrt(x*x + 1.0)); }
00165 inline double fp_acosh(double x) { return log(x + sqrt(x*x - 1.0)); }
00166 inline double fp_atanh(double x) { return log((1.0+x) / (1.0-x)) * 0.5; }
00167 #else
00168 inline double fp_asinh(double x) { return asinh(x); }
00169 inline double fp_acosh(double x) { return acosh(x); }
00170 inline double fp_atanh(double x) { return atanh(x); }
00171 #endif // FP_SUPPORT_ASINH
00172
00173 inline double fp_trunc(double x) { return x<0.0 ? ceil(x) : floor(x); }
00174
00175 inline double fp_pow_base(double x, double y) { return pow(x, y); }
00176
00177 #ifndef FP_SUPPORT_LOG2
00178 inline double fp_log2(double x)
00179 { return log(x) * 1.4426950408889634073599246810018921374266459541529859; }
00180 #else
00181 inline double fp_log2(double x) { return log2(x); }
00182 #endif // FP_SUPPORT_LOG2
00183
00184 inline double fp_exp2(double x) { return fp_pow(2.0, x); }
00185
00186 #ifdef FP_EPSILON
00187 template<typename Value_t>
00188 inline Value_t fp_epsilon() { return FP_EPSILON; }
00189 #else
00190 template<typename Value_t>
00191 inline Value_t fp_epsilon() { return 0.0; }
00192 #endif
00193
00194 #ifdef FP_EPSILON
00195 inline bool FloatEqual(double a, double b)
00196 { return fabs(a - b) <= fp_epsilon<double>(); }
00197 #else
00198 inline bool FloatEqual(double a, double b)
00199 { return a == b; }
00200 #endif // FP_EPSILON
00201
00202 inline bool IsIntegerConst(double a)
00203 { return FloatEqual(a, (double)(long)a); }
00204
00205
00206
00207
00208
00209 #ifdef FP_SUPPORT_FLOAT_TYPE
00210 inline float fp_abs(float x) { return fabsf(x); }
00211 inline float fp_acos(float x) { return acosf(x); }
00212 inline float fp_asin(float x) { return asinf(x); }
00213 inline float fp_atan(float x) { return atanf(x); }
00214 inline float fp_atan2(float x, float y) { return atan2f(x, y); }
00215 #ifdef FP_SUPPORT_CBRT
00216 inline float fp_cbrt(float x) { return cbrtf(x); }
00217 #else
00218 inline float fp_cbrt(float x) { return x>0 ? expf(logf( x)/3.0f)
00219 : x<0 ? -expf(logf(-x)/3.0f)
00220 : 0.0f; }
00221 #endif
00222 inline float fp_ceil(float x) { return ceilf(x); }
00223 inline float fp_cos(float x) { return cosf(x); }
00224 inline float fp_cosh(float x) { return coshf(x); }
00225 inline float fp_exp(float x) { return expf(x); }
00226 inline float fp_floor(float x) { return floorf(x); }
00227 inline float fp_int(float x) { return floorf(x + .5F); }
00228 inline float fp_log(float x) { return logf(x); }
00229 inline float fp_log10(float x)
00230 { return logf(x) *
00231 0.434294481903251827651128918916605082294397005803666566F; }
00232 inline float fp_mod(float x, float y) { return fmodf(x, y); }
00233 inline float fp_sin(float x) { return sinf(x); }
00234 inline float fp_sinh(float x) { return sinhf(x); }
00235 inline float fp_sqrt(float x) { return sqrtf(x); }
00236 inline float fp_tan(float x) { return tanf(x); }
00237 inline float fp_tanh(float x) { return tanhf(x); }
00238
00239 #ifndef FP_SUPPORT_ASINH
00240 inline float fp_asinh(float x) { return logf(x + sqrt(x*x + 1.0F)); }
00241 inline float fp_acosh(float x) { return logf(x + sqrt(x*x - 1.0F)); }
00242 inline float fp_atanh(float x) { return logf((1.0F+x) / (1.0F-x)) * 0.5F; }
00243 #else
00244 inline float fp_asinh(float x) { return asinhf(x); }
00245 inline float fp_acosh(float x) { return acoshf(x); }
00246 inline float fp_atanh(float x) { return atanhf(x); }
00247 #endif // FP_SUPPORT_ASINH
00248
00249 inline float fp_trunc(float x) { return x<0.0F ? ceilf(x) : floorf(x); }
00250
00251 inline float fp_pow_base(float x, float y) { return powf(x, y); }
00252
00253 #ifndef FP_SUPPORT_LOG2
00254 inline float fp_log2(float x)
00255 { return logf(x) *
00256 1.4426950408889634073599246810018921374266459541529859F; }
00257 #else
00258 inline float fp_log2(float x) { return log2f(x); }
00259 #endif // FP_SUPPORT_LOG2
00260
00261 inline float fp_exp2(float x) { return fp_pow(2.0F, x); }
00262
00263 #ifdef FP_EPSILON
00264 template<>
00265 inline float fp_epsilon<float>() { return 1e-6F; }
00266 #else
00267 template<>
00268 inline float fp_epsilon<float>() { return 0.0F; }
00269 #endif
00270
00271 #ifdef FP_EPSILON
00272 inline bool FloatEqual(float a, float b)
00273 { return fabsf(a - b) <= fp_epsilon<float>(); }
00274 #else
00275 inline bool FloatEqual(float a, float b)
00276 { return a == b; }
00277 #endif // FP_EPSILON
00278
00279 inline bool IsIntegerConst(float a)
00280 { return FloatEqual(a, (float)(long)a); }
00281 #endif // FP_SUPPORT_FLOAT_TYPE
00282
00283
00284
00285
00286
00287
00288 #ifdef FP_SUPPORT_LONG_DOUBLE_TYPE
00289 inline long double fp_abs(long double x) { return fabsl(x); }
00290 inline long double fp_acos(long double x) { return acosl(x); }
00291 inline long double fp_asin(long double x) { return asinl(x); }
00292 inline long double fp_atan(long double x) { return atanl(x); }
00293 inline long double fp_atan2(long double x, long double y)
00294 { return atan2l(x, y); }
00295 #ifdef FP_SUPPORT_CBRT
00296 inline long double fp_cbrt(long double x) { return cbrtl(x); }
00297 #else
00298 inline long double fp_cbrt(long double x)
00299 { return x>0 ? expl(logl( x)/3.0l)
00300 : x<0 ? -expl(logl(-x)/3.0l)
00301 : 0.0l; }
00302 #endif
00303 inline long double fp_ceil(long double x) { return ceill(x); }
00304 inline long double fp_cos(long double x) { return cosl(x); }
00305 inline long double fp_cosh(long double x) { return coshl(x); }
00306 inline long double fp_exp(long double x) { return expl(x); }
00307 inline long double fp_floor(long double x) { return floorl(x); }
00308 inline long double fp_int(long double x) { return floorl(x + .5L); }
00309 inline long double fp_log(long double x) { return logl(x); }
00310 inline long double fp_log10(long double x)
00311 { return logl(x) *
00312 0.434294481903251827651128918916605082294397005803666566L; }
00313 inline long double fp_mod(long double x, long double y)
00314 { return fmodl(x, y); }
00315 inline long double fp_sin(long double x) { return sinl(x); }
00316 inline long double fp_sinh(long double x) { return sinhl(x); }
00317 inline long double fp_sqrt(long double x) { return sqrtl(x); }
00318 inline long double fp_tan(long double x) { return tanl(x); }
00319 inline long double fp_tanh(long double x) { return tanhl(x); }
00320
00321 #ifndef FP_SUPPORT_ASINH
00322 inline long double fp_asinh(long double x)
00323 { return logl(x + sqrtl(x*x + 1.0L)); }
00324 inline long double fp_acosh(long double x)
00325 { return logl(x + sqrtl(x*x - 1.0L)); }
00326 inline long double fp_atanh(long double x)
00327 { return logl((1.0L+x) / (1.0L-x)) * 0.5L; }
00328 #else
00329 inline long double fp_asinh(long double x) { return asinhl(x); }
00330 inline long double fp_acosh(long double x) { return acoshl(x); }
00331 inline long double fp_atanh(long double x) { return atanhl(x); }
00332 #endif // FP_SUPPORT_ASINH
00333
00334 inline long double fp_trunc(long double x)
00335 { return x<0.0L ? ceill(x) : floorl(x); }
00336
00337 inline long double fp_pow_base(long double x, long double y)
00338 { return powl(x, y); }
00339
00340 #ifndef FP_SUPPORT_LOG2
00341 inline long double fp_log2(long double x)
00342 { return log(x) * 1.4426950408889634073599246810018921374266459541529859L; }
00343 #else
00344 inline long double fp_log2(long double x) { return log2l(x); }
00345 #endif // FP_SUPPORT_LOG2
00346
00347 inline long double fp_exp2(long double x) { return fp_pow(2.0L, x); }
00348
00349 #ifdef FP_EPSILON
00350 inline bool FloatEqual(long double a, long double b)
00351 { return fabsl(a - b) <= fp_epsilon<double>(); }
00352 #else
00353 inline bool FloatEqual(long double a, long double b)
00354 { return a == b; }
00355 #endif // FP_EPSILON
00356
00357 inline bool IsIntegerConst(long double a)
00358 { return FloatEqual(a, (long double)(long)a); }
00359 #endif // FP_SUPPORT_LONG_DOUBLE_TYPE
00360
00361
00362
00363
00364
00365 inline long fp_abs(long x) { return x < 0 ? -x : x; }
00366 inline long fp_acos(long) { return 0; }
00367 inline long fp_asin(long) { return 0; }
00368 inline long fp_atan(long) { return 0; }
00369 inline long fp_atan2(long, long) { return 0; }
00370 inline long fp_cbrt(long) { return 0; }
00371 inline long fp_ceil(long x) { return x; }
00372 inline long fp_cos(long) { return 0; }
00373 inline long fp_cosh(long) { return 0; }
00374 inline long fp_exp(long) { return 0; }
00375 inline long fp_floor(long x) { return x; }
00376 inline long fp_int(long x) { return x; }
00377 inline long fp_log(long) { return 0; }
00378 inline long fp_log10(long) { return 0; }
00379 inline long fp_mod(long x, long y) { return x % y; }
00380 inline long fp_pow(long, long) { return 0; }
00381 inline long fp_sin(long) { return 0; }
00382 inline long fp_sinh(long) { return 0; }
00383 inline long fp_sqrt(long) { return 1; }
00384 inline long fp_tan(long) { return 0; }
00385 inline long fp_tanh(long) { return 0; }
00386 inline long fp_asinh(long) { return 0; }
00387 inline long fp_acosh(long) { return 0; }
00388 inline long fp_atanh(long) { return 0; }
00389 inline long fp_trunc(long x) { return x; }
00390 inline long fp_pow_base(long, long) { return 0; }
00391 inline long fp_log2(long) { return 0; }
00392 inline long fp_exp2(long) { return 0; }
00393
00394 template<>
00395 inline long fp_epsilon<long>() { return 0; }
00396
00397 inline bool IsIntegerConst(long) { return true; }
00398
00399
00400
00401
00402
00403 #ifdef FP_SUPPORT_MPFR_FLOAT_TYPE
00404 inline MpfrFloat fp_abs(const MpfrFloat& x) { return MpfrFloat::abs(x); }
00405 inline MpfrFloat fp_acos(const MpfrFloat& x) { return MpfrFloat::acos(x); }
00406 inline MpfrFloat fp_asin(const MpfrFloat& x) { return MpfrFloat::asin(x); }
00407 inline MpfrFloat fp_atan(const MpfrFloat& x) { return MpfrFloat::atan(x); }
00408 inline MpfrFloat fp_atan2(const MpfrFloat& x, const MpfrFloat& y) { return MpfrFloat::atan2(x, y); }
00409 inline MpfrFloat fp_cbrt(const MpfrFloat& x) { return MpfrFloat::cbrt(x); }
00410 inline MpfrFloat fp_ceil(const MpfrFloat& x) { return MpfrFloat::ceil(x); }
00411 inline MpfrFloat fp_cos(const MpfrFloat& x) { return MpfrFloat::cos(x); }
00412 inline MpfrFloat fp_cosh(const MpfrFloat& x) { return MpfrFloat::cosh(x); }
00413 inline MpfrFloat fp_exp(const MpfrFloat& x) { return MpfrFloat::exp(x); }
00414 inline MpfrFloat fp_floor(const MpfrFloat& x) { return MpfrFloat::floor(x); }
00415 inline MpfrFloat fp_int(const MpfrFloat& x) { return MpfrFloat::round(x); }
00416 inline MpfrFloat fp_log(const MpfrFloat& x) { return MpfrFloat::log(x); }
00417 inline MpfrFloat fp_log10(const MpfrFloat& x) { return MpfrFloat::log10(x); }
00418 inline MpfrFloat fp_mod(const MpfrFloat& x, const MpfrFloat& y) { return x % y; }
00419 inline MpfrFloat fp_sin(const MpfrFloat& x) { return MpfrFloat::sin(x); }
00420 inline MpfrFloat fp_sinh(const MpfrFloat& x) { return MpfrFloat::sinh(x); }
00421 inline MpfrFloat fp_sqrt(const MpfrFloat& x) { return MpfrFloat::sqrt(x); }
00422 inline MpfrFloat fp_tan(const MpfrFloat& x) { return MpfrFloat::tan(x); }
00423 inline MpfrFloat fp_tanh(const MpfrFloat& x) { return MpfrFloat::tanh(x); }
00424 inline MpfrFloat fp_asinh(const MpfrFloat& x) { return MpfrFloat::asinh(x); }
00425 inline MpfrFloat fp_acosh(const MpfrFloat& x) { return MpfrFloat::acosh(x); }
00426 inline MpfrFloat fp_atanh(const MpfrFloat& x) { return MpfrFloat::atanh(x); }
00427 inline MpfrFloat fp_trunc(const MpfrFloat& x) { return MpfrFloat::trunc(x); }
00428
00429 inline MpfrFloat fp_pow(const MpfrFloat& x, const MpfrFloat& y) { return MpfrFloat::pow(x, y); }
00430 inline MpfrFloat fp_pow_base(const MpfrFloat& x, const MpfrFloat& y) { return MpfrFloat::pow(x, y); }
00431
00432 inline MpfrFloat fp_log2(const MpfrFloat& x) { return MpfrFloat::log2(x); }
00433 inline MpfrFloat fp_exp2(const MpfrFloat& x) { return MpfrFloat::exp2(x); }
00434
00435 inline bool IsIntegerConst(const MpfrFloat& a) { return a.isInteger(); }
00436
00437 template<>
00438 inline MpfrFloat fp_epsilon<MpfrFloat>() { return MpfrFloat::someEpsilon(); }
00439 #endif // FP_SUPPORT_MPFR_FLOAT_TYPE
00440
00441
00442
00443
00444
00445 #ifdef FP_SUPPORT_GMP_INT_TYPE
00446 inline GmpInt fp_abs(GmpInt x) { return GmpInt::abs(x); }
00447 inline GmpInt fp_acos(GmpInt) { return 0; }
00448 inline GmpInt fp_asin(GmpInt) { return 0; }
00449 inline GmpInt fp_atan(GmpInt) { return 0; }
00450 inline GmpInt fp_atan2(GmpInt, GmpInt) { return 0; }
00451 inline GmpInt fp_cbrt(GmpInt) { return 0; }
00452 inline GmpInt fp_ceil(GmpInt x) { return x; }
00453 inline GmpInt fp_cos(GmpInt) { return 0; }
00454 inline GmpInt fp_cosh(GmpInt) { return 0; }
00455 inline GmpInt fp_exp(GmpInt) { return 0; }
00456 inline GmpInt fp_floor(GmpInt x) { return x; }
00457 inline GmpInt fp_int(GmpInt x) { return x; }
00458 inline GmpInt fp_log(GmpInt) { return 0; }
00459 inline GmpInt fp_log10(GmpInt) { return 0; }
00460 inline GmpInt fp_mod(GmpInt x, GmpInt y) { return x % y; }
00461 inline GmpInt fp_pow(GmpInt, GmpInt) { return 0; }
00462 inline GmpInt fp_sin(GmpInt) { return 0; }
00463 inline GmpInt fp_sinh(GmpInt) { return 0; }
00464 inline GmpInt fp_sqrt(GmpInt) { return 0; }
00465 inline GmpInt fp_tan(GmpInt) { return 0; }
00466 inline GmpInt fp_tanh(GmpInt) { return 0; }
00467 inline GmpInt fp_asinh(GmpInt) { return 0; }
00468 inline GmpInt fp_acosh(GmpInt) { return 0; }
00469 inline GmpInt fp_atanh(GmpInt) { return 0; }
00470 inline GmpInt fp_trunc(GmpInt x) { return x; }
00471 inline GmpInt fp_pow_base(GmpInt, GmpInt) { return 0; }
00472 inline GmpInt fp_log2(GmpInt) { return 0; }
00473 inline GmpInt fp_exp2(GmpInt) { return 0; }
00474
00475 template<>
00476 inline GmpInt fp_epsilon<GmpInt>() { return 0; }
00477
00478 inline bool IsIntegerConst(GmpInt) { return true; }
00479 #endif // FP_SUPPORT_GMP_INT_TYPE
00480
00481
00482
00483
00484
00485
00486 #ifdef FP_EPSILON
00487 template<typename Value_t>
00488 inline bool fp_equal(Value_t x, Value_t y)
00489 { return fp_abs(x - y) <= fp_epsilon<Value_t>(); }
00490
00491 template<typename Value_t>
00492 inline bool fp_nequal(Value_t x, Value_t y)
00493 { return fp_abs(x - y) > fp_epsilon<Value_t>(); }
00494
00495 template<typename Value_t>
00496 inline bool fp_less(Value_t x, Value_t y)
00497 { return x < y - fp_epsilon<Value_t>(); }
00498
00499 template<typename Value_t>
00500 inline bool fp_lessOrEq(Value_t x, Value_t y)
00501 { return x <= y + fp_epsilon<Value_t>(); }
00502 #else // FP_EPSILON
00503 template<typename Value_t>
00504 inline bool fp_equal(Value_t x, Value_t y) { return x == y; }
00505
00506 template<typename Value_t>
00507 inline bool fp_nequal(Value_t x, Value_t y) { return x != y; }
00508
00509 template<typename Value_t>
00510 inline bool fp_less(Value_t x, Value_t y) { return x < y; }
00511
00512 template<typename Value_t>
00513 inline bool fp_lessOrEq(Value_t x, Value_t y) { return x <= y; }
00514 #endif // FP_EPSILON
00515
00516 template<>
00517 inline bool fp_equal<long>(long x, long y) { return x == y; }
00518
00519 template<>
00520 inline bool fp_nequal<long>(long x, long y) { return x != y; }
00521
00522 template<>
00523 inline bool fp_less<long>(long x, long y) { return x < y; }
00524
00525 template<>
00526 inline bool fp_lessOrEq<long>(long x, long y) { return x <= y; }
00527
00528 #ifdef FP_SUPPORT_GMP_INT_TYPE
00529 template<>
00530 inline bool fp_equal<GmpInt>(GmpInt x, GmpInt y) { return x == y; }
00531
00532 template<>
00533 inline bool fp_nequal<GmpInt>(GmpInt x, GmpInt y) { return x != y; }
00534
00535 template<>
00536 inline bool fp_less<GmpInt>(GmpInt x, GmpInt y) { return x < y; }
00537
00538 template<>
00539 inline bool fp_lessOrEq<GmpInt>(GmpInt x, GmpInt y) { return x <= y; }
00540 #endif
00541 }
00542
00543 #endif // ONCE_FPARSER_H_
00544
00545
00546 #ifndef FP_DISABLE_DOUBLE_TYPE
00547 #define FUNCTIONPARSER_INSTANTIATE_DOUBLE \
00548 template class FunctionParserBase<double>;
00549 #else
00550 #define FUNCTIONPARSER_INSTANTIATE_DOUBLE
00551 #endif
00552
00553 #ifdef FP_SUPPORT_FLOAT_TYPE
00554 #define FUNCTIONPARSER_INSTANTIATE_FLOAT \
00555 template class FunctionParserBase<float>;
00556 #else
00557 #define FUNCTIONPARSER_INSTANTIATE_FLOAT
00558 #endif
00559
00560 #ifdef FP_SUPPORT_LONG_DOUBLE_TYPE
00561 #define FUNCTIONPARSER_INSTANTIATE_LONG_DOUBLE \
00562 template class FunctionParserBase<long double>;
00563 #else
00564 #define FUNCTIONPARSER_INSTANTIATE_LONG_DOUBLE
00565 #endif
00566
00567 #ifdef FP_SUPPORT_LONG_INT_TYPE
00568 #define FUNCTIONPARSER_INSTANTIATE_LONG_INT \
00569 template class FunctionParserBase<long>;
00570 #else
00571 #define FUNCTIONPARSER_INSTANTIATE_LONG_INT
00572 #endif
00573
00574 #ifdef FP_SUPPORT_MPFR_FLOAT_TYPE
00575 #define FUNCTIONPARSER_INSTANTIATE_MPFR_FLOAT \
00576 template class FunctionParserBase<MpfrFloat>;
00577 #else
00578 #define FUNCTIONPARSER_INSTANTIATE_MPFR_FLOAT
00579 #endif
00580
00581 #ifdef FP_SUPPORT_GMP_INT_TYPE
00582 #define FUNCTIONPARSER_INSTANTIATE_GMP_INT \
00583 template class FunctionParserBase<GmpInt>;
00584 #else
00585 #define FUNCTIONPARSER_INSTANTIATE_GMP_INT
00586 #endif
00587
00588
00589
00590
00591 #define FUNCTIONPARSER_INSTANTIATE_TYPES \
00592 FUNCTIONPARSER_INSTANTIATE_DOUBLE \
00593 FUNCTIONPARSER_INSTANTIATE_FLOAT \
00594 FUNCTIONPARSER_INSTANTIATE_LONG_DOUBLE \
00595 FUNCTIONPARSER_INSTANTIATE_LONG_INT \
00596 FUNCTIONPARSER_INSTANTIATE_MPFR_FLOAT \
00597 FUNCTIONPARSER_INSTANTIATE_GMP_INT
00598
00599 #endif // ONCE_FPARSER_AUX_H_