summaryrefslogtreecommitdiff
path: root/boost/qvm/gen/mat_operations2.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:08:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:09:00 +0900
commitb5c87084afaef42b2d058f68091be31988a6a874 (patch)
treeadef9a65870a41181687e11d57fdf98e7629de3c /boost/qvm/gen/mat_operations2.hpp
parent34bd32e225e2a8a94104489b31c42e5801cc1f4a (diff)
downloadboost-b5c87084afaef42b2d058f68091be31988a6a874.tar.gz
boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.bz2
boost-b5c87084afaef42b2d058f68091be31988a6a874.zip
Imported Upstream version 1.64.0upstream/1.64.0
Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/qvm/gen/mat_operations2.hpp')
-rw-r--r--boost/qvm/gen/mat_operations2.hpp174
1 files changed, 174 insertions, 0 deletions
diff --git a/boost/qvm/gen/mat_operations2.hpp b/boost/qvm/gen/mat_operations2.hpp
index 105ebde2ea..6fbda7a800 100644
--- a/boost/qvm/gen/mat_operations2.hpp
+++ b/boost/qvm/gen/mat_operations2.hpp
@@ -490,6 +490,42 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==2 && mat_traits<B>::cols==2,
+ 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<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);
+ 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<2,2>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
mat_traits<A>::rows==2 && mat_traits<A>::cols==1 && is_scalar<B>::value,
deduce_mat<A> >::type
operator*( A const & a, B b )
@@ -524,6 +560,40 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==2 && 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);
+ 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<2,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==2 && is_scalar<B>::value,
deduce_mat<A> >::type
operator*( A const & a, B b )
@@ -557,6 +627,40 @@ 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==2,
+ 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);
+ 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,2>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
typename enable_if_c<
mat_traits<A>::rows==2 && mat_traits<A>::cols==2 && is_scalar<B>::value,
A &>::type
@@ -692,6 +796,42 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==2 && mat_traits<B>::cols==2,
+ 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<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);
+ 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<2,2>
+ {
+ static bool const value=true;
+ };
+ }
+
+ template <class A,class B>
+ BOOST_QVM_INLINE_OPERATIONS
+ typename lazy_enable_if_c<
mat_traits<A>::rows==2 && mat_traits<A>::cols==1 && is_scalar<B>::value,
deduce_mat<A> >::type
operator/( A const & a, B b )
@@ -726,6 +866,40 @@ boost
template <class A,class B>
BOOST_QVM_INLINE_OPERATIONS
typename lazy_enable_if_c<
+ is_scalar<A>::value && mat_traits<B>::rows==2 && 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);
+ 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<2,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==2 && is_scalar<B>::value,
deduce_mat<A> >::type
operator/( A const & a, B b )