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