fast_exponential.hpp 3.0 KB

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