File indexing completed on 2025-07-11 08:18:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
0020 #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
0021
0022 #include <type_traits>
0023
0024 #include <vexcl/vector.hpp>
0025 #include <vexcl/multivector.hpp>
0026
0027 #include <boost/numeric/odeint/util/is_resizeable.hpp>
0028 #include <boost/numeric/odeint/util/resize.hpp>
0029 #include <boost/numeric/odeint/util/same_size.hpp>
0030
0031 namespace boost {
0032 namespace numeric {
0033 namespace odeint {
0034
0035
0036
0037
0038
0039
0040 template< typename T >
0041 struct is_resizeable< vex::vector< T > > : std::true_type { };
0042
0043 template< typename T >
0044 struct resize_impl< vex::vector< T > , vex::vector< T > >
0045 {
0046 static void resize( vex::vector< T > &x1 , const vex::vector< T > &x2 )
0047 {
0048 x1.resize( x2.queue_list() , x2.size() );
0049 }
0050 };
0051
0052 template< typename T >
0053 struct same_size_impl< vex::vector< T > , vex::vector< T > >
0054 {
0055 static bool same_size( const vex::vector< T > &x1 , const vex::vector< T > &x2 )
0056 {
0057 return x1.size() == x2.size();
0058 }
0059 };
0060
0061
0062
0063
0064
0065
0066
0067
0068 template< typename T , size_t N >
0069 struct is_resizeable< vex::multivector< T , N > > : std::true_type { };
0070
0071 template< typename T , size_t N >
0072 struct resize_impl< vex::multivector< T , N > , vex::multivector< T , N > >
0073 {
0074 static void resize( vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
0075 {
0076 x1.resize( x2.queue_list() , x2.size() );
0077 }
0078 };
0079
0080 template< typename T , size_t N >
0081 struct same_size_impl< vex::multivector< T , N > , vex::multivector< T , N > >
0082 {
0083 static bool same_size( const vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
0084 {
0085 return x1.size() == x2.size();
0086 }
0087 };
0088
0089
0090 }
0091 }
0092 }
0093
0094
0095
0096 #endif