summaryrefslogtreecommitdiff
path: root/boost/qvm/gen/mat_operations4.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/qvm/gen/mat_operations4.hpp')
-rw-r--r--boost/qvm/gen/mat_operations4.hpp204
1 files changed, 204 insertions, 0 deletions
diff --git a/boost/qvm/gen/mat_operations4.hpp b/boost/qvm/gen/mat_operations4.hpp
index 0dab7fba9f..ad115f916d 100644
--- a/boost/qvm/gen/mat_operations4.hpp
+++ b/boost/qvm/gen/mat_operations4.hpp
@@ -568,6 +568,54 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==4,
+ deduce_mat<B> >::type
+ operator*( A a, B const & b )
+ {
+ typedef typename deduce_mat<B>::type R;
+ R r;
+ mat_traits<R>::template write_element<0,0>(r)=a*mat_traits<B>::template read_element<0,0>(b);
+ mat_traits<R>::template write_element<0,1>(r)=a*mat_traits<B>::template read_element<0,1>(b);
+ mat_traits<R>::template write_element<0,2>(r)=a*mat_traits<B>::template read_element<0,2>(b);
+ mat_traits<R>::template write_element<0,3>(r)=a*mat_traits<B>::template read_element<0,3>(b);
+ mat_traits<R>::template write_element<1,0>(r)=a*mat_traits<B>::template read_element<1,0>(b);
+ mat_traits<R>::template write_element<1,1>(r)=a*mat_traits<B>::template read_element<1,1>(b);
+ mat_traits<R>::template write_element<1,2>(r)=a*mat_traits<B>::template read_element<1,2>(b);
+ mat_traits<R>::template write_element<1,3>(r)=a*mat_traits<B>::template read_element<1,3>(b);
+ mat_traits<R>::template write_element<2,0>(r)=a*mat_traits<B>::template read_element<2,0>(b);
+ mat_traits<R>::template write_element<2,1>(r)=a*mat_traits<B>::template read_element<2,1>(b);
+ mat_traits<R>::template write_element<2,2>(r)=a*mat_traits<B>::template read_element<2,2>(b);
+ mat_traits<R>::template write_element<2,3>(r)=a*mat_traits<B>::template read_element<2,3>(b);
+ mat_traits<R>::template write_element<3,0>(r)=a*mat_traits<B>::template read_element<3,0>(b);
+ mat_traits<R>::template write_element<3,1>(r)=a*mat_traits<B>::template read_element<3,1>(b);
+ mat_traits<R>::template write_element<3,2>(r)=a*mat_traits<B>::template read_element<3,2>(b);
+ mat_traits<R>::template write_element<3,3>(r)=a*mat_traits<B>::template read_element<3,3>(b);
+ return r;
+ }
+
+ namespace
+ sfinae
+ {
+ using ::boost::qvm::operator*;
+ }
+
+ namespace
+ qvm_detail
+ {
+ template <int R,int C>
+ struct mul_sm_defined;
+
+ template <>
+ struct
+ mul_sm_defined<4,4>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
mat_traits<A>::rows==4 && mat_traits<A>::cols==1 && is_scalar<B>::value,
deduce_mat<A> >::type
operator*( A const & a, B b )
@@ -604,6 +652,42 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==1,
+ deduce_mat<B> >::type
+ operator*( A a, B const & b )
+ {
+ typedef typename deduce_mat<B>::type R;
+ R r;
+ mat_traits<R>::template write_element<0,0>(r)=a*mat_traits<B>::template read_element<0,0>(b);
+ mat_traits<R>::template write_element<1,0>(r)=a*mat_traits<B>::template read_element<1,0>(b);
+ mat_traits<R>::template write_element<2,0>(r)=a*mat_traits<B>::template read_element<2,0>(b);
+ mat_traits<R>::template write_element<3,0>(r)=a*mat_traits<B>::template read_element<3,0>(b);
+ return r;
+ }
+
+ namespace
+ sfinae
+ {
+ using ::boost::qvm::operator*;
+ }
+
+ namespace
+ qvm_detail
+ {
+ template <int R,int C>
+ struct mul_sm_defined;
+
+ template <>
+ struct
+ mul_sm_defined<4,1>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
mat_traits<A>::rows==1 && mat_traits<A>::cols==4 && is_scalar<B>::value,
deduce_mat<A> >::type
operator*( A const & a, B b )
@@ -639,6 +723,42 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==1 && mat_traits<B>::cols==4,
+ deduce_mat<B> >::type
+ operator*( A a, B const & b )
+ {
+ typedef typename deduce_mat<B>::type R;
+ R r;
+ mat_traits<R>::template write_element<0,0>(r)=a*mat_traits<B>::template read_element<0,0>(b);
+ mat_traits<R>::template write_element<0,1>(r)=a*mat_traits<B>::template read_element<0,1>(b);
+ mat_traits<R>::template write_element<0,2>(r)=a*mat_traits<B>::template read_element<0,2>(b);
+ mat_traits<R>::template write_element<0,3>(r)=a*mat_traits<B>::template read_element<0,3>(b);
+ return r;
+ }
+
+ namespace
+ sfinae
+ {
+ using ::boost::qvm::operator*;
+ }
+
+ namespace
+ qvm_detail
+ {
+ template <int R,int C>
+ struct mul_sm_defined;
+
+ template <>
+ struct
+ mul_sm_defined<1,4>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
mat_traits<A>::rows==4 && mat_traits<A>::cols==4 && is_scalar<B>::value,
A &>::type
@@ -802,6 +922,54 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==4,
+ deduce_mat<B> >::type
+ operator/( A a, B const & b )
+ {
+ typedef typename deduce_mat<B>::type R;
+ R r;
+ mat_traits<R>::template write_element<0,0>(r)=a/mat_traits<B>::template read_element<0,0>(b);
+ mat_traits<R>::template write_element<0,1>(r)=a/mat_traits<B>::template read_element<0,1>(b);
+ mat_traits<R>::template write_element<0,2>(r)=a/mat_traits<B>::template read_element<0,2>(b);
+ mat_traits<R>::template write_element<0,3>(r)=a/mat_traits<B>::template read_element<0,3>(b);
+ mat_traits<R>::template write_element<1,0>(r)=a/mat_traits<B>::template read_element<1,0>(b);
+ mat_traits<R>::template write_element<1,1>(r)=a/mat_traits<B>::template read_element<1,1>(b);
+ mat_traits<R>::template write_element<1,2>(r)=a/mat_traits<B>::template read_element<1,2>(b);
+ mat_traits<R>::template write_element<1,3>(r)=a/mat_traits<B>::template read_element<1,3>(b);
+ mat_traits<R>::template write_element<2,0>(r)=a/mat_traits<B>::template read_element<2,0>(b);
+ mat_traits<R>::template write_element<2,1>(r)=a/mat_traits<B>::template read_element<2,1>(b);
+ mat_traits<R>::template write_element<2,2>(r)=a/mat_traits<B>::template read_element<2,2>(b);
+ mat_traits<R>::template write_element<2,3>(r)=a/mat_traits<B>::template read_element<2,3>(b);
+ mat_traits<R>::template write_element<3,0>(r)=a/mat_traits<B>::template read_element<3,0>(b);
+ mat_traits<R>::template write_element<3,1>(r)=a/mat_traits<B>::template read_element<3,1>(b);
+ mat_traits<R>::template write_element<3,2>(r)=a/mat_traits<B>::template read_element<3,2>(b);
+ mat_traits<R>::template write_element<3,3>(r)=a/mat_traits<B>::template read_element<3,3>(b);
+ return r;
+ }
+
+ namespace
+ sfinae
+ {
+ using ::boost::qvm::operator/;
+ }
+
+ namespace
+ qvm_detail
+ {
+ template <int R,int C>
+ struct div_sm_defined;
+
+ template <>
+ struct
+ div_sm_defined<4,4>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
mat_traits<A>::rows==4 && mat_traits<A>::cols==1 && is_scalar<B>::value,
deduce_mat<A> >::type
operator/( A const & a, B b )
@@ -838,6 +1006,42 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==4 && mat_traits<B>::cols==1,
+ deduce_mat<B> >::type
+ operator/( A a, B const & b )
+ {
+ typedef typename deduce_mat<B>::type R;
+ R r;
+ mat_traits<R>::template write_element<0,0>(r)=a/mat_traits<B>::template read_element<0,0>(b);
+ mat_traits<R>::template write_element<1,0>(r)=a/mat_traits<B>::template read_element<1,0>(b);
+ mat_traits<R>::template write_element<2,0>(r)=a/mat_traits<B>::template read_element<2,0>(b);
+ mat_traits<R>::template write_element<3,0>(r)=a/mat_traits<B>::template read_element<3,0>(b);
+ return r;
+ }
+
+ namespace
+ sfinae
+ {
+ using ::boost::qvm::operator/;
+ }
+
+ namespace
+ qvm_detail
+ {
+ template <int R,int C>
+ struct div_sm_defined;
+
+ template <>
+ struct
+ div_sm_defined<4,1>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
mat_traits<A>::rows==1 && mat_traits<A>::cols==4 && is_scalar<B>::value,
deduce_mat<A> >::type
operator/( A const & a, B b )