master
ブランチ master
VulkanExample / dep / include / glm / ext / matrix_relational.inl
3.1 KB、88行 生 Blame 履歴
1/// @ref ext_vector_relational
2/// @file glm/ext/vector_relational.inl
3
4// Dependency:
5#include "../ext/vector_relational.hpp"
6#include "../common.hpp"
7
8namespace glm
9{
10 template<length_t C, length_t R, typename T, qualifier Q>
11 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b)
12 {
13 vec<C, bool, Q> Result(true);
14 for(length_t i = 0; i < C; ++i)
15 Result[i] = all(equal(a[i], b[i]));
16 return Result;
17 }
18
19 template<length_t C, length_t R, typename T, qualifier Q>
20 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, T Epsilon)
21 {
22 return equal(a, b, vec<C, T, Q>(Epsilon));
23 }
24
25 template<length_t C, length_t R, typename T, qualifier Q>
26 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, vec<C, T, Q> const& Epsilon)
27 {
28 vec<C, bool, Q> Result(true);
29 for(length_t i = 0; i < C; ++i)
30 Result[i] = all(equal(a[i], b[i], Epsilon[i]));
31 return Result;
32 }
33
34 template<length_t C, length_t R, typename T, qualifier Q>
35 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b)
36 {
37 vec<C, bool, Q> Result(true);
38 for(length_t i = 0; i < C; ++i)
39 Result[i] = any(notEqual(a[i], b[i]));
40 return Result;
41 }
42
43 template<length_t C, length_t R, typename T, qualifier Q>
44 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, T Epsilon)
45 {
46 return notEqual(a, b, vec<C, T, Q>(Epsilon));
47 }
48
49 template<length_t C, length_t R, typename T, qualifier Q>
50 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, vec<C, T, Q> const& Epsilon)
51 {
52 vec<C, bool, Q> Result(true);
53 for(length_t i = 0; i < C; ++i)
54 Result[i] = any(notEqual(a[i], b[i], Epsilon[i]));
55 return Result;
56 }
57
58 template<length_t C, length_t R, typename T, qualifier Q>
59 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, int MaxULPs)
60 {
61 return equal(a, b, vec<C, int, Q>(MaxULPs));
62 }
63
64 template<length_t C, length_t R, typename T, qualifier Q>
65 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, vec<C, int, Q> const& MaxULPs)
66 {
67 vec<C, bool, Q> Result(true);
68 for(length_t i = 0; i < C; ++i)
69 Result[i] = all(equal(a[i], b[i], MaxULPs[i]));
70 return Result;
71 }
72
73 template<length_t C, length_t R, typename T, qualifier Q>
74 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, int MaxULPs)
75 {
76 return notEqual(a, b, vec<C, int, Q>(MaxULPs));
77 }
78
79 template<length_t C, length_t R, typename T, qualifier Q>
80 GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& a, mat<C, R, T, Q> const& b, vec<C, int, Q> const& MaxULPs)
81 {
82 vec<C, bool, Q> Result(true);
83 for(length_t i = 0; i < C; ++i)
84 Result[i] = any(notEqual(a[i], b[i], MaxULPs[i]));
85 return Result;
86 }
87
88}//namespace glm