]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / numeric / odeint / external / vexcl / vexcl_resize.hpp
1 /*
2 [auto_generated]
3 boost/numeric/odeint/external/vexcl/vexcl_resize.hpp
4
5 [begin_description]
6 Enable resizing for vexcl vector and multivector.
7 [end_description]
8
9 Copyright 2012 Karsten Ahnert
10 Copyright 2012 Mario Mulansky
11 Copyright 2012 Denis Demidov
12
13 Distributed under the Boost Software License, Version 1.0.
14 (See accompanying file LICENSE_1_0.txt or
15 copy at http://www.boost.org/LICENSE_1_0.txt)
16 */
17
18
19 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
20 #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
21
22 #include <vexcl/vector.hpp>
23 #include <vexcl/multivector.hpp>
24
25 #include <boost/numeric/odeint/util/is_resizeable.hpp>
26 #include <boost/numeric/odeint/util/resize.hpp>
27 #include <boost/numeric/odeint/util/same_size.hpp>
28
29 namespace boost {
30 namespace numeric {
31 namespace odeint {
32
33
34
35 /*
36 * specializations for vex::vector< T >
37 */
38 template< typename T >
39 struct is_resizeable< vex::vector< T > > : boost::true_type { };
40
41 template< typename T >
42 struct resize_impl< vex::vector< T > , vex::vector< T > >
43 {
44 static void resize( vex::vector< T > &x1 , const vex::vector< T > &x2 )
45 {
46 x1.resize( x2.queue_list() , x2.size() );
47 }
48 };
49
50 template< typename T >
51 struct same_size_impl< vex::vector< T > , vex::vector< T > >
52 {
53 static bool same_size( const vex::vector< T > &x1 , const vex::vector< T > &x2 )
54 {
55 return x1.size() == x2.size();
56 }
57 };
58
59
60
61
62
63 /*
64 * specializations for vex::multivector< T >
65 */
66 template< typename T , size_t N >
67 struct is_resizeable< vex::multivector< T , N > > : boost::true_type { };
68
69 template< typename T , size_t N >
70 struct resize_impl< vex::multivector< T , N > , vex::multivector< T , N > >
71 {
72 static void resize( vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
73 {
74 x1.resize( x2.queue_list() , x2.size() );
75 }
76 };
77
78 template< typename T , size_t N >
79 struct same_size_impl< vex::multivector< T , N > , vex::multivector< T , N > >
80 {
81 static bool same_size( const vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
82 {
83 return x1.size() == x2.size();
84 }
85 };
86
87
88 } // namespace odeint
89 } // namespace numeric
90 } // namespace boost
91
92
93
94 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED