fast_exponential.hpp 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  17. # ifndef GLM_ENABLE_EXPERIMENTAL
  18. # pragma message("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.")
  19. # else
  20. # pragma message("GLM: GLM_GTX_fast_exponential extension included")
  21. # endif
  22. #endif
  23. namespace glm
  24. {
  25. /// @addtogroup gtx_fast_exponential
  26. /// @{
  27. /// Faster than the common pow function but less accurate.
  28. /// @see gtx_fast_exponential
  29. template<typename genType>
  30. GLM_FUNC_DECL genType fastPow(genType x, genType y);
  31. /// Faster than the common pow function but less accurate.
  32. /// @see gtx_fast_exponential
  33. template<length_t L, typename T, qualifier Q>
  34. GLM_FUNC_DECL vec<L, T, Q> fastPow(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
  35. /// Faster than the common pow function but less accurate.
  36. /// @see gtx_fast_exponential
  37. template<typename genTypeT, typename genTypeU>
  38. GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y);
  39. /// Faster than the common pow function but less accurate.
  40. /// @see gtx_fast_exponential
  41. template<length_t L, typename T, qualifier Q>
  42. GLM_FUNC_DECL vec<L, T, Q> fastPow(vec<L, T, Q> const& x);
  43. /// Faster than the common exp function but less accurate.
  44. /// @see gtx_fast_exponential
  45. template<typename T>
  46. GLM_FUNC_DECL T fastExp(T x);
  47. /// Faster than the common exp function but less accurate.
  48. /// @see gtx_fast_exponential
  49. template<length_t L, typename T, qualifier Q>
  50. GLM_FUNC_DECL vec<L, T, Q> fastExp(vec<L, T, Q> const& x);
  51. /// Faster than the common log function but less accurate.
  52. /// @see gtx_fast_exponential
  53. template<typename T>
  54. GLM_FUNC_DECL T fastLog(T x);
  55. /// Faster than the common exp2 function but less accurate.
  56. /// @see gtx_fast_exponential
  57. template<length_t L, typename T, qualifier Q>
  58. GLM_FUNC_DECL vec<L, T, Q> fastLog(vec<L, T, Q> const& x);
  59. /// Faster than the common exp2 function but less accurate.
  60. /// @see gtx_fast_exponential
  61. template<typename T>
  62. GLM_FUNC_DECL T fastExp2(T x);
  63. /// Faster than the common exp2 function but less accurate.
  64. /// @see gtx_fast_exponential
  65. template<length_t L, typename T, qualifier Q>
  66. GLM_FUNC_DECL vec<L, T, Q> fastExp2(vec<L, T, Q> const& x);
  67. /// Faster than the common log2 function but less accurate.
  68. /// @see gtx_fast_exponential
  69. template<typename T>
  70. GLM_FUNC_DECL T fastLog2(T x);
  71. /// Faster than the common log2 function but less accurate.
  72. /// @see gtx_fast_exponential
  73. template<length_t L, typename T, qualifier Q>
  74. GLM_FUNC_DECL vec<L, T, Q> fastLog2(vec<L, T, Q> const& x);
  75. /// @}
  76. }//namespace glm
  77. #include "fast_exponential.inl"