Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:52

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/external/vexcl/vexcl_resize.hpp
0004 
0005  [begin_description]
0006  Enable resizing for vexcl vector and multivector.
0007  [end_description]
0008 
0009  Copyright 2012 Karsten Ahnert
0010  Copyright 2012 Mario Mulansky
0011  Copyright 2012 Denis Demidov
0012 
0013  Distributed under the Boost Software License, Version 1.0.
0014  (See accompanying file LICENSE_1_0.txt or
0015  copy at http://www.boost.org/LICENSE_1_0.txt)
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  * specializations for vex::vector< T >
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  * specializations for vex::multivector< T >
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 } // namespace odeint
0089 } // namespace numeric
0090 } // namespace boost
0091 
0092 
0093 
0094 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED