File indexing completed on 2025-09-18 09:03:36
0001 #ifndef BOOST_QVM_GEN_MAT_ASSIGN3_HPP_INCLUDED
0002 #define BOOST_QVM_GEN_MAT_ASSIGN3_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==3 && mat_traits<B>::rows==3 &&
0019 mat_traits<A>::cols==3 && mat_traits<B>::cols==3,
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<0,2>(a,mat_traits<B>::template read_element<0,2>(b));
0026 write_mat_element<1,0>(a,mat_traits<B>::template read_element<1,0>(b));
0027 write_mat_element<1,1>(a,mat_traits<B>::template read_element<1,1>(b));
0028 write_mat_element<1,2>(a,mat_traits<B>::template read_element<1,2>(b));
0029 write_mat_element<2,0>(a,mat_traits<B>::template read_element<2,0>(b));
0030 write_mat_element<2,1>(a,mat_traits<B>::template read_element<2,1>(b));
0031 write_mat_element<2,2>(a,mat_traits<B>::template read_element<2,2>(b));
0032 return a;
0033 }
0034
0035 namespace
0036 sfinae
0037 {
0038 using ::boost::qvm::assign;
0039 }
0040
0041 namespace
0042 qvm_detail
0043 {
0044 template <int R,int C>
0045 struct assign_mm_defined;
0046
0047 template <>
0048 struct
0049 assign_mm_defined<3,3>
0050 {
0051 static bool const value=true;
0052 };
0053 }
0054
0055 template <class A,class B>
0056 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
0057 typename enable_if_c<
0058 mat_traits<A>::rows==3 && mat_traits<B>::rows==3 &&
0059 mat_traits<A>::cols==1 && mat_traits<B>::cols==1,
0060 A &>::type
0061 assign( A & a, B const & b )
0062 {
0063 write_mat_element<0,0>(a,mat_traits<B>::template read_element<0,0>(b));
0064 write_mat_element<1,0>(a,mat_traits<B>::template read_element<1,0>(b));
0065 write_mat_element<2,0>(a,mat_traits<B>::template read_element<2,0>(b));
0066 return a;
0067 }
0068
0069 namespace
0070 sfinae
0071 {
0072 using ::boost::qvm::assign;
0073 }
0074
0075 namespace
0076 qvm_detail
0077 {
0078 template <int R,int C>
0079 struct assign_mm_defined;
0080
0081 template <>
0082 struct
0083 assign_mm_defined<3,1>
0084 {
0085 static bool const value=true;
0086 };
0087 }
0088
0089 template <class A,class B>
0090 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
0091 typename enable_if_c<
0092 mat_traits<A>::rows==1 && mat_traits<B>::rows==1 &&
0093 mat_traits<A>::cols==3 && mat_traits<B>::cols==3,
0094 A &>::type
0095 assign( A & a, B const & b )
0096 {
0097 write_mat_element<0,0>(a,mat_traits<B>::template read_element<0,0>(b));
0098 write_mat_element<0,1>(a,mat_traits<B>::template read_element<0,1>(b));
0099 write_mat_element<0,2>(a,mat_traits<B>::template read_element<0,2>(b));
0100 return a;
0101 }
0102
0103 namespace
0104 sfinae
0105 {
0106 using ::boost::qvm::assign;
0107 }
0108
0109 namespace
0110 qvm_detail
0111 {
0112 template <int R,int C>
0113 struct assign_mm_defined;
0114
0115 template <>
0116 struct
0117 assign_mm_defined<1,3>
0118 {
0119 static bool const value=true;
0120 };
0121 }
0122
0123 } }
0124
0125 #endif