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