]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
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_187092DA6454CEB1853E6915F8466A4 | |
7 | #define BOOST_QVM_187092DA6454CEB1853E6915F8466A4 | |
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==4 && mat_traits<A>::cols==4 && | |
27 | vec_traits<B>::dim==4, | |
28 | deduce_vec2<A,B,4> >::type | |
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 a03 = mat_traits<A>::template read_element<0,3>(a); | |
37 | Ta const a10 = mat_traits<A>::template read_element<1,0>(a); | |
38 | Ta const a11 = mat_traits<A>::template read_element<1,1>(a); | |
39 | Ta const a12 = mat_traits<A>::template read_element<1,2>(a); | |
40 | Ta const a13 = mat_traits<A>::template read_element<1,3>(a); | |
41 | Ta const a20 = mat_traits<A>::template read_element<2,0>(a); | |
42 | Ta const a21 = mat_traits<A>::template read_element<2,1>(a); | |
43 | Ta const a22 = mat_traits<A>::template read_element<2,2>(a); | |
44 | Ta const a23 = mat_traits<A>::template read_element<2,3>(a); | |
45 | Ta const a30 = mat_traits<A>::template read_element<3,0>(a); | |
46 | Ta const a31 = mat_traits<A>::template read_element<3,1>(a); | |
47 | Ta const a32 = mat_traits<A>::template read_element<3,2>(a); | |
48 | Ta const a33 = mat_traits<A>::template read_element<3,3>(a); | |
49 | Tb const b0 = vec_traits<B>::template read_element<0>(b); | |
50 | Tb const b1 = vec_traits<B>::template read_element<1>(b); | |
51 | Tb const b2 = vec_traits<B>::template read_element<2>(b); | |
52 | Tb const b3 = vec_traits<B>::template read_element<3>(b); | |
53 | typedef typename deduce_vec2<A,B,4>::type R; | |
54 | BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==4); | |
55 | R r; | |
56 | vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1+a02*b2+a03*b3; | |
57 | vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1+a12*b2+a13*b3; | |
58 | vec_traits<R>::template write_element<2>(r)=a20*b0+a21*b1+a22*b2+a23*b3; | |
59 | vec_traits<R>::template write_element<3>(r)=a30*b0+a31*b1+a32*b2+a33*b3; | |
60 | return r; | |
61 | } | |
62 | ||
63 | namespace | |
64 | sfinae | |
65 | { | |
66 | using ::boost::qvm::operator*; | |
67 | } | |
68 | ||
69 | namespace | |
70 | qvm_detail | |
71 | { | |
72 | template <int R,int C> | |
73 | struct mul_mv_defined; | |
74 | ||
75 | template <> | |
76 | struct | |
77 | mul_mv_defined<4,4> | |
78 | { | |
79 | static bool const value=true; | |
80 | }; | |
81 | } | |
82 | ||
83 | template <class A,class B> | |
84 | BOOST_QVM_INLINE_OPERATIONS | |
85 | typename lazy_enable_if_c< | |
86 | mat_traits<B>::rows==4 && mat_traits<B>::cols==4 && | |
87 | vec_traits<A>::dim==4, | |
88 | deduce_vec2<A,B,4> >::type | |
89 | operator*( A const & a, B const & b ) | |
90 | { | |
91 | typedef typename vec_traits<A>::scalar_type Ta; | |
92 | typedef typename mat_traits<B>::scalar_type Tb; | |
93 | Ta const a0 = vec_traits<A>::template read_element<0>(a); | |
94 | Ta const a1 = vec_traits<A>::template read_element<1>(a); | |
95 | Ta const a2 = vec_traits<A>::template read_element<2>(a); | |
96 | Ta const a3 = vec_traits<A>::template read_element<3>(a); | |
97 | Tb const b00 = mat_traits<B>::template read_element<0,0>(b); | |
98 | Tb const b01 = mat_traits<B>::template read_element<0,1>(b); | |
99 | Tb const b02 = mat_traits<B>::template read_element<0,2>(b); | |
100 | Tb const b03 = mat_traits<B>::template read_element<0,3>(b); | |
101 | Tb const b10 = mat_traits<B>::template read_element<1,0>(b); | |
102 | Tb const b11 = mat_traits<B>::template read_element<1,1>(b); | |
103 | Tb const b12 = mat_traits<B>::template read_element<1,2>(b); | |
104 | Tb const b13 = mat_traits<B>::template read_element<1,3>(b); | |
105 | Tb const b20 = mat_traits<B>::template read_element<2,0>(b); | |
106 | Tb const b21 = mat_traits<B>::template read_element<2,1>(b); | |
107 | Tb const b22 = mat_traits<B>::template read_element<2,2>(b); | |
108 | Tb const b23 = mat_traits<B>::template read_element<2,3>(b); | |
109 | Tb const b30 = mat_traits<B>::template read_element<3,0>(b); | |
110 | Tb const b31 = mat_traits<B>::template read_element<3,1>(b); | |
111 | Tb const b32 = mat_traits<B>::template read_element<3,2>(b); | |
112 | Tb const b33 = mat_traits<B>::template read_element<3,3>(b); | |
113 | typedef typename deduce_vec2<A,B,4>::type R; | |
114 | BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==4); | |
115 | R r; | |
116 | vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10+a2*b20+a3*b30; | |
117 | vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11+a2*b21+a3*b31; | |
118 | vec_traits<R>::template write_element<2>(r)=a0*b02+a1*b12+a2*b22+a3*b32; | |
119 | vec_traits<R>::template write_element<3>(r)=a0*b03+a1*b13+a2*b23+a3*b33; | |
120 | return r; | |
121 | } | |
122 | ||
123 | namespace | |
124 | sfinae | |
125 | { | |
126 | using ::boost::qvm::operator*; | |
127 | } | |
128 | ||
129 | namespace | |
130 | qvm_detail | |
131 | { | |
132 | template <int R,int C> | |
133 | struct mul_vm_defined; | |
134 | ||
135 | template <> | |
136 | struct | |
137 | mul_vm_defined<4,4> | |
138 | { | |
139 | static bool const value=true; | |
140 | }; | |
141 | } | |
142 | ||
143 | } | |
144 | } | |
145 | ||
146 | #endif |