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/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 <viennacl/vector.hpp>
0023 
0024 #include <boost/numeric/odeint/util/is_resizeable.hpp>
0025 #include <boost/numeric/odeint/util/resize.hpp>
0026 #include <boost/numeric/odeint/util/same_size.hpp>
0027 
0028 namespace boost {
0029 namespace numeric {
0030 namespace odeint {
0031 
0032 
0033 
0034 /*
0035  * specializations for viennacl::vector< T >
0036  */
0037 template< typename T >
0038 struct is_resizeable< viennacl::vector< T > > : boost::true_type { };
0039 
0040 template< typename T >
0041 struct resize_impl< viennacl::vector< T > , viennacl::vector< T > >
0042 {
0043     static void resize( viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
0044     {
0045         x1.resize( x2.size() , false );
0046     }
0047 };
0048 
0049 template< typename T >
0050 struct same_size_impl< viennacl::vector< T > , viennacl::vector< T > >
0051 {
0052     static bool same_size( const viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
0053     {
0054         return x1.size() == x2.size();
0055     }
0056 };
0057 
0058 
0059 
0060 } // namespace odeint
0061 } // namespace numeric
0062 } // namespace boost
0063 
0064 
0065 
0066 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED