]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/qvm/gen/vec_mat_operations2.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / qvm / gen / vec_mat_operations2.hpp
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_48D38F75E6D91D2AE5C0F72B78818744
7 #define BOOST_QVM_48D38F75E6D91D2AE5C0F72B78818744
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==2 && mat_traits<A>::cols==2 &&
27 vec_traits<B>::dim==2,
28 deduce_vec2<A,B,2> >::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 a10 = mat_traits<A>::template read_element<1,0>(a);
36 Ta const a11 = mat_traits<A>::template read_element<1,1>(a);
37 Tb const b0 = vec_traits<B>::template read_element<0>(b);
38 Tb const b1 = vec_traits<B>::template read_element<1>(b);
39 typedef typename deduce_vec2<A,B,2>::type R;
40 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
41 R r;
42 vec_traits<R>::template write_element<0>(r)=a00*b0+a01*b1;
43 vec_traits<R>::template write_element<1>(r)=a10*b0+a11*b1;
44 return r;
45 }
46
47 namespace
48 sfinae
49 {
50 using ::boost::qvm::operator*;
51 }
52
53 namespace
54 qvm_detail
55 {
56 template <int R,int C>
57 struct mul_mv_defined;
58
59 template <>
60 struct
61 mul_mv_defined<2,2>
62 {
63 static bool const value=true;
64 };
65 }
66
67 template <class A,class B>
68 BOOST_QVM_INLINE_OPERATIONS
69 typename lazy_enable_if_c<
70 mat_traits<B>::rows==2 && mat_traits<B>::cols==2 &&
71 vec_traits<A>::dim==2,
72 deduce_vec2<A,B,2> >::type
73 operator*( A const & a, B const & b )
74 {
75 typedef typename vec_traits<A>::scalar_type Ta;
76 typedef typename mat_traits<B>::scalar_type Tb;
77 Ta const a0 = vec_traits<A>::template read_element<0>(a);
78 Ta const a1 = vec_traits<A>::template read_element<1>(a);
79 Tb const b00 = mat_traits<B>::template read_element<0,0>(b);
80 Tb const b01 = mat_traits<B>::template read_element<0,1>(b);
81 Tb const b10 = mat_traits<B>::template read_element<1,0>(b);
82 Tb const b11 = mat_traits<B>::template read_element<1,1>(b);
83 typedef typename deduce_vec2<A,B,2>::type R;
84 BOOST_QVM_STATIC_ASSERT(vec_traits<R>::dim==2);
85 R r;
86 vec_traits<R>::template write_element<0>(r)=a0*b00+a1*b10;
87 vec_traits<R>::template write_element<1>(r)=a0*b01+a1*b11;
88 return r;
89 }
90
91 namespace
92 sfinae
93 {
94 using ::boost::qvm::operator*;
95 }
96
97 namespace
98 qvm_detail
99 {
100 template <int R,int C>
101 struct mul_vm_defined;
102
103 template <>
104 struct
105 mul_vm_defined<2,2>
106 {
107 static bool const value=true;
108 };
109 }
110
111 }
112 }
113
114 #endif