vexcl_same_instance.hpp 1.5 KB

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