Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:22:33

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/external/compute/compute_resize.hpp
0004 
0005  [begin_description]
0006  Enable resizing for Boost.Compute vector
0007  [end_description]
0008 
0009  Copyright 2009-2011 Karsten Ahnert
0010  Copyright 2009-2011 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
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 #include <type_traits>
0026 
0027 namespace boost {
0028 namespace numeric {
0029 namespace odeint {
0030 
0031 template< class T, class A >
0032 struct is_resizeable< boost::compute::vector< T , A > >
0033 {
0034     struct type : public std::true_type { };
0035     const static bool value = type::value;
0036 };
0037 
0038 template< class T, class A >
0039 struct same_size_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
0040 {
0041     static bool same_size( const boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y )
0042     {
0043         return x.size() == y.size();
0044     }
0045 };
0046 
0047 template< class T, class A >
0048 struct resize_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
0049 {
0050     static void resize( boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y )
0051     {
0052         x.resize( y.size() );
0053     }
0054 };
0055 
0056 
0057 template< class Container1, class T, class A >
0058 struct copy_impl< Container1 , boost::compute::vector< T, A > >
0059 {
0060     static void copy( const Container1 &from , boost::compute::vector< T, A > &to )
0061     {
0062         boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
0063     }
0064 };
0065 
0066 template< class T, class A, class Container2 >
0067 struct copy_impl< boost::compute::vector< T, A > , Container2 >
0068 {
0069     static void copy( const boost::compute::vector< T, A > &from , Container2 &to )
0070     {
0071         boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
0072     }
0073 };
0074 
0075 template< class T, class A >
0076 struct copy_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > >
0077 {
0078     static void copy( const boost::compute::vector< T, A > &from , boost::compute::vector< T, A > &to )
0079     {
0080         boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
0081     }
0082 };
0083 
0084 
0085 
0086 
0087 } // odeint
0088 } // numeric
0089 } // boost
0090 
0091 
0092 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED