1 | /* |
2 | [auto_generated] |
3 | test/std_array.cpp |
4 | |
5 | [begin_description] |
6 | Checks if odeint compiles fine with the std::array using the array algebra |
7 | [end_description] |
8 | |
9 | Copyright 2009-2014 Karsten Ahnert |
10 | Copyright 2009-2014 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 | #define BOOST_TEST_MODULE odeint_std_array |
19 | |
20 | #include <array> |
21 | #include <boost/numeric/odeint.hpp> |
22 | #include <boost/static_assert.hpp> |
23 | #include <boost/type_traits/is_same.hpp> |
24 | #include <boost/test/unit_test.hpp> |
25 | |
26 | using namespace boost::unit_test; |
27 | |
28 | typedef std::array<double, 3> state_type; |
29 | |
30 | void rhs(const state_type &x, state_type &dxdt, const double t) |
31 | { |
32 | } |
33 | |
34 | BOOST_AUTO_TEST_SUITE( unwrap_reference_test ) |
35 | |
36 | BOOST_AUTO_TEST_CASE( test_case ) |
37 | { |
38 | state_type x = {0.0, 0.0, 0.0}; |
39 | |
40 | typedef boost::numeric::odeint::runge_kutta4<state_type> stepper_type; |
41 | |
42 | static_assert(( boost::is_same< stepper_type::algebra_type , |
43 | boost::numeric::odeint::array_algebra >::value ), "Not array algebra" ); |
44 | |
45 | stepper_type stepper1; |
46 | stepper1.do_step(system: rhs, x, t: 0.0, dt: 0.1); |
47 | |
48 | boost::numeric::odeint::runge_kutta4< |
49 | state_type, double, state_type, double, |
50 | boost::numeric::odeint::array_algebra > stepper; |
51 | stepper.do_step(system: rhs, x, t: 0.0, dt: 0.1); |
52 | |
53 | } |
54 | |
55 | |
56 | BOOST_AUTO_TEST_SUITE_END() |
57 | |