matrix_relational.hpp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /// @ref ext_matrix_relational
  2. /// @file glm/ext/matrix_relational.hpp
  3. ///
  4. /// @defgroup ext_matrix_relational GLM_EXT_matrix_relational
  5. /// @ingroup ext
  6. ///
  7. /// Exposes comparison functions for matrix types that take a user defined epsilon values.
  8. ///
  9. /// Include <glm/ext/matrix_relational.hpp> to use the features of this extension.
  10. ///
  11. /// @see ext_vector_relational
  12. /// @see ext_scalar_relational
  13. /// @see ext_quaternion_relational
  14. #pragma once
  15. // Dependencies
  16. #include "../detail/qualifier.hpp"
  17. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  18. # pragma message("GLM: GLM_EXT_matrix_relational extension included")
  19. #endif
  20. namespace glm
  21. {
  22. /// @addtogroup ext_matrix_relational
  23. /// @{
  24. /// Perform a component-wise equal-to comparison of two matrices.
  25. /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices.
  26. ///
  27. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  28. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  29. /// @tparam T Floating-point or integer scalar types
  30. /// @tparam Q Value from qualifier enum
  31. template<length_t C, length_t R, typename T, qualifier Q>
  32. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y);
  33. /// Perform a component-wise not-equal-to comparison of two matrices.
  34. /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices.
  35. ///
  36. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  37. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  38. /// @tparam T Floating-point or integer scalar types
  39. /// @tparam Q Value from qualifier enum
  40. template<length_t C, length_t R, typename T, qualifier Q>
  41. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y);
  42. /// Returns the component-wise comparison of |x - y| < epsilon.
  43. /// True if this expression is satisfied.
  44. ///
  45. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  46. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  47. /// @tparam T Floating-point or integer scalar types
  48. /// @tparam Q Value from qualifier enum
  49. template<length_t C, length_t R, typename T, qualifier Q>
  50. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, T epsilon);
  51. /// Returns the component-wise comparison of |x - y| < epsilon.
  52. /// True if this expression is satisfied.
  53. ///
  54. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  55. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  56. /// @tparam T Floating-point or integer scalar types
  57. /// @tparam Q Value from qualifier enum
  58. template<length_t C, length_t R, typename T, qualifier Q>
  59. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, vec<C, T, Q> const& epsilon);
  60. /// Returns the component-wise comparison of |x - y| < epsilon.
  61. /// True if this expression is not satisfied.
  62. ///
  63. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  64. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  65. /// @tparam T Floating-point or integer scalar types
  66. /// @tparam Q Value from qualifier enum
  67. template<length_t C, length_t R, typename T, qualifier Q>
  68. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, T epsilon);
  69. /// Returns the component-wise comparison of |x - y| >= epsilon.
  70. /// True if this expression is not satisfied.
  71. ///
  72. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  73. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  74. /// @tparam T Floating-point or integer scalar types
  75. /// @tparam Q Value from qualifier enum
  76. template<length_t C, length_t R, typename T, qualifier Q>
  77. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, vec<C, T, Q> const& epsilon);
  78. /// Returns the component-wise comparison between two vectors in term of ULPs.
  79. /// True if this expression is satisfied.
  80. ///
  81. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  82. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  83. /// @tparam T Floating-point
  84. /// @tparam Q Value from qualifier enum
  85. template<length_t C, length_t R, typename T, qualifier Q>
  86. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, int ULPs);
  87. /// Returns the component-wise comparison between two vectors in term of ULPs.
  88. /// True if this expression is satisfied.
  89. ///
  90. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  91. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  92. /// @tparam T Floating-point
  93. /// @tparam Q Value from qualifier enum
  94. template<length_t C, length_t R, typename T, qualifier Q>
  95. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> equal(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, vec<C, int, Q> const& ULPs);
  96. /// Returns the component-wise comparison between two vectors in term of ULPs.
  97. /// True if this expression is not satisfied.
  98. ///
  99. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  100. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  101. /// @tparam T Floating-point
  102. /// @tparam Q Value from qualifier enum
  103. template<length_t C, length_t R, typename T, qualifier Q>
  104. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, int ULPs);
  105. /// Returns the component-wise comparison between two vectors in term of ULPs.
  106. /// True if this expression is not satisfied.
  107. ///
  108. /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix
  109. /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix
  110. /// @tparam T Floating-point
  111. /// @tparam Q Value from qualifier enum
  112. template<length_t C, length_t R, typename T, qualifier Q>
  113. GLM_FUNC_DECL GLM_CONSTEXPR vec<C, bool, Q> notEqual(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y, vec<C, int, Q> const& ULPs);
  114. /// @}
  115. }//namespace glm
  116. #include "matrix_relational.inl"