File indexing completed on 2025-01-18 09:50:43
0001 #ifndef BOOST_QVM_GEN_MAT_ASSIGN2_HPP_INCLUDED
0002 #define BOOST_QVM_GEN_MAT_ASSIGN2_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <boost/qvm/config.hpp>
0012 #include <boost/qvm/enable_if.hpp>
0013 #include <boost/qvm/mat_traits.hpp>
0014
0015 namespace boost { namespace qvm {
0016
0017 template <class A,class B>
0018 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
0019 typename enable_if_c<
0020 mat_traits<A>::rows==2 && mat_traits<B>::rows==2 &&
0021 mat_traits<A>::cols==2 && mat_traits<B>::cols==2,
0022 A &>::type
0023 assign( A & a, B const & b )
0024 {
0025 write_mat_element<0,0>(a,mat_traits<B>::template read_element<0,0>(b));
0026 write_mat_element<0,1>(a,mat_traits<B>::template read_element<0,1>(b));
0027 write_mat_element<1,0>(a,mat_traits<B>::template read_element<1,0>(b));
0028 write_mat_element<1,1>(a,mat_traits<B>::template read_element<1,1>(b));
0029 return a;
0030 }
0031
0032 namespace
0033 sfinae
0034 {
0035 using ::boost::qvm::assign;
0036 }
0037
0038 namespace
0039 qvm_detail
0040 {
0041 template <int R,int C>
0042 struct assign_mm_defined;
0043
0044 template <>
0045 struct
0046 assign_mm_defined<2,2>
0047 {
0048 static bool const value=true;
0049 };
0050 }
0051
0052 template <class A,class B>
0053 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
0054 typename enable_if_c<
0055 mat_traits<A>::rows==2 && mat_traits<B>::rows==2 &&
0056 mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
0057 A &>::type
0058 assign( A & a, B const & b )
0059 {
0060 write_mat_element<0,0>(a,mat_traits<B>::template read_element<0,0>(b));
0061 write_mat_element<1,0>(a,mat_traits<B>::template read_element<1,0>(b));
0062 return a;
0063 }
0064
0065 namespace
0066 sfinae
0067 {
0068 using ::boost::qvm::assign;
0069 }
0070
0071 namespace
0072 qvm_detail
0073 {
0074 template <int R,int C>
0075 struct assign_mm_defined;
0076
0077 template <>
0078 struct
0079 assign_mm_defined<2,1>
0080 {
0081 static bool const value=true;
0082 };
0083 }
0084
0085 template <class A,class B>
0086 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
0087 typename enable_if_c<
0088 mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
0089 mat_traits<A>::cols==2 && mat_traits<B>::cols==2,
0090 A &>::type
0091 assign( A & a, B const & b )
0092 {
0093 write_mat_element<0,0>(a,mat_traits<B>::template read_element<0,0>(b));
0094 write_mat_element<0,1>(a,mat_traits<B>::template read_element<0,1>(b));
0095 return a;
0096 }
0097
0098 namespace
0099 sfinae
0100 {
0101 using ::boost::qvm::assign;
0102 }
0103
0104 namespace
0105 qvm_detail
0106 {
0107 template <int R,int C>
0108 struct assign_mm_defined;
0109
0110 template <>
0111 struct
0112 assign_mm_defined<1,2>
0113 {
0114 static bool const value=true;
0115 };
0116 }
0117
0118 } }
0119
0120 #endif