mat_assign2.hpp 3.5 KB

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