Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:18:05

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 <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  * specializations for vex::vector< T >
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  * specializations for vex::multivector< T >
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 } // namespace odeint
0091 } // namespace numeric
0092 } // namespace boost
0093 
0094 
0095 
0096 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED