algebra_dispatcher.cpp 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. [auto_generated]
  3. libs/numeric/odeint/test/algebra_dispatcher.cpp
  4. [begin_description]
  5. tba.
  6. [end_description]
  7. Copyright 2013 Karsten Ahnert
  8. Copyright 2013 Mario Mulansky
  9. Copyright 2013 Pascal Germroth
  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. #include <boost/config.hpp>
  15. #ifdef BOOST_MSVC
  16. #pragma warning(disable:4996)
  17. #endif
  18. #define BOOST_TEST_MODULE odeint_algebra_dispatcher
  19. #include <boost/numeric/odeint/config.hpp>
  20. #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
  21. #include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
  22. #include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
  23. #include <boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp>
  24. #include <boost/test/unit_test.hpp>
  25. #include <boost/static_assert.hpp>
  26. #include <boost/type_traits/is_same.hpp>
  27. #include <boost/array.hpp>
  28. #include <boost/mpl/list.hpp>
  29. using namespace boost::unit_test;
  30. using namespace boost::numeric::odeint;
  31. BOOST_AUTO_TEST_SUITE( algebra_dispatcher_test )
  32. BOOST_AUTO_TEST_CASE( range_algebra_with_vector )
  33. {
  34. typedef runge_kutta4< std::vector< double > > stepper_type;
  35. BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , range_algebra >::value ));
  36. }
  37. BOOST_AUTO_TEST_CASE( array_algebra_with_array )
  38. {
  39. typedef runge_kutta4< boost::array< double , 2 > > stepper_type;
  40. BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , array_algebra >::value ));
  41. }
  42. BOOST_AUTO_TEST_CASE( range_algebra_with_array )
  43. {
  44. typedef runge_kutta4< boost::array< double , 2 > , double , boost::array< double , 2 > , double , range_algebra > stepper_type;
  45. BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , range_algebra >::value ));
  46. }
  47. BOOST_AUTO_TEST_CASE( fusion_algebra_with_fusion_vector )
  48. {
  49. typedef runge_kutta4< boost::fusion::vector< double > > stepper_type;
  50. BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , fusion_algebra >::value ));
  51. }
  52. BOOST_AUTO_TEST_CASE( fusion_algebra_with_fusion_vector2 )
  53. {
  54. typedef runge_kutta_fehlberg78< boost::fusion::vector< double > > stepper_type;
  55. BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , fusion_algebra >::value ));
  56. }
  57. typedef boost::mpl::list< float , double , long double , std::complex< double > , std::complex< float > > fp_types;
  58. BOOST_AUTO_TEST_CASE_TEMPLATE( vector_space_algebra_with_floating_point , T , fp_types )
  59. {
  60. typedef runge_kutta_fehlberg78< T > stepper_type;
  61. BOOST_STATIC_ASSERT(( boost::is_same< typename stepper_type::algebra_type , vector_space_algebra >::value ));
  62. }
  63. BOOST_AUTO_TEST_SUITE_END()