]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/include/boost/qvm/gen/vec_mat_operations2.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / qvm / include / boost / qvm / gen / vec_mat_operations2.hpp
1 //Copyright (c) 2008-2016 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_F622919DE18B1FDAB0CA992B9729D49
7 #define BOOST_QVM_F622919DE18B1FDAB0CA992B9729D49
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
16 namespace
17 boost
18 {
19 namespace
20 qvm
21 {
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 )
29 {
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);
40 R r;
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;
43 return r;
44 }
45
46 namespace
47 sfinae
48 {
49 using ::boost::qvm::operator*;
50 }
51
52 namespace
53 qvm_detail
54 {
55 template <int R,int C>
56 struct mul_mv_defined;
57
58 template <>
59 struct
60 mul_mv_defined<2,2>
61 {
62 static bool const value=true;
63 };
64 }
65
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 )
73 {
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);
84 R r;
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;
87 return r;
88 }
89
90 namespace
91 sfinae
92 {
93 using ::boost::qvm::operator*;
94 }
95
96 namespace
97 qvm_detail
98 {
99 template <int R,int C>
100 struct mul_vm_defined;
101
102 template <>
103 struct
104 mul_vm_defined<2,2>
105 {
106 static bool const value=true;
107 };
108 }
109
110 }
111 }
112
113 #endif