1 //Copyright (c) 2008-2016 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_F622919DE18B1FDAB0CA992B9729D49
7 #define BOOST_QVM_F622919DE18B1FDAB0CA992B9729D49
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>
22 template <class A,class B>
23 BOOST_QVM_INLINE_OPERATIONS
24 typename lazy_enable_if_c<
25 mat_traits<A>::rows==2 && mat_traits<A>::cols==2 &&
26 vec_traits<B>::dim==2,
27 deduce_vec2<A,B,2> >::type
28 operator*( A const & a, B const & b )
30 typedef typename mat_traits<A>::scalar_type Ta;
31 typedef typename vec_traits<B>::scalar_type Tb;
32 Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
33 Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
34 Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
35 Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
36 Tb const b0 = vec_traits<B>::template read_element<0>(b);
37 Tb const b1 = vec_traits<B>::template read_element<1>(b);
38 typedef typename deduce_vec2<A,B,2>::type R;
39 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
41 vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1;
42 vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1;
49 using ::boost::qvm::operator*;
55 template <int R,int C>
56 struct mul_mv_defined;
62 static bool const value=true;
66 template <class A,class B>
67 BOOST_QVM_INLINE_OPERATIONS
68 typename lazy_enable_if_c<
69 mat_traits<B>::rows==2 && mat_traits<B>::cols==2 &&
70 vec_traits<A>::dim==2,
71 deduce_vec2<A,B,2> >::type
72 operator*( A const & a, B const & b )
74 typedef typename vec_traits<A>::scalar_type Ta;
75 typedef typename mat_traits<B>::scalar_type Tb;
76 Ta const a0 = vec_traits<A>::template read_element<0>(a);
77 Ta const a1 = vec_traits<A>::template read_element<1>(a);
78 Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
79 Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
80 Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
81 Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
82 typedef typename deduce_vec2<A,B,2>::type R;
83 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
85 vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10;
86 vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11;
93 using ::boost::qvm::operator*;
99 template <int R,int C>
100 struct mul_vm_defined;
106 static bool const value=true;