resizing_test_state_type.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. [auto_generated]
  3. libs/numeric/odeint/test/resizing_test_state_type.hpp
  4. [begin_description]
  5. tba.
  6. [end_description]
  7. Copyright 2009-2012 Karsten Ahnert
  8. Copyright 2009-2012 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 LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED
  14. #define LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED
  15. #include <boost/numeric/odeint/util/is_resizeable.hpp>
  16. #include <boost/numeric/odeint/util/resize.hpp>
  17. #include <boost/numeric/odeint/util/same_size.hpp>
  18. #include <boost/array.hpp>
  19. // Mario: velocity verlet tests need arrays of size 2
  20. // some ugly detailed dependency, maybe this can be improved?
  21. class test_array_type : public boost::array< double , 2 > { };
  22. size_t adjust_size_count;
  23. namespace boost {
  24. namespace numeric {
  25. namespace odeint {
  26. template<>
  27. struct is_resizeable< test_array_type >
  28. {
  29. typedef boost::true_type type;
  30. const static bool value = type::value;
  31. };
  32. template<>
  33. struct same_size_impl< test_array_type , test_array_type >
  34. {
  35. static bool same_size( const test_array_type &x1 , const test_array_type &x2 )
  36. {
  37. return false;
  38. }
  39. };
  40. template<>
  41. struct resize_impl< test_array_type , test_array_type >
  42. {
  43. static void resize( test_array_type &x1 , const test_array_type &x2 )
  44. {
  45. adjust_size_count++;
  46. }
  47. };
  48. } // namespace odeint
  49. } // namespace numeric
  50. } // namespace boost
  51. #endif // LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED