TypeIIRMLMath.h
Go to the documentation of this file.
1 // ---------------------- Doxygen info ----------------------
38 // ----------------------------------------------------------
39 // For a convenient reading of this file's source code,
40 // please use a tab width of four characters.
41 // ----------------------------------------------------------
42 
43 
44 #ifndef __TypeIIRMLMath__
45 #define __TypeIIRMLMath__
46 
47 
48 //*******************************************************************************************
49 // Include files
50 
51 #include <math.h>
52 
53 
54 namespace TypeIIRMLMath
55 {
56 
57 //*******************************************************************************************
58 // Definitions and macros
59 
60 
61 
62 
63 // ---------------------- Doxygen info ----------------------
68 // ----------------------------------------------------------
69 #define OTG_INFINITY ((double)1.0e100)
70 
71 
72 // ---------------------- Doxygen info ----------------------
84 // ----------------------------------------------------------
85 #define RML_INPUT_VALUE_EPSILON ((double)1.0e-10)
86 
87 
88 // ---------------------- Doxygen info ----------------------
96 // ----------------------------------------------------------
97 #define RML_VALID_SOLUTION_EPSILON ((double)1.0e-10)
98 
99 
100 // ---------------------- Doxygen info ----------------------
114 // ----------------------------------------------------------
115 #define MAXIMAL_NO_OF_POLYNOMIALS 7
116 
117 
118 // ---------------------- Doxygen info ----------------------
129 // ----------------------------------------------------------
130 #define RML_MAX_EXECUTION_TIME ((double)1e10)
131 
132 
133 // ---------------------- Doxygen info ----------------------
141 // ----------------------------------------------------------
142 #define RML_ADDITIONAL_RELATIVE_POSITION_ERROR_IN_CASE_OF_EQUALITY ((double)1e-7)
143 
144 
145 // ---------------------- Doxygen info ----------------------
153 // ----------------------------------------------------------
154 #define RML_ADDITIONAL_ABSOLUTE_POSITION_ERROR_IN_CASE_OF_EQUALITY ((double)1e-7)
155 
156 
157 // ---------------------- Doxygen info ----------------------
163 // ----------------------------------------------------------
164 #define POSITIVE_ZERO ((double)1.0e-50)
165 
166 
167 // ---------------------- Doxygen info ----------------------
178 // ----------------------------------------------------------
179 #define ABSOLUTE_PHASE_SYNC_EPSILON ((double)1.0e-6)
180 
181 
182 // ---------------------- Doxygen info ----------------------
191 // ----------------------------------------------------------
192 #define RELATIVE_PHASE_SYNC_EPSILON ((double)1.0e-3)
193 
194 
195 // ---------------------- Doxygen info ----------------------
200 // ----------------------------------------------------------
201 #define RML_INFINITY ((double)1.0e100)
202 
203 
204 // ---------------------- Doxygen info ----------------------
215 // ----------------------------------------------------------
216 #define RML_POSITION_EXTREMS_TIME_EPSILON ((double)1.0e-4)
217 
218 
219 // ---------------------- Doxygen info ----------------------
227 // ----------------------------------------------------------
228 #define PHASE_SYNC_COLLINEARITY_REL_EPSILON ((double)1.0e-2)
229 
230 
231 // ---------------------- Doxygen info ----------------------
242 // ----------------------------------------------------------
243 #define Sign(A) ( ((double)(A) < 0.0)?(-1):(1) )
244 
245 
246 // ---------------------- Doxygen info ----------------------
257 // ----------------------------------------------------------
258 #define FSign(A) ( ((double)(A) < 0.0)?(-1.0):(1.0) )
259 
260 
261 // ---------------------- Doxygen info ----------------------
272 // ----------------------------------------------------------
273 #define pow2(A) ((A)*(A))
274 
275 
276 // ---------------------- Doxygen info ----------------------
290 // ----------------------------------------------------------
291 inline double RMLSqrt(const double &Value)
292 {
293  return( ( Value <= 0.0 ) ? ( POSITIVE_ZERO ) : ( sqrt( Value ) ) );
294 }
295 
296 
297 // ---------------------- Doxygen info ----------------------
303 // ----------------------------------------------------------
304 #define IsInputEpsilonEqual(A,B) ((bool)((fabs((double)A - (double)B) <= RML_INPUT_VALUE_EPSILON)?(true):(false)))
305 
306 
307 // ---------------------- Doxygen info ----------------------
329 // ----------------------------------------------------------
330 inline bool IsEpsilonEquality( const double &Value1
331  , const double &Value2
332  , const double &Epsilon)
333 {
334  return(fabs(Value1 - Value2) <= Epsilon);
335 }
336 
337 
338 } // namespace TypeIIRMLMath
339 
340 #endif
double RMLSqrt(const double &Value)
Calculates the real square root of a given value. If the value is negative a value of almost zero wil...
bool IsEpsilonEquality(const double &Value1, const double &Value2, const double &Epsilon)
Checks epsilon equality for two values.
#define POSITIVE_ZERO
To prevent from numerical errors, a value for a "positive" value of zero is required for deterministi...


libreflexxestype2
Author(s):
autogenerated on Sat Nov 21 2020 03:17:34