1 //Copyright (c) 2008-2017 Emil Dotchevski and Reverge Studios, Inc.
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_QVM_48D38F75E6D91D2AE5C0F72B78818744
7 #define BOOST_QVM_48D38F75E6D91D2AE5C0F72B78818744
9 //This file was generated by a program. Do not edit manually.
11 #include <boost/qvm/deduce_vec.hpp>
12 #include <boost/qvm/enable_if.hpp>
13 #include <boost/qvm/inline.hpp>
14 #include <boost/qvm/mat_traits.hpp>
15 #include <boost/qvm/vec_traits.hpp>
23 template <class A,class B>
24 BOOST_QVM_INLINE_OPERATIONS
25 typename lazy_enable_if_c<
26 mat_traits<A>::rows==2 && mat_traits<A>::cols==2 &&
27 vec_traits<B>::dim==2,
28 deduce_vec2<A,B,2> >::type
29 operator*( A const & a, B const & b )
31 typedef typename mat_traits<A>::scalar_type Ta;
32 typedef typename vec_traits<B>::scalar_type Tb;
33 Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
34 Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
35 Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
36 Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
37 Tb const b0 = vec_traits<B>::template read_element<0>(b);
38 Tb const b1 = vec_traits<B>::template read_element<1>(b);
39 typedef typename deduce_vec2<A,B,2>::type R;
40 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
42 vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1;
43 vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1;
50 using ::boost::qvm::operator*;
56 template <int R,int C>
57 struct mul_mv_defined;
63 static bool const value=true;
67 template <class A,class B>
68 BOOST_QVM_INLINE_OPERATIONS
69 typename lazy_enable_if_c<
70 mat_traits<B>::rows==2 && mat_traits<B>::cols==2 &&
71 vec_traits<A>::dim==2,
72 deduce_vec2<A,B,2> >::type
73 operator*( A const & a, B const & b )
75 typedef typename vec_traits<A>::scalar_type Ta;
76 typedef typename mat_traits<B>::scalar_type Tb;
77 Ta const a0 = vec_traits<A>::template read_element<0>(a);
78 Ta const a1 = vec_traits<A>::template read_element<1>(a);
79 Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
80 Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
81 Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
82 Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
83 typedef typename deduce_vec2<A,B,2>::type R;
84 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
86 vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10;
87 vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11;
94 using ::boost::qvm::operator*;
100 template <int R,int C>
101 struct mul_vm_defined;
107 static bool const value=true;