master
ブランチ master
ShaderPlayground / deps / glm / glm / gtx / fast_exponential.hpp
3 KB、95行 生 Blame 履歴
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
14#pragma once
15
16// Dependency:
17#include "../glm.hpp"
18
19#ifndef GLM_ENABLE_EXPERIMENTAL
20# 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."
21#endif
22
23#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
24# pragma message("GLM: GLM_GTX_fast_exponential extension included")
25#endif
26
27namespace glm
28{
29 /// @addtogroup gtx_fast_exponential
30 /// @{
31
32 /// Faster than the common pow function but less accurate.
33 /// @see gtx_fast_exponential
34 template<typename genType>
35 GLM_FUNC_DECL genType fastPow(genType x, genType y);
36
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, vec<L, T, Q> const& y);
41
42 /// Faster than the common pow function but less accurate.
43 /// @see gtx_fast_exponential
44 template<typename genTypeT, typename genTypeU>
45 GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y);
46
47 /// Faster than the common pow 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> fastPow(vec<L, T, Q> const& x);
51
52 /// Faster than the common exp function but less accurate.
53 /// @see gtx_fast_exponential
54 template<typename T>
55 GLM_FUNC_DECL T fastExp(T x);
56
57 /// Faster than the common exp function but less accurate.
58 /// @see gtx_fast_exponential
59 template<length_t L, typename T, qualifier Q>
60 GLM_FUNC_DECL vec<L, T, Q> fastExp(vec<L, T, Q> const& x);
61
62 /// Faster than the common log function but less accurate.
63 /// @see gtx_fast_exponential
64 template<typename T>
65 GLM_FUNC_DECL T fastLog(T x);
66
67 /// Faster than the common exp2 function but less accurate.
68 /// @see gtx_fast_exponential
69 template<length_t L, typename T, qualifier Q>
70 GLM_FUNC_DECL vec<L, T, Q> fastLog(vec<L, T, Q> const& x);
71
72 /// Faster than the common exp2 function but less accurate.
73 /// @see gtx_fast_exponential
74 template<typename T>
75 GLM_FUNC_DECL T fastExp2(T x);
76
77 /// Faster than the common exp2 function but less accurate.
78 /// @see gtx_fast_exponential
79 template<length_t L, typename T, qualifier Q>
80 GLM_FUNC_DECL vec<L, T, Q> fastExp2(vec<L, T, Q> const& x);
81
82 /// Faster than the common log2 function but less accurate.
83 /// @see gtx_fast_exponential
84 template<typename T>
85 GLM_FUNC_DECL T fastLog2(T x);
86
87 /// Faster than the common log2 function but less accurate.
88 /// @see gtx_fast_exponential
89 template<length_t L, typename T, qualifier Q>
90 GLM_FUNC_DECL vec<L, T, Q> fastLog2(vec<L, T, Q> const& x);
91
92 /// @}
93}//namespace glm
94
95#include "fast_exponential.inl"