|
@@ -18,45 +18,38 @@ Well, they are:
|
|
|
|
|
|
#include <math.h>
|
|
|
#include <stdint.h>
|
|
|
-
|
|
|
-#ifdef DEBUG
|
|
|
- /*
|
|
|
- In this example we will use standard output.
|
|
|
- You can actually use any printf implementation you want.
|
|
|
- */
|
|
|
-# include <stdio.h>
|
|
|
-# define YAFL_LOG(...) fprintf(stderr, __VA_ARGS__)
|
|
|
-
|
|
|
- /*
|
|
|
- Using branch speculation may save some clocks...
|
|
|
- */
|
|
|
-# ifdef __GNUC__
|
|
|
-# define YAFL_UNLIKELY(x) __builtin_expect((x), 0)
|
|
|
-# else /*__GNUC__*/
|
|
|
-# define YAFL_UNLIKELY(x) (x)
|
|
|
-# endif/*__GNUC__*/
|
|
|
-
|
|
|
-#else /*DEBUG*/
|
|
|
-
|
|
|
- /*
|
|
|
- Here we have "Never" actually, but you can use some of above definitions if you want.
|
|
|
- */
|
|
|
-# define YAFL_UNLIKELY(x) (0)
|
|
|
-
|
|
|
-#endif/*DEBUG*/
|
|
|
-
|
|
|
-#define YAFL_EPS (1.0e-7)
|
|
|
-
|
|
|
-#define YAFL_SQRT sqrtf
|
|
|
-#define YAFL_ABS fabs
|
|
|
-
|
|
|
-typedef float yaflFloat;
|
|
|
-typedef int32_t yaflInt;
|
|
|
-
|
|
|
-/* WARNING!!!
|
|
|
-Fast UKF SSR updates may give dramatically incorrect results in case of adaptive Bierman filter
|
|
|
-*/
|
|
|
-//#define YAFL_USE_FAST_UKF
|
|
|
+#include <stdio.h>
|
|
|
+
|
|
|
+#define YAFL_DBG(...) fprintf(stderr, __VA_ARGS__)
|
|
|
+
|
|
|
+typedef int32_t yaflInt;
|
|
|
+
|
|
|
+#ifndef YAFL_USE_64_BIT
|
|
|
+# define YAFL_USE_64_BIT (0)
|
|
|
+#endif/*YAFL_USE_64_BIT*/
|
|
|
+
|
|
|
+#if YAFL_USE_64_BIT
|
|
|
+ typedef double yaflFloat;
|
|
|
+# define YAFL_EPS (1.0e-15)
|
|
|
+# define YAFL_SQRT sqrt
|
|
|
+# define YAFL_ABS fabs
|
|
|
+# define YAFL_ABS fabs
|
|
|
+# define YAFL_EXP exp
|
|
|
+# define YAFL_LOG log
|
|
|
+#else/*YAFL_USE_64_BIT*/
|
|
|
+ typedef float yaflFloat;
|
|
|
+# define YAFL_EPS (1.0e-6)
|
|
|
+# define YAFL_SQRT sqrtf
|
|
|
+# define YAFL_ABS fabsf
|
|
|
+# define YAFL_EXP expf
|
|
|
+# define YAFL_LOG logf
|
|
|
+#endif/*YAFL_USE_64_BIT*/
|
|
|
+
|
|
|
+#ifdef __GNUC__
|
|
|
+# define YAFL_UNLIKELY(x) __builtin_expect((x), 0)
|
|
|
+#else
|
|
|
+# define YAFL_UNLIKELY(x) (x)
|
|
|
+#endif
|
|
|
|
|
|
#endif // YAFL_CONFIG_H
|
|
|
|