File indexing completed on 2025-01-18 09:42:52
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 <vexcl/vector.hpp>
0023 #include <vexcl/multivector.hpp>
0024
0025 #include <boost/numeric/odeint/util/is_resizeable.hpp>
0026 #include <boost/numeric/odeint/util/resize.hpp>
0027 #include <boost/numeric/odeint/util/same_size.hpp>
0028
0029 namespace boost {
0030 namespace numeric {
0031 namespace odeint {
0032
0033
0034
0035
0036
0037
0038 template< typename T >
0039 struct is_resizeable< vex::vector< T > > : boost::true_type { };
0040
0041 template< typename T >
0042 struct resize_impl< vex::vector< T > , vex::vector< T > >
0043 {
0044 static void resize( vex::vector< T > &x1 , const vex::vector< T > &x2 )
0045 {
0046 x1.resize( x2.queue_list() , x2.size() );
0047 }
0048 };
0049
0050 template< typename T >
0051 struct same_size_impl< vex::vector< T > , vex::vector< T > >
0052 {
0053 static bool same_size( const vex::vector< T > &x1 , const vex::vector< T > &x2 )
0054 {
0055 return x1.size() == x2.size();
0056 }
0057 };
0058
0059
0060
0061
0062
0063
0064
0065
0066 template< typename T , size_t N >
0067 struct is_resizeable< vex::multivector< T , N > > : boost::true_type { };
0068
0069 template< typename T , size_t N >
0070 struct resize_impl< vex::multivector< T , N > , vex::multivector< T , N > >
0071 {
0072 static void resize( vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
0073 {
0074 x1.resize( x2.queue_list() , x2.size() );
0075 }
0076 };
0077
0078 template< typename T , size_t N >
0079 struct same_size_impl< vex::multivector< T , N > , vex::multivector< T , N > >
0080 {
0081 static bool same_size( const vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
0082 {
0083 return x1.size() == x2.size();
0084 }
0085 };
0086
0087
0088 }
0089 }
0090 }
0091
0092
0093
0094 #endif