]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/numeric/odeint/test/regression/regression_149.cpp
4 Test case for issue 149:
5 Error C2582 with msvc-10 when using iterator-based integration
8 Copyright 2011-2015 Karsten Ahnert
9 Copyright 2011-2015 Mario Mulansky
11 Distributed under the Boost Software License, Version 1.0.
12 (See accompanying file LICENSE_1_0.txt or
13 copy at http://www.boost.org/LICENSE_1_0.txt)
17 // disable checked iterator warning for msvc
19 #include <boost/config.hpp>
21 #pragma warning(disable:4996)
24 #define BOOST_TEST_MODULE odeint_regression_147
29 #include <boost/test/unit_test.hpp>
31 #include <boost/mpl/vector.hpp>
32 #include <boost/range/algorithm/find_if.hpp>
34 #include <boost/numeric/odeint.hpp>
36 using namespace boost::unit_test
;
37 using namespace boost::numeric::odeint
;
38 namespace mpl
= boost::mpl
;
40 typedef std::vector
<double> state_type
;
42 void rhs( const state_type
&x
, state_type
&dxdt
, const double t
)
47 template<class Stepper
>
50 void operator()( void )
52 bulirsch_stoer
< state_type
> stepper( 1e-9, 0.0, 0.0, 0.0 );
53 state_type
x( 3, 10.0 );
55 print( boost::find_if(
56 make_adaptive_time_range( stepper
, rhs
, x
, 0.0, 1.0, 0.01 ),
61 static bool pred( const std::pair
< const state_type
&, double > &x
)
63 return ( x
.first
[0] < 0.0 );
66 template<class Iterator
>
67 void print( Iterator iter
)
69 std::cout
<< iter
->second
<< "\t" << iter
->first
[0] << "\t"
70 << iter
->first
[1] << "\t" << iter
->first
[2] << "\n";
76 runge_kutta4
< state_type
> ,
77 runge_kutta_cash_karp54
< state_type
> ,
78 runge_kutta_dopri5
< state_type
> ,
79 runge_kutta_fehlberg78
< state_type
> ,
80 bulirsch_stoer
< state_type
>
84 BOOST_AUTO_TEST_SUITE( regression_147_test
)
86 BOOST_AUTO_TEST_CASE_TEMPLATE( regression_147_test
, Stepper
,
89 perform_test
< Stepper
> tester
;
93 BOOST_AUTO_TEST_SUITE_END()