| 1 | namespace glm |
| 2 | { |
| 3 | template<length_t L, typename T, qualifier Q> |
| 4 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> lessThan(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
| 5 | { |
| 6 | vec<L, bool, Q> Result(true); |
| 7 | for(length_t i = 0; i < L; ++i) |
| 8 | Result[i] = x[i] < y[i]; |
| 9 | return Result; |
| 10 | } |
| 11 | |
| 12 | template<length_t L, typename T, qualifier Q> |
| 13 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> lessThanEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
| 14 | { |
| 15 | vec<L, bool, Q> Result(true); |
| 16 | for(length_t i = 0; i < L; ++i) |
| 17 | Result[i] = x[i] <= y[i]; |
| 18 | return Result; |
| 19 | } |
| 20 | |
| 21 | template<length_t L, typename T, qualifier Q> |
| 22 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> greaterThan(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
| 23 | { |
| 24 | vec<L, bool, Q> Result(true); |
| 25 | for(length_t i = 0; i < L; ++i) |
| 26 | Result[i] = x[i] > y[i]; |
| 27 | return Result; |
| 28 | } |
| 29 | |
| 30 | template<length_t L, typename T, qualifier Q> |
| 31 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> greaterThanEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
| 32 | { |
| 33 | vec<L, bool, Q> Result(true); |
| 34 | for(length_t i = 0; i < L; ++i) |
| 35 | Result[i] = x[i] >= y[i]; |
| 36 | return Result; |
| 37 | } |
| 38 | |
| 39 | template<length_t L, typename T, qualifier Q> |
| 40 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
| 41 | { |
| 42 | vec<L, bool, Q> Result(true); |
| 43 | for(length_t i = 0; i < L; ++i) |
| 44 | Result[i] = x[i] == y[i]; |
| 45 | return Result; |
| 46 | } |
| 47 | |
| 48 | template<length_t L, typename T, qualifier Q> |
| 49 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
| 50 | { |
| 51 | vec<L, bool, Q> Result(true); |
| 52 | for(length_t i = 0; i < L; ++i) |
| 53 | Result[i] = x[i] != y[i]; |
| 54 | return Result; |
| 55 | } |
| 56 | |
| 57 | template<length_t L, qualifier Q> |
| 58 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec<L, bool, Q> const& v) |
| 59 | { |
| 60 | bool Result = false; |
| 61 | for(length_t i = 0; i < L; ++i) |
| 62 | Result = Result || v[i]; |
| 63 | return Result; |
| 64 | } |
| 65 | |
| 66 | template<length_t L, qualifier Q> |
| 67 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec<L, bool, Q> const& v) |
| 68 | { |
| 69 | bool Result = true; |
| 70 | for(length_t i = 0; i < L; ++i) |
| 71 | Result = Result && v[i]; |
| 72 | return Result; |
| 73 | } |
| 74 | |
| 75 | template<length_t L, qualifier Q> |
| 76 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> not_(vec<L, bool, Q> const& v) |
| 77 | { |
| 78 | vec<L, bool, Q> Result(true); |
| 79 | for(length_t i = 0; i < L; ++i) |
| 80 | Result[i] = !v[i]; |
| 81 | return Result; |
| 82 | } |
| 83 | }//namespace glm |
| 84 | |
| 85 | #if GLM_CONFIG_SIMD == GLM_ENABLE |
| 86 | # include "func_vector_relational_simd.inl" |
| 87 | #endif |