yafl_config.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*******************************************************************************
  2. Copyright 2021 anonimous <shkolnick-kun@gmail.com> and contributors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing,
  8. software distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions
  11. and limitations under the License.
  12. ******************************************************************************/
  13. #ifndef YAFL_CONFIG_H
  14. #define YAFL_CONFIG_H
  15. #include <math.h>
  16. #include <stdint.h>
  17. #include <stdio.h>
  18. #define YAFL_LOG(...) fprintf(stderr, __VA_ARGS__)
  19. typedef int32_t yaflInt;
  20. #ifndef YAFL_USE_64_BIT
  21. # define YAFL_USE_64_BIT (0)
  22. #endif/*YAFL_USE_64_BIT*/
  23. #if YAFL_USE_64_BIT
  24. typedef double yaflFloat;
  25. # define YAFL_EPS (1.0e-15)
  26. # define YAFL_SQRT sqrt
  27. # define YAFL_ABS fabs
  28. #else/*YAFL_USE_64_BIT*/
  29. typedef float yaflFloat;
  30. # define YAFL_EPS (1.0e-7)
  31. # define YAFL_SQRT sqrtf
  32. # define YAFL_ABS fabsf
  33. #endif/*YAFL_USE_64_BIT*/
  34. #ifdef __GNUC__
  35. # define YAFL_UNLIKELY(x) __builtin_expect((x), 0)
  36. #else
  37. # define YAFL_UNLIKELY(x) (x)
  38. #endif
  39. /* WARNING!!!
  40. Fast UKF SSR updates may give dramatically incorrect results in case of adaptive Bierman filter
  41. */
  42. //#define YAFL_USE_FAST_UKF
  43. #endif // YAFL_CONFIG_H