1#ifndef BOOST_QVM_GEN_VEC_MAT_OPERATIONS2_HPP_INCLUDED
2#define BOOST_QVM_GEN_VEC_MAT_OPERATIONS2_HPP_INCLUDED
3
4// Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
5
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)
8
9// This file was generated by a program. Do not edit manually.
10
11#include <boost/qvm/config.hpp>
12#include <boost/qvm/deduce_vec.hpp>
13#include <boost/qvm/enable_if.hpp>
14#include <boost/qvm/mat_traits.hpp>
15#include <boost/qvm/vec_traits.hpp>
16
17namespace boost { namespace qvm {
18
19template <class A,class B>
20BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
21typename 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
25operator*( A const & a, B const & b )
26 {
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);
37 R r;
38 write_vec_element<0>(r,a00*b0+a01*b1);
39 write_vec_element<1>(r,a10*b0+a11*b1);
40 return r;
41 }
42
43namespace
44sfinae
45 {
46 using ::boost::qvm::operator*;
47 }
48
49namespace
50qvm_detail
51 {
52 template <int R,int C>
53 struct mul_mv_defined;
54
55 template <>
56 struct
57 mul_mv_defined<2,2>
58 {
59 static bool const value=true;
60 };
61 }
62
63template <class A,class B>
64BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS
65typename 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
69operator*( A const & a, B const & b )
70 {
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);
81 R r;
82 write_vec_element<0>(r,a0*b00+a1*b10);
83 write_vec_element<1>(r,a0*b01+a1*b11);
84 return r;
85 }
86
87namespace
88sfinae
89 {
90 using ::boost::qvm::operator*;
91 }
92
93namespace
94qvm_detail
95 {
96 template <int R,int C>
97 struct mul_vm_defined;
98
99 template <>
100 struct
101 mul_vm_defined<2,2>
102 {
103 static bool const value=true;
104 };
105 }
106
107} }
108
109#endif
110

source code of boost/libs/qvm/include/boost/qvm/gen/vec_mat_operations2.hpp