1 #ifndef BOOST_QVM_GEN_VEC_MAT_OPERATIONS2_HPP_INCLUDED
2 #define BOOST_QVM_GEN_VEC_MAT_OPERATIONS2_HPP_INCLUDED
4 // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
6 // Distributed under the Boost Software License, Version 1.0. (See accompanying
7 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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>
17 namespace boost { namespace qvm {
19 template <class A,class B>
20 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
21 typename lazy_enable_if_c<
22 mat_traits<A>::rows==2 && mat_traits<A>::cols==2 &&
23 vec_traits<B>::dim==2,
24 deduce_vec2<A,B,2> >::type
25 operator*( A const & a, B const & b )
27 typedef typename mat_traits<A>::scalar_type Ta;
28 typedef typename vec_traits<B>::scalar_type Tb;
29 Ta const a00 = mat_traits<A>::template read_element<0,0>(a);
30 Ta const a01 = mat_traits<A>::template read_element<0,1>(a);
31 Ta const a10 = mat_traits<A>::template read_element<1,0>(a);
32 Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
33 Tb const b0 = vec_traits<B>::template read_element<0>(b);
34 Tb const b1 = vec_traits<B>::template read_element<1>(b);
35 typedef typename deduce_vec2<A,B,2>::type R;
36 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
38 vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1;
39 vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1;
46 using ::boost::qvm::operator*;
52 template <int R,int C>
53 struct mul_mv_defined;
59 static bool const value=true;
63 template <class A,class B>
64 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
65 typename lazy_enable_if_c<
66 mat_traits<B>::rows==2 && mat_traits<B>::cols==2 &&
67 vec_traits<A>::dim==2,
68 deduce_vec2<A,B,2> >::type
69 operator*( A const & a, B const & b )
71 typedef typename vec_traits<A>::scalar_type Ta;
72 typedef typename mat_traits<B>::scalar_type Tb;
73 Ta const a0 = vec_traits<A>::template read_element<0>(a);
74 Ta const a1 = vec_traits<A>::template read_element<1>(a);
75 Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
76 Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
77 Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
78 Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
79 typedef typename deduce_vec2<A,B,2>::type R;
80 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
82 vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10;
83 vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11;
90 using ::boost::qvm::operator*;
96 template <int R,int C>
97 struct mul_vm_defined;
103 static bool const value=true;