My Project
 All Classes Functions Variables Pages
fpconfig.hh
1 /***************************************************************************\
2 |* Function Parser for C++ v4.4.3 *|
3 |*-------------------------------------------------------------------------*|
4 |* Copyright: Juha Nieminen *|
5 |* *|
6 |* This library is distributed under the terms of the *|
7 |* GNU Lesser General Public License version 3. *|
8 |* (See lgpl.txt and gpl.txt for the license text.) *|
9 \***************************************************************************/
10 
11 // Configuration file
12 // ------------------
13 
14 /* NOTE:
15  This file is for the internal use of the function parser only.
16  You don't need to include this file in your source files, just
17  include "fparser.hh".
18 */
19 
20 
21 /* Uncomment any of these lines or define them in your compiler settings
22  to enable the correspondent version of the parser. (These are disabled
23  by default because they rely on C99 functions, and non-standard libraries
24  in the case pf MPFR and GMP, and they make compiling needlessly slower
25  and the resulting binary needlessly larger if they are not used in the
26  program.)
27 */
28 //#define FP_SUPPORT_FLOAT_TYPE
29 //#define FP_SUPPORT_LONG_DOUBLE_TYPE
30 //#define FP_SUPPORT_LONG_INT_TYPE
31 //#define FP_SUPPORT_MPFR_FLOAT_TYPE
32 //#define FP_SUPPORT_GMP_INT_TYPE
33 //#define FP_SUPPORT_COMPLEX_DOUBLE_TYPE
34 //#define FP_SUPPORT_COMPLEX_FLOAT_TYPE
35 //#define FP_SUPPORT_COMPLEX_LONG_DOUBLE_TYPE
36 
37 /* If you are using FunctionParser_ld or FunctionParser_cld and your compiler
38  supports the strtold() function, you should uncomment the following line.
39  */
40 //#define FP_USE_STRTOLD
41 
42 
43 /* Uncomment this line of define it in your compiler settings if you want
44  to disable compiling the basic double version of the library, in case
45  one of the above types is used but not the double type. (If the double
46  type is not used, then disabling it makes compiling faster and the
47  resulting binary smaller.)
48  */
49 //#define FP_DISABLE_DOUBLE_TYPE
50 
51 /*
52  Note that these do not change what FunctionParser supports, they only
53  change how the function is evaluated, potentially making it faster when
54  these functions are involved.
55  These will make the source code use asinh(), acosh(), atanh(), exp2()
56  and log2().
57 */
58 //#define FP_SUPPORT_TR1_MATH_FUNCS
59 
60 #ifdef FP_SUPPORT_TR1_MATH_FUNCS
61 #define FP_SUPPORT_ASINH
62 #define FP_SUPPORT_EXP2
63 #define FP_SUPPORT_LOG2
64 #define FP_SUPPORT_CBRT
65 #define FP_SUPPORT_HYPOT
66 #endif
67 
68 /*
69  Comment out the following line to enable the eval() function, which can
70  be used in the function string to recursively call the same function.
71  Note that enabling this function may be dangerous even if the maximum
72  recursion level is limited because it is still possible to write functions
73  using it which take enormous amounts of time to evaluate even though the
74  maximum recursion is never reached. This may be undesirable in some
75  applications.
76  Alternatively you can define the FP_ENABLE_EVAL precompiler constant in
77  your compiler settings.
78 */
79 #ifndef FP_ENABLE_EVAL
80 #define FP_DISABLE_EVAL
81 #endif
82 
83 
84 /*
85  Maximum recursion level for eval() calls:
86 */
87 #define FP_EVAL_MAX_REC_LEVEL 1000
88 
89 
90 /*
91  Whether to use shortcut evaluation for the & and | operators:
92 */
93 #ifndef FP_DISABLE_SHORTCUT_LOGICAL_EVALUATION
94 #define FP_ENABLE_SHORTCUT_LOGICAL_EVALUATION
95 #endif
96 
97 /*
98  Whether to enable optimizations that may ignore side effects
99  of if() calls, such as changing if(x,!y,0) into x&!y.
100  This is basically the polar opposite of "shortcut logical evaluation".
101  Disabled by default, because it makes eval() rather unsafe.
102 */
103 #ifdef FP_ENABLE_IGNORE_IF_SIDEEFFECTS
104 #endif
105 
106 /*
107  Comment out the following lines out if you are not going to use the
108  optimizer and want a slightly smaller library. The Optimize() method
109  can still be called, but it will not do anything.
110  If you are unsure, just leave it. It won't slow down the other parts of
111  the library.
112 */
113 #ifndef FP_NO_SUPPORT_OPTIMIZER
114 #define FP_SUPPORT_OPTIMIZER
115 #endif
116 
117 #if defined(FP_SUPPORT_COMPLEX_DOUBLE_TYPE) || defined(FP_SUPPORT_COMPLEX_FLOAT_TYPE) || defined(FP_SUPPORT_COMPLEX_LONG_DOUBLE_TYPE)
118 #define FP_SUPPORT_COMPLEX_NUMBERS
119 #endif
120 
121 
122 /*
123  Epsilon value used with the comparison operators (must be non-negative):
124  (Comment it out if you don't want to use epsilon in comparisons. Might
125  lead to marginally faster evaluation of the comparison operators, but
126  can introduce inaccuracies in comparisons.)
127 */
128 #define FP_EPSILON 1e-14
129 
130 
131 /*
132  No member function of FunctionParser is thread-safe. Most prominently,
133  Eval() is not thread-safe. By uncommenting one of these lines the Eval()
134  function can be made thread-safe at the cost of a possible small overhead.
135  The second version requires that the compiler supports the alloca() function,
136  which is not standard, but is faster.
137  */
138 //#define FP_USE_THREAD_SAFE_EVAL
139 //#define FP_USE_THREAD_SAFE_EVAL_WITH_ALLOCA
140 
141 /*
142  Uncomment (or define in your compiler options) to disable evaluation checks.
143  (Consult the documentation for details.)
144  */
145 //#define FP_NO_EVALUATION_CHECKS