~ubuntu-branches/ubuntu/oneiric/fparser/oneiric

« back to all changes in this revision

Viewing changes to fpconfig.hh

  • Committer: Bazaar Package Importer
  • Author(s): Scott Howard
  • Date: 2011-04-07 21:19:16 UTC
  • Revision ID: james.westby@ubuntu.com-20110407211916-ejhqulkjialkv5fl
Tags: upstream-4.3
ImportĀ upstreamĀ versionĀ 4.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************\
 
2
|* Function Parser for C++ v4.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
 
 
34
/* Uncomment this line of define it in your compiler settings if you want
 
35
   to disable compiling the basic double version of the library, in case
 
36
   one of the above types is used but not the double type. (If the double
 
37
   type is not used, then disabling it makes compiling faster and the
 
38
   resulting binary smaller.)
 
39
 */
 
40
//#define FP_DISABLE_DOUBLE_TYPE
 
41
 
 
42
/*
 
43
 Note that these do not change what FunctionParser supports, they only
 
44
 change how the function is evaluated, potentially making it faster when
 
45
 these functions are involved.
 
46
 These will make the source code use asinh(), acosh(), atanh(), exp2()
 
47
 and log2().
 
48
*/
 
49
//#define FP_SUPPORT_TR1_MATH_FUNCS
 
50
 
 
51
#ifdef FP_SUPPORT_TR1_MATH_FUNCS
 
52
#define FP_SUPPORT_ASINH
 
53
#define FP_SUPPORT_EXP2
 
54
#define FP_SUPPORT_LOG2
 
55
#define FP_SUPPORT_CBRT
 
56
#define FP_SUPPORT_HYPOT
 
57
#endif
 
58
 
 
59
/*
 
60
 Comment out the following line to enable the eval() function, which can
 
61
 be used in the function string to recursively call the same function.
 
62
 Note that enabling this function may be dangerous even if the maximum
 
63
 recursion level is limited because it is still possible to write functions
 
64
 using it which take enormous  amounts of time to evaluate even though the
 
65
 maximum recursion is never reached. This may be undesirable in some
 
66
 applications.
 
67
 Alternatively you can define the FP_ENABLE_EVAL precompiler constant in
 
68
 your compiler settings.
 
69
*/
 
70
#ifndef FP_ENABLE_EVAL
 
71
#define FP_DISABLE_EVAL
 
72
#endif
 
73
 
 
74
 
 
75
/*
 
76
 Maximum recursion level for eval() calls:
 
77
*/
 
78
#define FP_EVAL_MAX_REC_LEVEL 1000
 
79
 
 
80
 
 
81
/*
 
82
 Whether to use shortcut evaluation for the & and | operators:
 
83
*/
 
84
#ifndef FP_DISABLE_SHORTCUT_LOGICAL_EVALUATION
 
85
#define FP_ENABLE_SHORTCUT_LOGICAL_EVALUATION
 
86
#endif
 
87
 
 
88
/*
 
89
 Whether to enable optimizations that may ignore side effects
 
90
 of if() calls, such as changing if(x,!y,0) into x&!y.
 
91
 This is basically the polar opposite of "shortcut logical evaluation".
 
92
 Disabled by default, because it makes eval() rather unsafe.
 
93
*/
 
94
#ifdef FP_ENABLE_IGNORE_IF_SIDEEFFECTS
 
95
#endif
 
96
 
 
97
/*
 
98
 Comment out the following lines out if you are not going to use the
 
99
 optimizer and want a slightly smaller library. The Optimize() method
 
100
 can still be called, but it will not do anything.
 
101
 If you are unsure, just leave it. It won't slow down the other parts of
 
102
 the library.
 
103
*/
 
104
#ifndef FP_NO_SUPPORT_OPTIMIZER
 
105
#define FP_SUPPORT_OPTIMIZER
 
106
#endif
 
107
 
 
108
 
 
109
/*
 
110
 Epsilon value used with the comparison operators (must be non-negative):
 
111
 (Comment it out if you don't want to use epsilon in comparisons. Might
 
112
 lead to marginally faster evaluation of the comparison operators, but
 
113
 can introduce inaccuracies in comparisons.)
 
114
*/
 
115
#define FP_EPSILON 1e-14
 
116
 
 
117
 
 
118
/*
 
119
 No member function of FunctionParser is thread-safe. Most prominently,
 
120
 Eval() is not thread-safe. By uncommenting one of these lines the Eval()
 
121
 function can be made thread-safe at the cost of a possible small overhead.
 
122
 The second version requires that the compiler supports the alloca() function,
 
123
 which is not standard, but is faster.
 
124
 */
 
125
//#define FP_USE_THREAD_SAFE_EVAL
 
126
//#define FP_USE_THREAD_SAFE_EVAL_WITH_ALLOCA
 
127
 
 
128
/*
 
129
 Uncomment (or define in your compiler options) to disable evaluation checks.
 
130
 (Consult the documentation for details.)
 
131
 */
 
132
//#define FP_NO_EVALUATION_CHECKS