File indexing completed on 2025-01-18 09:42:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED
0019 #define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED
0020
0021 #include <boost/compute/container/vector.hpp>
0022
0023 #include <boost/numeric/odeint/util/copy.hpp>
0024
0025 namespace boost {
0026 namespace numeric {
0027 namespace odeint {
0028
0029 template< class T, class A >
0030 struct is_resizeable< boost::compute::vector< T , A > >
0031 {
0032 struct type : public boost::true_type { };
0033 const static bool value = type::value;
0034 };
0035
0036 template< class T, class A >
0037 struct same_size_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
0038 {
0039 static bool same_size( const boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y )
0040 {
0041 return x.size() == y.size();
0042 }
0043 };
0044
0045 template< class T, class A >
0046 struct resize_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
0047 {
0048 static void resize( boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y )
0049 {
0050 x.resize( y.size() );
0051 }
0052 };
0053
0054
0055 template< class Container1, class T, class A >
0056 struct copy_impl< Container1 , boost::compute::vector< T, A > >
0057 {
0058 static void copy( const Container1 &from , boost::compute::vector< T, A > &to )
0059 {
0060 boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
0061 }
0062 };
0063
0064 template< class T, class A, class Container2 >
0065 struct copy_impl< boost::compute::vector< T, A > , Container2 >
0066 {
0067 static void copy( const boost::compute::vector< T, A > &from , Container2 &to )
0068 {
0069 boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
0070 }
0071 };
0072
0073 template< class T, class A >
0074 struct copy_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
0075 {
0076 static void copy( const boost::compute::vector< T, A > &from , boost::compute::vector< T, A > &to )
0077 {
0078 boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
0079 }
0080 };
0081
0082
0083
0084
0085 }
0086 }
0087 }
0088
0089
0090 #endif