mat_assign2.hpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef BOOST_QVM_GEN_MAT_ASSIGN2_HPP_INCLUDED
  2. #define BOOST_QVM_GEN_MAT_ASSIGN2_HPP_INCLUDED
  3. /// Copyright (c) 2008-2021 Emil Dotchevski and Reverge Studios, Inc.
  4. /// Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. /// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. /// This file was generated by a program. Do not edit manually.
  7. #include <boost/qvm/enable_if.hpp>
  8. #include <boost/qvm/inline.hpp>
  9. #include <boost/qvm/mat_traits.hpp>
  10. namespace boost { namespace qvm {
  11. template <class A,class B>
  12. BOOST_QVM_INLINE_OPERATIONS
  13. typename enable_if_c<
  14. mat_traits<A>::rows==2 && mat_traits<B>::rows==2 &&
  15. mat_traits<A>::cols==2 && mat_traits<B>::cols==2,
  16. A &>::type
  17. assign( A & a, B const & b )
  18. {
  19. mat_traits<A>::template write_element<0,0>(a)=mat_traits<B>::template read_element<0,0>(b);
  20. mat_traits<A>::template write_element<0,1>(a)=mat_traits<B>::template read_element<0,1>(b);
  21. mat_traits<A>::template write_element<1,0>(a)=mat_traits<B>::template read_element<1,0>(b);
  22. mat_traits<A>::template write_element<1,1>(a)=mat_traits<B>::template read_element<1,1>(b);
  23. return a;
  24. }
  25. namespace
  26. sfinae
  27. {
  28. using ::boost::qvm::assign;
  29. }
  30. namespace
  31. qvm_detail
  32. {
  33. template <int R,int C>
  34. struct assign_mm_defined;
  35. template <>
  36. struct
  37. assign_mm_defined<2,2>
  38. {
  39. static bool const value=true;
  40. };
  41. }
  42. template <class A,class B>
  43. BOOST_QVM_INLINE_OPERATIONS
  44. typename enable_if_c<
  45. mat_traits<A>::rows==2 && mat_traits<B>::rows==2 &&
  46. mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
  47. A &>::type
  48. assign( A & a, B const & b )
  49. {
  50. mat_traits<A>::template write_element<0,0>(a)=mat_traits<B>::template read_element<0,0>(b);
  51. mat_traits<A>::template write_element<1,0>(a)=mat_traits<B>::template read_element<1,0>(b);
  52. return a;
  53. }
  54. namespace
  55. sfinae
  56. {
  57. using ::boost::qvm::assign;
  58. }
  59. namespace
  60. qvm_detail
  61. {
  62. template <int R,int C>
  63. struct assign_mm_defined;
  64. template <>
  65. struct
  66. assign_mm_defined<2,1>
  67. {
  68. static bool const value=true;
  69. };
  70. }
  71. template <class A,class B>
  72. BOOST_QVM_INLINE_OPERATIONS
  73. typename enable_if_c<
  74. mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
  75. mat_traits<A>::cols==2 && mat_traits<B>::cols==2,
  76. A &>::type
  77. assign( A & a, B const & b )
  78. {
  79. mat_traits<A>::template write_element<0,0>(a)=mat_traits<B>::template read_element<0,0>(b);
  80. mat_traits<A>::template write_element<0,1>(a)=mat_traits<B>::template read_element<0,1>(b);
  81. return a;
  82. }
  83. namespace
  84. sfinae
  85. {
  86. using ::boost::qvm::assign;
  87. }
  88. namespace
  89. qvm_detail
  90. {
  91. template <int R,int C>
  92. struct assign_mm_defined;
  93. template <>
  94. struct
  95. assign_mm_defined<1,2>
  96. {
  97. static bool const value=true;
  98. };
  99. }
  100. } }
  101. #endif