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