]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | [auto_generated] | |
3 | boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp | |
4 | ||
5 | [begin_description] | |
6 | Check if two VexCL containers are the same instance. | |
7 | [end_description] | |
8 | ||
9 | Copyright 2009-2011 Karsten Ahnert | |
10 | Copyright 2009-2011 Mario Mulansky | |
11 | ||
12 | Distributed under the Boost Software License, Version 1.0. | |
13 | (See accompanying file LICENSE_1_0.txt or | |
14 | copy at http://www.boost.org/LICENSE_1_0.txt) | |
15 | */ | |
16 | ||
17 | ||
18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED | |
19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED | |
20 | ||
21 | #include <vexcl/vector.hpp> | |
22 | #include <vexcl/multivector.hpp> | |
23 | ||
24 | #include <boost/numeric/odeint/util/same_instance.hpp> | |
25 | ||
26 | namespace boost { | |
27 | namespace numeric { | |
28 | namespace odeint { | |
29 | ||
30 | template <typename T> | |
31 | struct same_instance_impl< vex::vector<T> , vex::vector<T> > | |
32 | { | |
33 | static bool same_instance( const vex::vector<T> &x1 , const vex::vector<T> &x2 ) | |
34 | { | |
35 | return | |
36 | static_cast<const vex::vector<T>*>(&x1) == | |
37 | static_cast<const vex::vector<T>*>(&x2); | |
38 | } | |
39 | }; | |
40 | ||
41 | template <typename T, size_t N> | |
42 | struct same_instance_impl< vex::multivector<T, N> , vex::multivector<T, N> > | |
43 | { | |
44 | static bool same_instance( const vex::multivector<T, N> &x1 , const vex::multivector<T, N> &x2 ) | |
45 | { | |
46 | return | |
47 | static_cast<const vex::multivector<T, N>*>(&x1) == | |
48 | static_cast<const vex::multivector<T, N>*>(&x2); | |
49 | } | |
50 | }; | |
51 | ||
52 | } // namespace odeint | |
53 | } // namespace numeric | |
54 | } // namespace boost | |
55 | ||
56 | ||
57 | ||
58 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED |