Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:40:06

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/external/viennacl/viennacl_resize.hpp
0004 
0005  [begin_description]
0006  Enable resizing for viennacl vector.
0007  [end_description]
0008 
0009  Copyright 2012 Denis Demidov
0010  Copyright 2012 Karsten Ahnert
0011  Copyright 2012 Mario Mulansky
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_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
0020 #define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
0021 
0022 #include <type_traits>
0023 
0024 #include <viennacl/vector.hpp>
0025 
0026 #include <boost/numeric/odeint/util/is_resizeable.hpp>
0027 #include <boost/numeric/odeint/util/resize.hpp>
0028 #include <boost/numeric/odeint/util/same_size.hpp>
0029 
0030 namespace boost {
0031 namespace numeric {
0032 namespace odeint {
0033 
0034 
0035 
0036 /*
0037  * specializations for viennacl::vector< T >
0038  */
0039 template< typename T >
0040 struct is_resizeable< viennacl::vector< T > > : std::true_type { };
0041 
0042 template< typename T >
0043 struct resize_impl< viennacl::vector< T > , viennacl::vector< T > >
0044 {
0045     static void resize( viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
0046     {
0047         x1.resize( x2.size() , false );
0048     }
0049 };
0050 
0051 template< typename T >
0052 struct same_size_impl< viennacl::vector< T > , viennacl::vector< T > >
0053 {
0054     static bool same_size( const viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
0055     {
0056         return x1.size() == x2.size();
0057     }
0058 };
0059 
0060 
0061 
0062 } // namespace odeint
0063 } // namespace numeric
0064 } // namespace boost
0065 
0066 
0067 
0068 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED