1 //Copyright (c) 2008-2017 Emil Dotchevski and Reverge Studios, Inc. 2 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) 5 6 #ifndef BOOST_QVM_E5F500D4618DBE7B51573B33821F 7 #define BOOST_QVM_E5F500D4618DBE7B51573B33821F 8 9 //This file was generated by a program. Do not edit manually. 10 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> 16 17 namespace 18 boost 19 { 20 namespace 21 qvm 22 { 23 template <class A,class B> 24 BOOST_QVM_INLINE_OPERATIONS 25 typename lazy_enable_if_c< 26 mat_traits<A>::rows==3 && mat_traits<A>::cols==3 && 27 vec_traits<B>::dim==3, 28 deduce_vec2<A,B,3> >::type operator *(A const & a,B const & b)29 operator*( A const & a, B const & b ) 30 { 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 a02 = mat_traits<A>::template read_element<0,2>(a); 36 Ta const a10 = mat_traits<A>::template read_element<1,0>(a); 37 Ta const a11 = mat_traits<A>::template read_element<1,1>(a); 38 Ta const a12 = mat_traits<A>::template read_element<1,2>(a); 39 Ta const a20 = mat_traits<A>::template read_element<2,0>(a); 40 Ta const a21 = mat_traits<A>::template read_element<2,1>(a); 41 Ta const a22 = mat_traits<A>::template read_element<2,2>(a); 42 Tb const b0 = vec_traits<B>::template read_element<0>(b); 43 Tb const b1 = vec_traits<B>::template read_element<1>(b); 44 Tb const b2 = vec_traits<B>::template read_element<2>(b); 45 typedef typename deduce_vec2<A,B,3>::type R; 46 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3); 47 R r; 48 vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1+a02*b2; 49 vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1+a12*b2; 50 vec_traits<R>::template write_element<2>(r)=a20*b0+a21*b1+a22*b2; 51 return r; 52 } 53 54 namespace 55 sfinae 56 { 57 using ::boost::qvm::operator*; 58 } 59 60 namespace 61 qvm_detail 62 { 63 template <int R,int C> 64 struct mul_mv_defined; 65 66 template <> 67 struct 68 mul_mv_defined<3,3> 69 { 70 static bool const value=true; 71 }; 72 } operator *(A const & a,B const & b)73 74 template <class A,class B> 75 BOOST_QVM_INLINE_OPERATIONS 76 typename lazy_enable_if_c< 77 mat_traits<B>::rows==3 && mat_traits<B>::cols==3 && 78 vec_traits<A>::dim==3, 79 deduce_vec2<A,B,3> >::type 80 operator*( A const & a, B const & b ) 81 { 82 typedef typename vec_traits<A>::scalar_type Ta; 83 typedef typename mat_traits<B>::scalar_type Tb; 84 Ta const a0 = vec_traits<A>::template read_element<0>(a); 85 Ta const a1 = vec_traits<A>::template read_element<1>(a); 86 Ta const a2 = vec_traits<A>::template read_element<2>(a); 87 Tb const b00 = mat_traits<B>::template read_element<0,0>(b); 88 Tb const b01 = mat_traits<B>::template read_element<0,1>(b); 89 Tb const b02 = mat_traits<B>::template read_element<0,2>(b); 90 Tb const b10 = mat_traits<B>::template read_element<1,0>(b); 91 Tb const b11 = mat_traits<B>::template read_element<1,1>(b); 92 Tb const b12 = mat_traits<B>::template read_element<1,2>(b); 93 Tb const b20 = mat_traits<B>::template read_element<2,0>(b); 94 Tb const b21 = mat_traits<B>::template read_element<2,1>(b); 95 Tb const b22 = mat_traits<B>::template read_element<2,2>(b); 96 typedef typename deduce_vec2<A,B,3>::type R; 97 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==3); 98 R r; 99 vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10+a2*b20; 100 vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11+a2*b21; 101 vec_traits<R>::template write_element<2>(r)=a0*b02+a1*b12+a2*b22; 102 return r; 103 } 104 105 namespace 106 sfinae 107 { 108 using ::boost::qvm::operator*; 109 } 110 111 namespace 112 qvm_detail 113 { 114 template <int R,int C> 115 struct mul_vm_defined; 116 117 template <> 118 struct 119 mul_vm_defined<3,3> 120 { 121 static bool const value=true; 122 }; 123 } 124 125 } 126 } 127 128 #endif 129