fast_exponential.hpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /// @ref gtx_fast_exponential
  2. /// @file glm/gtx/fast_exponential.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_half_float (dependence)
  6. ///
  7. /// @defgroup gtx_fast_exponential GLM_GTX_fast_exponential
  8. /// @ingroup gtx
  9. ///
  10. /// Include <glm/gtx/fast_exponential.hpp> to use the features of this extension.
  11. ///
  12. /// Fast but less accurate implementations of exponential based functions.
  13. #pragma once
  14. // Dependency:
  15. #include "../glm.hpp"
  16. #ifndef GLM_ENABLE_EXPERIMENTAL
  17. # error "GLM: GLM_GTX_fast_exponential is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
  18. #endif
  19. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  20. # pragma message("GLM: GLM_GTX_fast_exponential extension included")
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_fast_exponential
  25. /// @{
  26. /// Faster than the common pow function but less accurate.
  27. /// @see gtx_fast_exponential
  28. template<typename genType>
  29. GLM_FUNC_DECL genType fastPow(genType x, genType y);
  30. /// Faster than the common pow function but less accurate.
  31. /// @see gtx_fast_exponential
  32. template<length_t L, typename T, qualifier Q>
  33. GLM_FUNC_DECL vec<L, T, Q> fastPow(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
  34. /// Faster than the common pow function but less accurate.
  35. /// @see gtx_fast_exponential
  36. template<typename genTypeT, typename genTypeU>
  37. GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y);
  38. /// Faster than the common pow function but less accurate.
  39. /// @see gtx_fast_exponential
  40. template<length_t L, typename T, qualifier Q>
  41. GLM_FUNC_DECL vec<L, T, Q> fastPow(vec<L, T, Q> const& x);
  42. /// Faster than the common exp function but less accurate.
  43. /// @see gtx_fast_exponential
  44. template<typename T>
  45. GLM_FUNC_DECL T fastExp(T x);
  46. /// Faster than the common exp function but less accurate.
  47. /// @see gtx_fast_exponential
  48. template<length_t L, typename T, qualifier Q>
  49. GLM_FUNC_DECL vec<L, T, Q> fastExp(vec<L, T, Q> const& x);
  50. /// Faster than the common log function but less accurate.
  51. /// @see gtx_fast_exponential
  52. template<typename T>
  53. GLM_FUNC_DECL T fastLog(T x);
  54. /// Faster than the common exp2 function but less accurate.
  55. /// @see gtx_fast_exponential
  56. template<length_t L, typename T, qualifier Q>
  57. GLM_FUNC_DECL vec<L, T, Q> fastLog(vec<L, T, Q> const& x);
  58. /// Faster than the common exp2 function but less accurate.
  59. /// @see gtx_fast_exponential
  60. template<typename T>
  61. GLM_FUNC_DECL T fastExp2(T x);
  62. /// Faster than the common exp2 function but less accurate.
  63. /// @see gtx_fast_exponential
  64. template<length_t L, typename T, qualifier Q>
  65. GLM_FUNC_DECL vec<L, T, Q> fastExp2(vec<L, T, Q> const& x);
  66. /// Faster than the common log2 function but less accurate.
  67. /// @see gtx_fast_exponential
  68. template<typename T>
  69. GLM_FUNC_DECL T fastLog2(T x);
  70. /// Faster than the common log2 function but less accurate.
  71. /// @see gtx_fast_exponential
  72. template<length_t L, typename T, qualifier Q>
  73. GLM_FUNC_DECL vec<L, T, Q> fastLog2(vec<L, T, Q> const& x);
  74. /// @}
  75. }//namespace glm
  76. #include "fast_exponential.inl"