]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/qvm/detail/mat_assign.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / qvm / detail / mat_assign.hpp
CommitLineData
1e59de90
TL
1#ifndef BOOST_QVM_DETAIL_MAT_ASSIGN_HPP_INCLUDED
2#define BOOST_QVM_DETAIL_MAT_ASSIGN_HPP_INCLUDED
92f5a8d4 3
1e59de90 4// Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
92f5a8d4 5
1e59de90
TL
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)
92f5a8d4
TL
8
9#include <boost/qvm/gen/mat_assign2.hpp>
10#include <boost/qvm/gen/mat_assign3.hpp>
11#include <boost/qvm/gen/mat_assign4.hpp>
12
1e59de90
TL
13namespace boost { namespace qvm {
14
92f5a8d4 15namespace
1e59de90 16qvm_detail
92f5a8d4 17 {
1e59de90
TL
18 template <int M,int N>
19 struct
20 assign_mm_defined
92f5a8d4 21 {
1e59de90
TL
22 static bool const value=false;
23 };
92f5a8d4 24
1e59de90
TL
25 template <int I,int N>
26 struct
27 copy_matrix_elements
28 {
29 template <class A,class B>
30 static
31 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL
32 void
33 f( A & a, B const & b )
34 {
35 mat_traits<A>::template write_element<I/mat_traits<A>::cols,I%mat_traits<A>::cols>(a) =
36 mat_traits<B>::template read_element<I/mat_traits<B>::cols,I%mat_traits<B>::cols>(b);
37 copy_matrix_elements<I+1,N>::f(a,b);
92f5a8d4 38 }
1e59de90 39 };
92f5a8d4 40
1e59de90
TL
41 template <int N>
42 struct
43 copy_matrix_elements<N,N>
44 {
92f5a8d4 45 template <class A,class B>
1e59de90
TL
46 static
47 BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL
48 void
49 f( A &, B const & )
92f5a8d4 50 {
92f5a8d4 51 }
1e59de90 52 };
92f5a8d4
TL
53 }
54
1e59de90
TL
55template <class A,class B>
56BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL
57typename enable_if_c<
58 is_mat<A>::value && is_mat<B>::value &&
59 mat_traits<A>::rows==mat_traits<B>::rows &&
60 mat_traits<A>::cols==mat_traits<B>::cols &&
61 !qvm_detail::assign_mm_defined<mat_traits<A>::rows,mat_traits<A>::cols>::value,
62 A &>::type
63assign( A & a, B const & b )
64 {
65 qvm_detail::copy_matrix_elements<0,mat_traits<A>::rows*mat_traits<A>::cols>::f(a,b);
66 return a;
67 }
68
69} }
70
92f5a8d4 71#endif