viennacl_resize.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. [auto_generated]
  3. boost/numeric/odeint/external/viennacl/viennacl_resize.hpp
  4. [begin_description]
  5. Enable resizing for viennacl vector.
  6. [end_description]
  7. Copyright 2012 Denis Demidov
  8. Copyright 2012 Karsten Ahnert
  9. Copyright 2012 Mario Mulansky
  10. Distributed under the Boost Software License, Version 1.0.
  11. (See accompanying file LICENSE_1_0.txt or
  12. copy at http://www.boost.org/LICENSE_1_0.txt)
  13. */
  14. #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
  15. #define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
  16. #include <viennacl/vector.hpp>
  17. #include <boost/numeric/odeint/util/is_resizeable.hpp>
  18. #include <boost/numeric/odeint/util/resize.hpp>
  19. #include <boost/numeric/odeint/util/same_size.hpp>
  20. namespace boost {
  21. namespace numeric {
  22. namespace odeint {
  23. /*
  24. * specializations for viennacl::vector< T >
  25. */
  26. template< typename T >
  27. struct is_resizeable< viennacl::vector< T > > : boost::true_type { };
  28. template< typename T >
  29. struct resize_impl< viennacl::vector< T > , viennacl::vector< T > >
  30. {
  31. static void resize( viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
  32. {
  33. x1.resize( x2.size() , false );
  34. }
  35. };
  36. template< typename T >
  37. struct same_size_impl< viennacl::vector< T > , viennacl::vector< T > >
  38. {
  39. static bool same_size( const viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
  40. {
  41. return x1.size() == x2.size();
  42. }
  43. };
  44. } // namespace odeint
  45. } // namespace numeric
  46. } // namespace boost
  47. #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED