master
ブランチ master
VulkanExample / dep / include / glm / ext / vector_ulp.hpp
3.9 KB、112行 生 Blame 履歴
1/// @ref ext_vector_ulp
2/// @file glm/ext/vector_ulp.hpp
3///
4/// @defgroup ext_vector_ulp GLM_EXT_vector_ulp
5/// @ingroup ext
6///
7/// Allow the measurement of the accuracy of a function against a reference
8/// implementation. This extension works on floating-point data and provide results
9/// in ULP.
10///
11/// Include <glm/ext/vector_ulp.hpp> to use the features of this extension.
12///
13/// @see ext_scalar_ulp
14/// @see ext_scalar_relational
15/// @see ext_vector_relational
16
17#pragma once
18
19// Dependencies
20#include "../ext/scalar_ulp.hpp"
21
22#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
23# pragma message("GLM: GLM_EXT_vector_ulp extension included")
24#endif
25
26namespace glm
27{
28 /// @addtogroup ext_vector_ulp
29 /// @{
30
31 /// Return the next ULP value(s) after the input value(s).
32 ///
33 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
34 /// @tparam T Floating-point
35 /// @tparam Q Value from qualifier enum
36 ///
37 /// @see ext_scalar_ulp
38 template<length_t L, typename T, qualifier Q>
39 GLM_FUNC_DECL vec<L, T, Q> nextFloat(vec<L, T, Q> const& x);
40
41 /// Return the value(s) ULP distance after the input value(s).
42 ///
43 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
44 /// @tparam T Floating-point
45 /// @tparam Q Value from qualifier enum
46 ///
47 /// @see ext_scalar_ulp
48 template<length_t L, typename T, qualifier Q>
49 GLM_FUNC_DECL vec<L, T, Q> nextFloat(vec<L, T, Q> const& x, int ULPs);
50
51 /// Return the value(s) ULP distance after the input value(s).
52 ///
53 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
54 /// @tparam T Floating-point
55 /// @tparam Q Value from qualifier enum
56 ///
57 /// @see ext_scalar_ulp
58 template<length_t L, typename T, qualifier Q>
59 GLM_FUNC_DECL vec<L, T, Q> nextFloat(vec<L, T, Q> const& x, vec<L, int, Q> const& ULPs);
60
61 /// Return the previous ULP value(s) before the input value(s).
62 ///
63 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
64 /// @tparam T Floating-point
65 /// @tparam Q Value from qualifier enum
66 ///
67 /// @see ext_scalar_ulp
68 template<length_t L, typename T, qualifier Q>
69 GLM_FUNC_DECL vec<L, T, Q> prevFloat(vec<L, T, Q> const& x);
70
71 /// Return the value(s) ULP distance before the input value(s).
72 ///
73 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
74 /// @tparam T Floating-point
75 /// @tparam Q Value from qualifier enum
76 ///
77 /// @see ext_scalar_ulp
78 template<length_t L, typename T, qualifier Q>
79 GLM_FUNC_DECL vec<L, T, Q> prevFloat(vec<L, T, Q> const& x, int ULPs);
80
81 /// Return the value(s) ULP distance before the input value(s).
82 ///
83 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
84 /// @tparam T Floating-point
85 /// @tparam Q Value from qualifier enum
86 ///
87 /// @see ext_scalar_ulp
88 template<length_t L, typename T, qualifier Q>
89 GLM_FUNC_DECL vec<L, T, Q> prevFloat(vec<L, T, Q> const& x, vec<L, int, Q> const& ULPs);
90
91 /// Return the distance in the number of ULP between 2 single-precision floating-point scalars.
92 ///
93 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
94 /// @tparam Q Value from qualifier enum
95 ///
96 /// @see ext_scalar_ulp
97 template<length_t L, typename T, qualifier Q>
98 GLM_FUNC_DECL vec<L, int, Q> floatDistance(vec<L, float, Q> const& x, vec<L, float, Q> const& y);
99
100 /// Return the distance in the number of ULP between 2 double-precision floating-point scalars.
101 ///
102 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
103 /// @tparam Q Value from qualifier enum
104 ///
105 /// @see ext_scalar_ulp
106 template<length_t L, typename T, qualifier Q>
107 GLM_FUNC_DECL vec<L, int64, Q> floatDistance(vec<L, double, Q> const& x, vec<L, double, Q> const& y);
108
109 /// @}
110}//namespace glm
111
112#include "vector_ulp.inl"