00001 /***************************************************************************\ 00002 |* Function Parser for C++ v4.0.3 *| 00003 |*-------------------------------------------------------------------------*| 00004 |* Copyright: Juha Nieminen *| 00005 \***************************************************************************/ 00006 00007 // Configuration file 00008 // ------------------ 00009 00010 /* NOTE: 00011 This file is for the internal use of the function parser only. 00012 You don't need to include this file in your source files, just 00013 include "fparser.hh". 00014 */ 00015 00016 00017 /* Uncomment any of these lines or define them in your compiler settings 00018 to enable the correspondent version of the parser. (These are disabled 00019 by default because they rely on C99 functions, and non-standard libraries 00020 in the case pf MPFR and GMP, and they make compiling needlessly slower 00021 and the resulting binary needlessly larger if they are not used in the 00022 program.) 00023 */ 00024 //#define FP_SUPPORT_FLOAT_TYPE 00025 #define FP_SUPPORT_LONG_DOUBLE_TYPE 00026 //#define FP_SUPPORT_LONG_INT_TYPE 00027 //#define FP_SUPPORT_MPFR_FLOAT_TYPE 00028 //#define FP_SUPPORT_GMP_INT_TYPE 00029 00030 /* Uncomment this line of define it in your compiler settings if you want 00031 to disable compiling the basic double version of the library, in case 00032 one of the above types is used but not the double type. (If the double 00033 type is not used, then disabling it makes compiling faster and the 00034 resulting binary smaller.) 00035 */ 00036 //#define FP_DISABLE_DOUBLE_TYPE 00037 00038 /* 00039 Note that these do not change what FunctionParser supports, they only 00040 change how the function is evaluated, potentially making it faster when 00041 these functions are involved. 00042 These will make the source code use asinh(), acosh(), atanh(), exp2() 00043 and log2(). 00044 */ 00045 //#define FP_SUPPORT_TR1_MATH_FUNCS 00046 00047 #ifdef FP_SUPPORT_TR1_MATH_FUNCS 00048 #define FP_SUPPORT_ASINH 00049 #define FP_SUPPORT_EXP2 00050 #define FP_SUPPORT_LOG2 00051 #define FP_SUPPORT_CBRT 00052 #endif 00053 00054 /* 00055 Comment out the following line to enable the eval() function, which can 00056 be used in the function string to recursively call the same function. 00057 Note that enabling this function may be dangerous even if the maximum 00058 recursion level is limited because it is still possible to write functions 00059 using it which take enormous amounts of time to evaluate even though the 00060 maximum recursion is never reached. This may be undesirable in some 00061 applications. 00062 Alternatively you can define the FP_ENABLE_EVAL precompiler constant in 00063 your compiler settings. 00064 */ 00065 #ifndef FP_ENABLE_EVAL 00066 #define FP_DISABLE_EVAL 00067 #endif 00068 00069 00070 /* 00071 Maximum recursion level for eval() calls: 00072 */ 00073 #define FP_EVAL_MAX_REC_LEVEL 1000 00074 00075 00076 /* 00077 Whether to use shortcut evaluation for the & and | operators: 00078 */ 00079 #define FP_DISABLE_SHORTCUT_LOGICAL_EVALUATION 00080 #ifndef FP_DISABLE_SHORTCUT_LOGICAL_EVALUATION 00081 #define FP_ENABLE_SHORTCUT_LOGICAL_EVALUATION 00082 #endif 00083 00084 /* 00085 Whether to enable optimizations that may ignore side effects 00086 of if() calls, such as changing if(x,!y,0) into x&!y. 00087 This is basically the polar opposite of "shortcut logical evaluation". 00088 Disabled by default, because it makes eval() rather unsafe. 00089 */ 00090 #ifdef FP_ENABLE_IGNORE_IF_SIDEEFFECTS 00091 #endif 00092 00093 /* 00094 Comment out the following lines out if you are not going to use the 00095 optimizer and want a slightly smaller library. The Optimize() method 00096 can still be called, but it will not do anything. 00097 If you are unsure, just leave it. It won't slow down the other parts of 00098 the library. 00099 */ 00100 //#define FP_NO_SUPPORT_OPTIMIZER 00101 #ifndef FP_NO_SUPPORT_OPTIMIZER 00102 #define FP_SUPPORT_OPTIMIZER 00103 #endif 00104 00105 00106 /* 00107 Epsilon value used with the comparison operators (must be non-negative): 00108 (Comment it out if you don't want to use epsilon in comparisons. Might 00109 lead to marginally faster evaluation of the comparison operators, but 00110 can introduce inaccuracies in comparisons.) 00111 */ 00112 #define FP_EPSILON 1e-14 00113 00114 00115 /* 00116 No member function of FunctionParser is thread-safe. Most prominently, 00117 Eval() is not thread-safe. By uncommenting one of these lines the Eval() 00118 function can be made thread-safe at the cost of a possible small overhead. 00119 The second version requires that the compiler supports the alloca() function, 00120 which is not standard, but is faster. 00121 */ 00122 //#define FP_USE_THREAD_SAFE_EVAL 00123 //#define FP_USE_THREAD_SAFE_EVAL_WITH_ALLOCA 00124 00125 /* 00126 Uncomment (or define in your compiler options) to disable evaluation checks. 00127 (Consult the documentation for details.) 00128 */ 00129 #define FP_NO_EVALUATION_CHECKS 00130 00131 00132 00133 // Temporary settings while double is the only supported type by the optimizer 00134 #ifdef FP_DISABLE_DOUBLE_TYPE 00135 #ifndef FP_NO_SUPPORT_OPTIMIZER 00136 #define FP_NO_SUPPORT_OPTIMIZER 00137 #endif 00138 #undef FP_SUPPORT_OPTIMIZER 00139 #endif