From ccf0f9278e115174218f53c593039b82266c435b Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 15:22:56 +0100 Subject: [PATCH 1/9] Remove uses of boost.array --- CMakeLists.txt | 1 - doc/concepts/state_algebra_operations.qbk | 6 +-- ...etails_state_types_algebras_operations.qbk | 4 +- doc/details_steppers.qbk | 12 +++--- doc/getting_started.qbk | 4 +- doc/tutorial_chaotic_system.qbk | 2 +- doc/tutorial_harmonic_oscillator.qbk | 2 +- doc/tutorial_solar_system.qbk | 2 +- doc/tutorial_special_topics.qbk | 2 +- doc/tutorial_stiff_systems.qbk | 2 +- examples/abm_precision.cpp | 4 +- examples/adaptive_iterator.cpp | 4 +- examples/bind_member_functions.cpp | 2 +- examples/bulirsch_stoer.cpp | 4 +- examples/chaotic_system.cpp | 6 +-- examples/elliptic_functions.cpp | 4 +- examples/generation_functions.cpp | 4 +- examples/gmpxx/lorenz_gmpxx.cpp | 4 +- examples/heun.cpp | 12 +++--- examples/lorenz.cpp | 4 +- examples/multiprecision/lorenz_mp.cpp | 2 +- examples/quadmath/black_hole.cpp | 2 +- examples/solar_system.cpp | 6 +-- examples/stepper_details.cpp | 6 +-- examples/stochastic_euler.cpp | 12 +++--- examples/stuart_landau.cpp | 2 +- .../odeint/algebra/algebra_dispatcher.hpp | 26 +----------- .../numeric/odeint/algebra/array_algebra.hpp | 2 +- .../odeint/algebra/default_operations.hpp | 2 +- .../numeric/odeint/algebra/range_algebra.hpp | 2 +- .../base/symplectic_rkn_stepper_base.hpp | 4 +- .../controlled_adams_bashforth_moulton.hpp | 4 +- .../detail/adams_bashforth_coefficients.hpp | 34 ++++++++-------- .../detail/adams_moulton_coefficients.hpp | 34 ++++++++-------- .../detail/adaptive_adams_coefficients.hpp | 12 +++--- .../stepper/detail/generic_rk_algorithm.hpp | 10 ++--- .../stepper/detail/generic_rk_operations.hpp | 40 +++++++++---------- .../detail/pid_step_adjuster_coefficients.hpp | 38 +++++++++--------- .../odeint/stepper/detail/rotating_buffer.hpp | 2 +- .../odeint/stepper/explicit_generic_rk.hpp | 6 +-- .../numeric/odeint/stepper/runge_kutta4.hpp | 12 +++--- .../stepper/runge_kutta_cash_karp54.hpp | 18 ++++----- .../odeint/stepper/runge_kutta_fehlberg78.hpp | 32 +++++++-------- .../odeint/stepper/symplectic_euler.hpp | 6 +-- .../symplectic_rkn_sb3a_m4_mclachlan.hpp | 4 +- .../stepper/symplectic_rkn_sb3a_mclachlan.hpp | 6 +-- .../odeint/stepper/velocity_verlet.hpp | 2 +- .../odeint/util/multi_array_adaption.hpp | 4 +- performance/SIMD/roessler.cpp | 4 +- performance/SIMD/roessler_simd.cpp | 4 +- performance/lorenz.hpp | 2 +- performance/odeint_rk4_array.cpp | 4 +- test/adams_bashforth.cpp | 12 +++--- test/adams_bashforth_moulton.cpp | 6 +-- test/adams_moulton.cpp | 6 +-- test/adaptive_iterator.cpp | 2 +- test/adaptive_time_iterator.cpp | 2 +- test/algebra_dispatcher.cpp | 6 +-- test/bulirsch_stoer.cpp | 4 +- test/const_step_iterator.cpp | 2 +- test/const_step_time_iterator.cpp | 2 +- test/controlled_adams_bashforth_moulton.cpp | 2 +- test/diagnostic_state_type.hpp | 4 +- test/dummy_steppers.hpp | 8 ++-- test/generic_error_stepper.cpp | 14 +++---- test/generic_stepper.cpp | 10 ++--- test/integrate.cpp | 2 +- test/integrate_implicit.cpp | 2 +- test/n_step_iterator.cpp | 2 +- test/n_step_time_iterator.cpp | 2 +- test/numeric/adams_bashforth.cpp | 4 +- test/numeric/adams_bashforth_moulton.cpp | 4 +- .../adaptive_adams_bashforth_moulton.cpp | 4 +- test/numeric/rosenbrock.cpp | 2 +- test/numeric/runge_kutta.cpp | 4 +- test/numeric/symplectic.cpp | 4 +- test/numeric/velocity_verlet.cpp | 4 +- test/prepare_stepper_testing.hpp | 8 ++-- test/range_algebra.cpp | 22 +++++----- test/regression/regression_147.cpp | 2 +- test/regression/regression_168.cpp | 2 +- test/resizing.cpp | 2 +- test/resizing_test_state_type.hpp | 4 +- test/runge_kutta_concepts.cpp | 6 +-- test/runge_kutta_controlled_concepts.cpp | 6 +-- test/runge_kutta_error_concepts.cpp | 6 +-- test/stepper_with_ranges.cpp | 10 ++--- test/symplectic_steppers.cpp | 2 +- test/times_iterator.cpp | 8 ++-- test/times_time_iterator.cpp | 2 +- test/velocity_verlet.cpp | 4 +- test_external/gmp/check_gmp.cpp | 2 +- test_external/gmp/gmp_integrate.cpp | 2 +- test_external/mkl/check_mkl.cpp | 2 +- 94 files changed, 305 insertions(+), 328 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3692bea4..d04c7d90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ target_include_directories(boost_numeric_odeint INTERFACE include) target_link_libraries(boost_numeric_odeint INTERFACE - Boost::array Boost::assert Boost::bind Boost::compute diff --git a/doc/concepts/state_algebra_operations.qbk b/doc/concepts/state_algebra_operations.qbk index d92bb839..fb58671d 100644 --- a/doc/concepts/state_algebra_operations.qbk +++ b/doc/concepts/state_algebra_operations.qbk @@ -103,13 +103,13 @@ In the following we list the existing `Algebra`/`Operations` configurations that [table [[`State`] [`Algebra`] [`Operations`] [Remarks]] - [[Anything supporting __boost_range, like `std::vector`, `std::list`, `boost::array`,... based on a `value_type` that supports operators +,* (typically `double`)] [`range_algebra`] [`default_operations`] [Standard implementation, applicable for most typical situations.]] - [[`boost::array` based on a `value_type` that supports operators +,*] [`array_algebra`] [`default_operations`] [Special implementation for boost::array with better performance than `range_algebra`]] + [[Anything supporting __boost_range, like `std::vector`, `std::list`, `std::array`,... based on a `value_type` that supports operators +,* (typically `double`)] [`range_algebra`] [`default_operations`] [Standard implementation, applicable for most typical situations.]] + [[`std::array` based on a `value_type` that supports operators +,*] [`array_algebra`] [`default_operations`] [Special implementation for std::array with better performance than `range_algebra`]] [[Anything that defines operators + within itself and * with scalar (Mathematically spoken, anything that is a vector space).] [`vector_space_algebra`] [`default_operations`] [For the use of __controlled_stepper, the template `vector_space_reduce` has to be instantiated.]] [[`thrust::device_vector`, `thrust::host_vector`] [`thrust_algebra`] [`thrust_operations`] [For running odeint on CUDA devices by using __thrust]] [[Any RandomAccessRange] [`openmp_range_algebra`] [`default_operations`] [OpenMP-parallelised range algebra]] [[`openmp_state`] [`openmp_algebra`] [`default_operations`] [OpenMP-parallelised algebra for split data]] - [[`boost::array` or anything which allocates the elements in a C-like manner] [`vector_space_algebra`] [`mkl_operations`] [Using the __intel_mkl in odeint for maximum performance. Currently, only the RK4 stepper is supported.]] + [[`std::array` or anything which allocates the elements in a C-like manner] [`vector_space_algebra`] [`mkl_operations`] [Using the __intel_mkl in odeint for maximum performance. Currently, only the RK4 stepper is supported.]] ] [endsect] diff --git a/doc/details_state_types_algebras_operations.qbk b/doc/details_state_types_algebras_operations.qbk index 274306b3..78481441 100644 --- a/doc/details_state_types_algebras_operations.qbk +++ b/doc/details_state_types_algebras_operations.qbk @@ -43,7 +43,7 @@ with non-standard state types: Again, odeint already provides basic interfaces for most of the usual state types. -So if you use a `std::vector`, or a `boost::array` as state type no additional +So if you use a `std::vector`, or a `std::array` as state type no additional work is required, they just work out of the box. [section Construction/Resizing] @@ -51,7 +51,7 @@ work is required, they just work out of the box. We distinguish between two basic state types: fixed sized and dynamically sized. For fixed size state types the default constructor `state_type()` already -allocates the required memory, prominent example is `boost::array`. +allocates the required memory, prominent example is `std:array`. Dynamically sized types have to be resized to make sure enough memory is allocated, the standard constructor does not take care of the resizing. Examples for this are the STL containers like `vector`. diff --git a/doc/details_steppers.qbk b/doc/details_steppers.qbk index 1a83f5c1..c31a425c 100644 --- a/doc/details_steppers.qbk +++ b/doc/details_steppers.qbk @@ -275,7 +275,7 @@ if the sizes of the state and the internal variable differ and only resizes if they are different. [note You only have to worry about memory allocation when using dynamically -sized vector types. If your state type is heap allocated, like `boost::array`, +sized vector types. If your state type is heap allocated, like `std::array`, no memory allocation is required whatsoever.] By default the resizing parameter is `initially_resizer`, meaning that the @@ -290,7 +290,7 @@ everything themselves. The third class of resizer is the `never_resizer` which means that the internal variables are never adjusted automatically and always have to be adjusted by hand . -There is a second mechanism which influences the resizing and which controls if a state type is at least resizeable - a meta-function `is_resizeable`. This meta-function returns a static Boolean value if any type is resizable. For example it will return `true` for `std::vector< T >` but `false` for `boost::array< T >`. By default and for unknown types `is_resizeable` returns `false`, so if you have your own type you need to specialize this meta-function. For more details on the resizing mechanism see the section __adapt_state_types. +There is a second mechanism which influences the resizing and which controls if a state type is at least resizeable - a meta-function `is_resizeable`. This meta-function returns a static Boolean value if any type is resizable. For example it will return `true` for `std::vector< T >` but `false` for `std::array< T >`. By default and for unknown types `is_resizeable` returns `false`, so if you have your own type you need to specialize this meta-function. For more details on the resizing mechanism see the section __adapt_state_types. @@ -398,10 +398,10 @@ like - presumably arbitrary precision types. One could also instantiate the coefficients directly `` -const boost::array< double , 1 > heun_a1 = {{ 1.0 / 3.0 }}; -const boost::array< double , 2 > heun_a2 = {{ 0.0 , 2.0 / 3.0 }}; -const boost::array< double , 3 > heun_b = {{ 1.0 / 4.0 , 0.0 , 3.0 / 4.0 }}; -const boost::array< double , 3 > heun_c = {{ 0.0 , 1.0 / 3.0 , 2.0 / 3.0 }}; +const std::array< double , 1 > heun_a1 = {{ 1.0 / 3.0 }}; +const std::array< double , 2 > heun_a2 = {{ 0.0 , 2.0 / 3.0 }}; +const std::array< double , 3 > heun_b = {{ 1.0 / 4.0 , 0.0 , 3.0 / 4.0 }}; +const std::array< double , 3 > heun_c = {{ 0.0 , 1.0 / 3.0 , 2.0 / 3.0 }}; `` But then you are nailed down to use doubles. diff --git a/doc/getting_started.qbk b/doc/getting_started.qbk index 7819940d..da15804e 100644 --- a/doc/getting_started.qbk +++ b/doc/getting_started.qbk @@ -29,7 +29,7 @@ Ordinary differential equations occur nearly everywhere in natural sciences. For Numerical approximations for the solution ['x(t)] are calculated iteratively. The easiest algorithm is the Euler scheme, where starting at ['x(0)] one finds ['x(dt) = x(0) + dt f(x(0),0)]. Now one can use ['x(dt)] and obtain ['x(2dt)] in a similar way and so on. The Euler method is of order 1, that means the error at each step is ['~ dt[super 2]]. This is, of course, not very satisfying, which is why the Euler method is rarely used for real life problems and serves just as illustrative example. The main focus of odeint is to provide numerical methods implemented in a way where the algorithm is completely independent on the data structure used to represent the state /x/. -In doing so, odeint is applicable for a broad variety of situations and it can be used with many other libraries. Besides the usual case where the state is defined as a `std::vector` or a `boost::array`, we provide native support for the following libraries: +In doing so, odeint is applicable for a broad variety of situations and it can be used with many other libraries. Besides the usual case where the state is defined as a `std::vector` or a `std::array`, we provide native support for the following libraries: * __ublas * __thrust, making odeint naturally running on CUDA devices @@ -88,7 +88,7 @@ first order ODEs by introducing the new variables ['q=x] and ['p=x'] such that [ [rhs_function] Here we chose `vector` as the state type, but others are also -possible, for example `boost::array`. odeint is designed in such a +possible, for example `std::array`. odeint is designed in such a way that you can easily use your own state types. Next, the ODE is defined which is in this case a simple function calculating ['f(x)]. The parameter signature of this function is crucial: the integration methods will always diff --git a/doc/tutorial_chaotic_system.qbk b/doc/tutorial_chaotic_system.qbk index 93057337..f2345e81 100644 --- a/doc/tutorial_chaotic_system.qbk +++ b/doc/tutorial_chaotic_system.qbk @@ -44,7 +44,7 @@ const double sigma = 10.0; const double R = 28.0; const double b = 8.0 / 3.0; -typedef boost::array< double , 3 > lorenz_state_type; +typedef std::array< double , 3 > lorenz_state_type; void lorenz( const lorenz_state_type &x , lorenz_state_type &dxdt , double t ) { diff --git a/doc/tutorial_harmonic_oscillator.qbk b/doc/tutorial_harmonic_oscillator.qbk index 53b8d882..abebc26d 100644 --- a/doc/tutorial_harmonic_oscillator.qbk +++ b/doc/tutorial_harmonic_oscillator.qbk @@ -16,7 +16,7 @@ [section Define the ODE] -First of all, you have to specify the data type that represents a state ['x] of your system. Mathematically, this usually is an n-dimensional vector with real numbers or complex numbers as scalar objects. For odeint the most natural way is to use `vector< double >` or `vector< complex< double > >` to represent the system state. However, odeint can deal with other container types as well, e.g. `boost::array< double , N >`, as long as it fulfills some requirements defined below. +First of all, you have to specify the data type that represents a state ['x] of your system. Mathematically, this usually is an n-dimensional vector with real numbers or complex numbers as scalar objects. For odeint the most natural way is to use `vector< double >` or `vector< complex< double > >` to represent the system state. However, odeint can deal with other container types as well, e.g. `std::array< double , N >`, as long as it fulfills some requirements defined below. To integrate a differential equation numerically, one also has to define the rhs of the equation ['x' = f(x)]. In odeint you supply this function in terms of an object that implements the ()-operator with a certain parameter structure. Hence, the straightforward way would be to just define a function, e.g: diff --git a/doc/tutorial_solar_system.qbk b/doc/tutorial_solar_system.qbk index a9e66779..05a58707 100644 --- a/doc/tutorial_solar_system.qbk +++ b/doc/tutorial_solar_system.qbk @@ -69,7 +69,7 @@ To implement this system we define a 3D point type which will represent the spac [point_type] -The next step is to define a container type storing the values of ['q] and ['p] and to define system functions. As container type we use `boost::array` +The next step is to define a container type storing the values of ['q] and ['p] and to define system functions. As container type we use `std::array` [import ../examples/solar_system.cpp] [container_type_definition] diff --git a/doc/tutorial_special_topics.qbk b/doc/tutorial_special_topics.qbk index 0e3e9dc3..dc34d4e3 100644 --- a/doc/tutorial_special_topics.qbk +++ b/doc/tutorial_special_topics.qbk @@ -65,7 +65,7 @@ Like the __tut_solar_system, the FPU is solved again by a symplectic solver, but [fpu_system_function] -You can also use `boost::array< double , N >` for the state type. +You can also use `std::array< double , N >` for the state type. Now, you have to define your initial values and perform the integration: diff --git a/doc/tutorial_stiff_systems.qbk b/doc/tutorial_stiff_systems.qbk index 6e28257a..be7a7c9e 100644 --- a/doc/tutorial_stiff_systems.qbk +++ b/doc/tutorial_stiff_systems.qbk @@ -43,7 +43,7 @@ with other state_types, realized by templatizing the `operator()`: [stiff_system_alternative_definition] Now you can use `stiff_system` in combination with `std::vector` or -`boost::array`. In the example the explicit time derivative of ['f(x,t)] is +`std::array`. In the example the explicit time derivative of ['f(x,t)] is introduced separately in the Jacobian. If ['df / dt = 0] simply fill `dfdt` with zeros. A well know solver for stiff systems is the Rosenbrock method. It has a step size control and dense output facilities and can be used like all the other steppers: diff --git a/examples/abm_precision.cpp b/examples/abm_precision.cpp index 747919f3..ff2d08e0 100644 --- a/examples/abm_precision.cpp +++ b/examples/abm_precision.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include using namespace boost::numeric::odeint; @@ -23,7 +23,7 @@ const int Steps = 4; typedef double value_type; -typedef boost::array< double , 2 > state_type; +typedef std::array< double , 2 > state_type; typedef runge_kutta_fehlberg78 initializing_stepper_type; typedef adams_bashforth_moulton< Steps , state_type > stepper_type; diff --git a/examples/adaptive_iterator.cpp b/examples/adaptive_iterator.cpp index 343699de..b7edeab0 100644 --- a/examples/adaptive_iterator.cpp +++ b/examples/adaptive_iterator.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -55,7 +55,7 @@ struct lorenz int main( int argc , char **argv ) { - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; /* * Controlled steppers with time iterator diff --git a/examples/bind_member_functions.cpp b/examples/bind_member_functions.cpp index 51f85e03..292e7e60 100644 --- a/examples/bind_member_functions.cpp +++ b/examples/bind_member_functions.cpp @@ -20,7 +20,7 @@ namespace odeint = boost::numeric::odeint; -typedef boost::array< double , 3 > state_type; +typedef std::array< double , 3 > state_type; //[ ode_wrapper template< class Obj , class Mem > diff --git a/examples/bulirsch_stoer.cpp b/examples/bulirsch_stoer.cpp index 0b18f46e..84987411 100644 --- a/examples/bulirsch_stoer.cpp +++ b/examples/bulirsch_stoer.cpp @@ -14,7 +14,7 @@ #define _USE_MATH_DEFINES #include -#include +#include #include #include @@ -26,7 +26,7 @@ using namespace std; using namespace boost::numeric::odeint; -typedef boost::array< double , 1 > state_type; +typedef std::array< double , 1 > state_type; /* * x' = ( - x*sin t + 2 tan x ) y diff --git a/examples/chaotic_system.cpp b/examples/chaotic_system.cpp index 60784689..9549cad6 100644 --- a/examples/chaotic_system.cpp +++ b/examples/chaotic_system.cpp @@ -15,7 +15,7 @@ #include -#include +#include #include @@ -52,8 +52,8 @@ const size_t n = 3; const size_t num_of_lyap = 3; const size_t N = n + n*num_of_lyap; -typedef boost::array< double , N > state_type; -typedef boost::array< double , num_of_lyap > lyap_type; +typedef std::array< double , N > state_type; +typedef std::array< double , num_of_lyap > lyap_type; void lorenz_with_lyap( const state_type &x , state_type &dxdt , double t ) { diff --git a/examples/elliptic_functions.cpp b/examples/elliptic_functions.cpp index 97ba59da..c791c075 100644 --- a/examples/elliptic_functions.cpp +++ b/examples/elliptic_functions.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include @@ -27,7 +27,7 @@ using namespace std; using namespace boost::numeric::odeint; -typedef boost::array< double , 3 > state_type; +typedef std::array< double , 3 > state_type; /* * x1' = x2*x3 diff --git a/examples/generation_functions.cpp b/examples/generation_functions.cpp index 6baa5f22..ac7146dc 100644 --- a/examples/generation_functions.cpp +++ b/examples/generation_functions.cpp @@ -12,11 +12,11 @@ copy at http://www.boost.org/LICENSE_1_0.txt) */ -#include +#include #include -typedef boost::array< double , 1 > state_type; +typedef std::array< double , 1 > state_type; using namespace boost::numeric::odeint; diff --git a/examples/gmpxx/lorenz_gmpxx.cpp b/examples/gmpxx/lorenz_gmpxx.cpp index 39b4c72e..b54d27ce 100644 --- a/examples/gmpxx/lorenz_gmpxx.cpp +++ b/examples/gmpxx/lorenz_gmpxx.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include @@ -25,7 +25,7 @@ using namespace boost::numeric::odeint; //[ gmpxx_lorenz typedef mpf_class value_type; -typedef boost::array< value_type , 3 > state_type; +typedef std::array< value_type , 3 > state_type; struct lorenz { diff --git a/examples/heun.cpp b/examples/heun.cpp index 34fe12c4..8b9ab502 100644 --- a/examples/heun.cpp +++ b/examples/heun.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace fusion = boost::fusion; //[ heun_define_coefficients template< class Value = double > -struct heun_a1 : boost::array< Value , 1 > { +struct heun_a1 : std::array< Value , 1 > { heun_a1( void ) { (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 3 ); @@ -41,7 +41,7 @@ struct heun_a1 : boost::array< Value , 1 > { }; template< class Value = double > -struct heun_a2 : boost::array< Value , 2 > +struct heun_a2 : std::array< Value , 2 > { heun_a2( void ) { @@ -52,7 +52,7 @@ struct heun_a2 : boost::array< Value , 2 > template< class Value = double > -struct heun_b : boost::array< Value , 3 > +struct heun_b : std::array< Value , 3 > { heun_b( void ) { @@ -63,7 +63,7 @@ struct heun_b : boost::array< Value , 3 > }; template< class Value = double > -struct heun_c : boost::array< Value , 3 > +struct heun_c : std::array< Value , 3 > { heun_c( void ) { @@ -157,7 +157,7 @@ int main( int argc , char **argv ) //[ heun_example - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; heun< state_type > h; state_type x = {{ 10.0 , 10.0 , 10.0 }}; diff --git a/examples/lorenz.cpp b/examples/lorenz.cpp index 37155aae..d48e14a3 100644 --- a/examples/lorenz.cpp +++ b/examples/lorenz.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include @@ -10,7 +10,7 @@ const double sigma = 10.0; const double R = 28.0; const double b = 8.0 / 3.0; -typedef boost::array< double , 3 > state_type; +typedef std::array< double , 3 > state_type; void lorenz( const state_type &x , state_type &dxdt , double t ) { diff --git a/examples/multiprecision/lorenz_mp.cpp b/examples/multiprecision/lorenz_mp.cpp index c3e5b82e..fd573a2a 100644 --- a/examples/multiprecision/lorenz_mp.cpp +++ b/examples/multiprecision/lorenz_mp.cpp @@ -24,7 +24,7 @@ using namespace boost::numeric::odeint; typedef boost::multiprecision::cpp_dec_float_50 value_type; -typedef boost::array< value_type , 3 > state_type; +typedef std::array< value_type , 3 > state_type; //] //[ mp_lorenz_rhs diff --git a/examples/quadmath/black_hole.cpp b/examples/quadmath/black_hole.cpp index 5a6802af..e4f233de 100644 --- a/examples/quadmath/black_hole.cpp +++ b/examples/quadmath/black_hole.cpp @@ -72,7 +72,7 @@ inline std::ostream& operator<< (std::ostream& os, const __float128& f) { } -#include +#include #include #include #include diff --git a/examples/solar_system.cpp b/examples/solar_system.cpp index 3586d5b8..b472130f 100644 --- a/examples/solar_system.cpp +++ b/examples/solar_system.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include @@ -23,8 +23,8 @@ const size_t n = 6; typedef point< double , 3 > point_type; -typedef boost::array< point_type , n > container_type; -typedef boost::array< double , n > mass_type; +typedef std::array< point_type , n > container_type; +typedef std::array< double , n > mass_type; //] diff --git a/examples/stepper_details.cpp b/examples/stepper_details.cpp index d4ae8bd1..05d3404c 100644 --- a/examples/stepper_details.cpp +++ b/examples/stepper_details.cpp @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include @@ -23,7 +23,7 @@ using namespace boost::numeric::odeint; const size_t N = 3; -typedef boost::array< double , N > state_type; +typedef std::array< double , N > state_type; //[ system_function_structure void sys( const state_type & /*x*/ , state_type & /*dxdt*/ , const double /*t*/ ) @@ -42,7 +42,7 @@ void sys2( const state_type &/*x*/ , state_type &/*dxdt*/ , const double /*t*/ ) //[ symplectic_stepper_detail_system_function -typedef boost::array< double , 1 > vector_type; +typedef std::array< double , 1 > vector_type; struct harm_osc_f1 diff --git a/examples/stochastic_euler.cpp b/examples/stochastic_euler.cpp index c98d27b0..37b29516 100644 --- a/examples/stochastic_euler.cpp +++ b/examples/stochastic_euler.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include @@ -26,8 +26,8 @@ template< size_t N > class stochastic_euler { public: - typedef boost::array< double , N > state_type; - typedef boost::array< double , N > deriv_type; + typedef std::array< double , N > state_type; + typedef std::array< double , N > deriv_type; typedef double value_type; typedef double time_type; typedef unsigned short order_type; @@ -71,8 +71,8 @@ class stochastic_euler { public: - typedef boost::array< double , N > state_type; - typedef boost::array< double , N > deriv_type; + typedef std::array< double , N > state_type; + typedef std::array< double , N > deriv_type; typedef double value_type; typedef double time_type; typedef unsigned short order_type; @@ -97,7 +97,7 @@ public: //[ stochastic_euler_ornstein_uhlenbeck_def const static size_t N = 1; -typedef boost::array< double , N > state_type; +typedef std::array< double , N > state_type; struct ornstein_det { diff --git a/examples/stuart_landau.cpp b/examples/stuart_landau.cpp index 84f9b04d..da29b5e9 100644 --- a/examples/stuart_landau.cpp +++ b/examples/stuart_landau.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include diff --git a/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp b/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp index 88cf159e..102a0ae3 100644 --- a/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp +++ b/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp @@ -29,7 +29,7 @@ #include #include -#include +#include namespace boost { @@ -48,7 +48,7 @@ struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { }; // specialize for array template< class T , size_t N > -struct algebra_dispatcher< boost::array< T , N > > +struct algebra_dispatcher< std::array< T , N > > { typedef array_algebra algebra_type; }; @@ -85,26 +85,4 @@ struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > > } } -#ifdef BOOST_NUMERIC_ODEINT_CXX11 - -// c++11 mode: specialization for std::array if available - -#include - -namespace boost { -namespace numeric { -namespace odeint { - -// specialize for std::array -template< class T , size_t N > -struct algebra_dispatcher< std::array< T , N > > -{ - typedef array_algebra algebra_type; -}; - -} } } - -#endif - - #endif diff --git a/include/boost/numeric/odeint/algebra/array_algebra.hpp b/include/boost/numeric/odeint/algebra/array_algebra.hpp index 471e866f..3d170558 100644 --- a/include/boost/numeric/odeint/algebra/array_algebra.hpp +++ b/include/boost/numeric/odeint/algebra/array_algebra.hpp @@ -23,7 +23,7 @@ #define BOOST_NUMERIC_ODEINT_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED #include -#include +#include #include diff --git a/include/boost/numeric/odeint/algebra/default_operations.hpp b/include/boost/numeric/odeint/algebra/default_operations.hpp index 56139083..0101e48e 100644 --- a/include/boost/numeric/odeint/algebra/default_operations.hpp +++ b/include/boost/numeric/odeint/algebra/default_operations.hpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include diff --git a/include/boost/numeric/odeint/algebra/range_algebra.hpp b/include/boost/numeric/odeint/algebra/range_algebra.hpp index 3d7695c8..71ec0bc0 100644 --- a/include/boost/numeric/odeint/algebra/range_algebra.hpp +++ b/include/boost/numeric/odeint/algebra/range_algebra.hpp @@ -3,7 +3,7 @@ boost/numeric/odeint/algebra/range_algebra.hpp [begin_description] - Default algebra, which works with the most state types, like vector< double >, boost::array< double >, boost::range. + Default algebra, which works with the most state types, like vector< double >, std::array< double >, boost::range. Internally is uses boost::range to obtain the begin and end iterator of the according sequence. [end_description] diff --git a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp index eb09aefc..9c3e5d57 100644 --- a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED -#include +#include #include #include @@ -86,7 +86,7 @@ public: static const order_type order_value = Order; - typedef boost::array< value_type , num_of_stages > coef_type; + typedef std::array< value_type , num_of_stages > coef_type; symplectic_nystroem_stepper_base( const coef_type &coef_a , const coef_type &coef_b , const algebra_type &algebra = algebra_type() ) : algebra_stepper_base_type( algebra ) , m_coef_a( coef_a ) , m_coef_b( coef_b ) , diff --git a/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp index 85ee4d01..6d3f6c64 100644 --- a/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp @@ -53,7 +53,7 @@ public: : m_algebra( algebra ) {}; - size_t adjust_order(size_t order, size_t init, boost::array &xerr) + size_t adjust_order(size_t order, size_t init, std::array &xerr) { using std::abs; @@ -149,7 +149,7 @@ public: typedef typename stepper_type::wrapped_state_type wrapped_state_type; typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - typedef boost::array< wrapped_state_type , 4 > error_storage_type; + typedef std::array< wrapped_state_type , 4 > error_storage_type; typedef typename stepper_type::coeff_type coeff_type; typedef controlled_adams_bashforth_moulton< ErrorStepper , StepAdjuster , OrderAdjuster , Resizer > controlled_stepper_type; diff --git a/include/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp b/include/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp index 26a9f9a6..5a7cdf21 100644 --- a/include/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp +++ b/include/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp @@ -18,7 +18,7 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED -#include +#include namespace boost { @@ -30,11 +30,11 @@ template< class Value , size_t Steps > class adams_bashforth_coefficients ; template< class Value > -class adams_bashforth_coefficients< Value , 1 > : public boost::array< Value , 1 > +class adams_bashforth_coefficients< Value , 1 > : public std::array< Value , 1 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 1 >() + : std::array< Value , 1 >() { (*this)[0] = static_cast< Value >( 1 ); } @@ -42,11 +42,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 2 > : public boost::array< Value , 2 > +class adams_bashforth_coefficients< Value , 2 > : public std::array< Value , 2 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 2 >() + : std::array< Value , 2 >() { (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 2 ); (*this)[1] = -static_cast< Value >( 1 ) / static_cast< Value >( 2 ); @@ -55,11 +55,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 3 > : public boost::array< Value , 3 > +class adams_bashforth_coefficients< Value , 3 > : public std::array< Value , 3 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 3 >() + : std::array< Value , 3 >() { (*this)[0] = static_cast< Value >( 23 ) / static_cast< Value >( 12 ); (*this)[1] = -static_cast< Value >( 4 ) / static_cast< Value >( 3 ); @@ -69,11 +69,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 4 > : public boost::array< Value , 4 > +class adams_bashforth_coefficients< Value , 4 > : public std::array< Value , 4 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 4 >() + : std::array< Value , 4 >() { (*this)[0] = static_cast< Value >( 55 ) / static_cast< Value >( 24 ); (*this)[1] = -static_cast< Value >( 59 ) / static_cast< Value >( 24 ); @@ -84,11 +84,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 5 > : public boost::array< Value , 5 > +class adams_bashforth_coefficients< Value , 5 > : public std::array< Value , 5 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 5 >() + : std::array< Value , 5 >() { (*this)[0] = static_cast< Value >( 1901 ) / static_cast< Value >( 720 ); (*this)[1] = -static_cast< Value >( 1387 ) / static_cast< Value >( 360 ); @@ -100,11 +100,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 6 > : public boost::array< Value , 6 > +class adams_bashforth_coefficients< Value , 6 > : public std::array< Value , 6 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 6 >() + : std::array< Value , 6 >() { (*this)[0] = static_cast< Value >( 4277 ) / static_cast< Value >( 1440 ); (*this)[1] = -static_cast< Value >( 2641 ) / static_cast< Value >( 480 ); @@ -117,11 +117,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 7 > : public boost::array< Value , 7 > +class adams_bashforth_coefficients< Value , 7 > : public std::array< Value , 7 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 7 >() + : std::array< Value , 7 >() { (*this)[0] = static_cast< Value >( 198721 ) / static_cast< Value >( 60480 ); (*this)[1] = -static_cast< Value >( 18637 ) / static_cast< Value >( 2520 ); @@ -135,11 +135,11 @@ public: template< class Value > -class adams_bashforth_coefficients< Value , 8 > : public boost::array< Value , 8 > +class adams_bashforth_coefficients< Value , 8 > : public std::array< Value , 8 > { public: adams_bashforth_coefficients( void ) - : boost::array< Value , 8 >() + : std::array< Value , 8 >() { (*this)[0] = static_cast< Value >( 16083 ) / static_cast< Value >( 4480 ); (*this)[1] = -static_cast< Value >( 1152169 ) / static_cast< Value >( 120960 ); diff --git a/include/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp b/include/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp index 8047fa8a..22ba8de1 100644 --- a/include/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp +++ b/include/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp @@ -19,7 +19,7 @@ #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED -#include +#include namespace boost { @@ -31,11 +31,11 @@ template< class Value , size_t Steps > class adams_moulton_coefficients ; template< class Value > -class adams_moulton_coefficients< Value , 1 > : public boost::array< Value , 1 > +class adams_moulton_coefficients< Value , 1 > : public std::array< Value , 1 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 1 >() + : std::array< Value , 1 >() { (*this)[0] = static_cast< Value >( 1 ); } @@ -43,11 +43,11 @@ public: template< class Value > -class adams_moulton_coefficients< Value , 2 > : public boost::array< Value , 2 > +class adams_moulton_coefficients< Value , 2 > : public std::array< Value , 2 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 2 >() + : std::array< Value , 2 >() { (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); @@ -56,11 +56,11 @@ public: template< class Value > -class adams_moulton_coefficients< Value , 3 > : public boost::array< Value , 3 > +class adams_moulton_coefficients< Value , 3 > : public std::array< Value , 3 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 3 >() + : std::array< Value , 3 >() { (*this)[0] = static_cast< Value >( 5 ) / static_cast< Value >( 12 ); (*this)[1] = static_cast< Value >( 2 ) / static_cast< Value >( 3 ); @@ -70,11 +70,11 @@ public: template< class Value > -class adams_moulton_coefficients< Value , 4 > : public boost::array< Value , 4 > +class adams_moulton_coefficients< Value , 4 > : public std::array< Value , 4 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 4 >() + : std::array< Value , 4 >() { (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 8 ); (*this)[1] = static_cast< Value >( 19 ) / static_cast< Value >( 24 ); @@ -85,11 +85,11 @@ public: template< class Value > -class adams_moulton_coefficients< Value , 5 > : public boost::array< Value , 5 > +class adams_moulton_coefficients< Value , 5 > : public std::array< Value , 5 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 5 >() + : std::array< Value , 5 >() { (*this)[0] = static_cast< Value >( 251 ) / static_cast< Value >( 720 ); (*this)[1] = static_cast< Value >( 323 ) / static_cast< Value >( 360 ); @@ -101,11 +101,11 @@ public: template< class Value > -class adams_moulton_coefficients< Value , 6 > : public boost::array< Value , 6 > +class adams_moulton_coefficients< Value , 6 > : public std::array< Value , 6 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 6 >() + : std::array< Value , 6 >() { (*this)[0] = static_cast< Value >( 95 ) / static_cast< Value >( 288 ); (*this)[1] = static_cast< Value >( 1427 ) / static_cast< Value >( 1440 ); @@ -117,11 +117,11 @@ public: }; template< class Value > -class adams_moulton_coefficients< Value , 7 > : public boost::array< Value , 7 > +class adams_moulton_coefficients< Value , 7 > : public std::array< Value , 7 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 7 >() + : std::array< Value , 7 >() { (*this)[0] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 ); (*this)[1] = static_cast< Value >( 2713 ) / static_cast< Value >( 2520 ); @@ -135,11 +135,11 @@ public: template< class Value > -class adams_moulton_coefficients< Value , 8 > : public boost::array< Value , 8 > +class adams_moulton_coefficients< Value , 8 > : public std::array< Value , 8 > { public: adams_moulton_coefficients( void ) - : boost::array< Value , 8 >() + : std::array< Value , 8 >() { (*this)[0] = static_cast< Value >( 5257 ) / static_cast< Value >( 17280 ); (*this)[1] = static_cast< Value >( 139849 ) / static_cast< Value >( 120960 ); diff --git a/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp b/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp index c1029a16..90530c50 100644 --- a/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp +++ b/include/boost/numeric/odeint/stepper/detail/adaptive_adams_coefficients.hpp @@ -27,7 +27,7 @@ #include #include -#include +#include namespace boost { namespace numeric { @@ -168,10 +168,10 @@ public: size_t m_eo; size_t m_steps_init; - rotating_buffer, 2> beta; // beta[0] = beta(n) - rotating_buffer, 3> phi; // phi[0] = phi(n+1) - boost::array g; - boost::array gs; + rotating_buffer, 2> beta; // beta[0] = beta(n) + rotating_buffer, 3> phi; // phi[0] = phi(n+1) + std::array g; + std::array gs; private: template< class StateType > @@ -192,7 +192,7 @@ private: time_storage_type m_time_storage; static const size_t c_size = order_value + 2; - boost::array c; + std::array c; algebra_type m_algebra; diff --git a/include/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp b/include/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp index ab74b24e..46ca997c 100644 --- a/include/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp +++ b/include/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include @@ -49,14 +49,14 @@ namespace detail { template< class T , class Constant > struct array_wrapper { - typedef const typename boost::array< T , Constant::value > type; + typedef const typename std::array< T , Constant::value > type; }; template< class T , size_t i > struct stage { T c; - boost::array< T , i > a; + std::array< T , i > a; }; @@ -91,8 +91,8 @@ public: >::type >::type coef_a_type; - typedef boost::array< Value , StageCount > coef_b_type; - typedef boost::array< Value , StageCount > coef_c_type; + typedef std::array< Value , StageCount > coef_b_type; + typedef std::array< Value , StageCount > coef_c_type; typedef typename boost::fusion::result_of::as_vector < diff --git a/include/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp b/include/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp index 2cce3f4d..add68edf 100644 --- a/include/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp +++ b/include/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp @@ -30,7 +30,7 @@ struct generic_rk_scale_sum; template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 1 , Operations , Fac , Time > : public Operations::template scale_sum2< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) : Operations::template scale_sum2< Fac , Time >( 1.0 , a[0]*dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum2< Fac , Time >( 1.0 , a[0]*dt ) { } typedef void result_type; @@ -40,7 +40,7 @@ struct generic_rk_scale_sum< 1 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 2 , Operations , Fac , Time > : public Operations::template scale_sum3< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum3< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt ) { } @@ -50,7 +50,7 @@ struct generic_rk_scale_sum< 2 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 3 , Operations , Fac , Time > : public Operations::template scale_sum4< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum4< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt ) { } @@ -60,7 +60,7 @@ struct generic_rk_scale_sum< 3 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 4 , Operations , Fac , Time > : public Operations::template scale_sum5< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum5< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt ) { } @@ -70,7 +70,7 @@ struct generic_rk_scale_sum< 4 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 5 , Operations , Fac , Time > : public Operations::template scale_sum6< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum6< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt ) { } @@ -80,7 +80,7 @@ struct generic_rk_scale_sum< 5 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 6 , Operations , Fac , Time > : public Operations::template scale_sum7< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum7< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt ) { } @@ -90,7 +90,7 @@ struct generic_rk_scale_sum< 6 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 7 , Operations , Fac , Time > : public Operations::template scale_sum8< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum8< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt ) { } @@ -100,7 +100,7 @@ struct generic_rk_scale_sum< 7 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 8 , Operations , Fac , Time > : public Operations::template scale_sum9< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum9< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt ) { } @@ -111,7 +111,7 @@ struct generic_rk_scale_sum< 8 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 9 , Operations , Fac , Time > : public Operations::template scale_sum10< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum10< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt ) { } @@ -122,7 +122,7 @@ struct generic_rk_scale_sum< 9 , Operations , Fac , Time > : public Operations:: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 10 , Operations , Fac , Time > : public Operations::template scale_sum11< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum11< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt ) { } @@ -133,7 +133,7 @@ struct generic_rk_scale_sum< 10 , Operations , Fac , Time > : public Operations: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 11 , Operations , Fac , Time > : public Operations::template scale_sum12< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum12< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt ) { } @@ -144,7 +144,7 @@ struct generic_rk_scale_sum< 11 , Operations , Fac , Time > : public Operations: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 12 , Operations , Fac , Time > : public Operations::template scale_sum13< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum13< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt , a[11]*dt ) { } @@ -155,7 +155,7 @@ struct generic_rk_scale_sum< 12 , Operations , Fac , Time > : public Operations: template< class Operations , class Fac , class Time > struct generic_rk_scale_sum< 13 , Operations , Fac , Time > : public Operations::template scale_sum14< Fac , Time > { - generic_rk_scale_sum( const boost::array &a , Time dt ) + generic_rk_scale_sum( const std::array &a , Time dt ) : Operations::template scale_sum14< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt , a[11]*dt , a[12]*dt ) { } @@ -171,7 +171,7 @@ struct generic_rk_scale_sum_err; template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 1 , Operations , Fac , Time > : public Operations::template scale_sum1< Time > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) : Operations::template scale_sum1< Time >( a[0]*dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum1< Time >( a[0]*dt ) { } typedef void result_type; @@ -181,7 +181,7 @@ struct generic_rk_scale_sum_err< 1 , Operations , Fac , Time > : public Operatio template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 2 , Operations , Fac , Time > : public Operations::template scale_sum2< Time > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum2< Time >( a[0]*dt , a[1]*dt ) { } @@ -191,7 +191,7 @@ struct generic_rk_scale_sum_err< 2 , Operations , Fac , Time > : public Operatio template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 3 , Operations , Fac , Time > : public Operations::template scale_sum3< Time > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum3< Time >( a[0]*dt , a[1]*dt , a[2]*dt ) { } @@ -201,7 +201,7 @@ struct generic_rk_scale_sum_err< 3 , Operations , Fac , Time > : public Operatio template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 4 , Operations , Fac , Time > : public Operations::template scale_sum4< Time > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum4< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt ) { } @@ -211,7 +211,7 @@ struct generic_rk_scale_sum_err< 4 , Operations , Fac , Time > : public Operatio template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 5 , Operations , Fac , Time > : public Operations::template scale_sum5< Fac > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum5< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt ) { } @@ -222,7 +222,7 @@ struct generic_rk_scale_sum_err< 5 , Operations , Fac , Time > : public Operatio template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 6 , Operations , Fac , Time > : public Operations::template scale_sum6< Time > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum6< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt ) { } @@ -234,7 +234,7 @@ struct generic_rk_scale_sum_err< 6 , Operations , Fac , Time > : public Operatio template< class Operations , class Fac , class Time > struct generic_rk_scale_sum_err< 13 , Operations , Fac , Time > : public Operations::template scale_sum13< Time > { - generic_rk_scale_sum_err( const boost::array &a , Time dt ) + generic_rk_scale_sum_err( const std::array &a , Time dt ) : Operations::template scale_sum13< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt , a[11]*dt , a[12]*dt ) { } diff --git a/include/boost/numeric/odeint/stepper/detail/pid_step_adjuster_coefficients.hpp b/include/boost/numeric/odeint/stepper/detail/pid_step_adjuster_coefficients.hpp index 2dee6ed1..3114d2ac 100644 --- a/include/boost/numeric/odeint/stepper/detail/pid_step_adjuster_coefficients.hpp +++ b/include/boost/numeric/odeint/stepper/detail/pid_step_adjuster_coefficients.hpp @@ -15,7 +15,7 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_PID_STEP_ADJUSTER_COEFFICIENTS_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_PID_STEP_ADJUSTER_COEFFICIENTS_HPP_INCLUDED -#include +#include namespace boost { namespace numeric { @@ -38,11 +38,11 @@ template class pid_step_adjuster_coefficients; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0; (*this)[1] = 0.0; @@ -53,11 +53,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 2.0; (*this)[1] = 1.0 / 2.0; @@ -68,11 +68,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 5.0; (*this)[1] = 2.0 / 5.0; @@ -83,11 +83,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 6.0; (*this)[1] = 2.0 / 6.0; @@ -98,11 +98,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 4.0; (*this)[1] = 2.0 / 2.0; @@ -113,11 +113,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 6.0; (*this)[1] = 2.0 / 6.0; @@ -128,11 +128,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 18.0; (*this)[1] = 2.0 / 9.0; @@ -143,11 +143,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 5.0 / 4.0; (*this)[1] = 1.0 / 2.0; @@ -158,11 +158,11 @@ public: }; template<> -class pid_step_adjuster_coefficients : public boost::array +class pid_step_adjuster_coefficients : public std::array { public: pid_step_adjuster_coefficients() - : boost::array() + : std::array() { (*this)[0] = 1.0 / 3.0; (*this)[1] = 1.0 / 18.0; diff --git a/include/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp b/include/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp index 2338afd9..d801583a 100644 --- a/include/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp +++ b/include/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp @@ -18,7 +18,7 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED -#include +#include namespace boost { namespace numeric { diff --git a/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp b/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp index f8edc201..72a933c5 100644 --- a/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp +++ b/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp @@ -20,7 +20,7 @@ #define BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_GENERIC_RK_HPP_INCLUDED -#include +#include #include @@ -60,14 +60,14 @@ struct stage_vector; template< class T , class Constant > struct array_wrapper { - typedef const typename boost::array< T , Constant::value > type; + typedef const typename std::array< T , Constant::value > type; }; template< class T , size_t i > struct stage { T c; - boost::array< T , i > a; + std::array< T , i > a; }; diff --git a/include/boost/numeric/odeint/stepper/runge_kutta4.hpp b/include/boost/numeric/odeint/stepper/runge_kutta4.hpp index 2410774e..df2a213b 100644 --- a/include/boost/numeric/odeint/stepper/runge_kutta4.hpp +++ b/include/boost/numeric/odeint/stepper/runge_kutta4.hpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include @@ -42,7 +42,7 @@ namespace odeint { #ifndef DOXYGEN_SKIP template< class Value = double > -struct rk4_coefficients_a1 : boost::array< Value , 1 > +struct rk4_coefficients_a1 : std::array< Value , 1 > { rk4_coefficients_a1( void ) { @@ -51,7 +51,7 @@ struct rk4_coefficients_a1 : boost::array< Value , 1 > }; template< class Value = double > -struct rk4_coefficients_a2 : boost::array< Value , 2 > +struct rk4_coefficients_a2 : std::array< Value , 2 > { rk4_coefficients_a2( void ) { @@ -62,7 +62,7 @@ struct rk4_coefficients_a2 : boost::array< Value , 2 > template< class Value = double > -struct rk4_coefficients_a3 : boost::array< Value , 3 > +struct rk4_coefficients_a3 : std::array< Value , 3 > { rk4_coefficients_a3( void ) { @@ -73,7 +73,7 @@ struct rk4_coefficients_a3 : boost::array< Value , 3 > }; template< class Value = double > -struct rk4_coefficients_b : boost::array< Value , 4 > +struct rk4_coefficients_b : std::array< Value , 4 > { rk4_coefficients_b( void ) { @@ -85,7 +85,7 @@ struct rk4_coefficients_b : boost::array< Value , 4 > }; template< class Value = double > -struct rk4_coefficients_c : boost::array< Value , 4 > +struct rk4_coefficients_c : std::array< Value , 4 > { rk4_coefficients_c( void ) { diff --git a/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp b/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp index beecb3f3..2475c332 100644 --- a/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp +++ b/include/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp @@ -31,7 +31,7 @@ #include #include -#include +#include @@ -43,7 +43,7 @@ namespace odeint { #ifndef DOXYGEN_SKIP template< class Value = double > -struct rk54_ck_coefficients_a1 : boost::array< Value , 1 > +struct rk54_ck_coefficients_a1 : std::array< Value , 1 > { rk54_ck_coefficients_a1( void ) { @@ -52,7 +52,7 @@ struct rk54_ck_coefficients_a1 : boost::array< Value , 1 > }; template< class Value = double > -struct rk54_ck_coefficients_a2 : boost::array< Value , 2 > +struct rk54_ck_coefficients_a2 : std::array< Value , 2 > { rk54_ck_coefficients_a2( void ) { @@ -63,7 +63,7 @@ struct rk54_ck_coefficients_a2 : boost::array< Value , 2 > template< class Value = double > -struct rk54_ck_coefficients_a3 : boost::array< Value , 3 > +struct rk54_ck_coefficients_a3 : std::array< Value , 3 > { rk54_ck_coefficients_a3( void ) { @@ -74,7 +74,7 @@ struct rk54_ck_coefficients_a3 : boost::array< Value , 3 > }; template< class Value = double > -struct rk54_ck_coefficients_a4 : boost::array< Value , 4 > +struct rk54_ck_coefficients_a4 : std::array< Value , 4 > { rk54_ck_coefficients_a4( void ) { @@ -86,7 +86,7 @@ struct rk54_ck_coefficients_a4 : boost::array< Value , 4 > }; template< class Value = double > -struct rk54_ck_coefficients_a5 : boost::array< Value , 5 > +struct rk54_ck_coefficients_a5 : std::array< Value , 5 > { rk54_ck_coefficients_a5( void ) { @@ -99,7 +99,7 @@ struct rk54_ck_coefficients_a5 : boost::array< Value , 5 > }; template< class Value = double > -struct rk54_ck_coefficients_b : boost::array< Value , 6 > +struct rk54_ck_coefficients_b : std::array< Value , 6 > { rk54_ck_coefficients_b( void ) { @@ -113,7 +113,7 @@ struct rk54_ck_coefficients_b : boost::array< Value , 6 > }; template< class Value = double > -struct rk54_ck_coefficients_db : boost::array< Value , 6 > +struct rk54_ck_coefficients_db : std::array< Value , 6 > { rk54_ck_coefficients_db( void ) { @@ -128,7 +128,7 @@ struct rk54_ck_coefficients_db : boost::array< Value , 6 > template< class Value = double > -struct rk54_ck_coefficients_c : boost::array< Value , 6 > +struct rk54_ck_coefficients_c : std::array< Value , 6 > { rk54_ck_coefficients_c( void ) { diff --git a/include/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp b/include/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp index f2f8251f..7727f893 100644 --- a/include/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp +++ b/include/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -44,7 +44,7 @@ namespace odeint { #ifndef DOXYGEN_SKIP template< class Value = double > -struct rk78_coefficients_a1 : boost::array< Value , 1 > +struct rk78_coefficients_a1 : std::array< Value , 1 > { rk78_coefficients_a1( void ) { @@ -53,7 +53,7 @@ struct rk78_coefficients_a1 : boost::array< Value , 1 > }; template< class Value = double > -struct rk78_coefficients_a2 : boost::array< Value , 2 > +struct rk78_coefficients_a2 : std::array< Value , 2 > { rk78_coefficients_a2( void ) { @@ -64,7 +64,7 @@ struct rk78_coefficients_a2 : boost::array< Value , 2 > template< class Value = double > -struct rk78_coefficients_a3 : boost::array< Value , 3 > +struct rk78_coefficients_a3 : std::array< Value , 3 > { rk78_coefficients_a3( void ) { @@ -75,7 +75,7 @@ struct rk78_coefficients_a3 : boost::array< Value , 3 > }; template< class Value = double > -struct rk78_coefficients_a4 : boost::array< Value , 4 > +struct rk78_coefficients_a4 : std::array< Value , 4 > { rk78_coefficients_a4( void ) { @@ -87,7 +87,7 @@ struct rk78_coefficients_a4 : boost::array< Value , 4 > }; template< class Value = double > -struct rk78_coefficients_a5 : boost::array< Value , 5 > +struct rk78_coefficients_a5 : std::array< Value , 5 > { rk78_coefficients_a5( void ) { @@ -101,7 +101,7 @@ struct rk78_coefficients_a5 : boost::array< Value , 5 > template< class Value = double > -struct rk78_coefficients_a6 : boost::array< Value , 6 > +struct rk78_coefficients_a6 : std::array< Value , 6 > { rk78_coefficients_a6( void ) { @@ -115,7 +115,7 @@ struct rk78_coefficients_a6 : boost::array< Value , 6 > }; template< class Value = double > -struct rk78_coefficients_a7 : boost::array< Value , 7 > +struct rk78_coefficients_a7 : std::array< Value , 7 > { rk78_coefficients_a7( void ) { @@ -130,7 +130,7 @@ struct rk78_coefficients_a7 : boost::array< Value , 7 > }; template< class Value = double > -struct rk78_coefficients_a8 : boost::array< Value , 8 > +struct rk78_coefficients_a8 : std::array< Value , 8 > { rk78_coefficients_a8( void ) { @@ -146,7 +146,7 @@ struct rk78_coefficients_a8 : boost::array< Value , 8 > }; template< class Value = double > -struct rk78_coefficients_a9 : boost::array< Value , 9 > +struct rk78_coefficients_a9 : std::array< Value , 9 > { rk78_coefficients_a9( void ) { @@ -163,7 +163,7 @@ struct rk78_coefficients_a9 : boost::array< Value , 9 > }; template< class Value = double > -struct rk78_coefficients_a10 : boost::array< Value , 10 > +struct rk78_coefficients_a10 : std::array< Value , 10 > { rk78_coefficients_a10( void ) { @@ -181,7 +181,7 @@ struct rk78_coefficients_a10 : boost::array< Value , 10 > }; template< class Value = double > -struct rk78_coefficients_a11 : boost::array< Value , 11 > +struct rk78_coefficients_a11 : std::array< Value , 11 > { rk78_coefficients_a11( void ) { @@ -200,7 +200,7 @@ struct rk78_coefficients_a11 : boost::array< Value , 11 > }; template< class Value = double > -struct rk78_coefficients_a12 : boost::array< Value , 12 > +struct rk78_coefficients_a12 : std::array< Value , 12 > { rk78_coefficients_a12( void ) { @@ -220,7 +220,7 @@ struct rk78_coefficients_a12 : boost::array< Value , 12 > }; template< class Value = double > -struct rk78_coefficients_b : boost::array< Value , 13 > +struct rk78_coefficients_b : std::array< Value , 13 > { rk78_coefficients_b( void ) { @@ -241,7 +241,7 @@ struct rk78_coefficients_b : boost::array< Value , 13 > }; template< class Value = double > -struct rk78_coefficients_db : boost::array< Value , 13 > +struct rk78_coefficients_db : std::array< Value , 13 > { rk78_coefficients_db( void ) { @@ -263,7 +263,7 @@ struct rk78_coefficients_db : boost::array< Value , 13 > template< class Value = double > -struct rk78_coefficients_c : boost::array< Value , 13 > +struct rk78_coefficients_c : std::array< Value , 13 > { rk78_coefficients_c( void ) { diff --git a/include/boost/numeric/odeint/stepper/symplectic_euler.hpp b/include/boost/numeric/odeint/stepper/symplectic_euler.hpp index bd40860b..22a2bd0f 100644 --- a/include/boost/numeric/odeint/stepper/symplectic_euler.hpp +++ b/include/boost/numeric/odeint/stepper/symplectic_euler.hpp @@ -26,7 +26,7 @@ #include #include -#include +#include namespace boost { namespace numeric { @@ -38,7 +38,7 @@ namespace detail { namespace symplectic_euler_coef { template< class Value > -struct coef_a_type : public boost::array< Value , 1 > +struct coef_a_type : public std::array< Value , 1 > { coef_a_type( void ) { @@ -47,7 +47,7 @@ struct coef_a_type : public boost::array< Value , 1 > }; template< class Value > -struct coef_b_type : public boost::array< Value , 1 > +struct coef_b_type : public std::array< Value , 1 > { coef_b_type( void ) { diff --git a/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp b/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp index b33773e2..4d30d09e 100644 --- a/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp +++ b/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp @@ -44,7 +44,7 @@ namespace symplectic_rkn_sb3a_m4_mclachlan { template< class Value > - struct coef_a_type : public boost::array< Value , 5 > + struct coef_a_type : public std::array< Value , 5 > { coef_a_type( void ) { @@ -60,7 +60,7 @@ namespace symplectic_rkn_sb3a_m4_mclachlan { }; template< class Value > - struct coef_b_type : public boost::array< Value , 5 > + struct coef_b_type : public std::array< Value , 5 > { coef_b_type( void ) { diff --git a/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp b/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp index d75c5353..073e7917 100644 --- a/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp +++ b/include/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp @@ -28,7 +28,7 @@ #include -#include +#include namespace boost { namespace numeric { @@ -48,7 +48,7 @@ namespace symplectic_rkn_sb3a_mclachlan { */ template< class Value > - struct coef_a_type : public boost::array< Value , 6 > + struct coef_a_type : public std::array< Value , 6 > { coef_a_type( void ) { @@ -63,7 +63,7 @@ namespace symplectic_rkn_sb3a_mclachlan { }; template< class Value > - struct coef_b_type : public boost::array< Value , 6 > + struct coef_b_type : public std::array< Value , 6 > { coef_b_type( void ) { diff --git a/include/boost/numeric/odeint/stepper/velocity_verlet.hpp b/include/boost/numeric/odeint/stepper/velocity_verlet.hpp index 3a20fc25..f5a28bc0 100644 --- a/include/boost/numeric/odeint/stepper/velocity_verlet.hpp +++ b/include/boost/numeric/odeint/stepper/velocity_verlet.hpp @@ -31,7 +31,7 @@ #include #include // #include -// #include +// #include diff --git a/include/boost/numeric/odeint/util/multi_array_adaption.hpp b/include/boost/numeric/odeint/util/multi_array_adaption.hpp index e2c0a483..d7c3ccb9 100644 --- a/include/boost/numeric/odeint/util/multi_array_adaption.hpp +++ b/include/boost/numeric/odeint/util/multi_array_adaption.hpp @@ -111,10 +111,10 @@ struct resize_impl_sfinae< T1 , T2 , { static void resize( T1 &x1 , const T2 &x2 ) { - boost::array< int , T1::dimensionality > extents; + std::array< int , T1::dimensionality > extents; for( size_t i=0 ; i origins; + std::array< int , T1::dimensionality > origins; for( size_t i=0 ; i #include -#include +#include #include @@ -26,7 +26,7 @@ typedef boost::timer timer_type; typedef double fp_type; //typedef float fp_type; -typedef boost::array state_type; +typedef std::array state_type; typedef std::vector state_vec; //--------------------------------------------------------------------------- diff --git a/performance/SIMD/roessler_simd.cpp b/performance/SIMD/roessler_simd.cpp index d79af4d8..fd32b541 100644 --- a/performance/SIMD/roessler_simd.cpp +++ b/performance/SIMD/roessler_simd.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -38,7 +38,7 @@ typedef double fp_type; //typedef float fp_type; typedef simd::pack simd_pack; -typedef boost::array state_type; +typedef std::array state_type; // use the simd allocator to get properly aligned memory typedef std::vector< state_type, simd::allocator< state_type > > state_vec; diff --git a/performance/lorenz.hpp b/performance/lorenz.hpp index c1ea37c9..72a2b3db 100644 --- a/performance/lorenz.hpp +++ b/performance/lorenz.hpp @@ -13,7 +13,7 @@ #ifndef LORENZ_HPP_ #define LORENZ_HPP_ -#include +#include struct lorenz { diff --git a/performance/odeint_rk4_array.cpp b/performance/odeint_rk4_array.cpp index 6d60296f..77c03c8d 100644 --- a/performance/odeint_rk4_array.cpp +++ b/performance/odeint_rk4_array.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -22,7 +22,7 @@ typedef boost::timer timer_type; -typedef boost::array< double , 3 > state_type; +typedef std::array< double , 3 > state_type; using namespace boost::numeric::odeint; diff --git a/test/adams_bashforth.cpp b/test/adams_bashforth.cpp index 7574346c..cb06c8fb 100644 --- a/test/adams_bashforth.cpp +++ b/test/adams_bashforth.cpp @@ -26,7 +26,7 @@ #include -#include +#include #include @@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE( test_rotating_buffer ) BOOST_AUTO_TEST_CASE( test_copying ) { - typedef boost::array< double , 1 > state_type; + typedef std::array< double , 1 > state_type; typedef adams_bashforth< 2 , state_type > stepper_type; stepper_type s1; @@ -150,7 +150,7 @@ typedef boost::mpl::range_c< size_t , 1 , 6 > vector_of_steps; BOOST_AUTO_TEST_CASE_TEMPLATE( test_init_and_steps , step_type , vector_of_steps ) { const static size_t steps = step_type::value; - typedef boost::array< value_type , 3 > state_type; + typedef std::array< value_type , 3 > state_type; adams_bashforth< steps , state_type > stepper; state_type x = {{ 10.0 , 10.0 , 10.0 }}; @@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_init_and_steps , step_type , vector_of_steps BOOST_AUTO_TEST_CASE( test_instantiation ) { - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; adams_bashforth< 1 , state_type > s1; adams_bashforth< 2 , state_type > s2; adams_bashforth< 3 , state_type > s3; @@ -189,7 +189,7 @@ BOOST_AUTO_TEST_CASE( test_instantiation ) BOOST_AUTO_TEST_CASE( test_auto_initialization ) { - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; state_type x = {{ 10.0 , 10.0 , 10.0 }}; adams_bashforth< 3 , state_type , value_type , state_type , value_type , range_algebra , default_operations , @@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE( test_auto_initialization ) BOOST_AUTO_TEST_CASE( test_manual_initialization ) { - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; state_type x = {{ 10.0 , 10.0 , 10.0 }}; adams_bashforth< 3 , state_type , value_type , state_type , value_type , range_algebra , default_operations , diff --git a/test/adams_bashforth_moulton.cpp b/test/adams_bashforth_moulton.cpp index 8e7688bb..c38f26d1 100644 --- a/test/adams_bashforth_moulton.cpp +++ b/test/adams_bashforth_moulton.cpp @@ -56,7 +56,7 @@ typedef boost::mpl::range_c< size_t , 1 , 6 > vector_of_steps; BOOST_AUTO_TEST_CASE_TEMPLATE( test_init_and_steps , step_type , vector_of_steps ) { const static size_t steps = step_type::value; - typedef boost::array< value_type , 3 > state_type; + typedef std::array< value_type , 3 > state_type; adams_bashforth_moulton< steps , state_type > stepper; state_type x = {{ 10.0 , 10.0 , 10.0 }}; @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_init_and_steps , step_type , vector_of_steps BOOST_AUTO_TEST_CASE( test_copying ) { - typedef boost::array< double , 1 > state_type; + typedef std::array< double , 1 > state_type; typedef adams_bashforth_moulton< 2 , state_type > stepper_type; stepper_type s1; @@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE( test_copying ) BOOST_AUTO_TEST_CASE( test_instantiation ) { - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; adams_bashforth_moulton< 1 , state_type > s1; adams_bashforth_moulton< 2 , state_type > s2; adams_bashforth_moulton< 3 , state_type > s3; diff --git a/test/adams_moulton.cpp b/test/adams_moulton.cpp index faccdda5..7670cda6 100644 --- a/test/adams_moulton.cpp +++ b/test/adams_moulton.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include @@ -74,7 +74,7 @@ typedef boost::mpl::range_c< size_t , 1 , 6 > vector_of_steps; BOOST_AUTO_TEST_CASE_TEMPLATE( test_init_and_steps , step_type , vector_of_steps ) { const static size_t steps = step_type::value; - typedef boost::array< value_type , 3 > state_type; + typedef std::array< value_type , 3 > state_type; adams_moulton< steps , state_type > stepper; // state_type x = {{ 10.0 , 10.0 , 10.0 }}; @@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_init_and_steps , step_type , vector_of_steps BOOST_AUTO_TEST_CASE( test_instantiation ) { - typedef boost::array< double , 3 > state_type; + typedef std::array< double , 3 > state_type; adams_moulton< 1 , state_type > s1; adams_moulton< 2 , state_type > s2; adams_moulton< 3 , state_type > s3; diff --git a/test/adaptive_iterator.cpp b/test/adaptive_iterator.cpp index 8f3cfa74..6fb29169 100644 --- a/test/adaptive_iterator.cpp +++ b/test/adaptive_iterator.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/adaptive_time_iterator.cpp b/test/adaptive_time_iterator.cpp index 406a71c6..b39fd0d0 100644 --- a/test/adaptive_time_iterator.cpp +++ b/test/adaptive_time_iterator.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/algebra_dispatcher.cpp b/test/algebra_dispatcher.cpp index 66a292fd..428faa8d 100644 --- a/test/algebra_dispatcher.cpp +++ b/test/algebra_dispatcher.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include using namespace boost::unit_test; @@ -48,13 +48,13 @@ BOOST_AUTO_TEST_CASE( range_algebra_with_vector ) BOOST_AUTO_TEST_CASE( array_algebra_with_array ) { - typedef runge_kutta4< boost::array< double , 2 > > stepper_type; + typedef runge_kutta4< std::array< double , 2 > > stepper_type; BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , array_algebra >::value )); } BOOST_AUTO_TEST_CASE( range_algebra_with_array ) { - typedef runge_kutta4< boost::array< double , 2 > , double , boost::array< double , 2 > , double , range_algebra > stepper_type; + typedef runge_kutta4< std::array< double , 2 > , double , std::array< double , 2 > , double , range_algebra > stepper_type; BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , range_algebra >::value )); } diff --git a/test/bulirsch_stoer.cpp b/test/bulirsch_stoer.cpp index 2c6a0c95..47c2d06a 100644 --- a/test/bulirsch_stoer.cpp +++ b/test/bulirsch_stoer.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include @@ -39,7 +39,7 @@ using namespace boost::unit_test; using namespace boost::numeric::odeint; typedef double value_type; -typedef boost::array< value_type , 3 > state_type; +typedef std::array< value_type , 3 > state_type; const double sigma = 10.0; const double R = 28.0; diff --git a/test/const_step_iterator.cpp b/test/const_step_iterator.cpp index 2d0ac9db..f3c95d53 100644 --- a/test/const_step_iterator.cpp +++ b/test/const_step_iterator.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/const_step_time_iterator.cpp b/test/const_step_time_iterator.cpp index 9227f5c0..f8188a86 100644 --- a/test/const_step_time_iterator.cpp +++ b/test/const_step_time_iterator.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/controlled_adams_bashforth_moulton.cpp b/test/controlled_adams_bashforth_moulton.cpp index 40d65720..69d35603 100644 --- a/test/controlled_adams_bashforth_moulton.cpp +++ b/test/controlled_adams_bashforth_moulton.cpp @@ -22,7 +22,7 @@ struct const_sys } }; -typedef boost::array< double , 1 > state_type; +typedef std::array< double , 1 > state_type; typedef double value_type; BOOST_AUTO_TEST_SUITE( controlled_adams_bashforth_moulton_test ) diff --git a/test/diagnostic_state_type.hpp b/test/diagnostic_state_type.hpp index 0c21013e..13008caa 100644 --- a/test/diagnostic_state_type.hpp +++ b/test/diagnostic_state_type.hpp @@ -18,7 +18,7 @@ #ifndef LIBS_NUMERIC_ODEINT_TEST_DIAGNOSTIC_STATE_TYPE_HPP_DEFINED #define LIBS_NUMERIC_ODEINT_TEST_DIAGNOSTIC_STATE_TYPE_HPP_DEFINED -#include +#include #include #include #include @@ -62,7 +62,7 @@ struct counter }; template< size_t N > -class diagnostic_type : public boost::array< double , 1 > { }; +class diagnostic_type : public std::array< double , 1 > { }; typedef diagnostic_type< 0 > diagnostic_state_type; diff --git a/test/dummy_steppers.hpp b/test/dummy_steppers.hpp index 5f8d749f..997457ed 100644 --- a/test/dummy_steppers.hpp +++ b/test/dummy_steppers.hpp @@ -18,7 +18,7 @@ #ifndef BOOST_LIBS_NUMERIC_ODEINT_TEST_DUMMY_STEPPER_HPP_INCLUDED #define BOOST_LIBS_NUMERIC_ODEINT_TEST_DUMMY_STEPPER_HPP_INCLUDED -#include +#include #include #include @@ -30,7 +30,7 @@ struct dummy_stepper { typedef double value_type; typedef value_type time_type; - typedef boost::array< value_type , 1 > state_type; + typedef std::array< value_type , 1 > state_type; typedef state_type deriv_type; typedef unsigned short order_type; typedef stepper_tag stepper_category; @@ -48,7 +48,7 @@ struct dummy_dense_output_stepper { typedef double value_type; typedef value_type time_type; - typedef boost::array< value_type , 1 > state_type; + typedef std::array< value_type , 1 > state_type; typedef state_type deriv_type; typedef dense_output_stepper_tag stepper_category; @@ -100,7 +100,7 @@ struct dummy_controlled_stepper { typedef double value_type; typedef value_type time_type; - typedef boost::array< value_type , 1 > state_type; + typedef std::array< value_type , 1 > state_type; typedef state_type deriv_type; typedef controlled_stepper_tag stepper_category; diff --git a/test/generic_error_stepper.cpp b/test/generic_error_stepper.cpp index 0b18da89..7650b5db 100644 --- a/test/generic_error_stepper.cpp +++ b/test/generic_error_stepper.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include using namespace boost::unit_test; using namespace boost::numeric::odeint; @@ -40,7 +40,7 @@ using namespace boost::numeric::odeint; namespace fusion = boost::fusion; typedef double value_type; -typedef boost::array< value_type , 2 > state_type; +typedef std::array< value_type , 2 > state_type; void sys( const state_type &x , state_type &dxdt , const value_type &t ) { @@ -50,11 +50,11 @@ void sys( const state_type &x , state_type &dxdt , const value_type &t ) typedef explicit_error_generic_rk< 6 , 5 , 4 , 5 , state_type> error_rk_generic_type; -const boost::array< double , 1 > a1 = {{ 0.2 }}; -const boost::array< double , 2 > a2 = {{ 3.0/40.0 , 9.0/40 }}; -const boost::array< double , 3 > a3 = {{ 0.3 , -0.9 , 1.2 }}; -const boost::array< double , 4 > a4 = {{ -11.0/54.0 , 2.5 , -70.0/27.0 , 35.0/27.0 }}; -const boost::array< double , 5 > a5 = {{ 1631.0/55296.0 , 175.0/512.0 , 575.0/13824.0 , 44275.0/110592.0 , 253.0/4096.0 }}; +const std::array< double , 1 > a1 = {{ 0.2 }}; +const std::array< double , 2 > a2 = {{ 3.0/40.0 , 9.0/40 }}; +const std::array< double , 3 > a3 = {{ 0.3 , -0.9 , 1.2 }}; +const std::array< double , 4 > a4 = {{ -11.0/54.0 , 2.5 , -70.0/27.0 , 35.0/27.0 }}; +const std::array< double , 5 > a5 = {{ 1631.0/55296.0 , 175.0/512.0 , 575.0/13824.0 , 44275.0/110592.0 , 253.0/4096.0 }}; const error_rk_generic_type::coef_a_type a = fusion::make_vector( a1 , a2 , a3 , a4 , a5 ); const error_rk_generic_type::coef_b_type b = {{ 37.0/378.0 , 0.0 , 250.0/621.0 , 125.0/594.0 , 0.0 , 512.0/1771.0 }}; diff --git a/test/generic_stepper.cpp b/test/generic_stepper.cpp index e2c18272..c57a0b1f 100644 --- a/test/generic_stepper.cpp +++ b/test/generic_stepper.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include using namespace boost::unit_test; using namespace boost::numeric::odeint; @@ -39,7 +39,7 @@ using namespace boost::numeric::odeint; namespace fusion = boost::fusion; typedef double value_type; -typedef boost::array< value_type , 2 > state_type; +typedef std::array< value_type , 2 > state_type; void sys( const state_type &x , state_type &dxdt , const value_type &t ) { @@ -50,9 +50,9 @@ void sys( const state_type &x , state_type &dxdt , const value_type &t ) typedef explicit_generic_rk< 4 , 4 , state_type> rk_generic_type; typedef runge_kutta4< state_type > rk4_generic_type; -const boost::array< double , 1 > a1 = {{ 0.5 }}; -const boost::array< double , 2 > a2 = {{ 0.0 , 0.5 }}; -const boost::array< double , 3 > a3 = {{ 0.0 , 0.0 , 1.0 }}; +const std::array< double , 1 > a1 = {{ 0.5 }}; +const std::array< double , 2 > a2 = {{ 0.0 , 0.5 }}; +const std::array< double , 3 > a3 = {{ 0.0 , 0.0 , 1.0 }}; const rk_generic_type::coef_a_type a = fusion::make_vector( a1 , a2 , a3 ); const rk_generic_type::coef_b_type b = {{ 1.0/6 , 1.0/3 , 1.0/3 , 1.0/6 }}; diff --git a/test/integrate.cpp b/test/integrate.cpp index 07d4617f..d4628b3c 100644 --- a/test/integrate.cpp +++ b/test/integrate.cpp @@ -25,7 +25,7 @@ #include -#include +#include #include #include diff --git a/test/integrate_implicit.cpp b/test/integrate_implicit.cpp index 4bff200a..756042c4 100644 --- a/test/integrate_implicit.cpp +++ b/test/integrate_implicit.cpp @@ -22,7 +22,7 @@ #include -#include +#include #include #include #include diff --git a/test/n_step_iterator.cpp b/test/n_step_iterator.cpp index bebcf6da..2e59f0e2 100644 --- a/test/n_step_iterator.cpp +++ b/test/n_step_iterator.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/n_step_time_iterator.cpp b/test/n_step_time_iterator.cpp index d50d9635..c1237638 100644 --- a/test/n_step_time_iterator.cpp +++ b/test/n_step_time_iterator.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/numeric/adams_bashforth.cpp b/test/numeric/adams_bashforth.cpp index ca8a6cee..5f2a83f4 100644 --- a/test/numeric/adams_bashforth.cpp +++ b/test/numeric/adams_bashforth.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace mpl = boost::mpl; typedef double value_type; -typedef boost::array< double , 2 > state_type; +typedef std::array< double , 2 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc diff --git a/test/numeric/adams_bashforth_moulton.cpp b/test/numeric/adams_bashforth_moulton.cpp index dea57182..d0fa026b 100644 --- a/test/numeric/adams_bashforth_moulton.cpp +++ b/test/numeric/adams_bashforth_moulton.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace mpl = boost::mpl; typedef double value_type; -typedef boost::array< double , 2 > state_type; +typedef std::array< double , 2 > state_type; typedef runge_kutta_fehlberg78 initializing_stepper; // harmonic oscillator, analytic solution x[0] = sin( t ) diff --git a/test/numeric/adaptive_adams_bashforth_moulton.cpp b/test/numeric/adaptive_adams_bashforth_moulton.cpp index 0932dd1d..56a3a948 100644 --- a/test/numeric/adaptive_adams_bashforth_moulton.cpp +++ b/test/numeric/adaptive_adams_bashforth_moulton.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace mpl = boost::mpl; typedef double value_type; -typedef boost::array< double , 2 > state_type; +typedef std::array< double , 2 > state_type; typedef runge_kutta_fehlberg78 initializing_stepper; // harmonic oscillator, analytic solution x[0] = sin( t ) diff --git a/test/numeric/rosenbrock.cpp b/test/numeric/rosenbrock.cpp index 2b6a2678..123ffa1b 100644 --- a/test/numeric/rosenbrock.cpp +++ b/test/numeric/rosenbrock.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include diff --git a/test/numeric/runge_kutta.cpp b/test/numeric/runge_kutta.cpp index a71701bd..60ed20b4 100644 --- a/test/numeric/runge_kutta.cpp +++ b/test/numeric/runge_kutta.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -34,7 +34,7 @@ namespace mpl = boost::mpl; typedef double value_type; -typedef boost::array< double , 2 > state_type; +typedef std::array< double , 2 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc diff --git a/test/numeric/symplectic.cpp b/test/numeric/symplectic.cpp index 6d3f75b1..5820858e 100644 --- a/test/numeric/symplectic.cpp +++ b/test/numeric/symplectic.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace mpl = boost::mpl; typedef double value_type; -typedef boost::array< double ,1 > state_type; +typedef std::array< double ,1 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc diff --git a/test/numeric/velocity_verlet.cpp b/test/numeric/velocity_verlet.cpp index 5ac77807..0023bbab 100644 --- a/test/numeric/velocity_verlet.cpp +++ b/test/numeric/velocity_verlet.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -33,7 +33,7 @@ namespace mpl = boost::mpl; typedef double value_type; -typedef boost::array< double , 1 > state_type; +typedef std::array< double , 1 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc diff --git a/test/prepare_stepper_testing.hpp b/test/prepare_stepper_testing.hpp index 10c0c84e..5d3e7db1 100644 --- a/test/prepare_stepper_testing.hpp +++ b/test/prepare_stepper_testing.hpp @@ -17,7 +17,7 @@ #ifndef PREPARE_STEPPER_TESTING_HPP_ #define PREPARE_STEPPER_TESTING_HPP_ -#include +#include #include #include @@ -38,11 +38,11 @@ using namespace boost::numeric::odeint; typedef std::vector< double > vector_type; typedef std::vector< std::complex > complex_vector_type; typedef double vector_space_type; -typedef boost::array< double , 1 > array_type; -typedef boost::array< std::complex , 1 > complex_array_type; +typedef std::array< double , 1 > array_type; +typedef std::array< std::complex , 1 > complex_array_type; typedef boost::multiprecision::cpp_dec_float_50 mp_type; -typedef boost::array< mp_type , 1 > mp_array_type; +typedef std::array< mp_type , 1 > mp_array_type; typedef mpl::vector< vector_type , complex_vector_type , vector_space_type , array_type , complex_array_type , mp_type , mp_array_type diff --git a/test/range_algebra.cpp b/test/range_algebra.cpp index d80e9519..ef9ece0e 100644 --- a/test/range_algebra.cpp +++ b/test/range_algebra.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ range_algebra algebra; BOOST_AUTO_TEST_CASE_TEMPLATE( for_each2 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }}; algebra.for_each2( x1 , x2 , default_operations::scale_sum1<>( 1.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 2.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 2.0 , 1.0e-10 ); @@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each2 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( for_each3 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }}; algebra.for_each3( x1 , x2 , x3 , default_operations::scale_sum2<>( 1.0 , 2.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 8.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 8.0 , 1.0e-10 ); @@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each3 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( for_each4 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }}; algebra.for_each4( x1 , x2 , x3 , x4 , default_operations::scale_sum3<>( 1.0 , 2.0 , 3.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 20.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 20.0 , 1.0e-10 ); @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each4 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( for_each5 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }}; algebra.for_each5( x1 , x2 , x3 , x4 , x5 , default_operations::scale_sum4<>( 1.0 , 2.0 , 3.0 , 4.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 40.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 40.0 , 1.0e-10 ); @@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each5 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( for_each6 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }}; algebra.for_each6( x1 , x2 , x3 , x4 , x5 , x6 ,default_operations::scale_sum5<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 70.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 70.0 , 1.0e-10 ); @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each6 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( for_each7 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }}; algebra.for_each7( x1 , x2 , x3 , x4 , x5 , x6 , x7 , default_operations::scale_sum6<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 112.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 112.0 , 1.0e-10 ); @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each7 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( for_each8 , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }} , x8 = {{ 8.0 , 8.0 }}; + std::array< double , 2 > x1 = {{ 1.0 , 1.0 }} , x2 = {{ 2.0 , 2.0 }} , x3 = {{ 3.0 , 3.0 }} , x4 = {{ 4.0 , 4.0 }} , x5 = {{ 5.0 , 5.0 }} , x6 = {{ 6.0 , 6.0 }} , x7 = {{ 7.0 , 7.0 }} , x8 = {{ 8.0 , 8.0 }}; algebra.for_each8( x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , default_operations::scale_sum7<>( 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 ) ); BOOST_CHECK_CLOSE( x1[0] , 168.0 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1] , 168.0 , 1.0e-10 ); @@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( for_each8 , algebra_type , algebra_types ) BOOST_AUTO_TEST_CASE_TEMPLATE( norm_inf , algebra_type , algebra_types ) { algebra_type algebra; - boost::array< double , 2 > x = {{ 1.25 , 2.25 }}; + std::array< double , 2 > x = {{ 1.25 , 2.25 }}; double nrm = algebra.norm_inf( x ); BOOST_CHECK_CLOSE( nrm , 2.25 , 1.0e-10 ); BOOST_CHECK_CLOSE( x[0] , 1.25 , 1.0e-10 ); @@ -132,8 +132,8 @@ BOOST_AUTO_TEST_CASE( for_each2_with_units ) typedef units::quantity< si::time , double > time_type; typedef units::quantity< si::length , double > length_type; typedef units::quantity< si::velocity , double > velocity_type; - boost::array< length_type , 2 > x1 = {{ 1.0 * si::meter , 1.0 * si::meter }}; - boost::array< velocity_type , 2 > x2 = {{ 2.0 * si::meter / si::seconds , 2.0 * si::meter / si::seconds }}; + std::array< length_type , 2 > x1 = {{ 1.0 * si::meter , 1.0 * si::meter }}; + std::array< velocity_type , 2 > x2 = {{ 2.0 * si::meter / si::seconds , 2.0 * si::meter / si::seconds }}; algebra.for_each2( x1 , x2 , default_operations::scale_sum1< time_type >( 0.1 * si::second ) ); BOOST_CHECK_CLOSE( x1[0].value() , 0.2 , 1.0e-10 ); BOOST_CHECK_CLOSE( x1[1].value() , 0.2 , 1.0e-10 ); diff --git a/test/regression/regression_147.cpp b/test/regression/regression_147.cpp index 7373782d..2a4caa89 100644 --- a/test/regression/regression_147.cpp +++ b/test/regression/regression_147.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include diff --git a/test/regression/regression_168.cpp b/test/regression/regression_168.cpp index 8349261a..e511c58f 100644 --- a/test/regression/regression_168.cpp +++ b/test/regression/regression_168.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include diff --git a/test/resizing.cpp b/test/resizing.cpp index 75179519..2dede6e9 100644 --- a/test/resizing.cpp +++ b/test/resizing.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/resizing_test_state_type.hpp b/test/resizing_test_state_type.hpp index af55937a..ffad1a10 100644 --- a/test/resizing_test_state_type.hpp +++ b/test/resizing_test_state_type.hpp @@ -22,13 +22,13 @@ #include #include -#include +#include // Mario: velocity verlet tests need arrays of size 2 // some ugly detailed dependency, maybe this can be improved? -class test_array_type : public boost::array< double , 2 > { }; +class test_array_type : public std::array< double , 2 > { }; size_t adjust_size_count; diff --git a/test/runge_kutta_concepts.cpp b/test/runge_kutta_concepts.cpp index 42235dea..8fa073f7 100644 --- a/test/runge_kutta_concepts.cpp +++ b/test/runge_kutta_concepts.cpp @@ -29,7 +29,7 @@ #include -#include +#include #include @@ -128,9 +128,9 @@ struct perform_stepper_test< Stepper , std::vector > }; template< class Stepper , typename T > -struct perform_stepper_test< Stepper , boost::array > +struct perform_stepper_test< Stepper , std::array > { - typedef boost::array array_type; + typedef std::array array_type; void operator()( void ) { using std::abs; diff --git a/test/runge_kutta_controlled_concepts.cpp b/test/runge_kutta_controlled_concepts.cpp index 7f70cc53..8a1e9b0f 100644 --- a/test/runge_kutta_controlled_concepts.cpp +++ b/test/runge_kutta_controlled_concepts.cpp @@ -29,7 +29,7 @@ #include -#include +#include #include @@ -154,9 +154,9 @@ struct perform_controlled_stepper_test< ControlledStepper , vector_space_type > }; template< class ControlledStepper , typename T > -struct perform_controlled_stepper_test< ControlledStepper , boost::array > +struct perform_controlled_stepper_test< ControlledStepper , std::array > { - typedef boost::array array_type; + typedef std::array array_type; void operator()( void ) { using std::abs; diff --git a/test/runge_kutta_error_concepts.cpp b/test/runge_kutta_error_concepts.cpp index 06980772..5afe589e 100644 --- a/test/runge_kutta_error_concepts.cpp +++ b/test/runge_kutta_error_concepts.cpp @@ -29,7 +29,7 @@ #include -#include +#include #include @@ -126,9 +126,9 @@ struct perform_error_stepper_test< Stepper , std::vector > template< class Stepper , typename T > -struct perform_error_stepper_test< Stepper , boost::array > +struct perform_error_stepper_test< Stepper , std::array > { - typedef boost::array array_type; + typedef std::array array_type; void operator()( void ) { using std::abs; diff --git a/test/stepper_with_ranges.cpp b/test/stepper_with_ranges.cpp index 59f007f2..3f883cd5 100644 --- a/test/stepper_with_ranges.cpp +++ b/test/stepper_with_ranges.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -40,7 +40,7 @@ #include typedef std::vector< double > state_type; -typedef boost::array< double , 3 > state_type2; +typedef std::array< double , 3 > state_type2; /* explicitly force range algebra for this array! */ namespace boost { namespace numeric { namespace odeint { @@ -138,9 +138,9 @@ struct ham_sys struct vector_fixture { const static size_t dim = 6; - boost::array< double , dim > in; - boost::array< double , dim > q; - boost::array< double , dim > p; + std::array< double , dim > in; + std::array< double , dim > q; + std::array< double , dim > p; state_type err; vector_fixture( void ) diff --git a/test/symplectic_steppers.cpp b/test/symplectic_steppers.cpp index 498983bd..265c8528 100644 --- a/test/symplectic_steppers.cpp +++ b/test/symplectic_steppers.cpp @@ -28,7 +28,7 @@ #include -#include +#include #include #include diff --git a/test/times_iterator.cpp b/test/times_iterator.cpp index e2acbd0e..c98097ab 100644 --- a/test/times_iterator.cpp +++ b/test/times_iterator.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -50,8 +50,8 @@ typedef mpl::vector< , dummy_dense_output_stepper > dummy_steppers; -boost::array times = {{ 0.0 , 0.1, 0.2, 0.3 }}; -typedef boost::array::iterator time_iterator_type; +std::array times = {{ 0.0 , 0.1, 0.2, 0.3 }}; +typedef std::array::iterator time_iterator_type; BOOST_AUTO_TEST_CASE_TEMPLATE( copy_stepper_iterator , Stepper , dummy_steppers ) { @@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_negative_time_step , Stepper , dum typedef times_iterator< Stepper , empty_system , state_type , time_iterator_type > stepper_iterator; state_type x = {{ 1.0 }}; std::vector< state_type > res; - boost::array neg_times = {{ 0.0 , -0.1, -0.2, -0.3 }}; + std::array neg_times = {{ 0.0 , -0.1, -0.2, -0.3 }}; stepper_iterator first( Stepper() , empty_system() , x , neg_times.begin() , neg_times.end() , -0.1 ); stepper_iterator last( Stepper() , empty_system() , x ); diff --git a/test/times_time_iterator.cpp b/test/times_time_iterator.cpp index 8b6b2943..fc6ca4d7 100644 --- a/test/times_time_iterator.cpp +++ b/test/times_time_iterator.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/velocity_verlet.cpp b/test/velocity_verlet.cpp index 93a2e97c..e979441e 100644 --- a/test/velocity_verlet.cpp +++ b/test/velocity_verlet.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -101,7 +101,7 @@ void init_state( Q &q , P &p ) p[0] = 2.0 ; p[1] = -1.0; } -typedef boost::array< double , 2 > array_type; +typedef std::array< double , 2 > array_type; typedef std::vector< double > vector_type; typedef velocity_verlet< array_type > array_stepper; diff --git a/test_external/gmp/check_gmp.cpp b/test_external/gmp/check_gmp.cpp index 04b3e101..86256fef 100644 --- a/test_external/gmp/check_gmp.cpp +++ b/test_external/gmp/check_gmp.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include diff --git a/test_external/gmp/gmp_integrate.cpp b/test_external/gmp/gmp_integrate.cpp index 0a6be30b..64b681b0 100644 --- a/test_external/gmp/gmp_integrate.cpp +++ b/test_external/gmp/gmp_integrate.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include diff --git a/test_external/mkl/check_mkl.cpp b/test_external/mkl/check_mkl.cpp index bedbd66d..846fba2f 100644 --- a/test_external/mkl/check_mkl.cpp +++ b/test_external/mkl/check_mkl.cpp @@ -22,7 +22,7 @@ using namespace boost::numeric::odeint; typedef double value_type; -typedef boost::array< value_type , 1 > state_type; +typedef std::array< value_type , 1 > state_type; void constant_system( state_type &x , state_type &dxdt , value_type t ) From 1bef73bfdc39deaf6727269efd87cebec08102d2 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 15:43:01 +0100 Subject: [PATCH 2/9] Begin replacing boost/type_traits --- .../odeint/algebra/algebra_dispatcher.hpp | 12 +++++----- .../algebra/detail/extract_value_type.hpp | 6 ++--- .../numeric/odeint/algebra/detail/macros.hpp | 5 ++--- .../odeint/algebra/vector_space_algebra.hpp | 3 --- .../odeint/external/eigen/eigen_resize.hpp | 22 ++++++++----------- .../odeint/external/gsl/gsl_wrapper.hpp | 5 ++--- .../odeint/integrate/integrate_adaptive.hpp | 2 -- .../odeint/integrate/integrate_const.hpp | 6 ++--- .../odeint/integrate/integrate_n_steps.hpp | 2 -- .../odeint/integrate/integrate_times.hpp | 2 -- .../iterator/impl/adaptive_iterator_impl.hpp | 2 -- .../iterator/impl/times_iterator_impl.hpp | 2 -- .../iterator/integrate/integrate_adaptive.hpp | 2 -- .../iterator/integrate/integrate_const.hpp | 6 ++--- .../iterator/integrate/integrate_n_steps.hpp | 2 -- .../iterator/integrate/integrate_times.hpp | 2 -- .../stepper/bulirsch_stoer_dense_out.hpp | 3 --- .../odeint/stepper/stepper_categories.hpp | 2 -- 18 files changed, 27 insertions(+), 59 deletions(-) diff --git a/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp b/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp index 102a0ae3..cf4d0c36 100644 --- a/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp +++ b/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp @@ -17,10 +17,11 @@ #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED -#include - +#include #include -#include +#include + +#include #include #include @@ -29,9 +30,6 @@ #include #include -#include - - namespace boost { namespace numeric { namespace odeint { @@ -55,7 +53,7 @@ struct algebra_dispatcher< std::array< T , N > > //specialize for some integral types template< typename T > -struct algebra_dispatcher_sfinae< T , typename boost::enable_if< typename boost::is_floating_point< T >::type >::type > +struct algebra_dispatcher_sfinae< T , typename std::enable_if< std::is_floating_point< T >::value >::type > { typedef vector_space_algebra algebra_type; }; diff --git a/include/boost/numeric/odeint/algebra/detail/extract_value_type.hpp b/include/boost/numeric/odeint/algebra/detail/extract_value_type.hpp index 8d4340df..fa640be1 100644 --- a/include/boost/numeric/odeint/algebra/detail/extract_value_type.hpp +++ b/include/boost/numeric/odeint/algebra/detail/extract_value_type.hpp @@ -17,11 +17,11 @@ #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_EXTRACT_VALUE_TYPE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_EXTRACT_VALUE_TYPE_HPP_INCLUDED +#include #include #include #include #include -#include BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) @@ -40,8 +40,8 @@ struct extract_value_type // e.g. returning S::value_type::value_type::value_type template< typename S > -struct extract_value_type< S , typename boost::enable_if< has_value_type >::type > - : mpl::if_< is_same< S, typename S::value_type > , +struct extract_value_type< S , typename std::enable_if< has_value_type::value >::type > + : mpl::if_< std::is_same< S, typename S::value_type > , mpl::identity< S > , // cut the recursion if S and S::value_type are the same extract_value_type< typename S::value_type > >::type {}; diff --git a/include/boost/numeric/odeint/algebra/detail/macros.hpp b/include/boost/numeric/odeint/algebra/detail/macros.hpp index 9e18a8a2..12c4d21d 100644 --- a/include/boost/numeric/odeint/algebra/detail/macros.hpp +++ b/include/boost/numeric/odeint/algebra/detail/macros.hpp @@ -18,14 +18,13 @@ #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED +#include //type traits aren't working with nvcc #ifndef __CUDACC__ -#include -#include #define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 ) \ - BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< Type1 >::type , Type2 >::value )) + static_assert(( std::is_same< typename std::remove_const< Type1 >::type , Type2 >::value )); #else //empty macro for nvcc diff --git a/include/boost/numeric/odeint/algebra/vector_space_algebra.hpp b/include/boost/numeric/odeint/algebra/vector_space_algebra.hpp index 450a015a..00240e04 100644 --- a/include/boost/numeric/odeint/algebra/vector_space_algebra.hpp +++ b/include/boost/numeric/odeint/algebra/vector_space_algebra.hpp @@ -20,9 +20,6 @@ #include -#include - - namespace boost { namespace numeric { namespace odeint { diff --git a/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp b/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp index 1989cc36..3e69e13f 100644 --- a/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp +++ b/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp @@ -18,36 +18,32 @@ #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED #define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED +#include #include #include #include -#include -#include - #include namespace boost { namespace numeric { namespace odeint { - - template< class Derived > struct is_resizeable_sfinae< Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > + typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type > { - typedef boost::true_type type; + typedef std::integral_constant type; const static bool value = type::value; }; template < class Derived > struct is_resizeable_sfinae< Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > + typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type > { - typedef boost::true_type type; + typedef std::integral_constant type; const static bool value = type::value; }; @@ -55,7 +51,7 @@ struct is_resizeable_sfinae< Derived , template< class Derived > struct same_size_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > + typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type > { static bool same_size( const Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 ) @@ -66,7 +62,7 @@ struct same_size_impl_sfinae< Derived , Derived , template< class Derived > struct same_size_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > + typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type > { static bool same_size( const Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 ) { @@ -79,7 +75,7 @@ struct same_size_impl_sfinae< Derived , Derived , template< class Derived > struct resize_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > + typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type > { static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 ) { @@ -89,7 +85,7 @@ struct resize_impl_sfinae< Derived , Derived , template< class Derived > struct resize_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > + typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type > { static void resize( Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 ) { diff --git a/include/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp b/include/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp index a856f6e8..e7d80813 100644 --- a/include/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp +++ b/include/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp @@ -22,7 +22,6 @@ #include -#include #include #include @@ -167,8 +166,8 @@ namespace odeint { template<> struct is_resizeable< gsl_vector* > { - //struct type : public boost::true_type { }; - typedef boost::true_type type; + //struct type : public std::integral_constant { }; + typedef std::integral_constant type; const static bool value = type::value; }; diff --git a/include/boost/numeric/odeint/integrate/integrate_adaptive.hpp b/include/boost/numeric/odeint/integrate/integrate_adaptive.hpp index 09997142..ee4a7177 100644 --- a/include/boost/numeric/odeint/integrate/integrate_adaptive.hpp +++ b/include/boost/numeric/odeint/integrate/integrate_adaptive.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED -#include - #include #include #include diff --git a/include/boost/numeric/odeint/integrate/integrate_const.hpp b/include/boost/numeric/odeint/integrate/integrate_const.hpp index fae683f9..32d02d26 100644 --- a/include/boost/numeric/odeint/integrate/integrate_const.hpp +++ b/include/boost/numeric/odeint/integrate/integrate_const.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED -#include +#include #include #include @@ -44,7 +44,7 @@ size_t integrate_const( typedef typename odeint::unwrap_reference::type::stepper_category stepper_category; // we want to get as fast as possible to the end // no overflow checks needed - if (boost::is_same::value) { + BOOST_IF_CONSTEXPR (std::is_same::value) { return detail::integrate_adaptive( stepper, system, start_state, start_time, end_time, dt, @@ -77,7 +77,7 @@ size_t integrate_const( typedef typename odeint::unwrap_reference::type::stepper_category stepper_category; // we want to get as fast as possible to the end - if (boost::is_same::value) { + BOOST_IF_CONSTEXPR (std::is_same::value) { return detail::integrate_adaptive( stepper, system, start_state, start_time, end_time, dt, diff --git a/include/boost/numeric/odeint/integrate/integrate_n_steps.hpp b/include/boost/numeric/odeint/integrate/integrate_n_steps.hpp index 5cc8aa0e..a0412899 100644 --- a/include/boost/numeric/odeint/integrate/integrate_n_steps.hpp +++ b/include/boost/numeric/odeint/integrate/integrate_n_steps.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED -#include - #include #include #include diff --git a/include/boost/numeric/odeint/integrate/integrate_times.hpp b/include/boost/numeric/odeint/integrate/integrate_times.hpp index 79fba4f1..d4bb6b83 100644 --- a/include/boost/numeric/odeint/integrate/integrate_times.hpp +++ b/include/boost/numeric/odeint/integrate/integrate_times.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED -#include - #include #include diff --git a/include/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp b/include/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp index e5b4b3cf..96de1c6e 100644 --- a/include/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp +++ b/include/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ADAPTIVE_ITERATOR_IMPL_HPP_DEFINED #define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ADAPTIVE_ITERATOR_IMPL_HPP_DEFINED -#include -#include #include #include diff --git a/include/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp b/include/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp index 7a2b48d8..1fd8c50d 100644 --- a/include/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp +++ b/include/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_TIMES_ITERATOR_IMPL_HPP_DEFINED #define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_TIMES_ITERATOR_IMPL_HPP_DEFINED -#include -#include #include #include diff --git a/include/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp b/include/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp index 3229a00c..77b4227f 100644 --- a/include/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp +++ b/include/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED -#include - #include #include #include diff --git a/include/boost/numeric/odeint/iterator/integrate/integrate_const.hpp b/include/boost/numeric/odeint/iterator/integrate/integrate_const.hpp index ffcea6c1..ce0c2973 100644 --- a/include/boost/numeric/odeint/iterator/integrate/integrate_const.hpp +++ b/include/boost/numeric/odeint/iterator/integrate/integrate_const.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED -#include +#include #include #include @@ -46,7 +46,7 @@ size_t integrate_const( { typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; // we want to get as fast as possible to the end - if( boost::is_same< null_observer , Observer >::value ) + BOOST_IF_CONSTEXPR ( std::is_same< null_observer , Observer >::value ) { return detail::integrate_adaptive( stepper , system , start_state , @@ -74,7 +74,7 @@ size_t integrate_const( { typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; // we want to get as fast as possible to the end - if( boost::is_same< null_observer , Observer >::value ) + BOOST_IF_CONSTEXPR ( std::is_same< null_observer , Observer >::value ) { return detail::integrate_adaptive( stepper , system , start_state , diff --git a/include/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp b/include/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp index 8f30c779..d35ce20c 100644 --- a/include/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp +++ b/include/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED -#include - #include #include #include diff --git a/include/boost/numeric/odeint/iterator/integrate/integrate_times.hpp b/include/boost/numeric/odeint/iterator/integrate/integrate_times.hpp index 1bbd8367..8d5ab1ec 100644 --- a/include/boost/numeric/odeint/iterator/integrate/integrate_times.hpp +++ b/include/boost/numeric/odeint/iterator/integrate/integrate_times.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED -#include - #include #include diff --git a/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp b/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp index 22eb373b..425d9433 100644 --- a/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp +++ b/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp @@ -45,9 +45,6 @@ #include -#include - - namespace boost { namespace numeric { namespace odeint { diff --git a/include/boost/numeric/odeint/stepper/stepper_categories.hpp b/include/boost/numeric/odeint/stepper/stepper_categories.hpp index 9bc53723..def29d0a 100644 --- a/include/boost/numeric/odeint/stepper/stepper_categories.hpp +++ b/include/boost/numeric/odeint/stepper/stepper_categories.hpp @@ -18,8 +18,6 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED -#include - namespace boost { namespace numeric { namespace odeint { From 8c095fed5b55a183c4c474c13144c31bde8dfd9f Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 15:55:15 +0100 Subject: [PATCH 3/9] Remove use of boost.static_assert --- CMakeLists.txt | 1 - examples/my_vector.cpp | 2 +- .../numeric/odeint/algebra/detail/macros.hpp | 7 ----- .../numeric/odeint/algebra/fusion_algebra.hpp | 26 +++++++++---------- .../odeint/stepper/adams_bashforth.hpp | 3 +-- .../stepper/adams_bashforth_moulton.hpp | 3 +-- .../odeint/stepper/extrapolation_stepper.hpp | 2 +- test/algebra_dispatcher.cpp | 12 ++++----- test/generation.cpp | 2 +- test/is_pair.cpp | 12 ++++----- test/std_array.cpp | 9 +++---- test/symplectic_steppers.cpp | 24 ++++++++--------- test_external/eigen/is_resizeable.cpp | 4 +-- test_external/nt2/is_resizeable.cpp | 2 +- 14 files changed, 49 insertions(+), 60 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d04c7d90..1c9440a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,6 @@ target_link_libraries(boost_numeric_odeint Boost::numeric_ublas Boost::preprocessor Boost::range - Boost::static_assert Boost::throw_exception Boost::type_traits Boost::units diff --git a/examples/my_vector.cpp b/examples/my_vector.cpp index 746dfaad..4d862227 100644 --- a/examples/my_vector.cpp +++ b/examples/my_vector.cpp @@ -104,7 +104,7 @@ int main() x[0] = 5.0 ; x[1] = 10.0 ; x[2] = 10.0; // make sure resizing is ON - BOOST_STATIC_ASSERT( is_resizeable::value == true ); + static_assert( is_resizeable::value == true, "Resizing must be on" ); // my_vector works with range_algebra as it implements // the required parts of a container interface diff --git a/include/boost/numeric/odeint/algebra/detail/macros.hpp b/include/boost/numeric/odeint/algebra/detail/macros.hpp index 12c4d21d..9badf223 100644 --- a/include/boost/numeric/odeint/algebra/detail/macros.hpp +++ b/include/boost/numeric/odeint/algebra/detail/macros.hpp @@ -32,11 +32,4 @@ #endif // __CUDACC__ - - -/* -#define BOOST_ODEINT_CHECK_OPERATION_ARITY( Operation , Arity ) \ - BOOST_STATIC_ASSERT(( boost::function_traits< Operation >::arity == Arity )) - */ - #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/algebra/fusion_algebra.hpp b/include/boost/numeric/odeint/algebra/fusion_algebra.hpp index 0055e5d4..69f4a39b 100644 --- a/include/boost/numeric/odeint/algebra/fusion_algebra.hpp +++ b/include/boost/numeric/odeint/algebra/fusion_algebra.hpp @@ -122,7 +122,7 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class Op > static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 8 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 8 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -131,7 +131,7 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class Op > static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 9 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 9 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -140,7 +140,7 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class Op > static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 10 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 10 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -149,8 +149,8 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class Op > static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 11 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 11 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 11 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_RESULT_OF_NUM_ARGS >= 11 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -159,8 +159,8 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 12 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 12 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 12 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_RESULT_OF_NUM_ARGS >= 12 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -169,8 +169,8 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 13 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 13 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 13 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_RESULT_OF_NUM_ARGS >= 13 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& , S13& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -179,8 +179,8 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 14 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 14 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 14 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_RESULT_OF_NUM_ARGS >= 14 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& , S13& , S14& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); @@ -189,8 +189,8 @@ struct fusion_algebra template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op > static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op ) { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 15 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 15 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); + static_assert( BOOST_FUSION_INVOKE_MAX_ARITY >= 15 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); + static_assert( BOOST_RESULT_OF_NUM_ARGS >= 15 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& , S13& , S14& , S15& > Sequences; Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 , s15 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); diff --git a/include/boost/numeric/odeint/stepper/adams_bashforth.hpp b/include/boost/numeric/odeint/stepper/adams_bashforth.hpp index 5ff1e835..6190dc75 100644 --- a/include/boost/numeric/odeint/stepper/adams_bashforth.hpp +++ b/include/boost/numeric/odeint/stepper/adams_bashforth.hpp @@ -85,8 +85,7 @@ class adams_bashforth : public algebra_stepper_base< Algebra , Operations > { #ifndef DOXYGEN_SKIP - BOOST_STATIC_ASSERT(( Steps > 0 )); - BOOST_STATIC_ASSERT(( Steps < 9 )); + static_assert(( Steps > 0 && Steps < 9 ), "Must have between 1 and 8 steps inclusive"); #endif public : diff --git a/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp index f3edce19..d3d89aec 100644 --- a/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp @@ -56,8 +56,7 @@ class adams_bashforth_moulton { #ifndef DOXYGEN_SKIP - BOOST_STATIC_ASSERT(( Steps > 0 )); - BOOST_STATIC_ASSERT(( Steps < 9 )); + static_assert(( Steps > 0 && Steps < 9 ), "Must have between 1 and 8 steps inclusive"); #endif public : diff --git a/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp b/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp index 3b688e95..e78d38d0 100644 --- a/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp +++ b/include/boost/numeric/odeint/stepper/extrapolation_stepper.hpp @@ -67,7 +67,7 @@ class extrapolation_stepper : public explicit_error_stepper_base private: // check for Order being odd - BOOST_STATIC_ASSERT_MSG( + static_assert( ( ( Order % 2 ) == 0 ) && ( Order > 2 ), "extrapolation_stepper requires even Order larger than 2" ); diff --git a/test/algebra_dispatcher.cpp b/test/algebra_dispatcher.cpp index 428faa8d..12a676db 100644 --- a/test/algebra_dispatcher.cpp +++ b/test/algebra_dispatcher.cpp @@ -43,38 +43,38 @@ BOOST_AUTO_TEST_SUITE( algebra_dispatcher_test ) BOOST_AUTO_TEST_CASE( range_algebra_with_vector ) { typedef runge_kutta4< std::vector< double > > stepper_type; - BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , range_algebra >::value )); + static_assert(( boost::is_same< stepper_type::algebra_type , range_algebra >::value ), "Not range algebra"); } BOOST_AUTO_TEST_CASE( array_algebra_with_array ) { typedef runge_kutta4< std::array< double , 2 > > stepper_type; - BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , array_algebra >::value )); + static_assert(( boost::is_same< stepper_type::algebra_type , array_algebra >::value ), "Not array algebra"); } BOOST_AUTO_TEST_CASE( range_algebra_with_array ) { typedef runge_kutta4< std::array< double , 2 > , double , std::array< double , 2 > , double , range_algebra > stepper_type; - BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , range_algebra >::value )); + static_assert(( boost::is_same< stepper_type::algebra_type , range_algebra >::value ), "Not range algebra"); } BOOST_AUTO_TEST_CASE( fusion_algebra_with_fusion_vector ) { typedef runge_kutta4< boost::fusion::vector< double > > stepper_type; - BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , fusion_algebra >::value )); + static_assert(( boost::is_same< stepper_type::algebra_type , fusion_algebra >::value ), "Not fusion algebra"); } BOOST_AUTO_TEST_CASE( fusion_algebra_with_fusion_vector2 ) { typedef runge_kutta_fehlberg78< boost::fusion::vector< double > > stepper_type; - BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , fusion_algebra >::value )); + static_assert(( boost::is_same< stepper_type::algebra_type , fusion_algebra >::value ), "Not fusion algebra"); } typedef boost::mpl::list< float , double , long double , std::complex< double > , std::complex< float > > fp_types; BOOST_AUTO_TEST_CASE_TEMPLATE( vector_space_algebra_with_floating_point , T , fp_types ) { typedef runge_kutta_fehlberg78< T > stepper_type; - BOOST_STATIC_ASSERT(( boost::is_same< typename stepper_type::algebra_type , vector_space_algebra >::value )); + static_assert(( boost::is_same< typename stepper_type::algebra_type , vector_space_algebra >::value ), "Not vector space algebra"); } diff --git a/test/generation.cpp b/test/generation.cpp index 6432692d..faf00d48 100644 --- a/test/generation.cpp +++ b/test/generation.cpp @@ -31,7 +31,7 @@ using namespace boost::numeric::odeint; template< class Stepper1 , class Stepper2 > void check_stepper_type( const Stepper1 &s1 , const Stepper2 &s2 ) { - BOOST_STATIC_ASSERT(( boost::is_same< Stepper1 , Stepper2 >::value )); + static_assert(( boost::is_same< Stepper1 , Stepper2 >::value ), "Stepper1 and Stepper2 must be the same type"); } BOOST_AUTO_TEST_SUITE( generation_test ) diff --git a/test/is_pair.cpp b/test/is_pair.cpp index bf3bc35b..07c913c0 100644 --- a/test/is_pair.cpp +++ b/test/is_pair.cpp @@ -38,12 +38,12 @@ BOOST_AUTO_TEST_CASE( test_is_pair ) typedef std::pair< const int , int > type5; typedef std::pair< const int& , int > type6; - BOOST_STATIC_ASSERT(( is_pair< type1 >::value )); - BOOST_STATIC_ASSERT(( is_pair< type2 >::value )); - BOOST_STATIC_ASSERT(( is_pair< type3 >::value )); - BOOST_STATIC_ASSERT(( is_pair< type4 >::value )); - BOOST_STATIC_ASSERT(( is_pair< type5 >::value )); - BOOST_STATIC_ASSERT(( is_pair< type6 >::value )); + static_assert(( is_pair< type1 >::value ), "Not a pair"); + static_assert(( is_pair< type2 >::value ), "Not a pair"); + static_assert(( is_pair< type3 >::value ), "Not a pair"); + static_assert(( is_pair< type4 >::value ), "Not a pair"); + static_assert(( is_pair< type5 >::value ), "Not a pair"); + static_assert(( is_pair< type6 >::value ), "Not a pair"); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/std_array.cpp b/test/std_array.cpp index 350a387a..1ad17117 100644 --- a/test/std_array.cpp +++ b/test/std_array.cpp @@ -38,11 +38,10 @@ BOOST_AUTO_TEST_CASE( test_case ) state_type x = {0.0, 0.0, 0.0}; typedef boost::numeric::odeint::runge_kutta4 stepper_type; -// check if array algebra is selected, but only if odeint detects c++11 -#ifdef BOOST_NUMERIC_ODEINT_CXX11 - BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , - boost::numeric::odeint::array_algebra >::value )); -#endif + + static_assert(( boost::is_same< stepper_type::algebra_type , + boost::numeric::odeint::array_algebra >::value ), "Not array algebra"); + stepper_type stepper1; stepper1.do_step(rhs, x, 0.0, 0.1); diff --git a/test/symplectic_steppers.cpp b/test/symplectic_steppers.cpp index 265c8528..5f4b8f99 100644 --- a/test/symplectic_steppers.cpp +++ b/test/symplectic_steppers.cpp @@ -128,33 +128,33 @@ BOOST_AUTO_TEST_SUITE( symplectic_steppers_test ) BOOST_AUTO_TEST_CASE_TEMPLATE( test_assoc_types , Stepper , vector_steppers< initially_resizer > ) { - BOOST_STATIC_ASSERT_MSG( + static_assert( ( boost::is_same< typename Stepper::coor_type , diagnostic_state_type >::value ) , "Coordinate type" ); - BOOST_STATIC_ASSERT_MSG( + static_assert( ( boost::is_same< typename Stepper::momentum_type , diagnostic_state_type2 >::value ) , "Momentum type" ); - BOOST_STATIC_ASSERT_MSG( + static_assert( ( boost::is_same< typename Stepper::coor_deriv_type , diagnostic_deriv_type >::value ) , "Coordinate deriv type" ); - BOOST_STATIC_ASSERT_MSG( + static_assert( ( boost::is_same< typename Stepper::momentum_deriv_type , diagnostic_deriv_type2 >::value ) , "Momentum deriv type" ); - BOOST_STATIC_ASSERT_MSG( + static_assert( ( boost::is_same< typename Stepper::state_type , std::pair< diagnostic_state_type , diagnostic_state_type2 > >::value ) , "State type" ); - BOOST_STATIC_ASSERT_MSG( + static_assert( ( boost::is_same< typename Stepper::deriv_type , std::pair< diagnostic_deriv_type , diagnostic_deriv_type2 > >::value ) , "Deriv type" ); - BOOST_STATIC_ASSERT_MSG( ( boost::is_same< typename Stepper::value_type , double >::value ) , "Value type" ); - BOOST_STATIC_ASSERT_MSG( ( boost::is_same< typename Stepper::time_type , double >::value ) , "Time type" ); - BOOST_STATIC_ASSERT_MSG( ( boost::is_same< typename Stepper::algebra_type , custom_range_algebra >::value ) , "Algebra type" ); - BOOST_STATIC_ASSERT_MSG( ( boost::is_same< typename Stepper::operations_type , custom_default_operations >::value ) , "Operations type" ); + static_assert( ( boost::is_same< typename Stepper::value_type , double >::value ) , "Value type" ); + static_assert( ( boost::is_same< typename Stepper::time_type , double >::value ) , "Time type" ); + static_assert( ( boost::is_same< typename Stepper::algebra_type , custom_range_algebra >::value ) , "Algebra type" ); + static_assert( ( boost::is_same< typename Stepper::operations_type , custom_default_operations >::value ) , "Operations type" ); - BOOST_STATIC_ASSERT_MSG( ( boost::is_same< typename Stepper::resizer_type , initially_resizer >::value ) , "Resizer type" ); - BOOST_STATIC_ASSERT_MSG( ( boost::is_same< typename Stepper::stepper_category , stepper_tag >::value ) , "Stepper category" ); + static_assert( ( boost::is_same< typename Stepper::resizer_type , initially_resizer >::value ) , "Resizer type" ); + static_assert( ( boost::is_same< typename Stepper::stepper_category , stepper_tag >::value ) , "Stepper category" ); } diff --git a/test_external/eigen/is_resizeable.cpp b/test_external/eigen/is_resizeable.cpp index 5f29ee53..3640e25f 100644 --- a/test_external/eigen/is_resizeable.cpp +++ b/test_external/eigen/is_resizeable.cpp @@ -34,13 +34,13 @@ BOOST_AUTO_TEST_SUITE( is_resizeable ) BOOST_AUTO_TEST_CASE( test_compile_time_matrix ) { typedef Eigen::Matrix< double , 1 , 1 > matrix_type; - BOOST_STATIC_ASSERT(( boost::numeric::odeint::is_resizeable< matrix_type >::value )); + static_assert(( boost::numeric::odeint::is_resizeable< matrix_type >::value ), "Matrix is not resizeable"); } BOOST_AUTO_TEST_CASE( test_compile_time_array ) { typedef Eigen::Array< double , 1 , 1 > array_type; - BOOST_STATIC_ASSERT(( boost::numeric::odeint::is_resizeable< array_type >::value )); + static_assert(( boost::numeric::odeint::is_resizeable< array_type >::value ), "Array is not resizeable"); } diff --git a/test_external/nt2/is_resizeable.cpp b/test_external/nt2/is_resizeable.cpp index 10ecdbb5..638f3332 100644 --- a/test_external/nt2/is_resizeable.cpp +++ b/test_external/nt2/is_resizeable.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_SUITE( nt2_is_resizeable ) BOOST_AUTO_TEST_CASE_TEMPLATE( is_resizeable, T, fp_types ) { - BOOST_STATIC_ASSERT(( boost::numeric::odeint::is_resizeable< nt2::table >::value )); + static_assert(( boost::numeric::odeint::is_resizeable< nt2::table >::value ), "Table is not resizeable"); } BOOST_AUTO_TEST_SUITE_END() From 654f44122b13a977194abaeab2eec38b771268ce Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 16:03:40 +0100 Subject: [PATCH 4/9] Add automatic standalone mode detection --- .../numeric/odeint/tools/is_standalone.hpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/boost/numeric/odeint/tools/is_standalone.hpp diff --git a/include/boost/numeric/odeint/tools/is_standalone.hpp b/include/boost/numeric/odeint/tools/is_standalone.hpp new file mode 100644 index 00000000..9578cd58 --- /dev/null +++ b/include/boost/numeric/odeint/tools/is_standalone.hpp @@ -0,0 +1,21 @@ +// Copyright Matt Borland 2021. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_NUMERIC_ODEINT_TOOLS_IS_STANDALONE_HPP +#define BOOST_NUMERIC_ODEINT_TOOLS_IS_STANDALONE_HPP + +// If one or more of our required dependencies are missing assume we are +// in standalone mode + +#ifdef __has_include +#if !__has_include() || !__has_include() || !__has_include() || \ + !__has_include() || !__has_include() +# ifndef BOOST_NUMERIC_ODEINT_STANDALONE +# define BOOST_NUMERIC_ODEINT_STANDALONE +# endif +#endif +#endif + +#endif //BOOST_NUMERIC_ODEINT_TOOLS_IS_STANDALONE_HPP From 2dc1690ff5e36ab8ea63efe21f74c64ffd7c7e61 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 16:04:02 +0100 Subject: [PATCH 5/9] Define context switching assert macro --- include/boost/numeric/odeint/tools/assert.hpp | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/boost/numeric/odeint/tools/assert.hpp diff --git a/include/boost/numeric/odeint/tools/assert.hpp b/include/boost/numeric/odeint/tools/assert.hpp new file mode 100644 index 00000000..0f1a200c --- /dev/null +++ b/include/boost/numeric/odeint/tools/assert.hpp @@ -0,0 +1,30 @@ +// (C) Copyright Matt Borland 2021 - 2023. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// We deliberately use assert in here: +// +// boost-no-inspect + +#ifndef BOOST_NUMERIC_ODEINT_TOOLS_ASSERT_HPP +#define BOOST_NUMERIC_ODEINT_TOOLS_ASSERT_HPP + +#include + +#ifndef BOOST_NUMERIC_ODEINT_STANDALONE + +#include + +#define BOOST_NUMERIC_ODEINT_ASSERT(expr) BOOST_ASSERT(expr) +#define BOOST_NUMERIC_ODEINT_ASSERT_MSG(expr, msg) BOOST_ASSERT_MSG(expr, msg) + +#else // Standalone mode so we use cassert + +#include +#define BOOST_NUMERIC_ODEINT_ASSERT(expr) assert(expr) +#define BOOST_NUMERIC_ODEINT_ASSERT_MSG(expr, msg) assert((expr)&&(msg)) + +#endif + +#endif //BOOST_NUMERIC_ODEINT_TOOLS_ASSERT_HPP From 7d91d3fb30725417d5e1aeb50c3f20e3c9718f5d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 16:09:13 +0100 Subject: [PATCH 6/9] Remove uses of boost.assert --- .../boost/numeric/odeint/external/mpi/mpi_vector_state.hpp | 3 ++- .../numeric/odeint/external/openmp/openmp_nested_algebra.hpp | 4 ++-- .../numeric/odeint/external/openmp/openmp_range_algebra.hpp | 4 ++-- .../odeint/stepper/detail/adams_bashforth_call_algebra.hpp | 5 +---- .../odeint/stepper/detail/adams_moulton_call_algebra.hpp | 2 +- include/boost/numeric/odeint/util/split_adaptor.hpp | 5 +++-- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp b/include/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp index 096d40a6..3ac0a197 100644 --- a/include/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp +++ b/include/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace boost { namespace numeric { @@ -75,7 +76,7 @@ struct unsplit_impl< mpi_state< InnerState >, Target, size_t total_size = 0; for(size_t i = 0 ; i < pieces.size() ; i++) total_size += boost::size(pieces[i]); - BOOST_ASSERT( total_size <= boost::size(to) ); + BOOST_NUMERIC_ODEINT_ASSERT( total_size <= boost::size(to) ); // copy parts iterator out = boost::begin(to); for(size_t i = 0 ; i < pieces.size() ; i++) diff --git a/include/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp b/include/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp index a3d299f0..370da819 100644 --- a/include/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp +++ b/include/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp @@ -19,10 +19,10 @@ #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_NESTED_ALGEBRA_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_NESTED_ALGEBRA_HPP_INCLUDED -#include #include #include #include +#include namespace boost { namespace numeric { @@ -40,7 +40,7 @@ struct openmp_nested_algebra #if __cplusplus >= 201103L // C++11 supports _Pragma #define BOOST_ODEINT_GEN_LOCAL(z, n, unused) \ - BOOST_ASSERT_MSG( len == boost::size(s ## n), "All nested state ranges must have the same size." ); \ + BOOST_NUMERIC_ODEINT_ASSERT_MSG( len == boost::size(s ## n), "All nested state ranges must have the same size." ); \ typename boost::range_iterator::type beg ## n = boost::begin(s ## n); #define BOOST_ODEINT_GEN_BODY(n) \ const size_t len = boost::size(s0); \ diff --git a/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp b/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp index 295db647..d90e8850 100644 --- a/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp +++ b/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp @@ -19,10 +19,10 @@ #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_RANGE_ALGEBRA_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_RANGE_ALGEBRA_HPP_INCLUDED -#include #include #include #include +#include namespace boost { namespace numeric { @@ -38,7 +38,7 @@ struct openmp_range_algebra #if __cplusplus >= 201103L // C++11 supports _Pragma #define BOOST_ODEINT_GEN_LOCAL(z, n, unused) \ - BOOST_ASSERT_MSG( len == boost::size(s ## n), "All state ranges must have the same size." ); \ + BOOST_NUMERIC_ODEINT_ASSERT_MSG( len == boost::size(s ## n), "All state ranges must have the same size." ); \ typename boost::range_iterator::type beg ## n = boost::begin(s ## n); #define BOOST_ODEINT_GEN_BODY(n) \ const size_t len = boost::size(s0); \ diff --git a/include/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp b/include/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp index cc279abb..835a641e 100644 --- a/include/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp +++ b/include/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp @@ -18,8 +18,7 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED -#include - +#include namespace boost { namespace numeric { @@ -115,7 +114,6 @@ struct adams_bashforth_call_algebra< 7 , Algebra , Operations > template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const { - //BOOST_ASSERT( false ); // not implemented typedef typename Coefficients::value_type value_type; algebra.for_each9( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , steps[6].m_v , typename Operations::template scale_sum8< value_type , Time , Time , Time , Time , Time , Time >( @@ -130,7 +128,6 @@ struct adams_bashforth_call_algebra< 8 , Algebra , Operations > template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const { - //BOOST_ASSERT( false ); // not implemented typedef typename Coefficients::value_type value_type; algebra.for_each10( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , steps[6].m_v , steps[7].m_v , typename Operations::template scale_sum9< value_type , Time , Time , Time , Time , Time , Time , Time >( diff --git a/include/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp b/include/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp index b6f5f2a4..5d7837a9 100644 --- a/include/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp +++ b/include/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp @@ -18,7 +18,7 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED -#include +#include namespace boost { namespace numeric { diff --git a/include/boost/numeric/odeint/util/split_adaptor.hpp b/include/boost/numeric/odeint/util/split_adaptor.hpp index cf0d6238..556f9112 100644 --- a/include/boost/numeric/odeint/util/split_adaptor.hpp +++ b/include/boost/numeric/odeint/util/split_adaptor.hpp @@ -19,6 +19,7 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_SPLIT_ADAPTOR_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_SPLIT_ADAPTOR_INCLUDED +#include #include #include #include @@ -33,8 +34,8 @@ namespace detail { inline std::pair split_offsets( std::size_t total_length, std::size_t index, std::size_t parts ) { - BOOST_ASSERT( parts > 0 ); - BOOST_ASSERT( index < parts ); + BOOST_NUMERIC_ODEINT_ASSERT( parts > 0 ); + BOOST_NUMERIC_ODEINT_ASSERT( index < parts ); const std::size_t slice = total_length / parts, partial = total_length % parts, From 91712beba2d7ead5f1dfd142c764fba1d6268dda Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 17:02:29 +0100 Subject: [PATCH 7/9] Remove usages of boost::mpl::bool --- doc/concepts/symplectic_system.qbk | 4 +-- .../base/symplectic_rkn_stepper_base.hpp | 5 ++-- include/boost/numeric/odeint/util/copy.hpp | 13 ++++++++++ .../numeric/odeint/util/detail/is_range.hpp | 26 +++++++++---------- include/boost/numeric/odeint/util/is_pair.hpp | 9 +++---- 5 files changed, 34 insertions(+), 23 deletions(-) diff --git a/doc/concepts/symplectic_system.qbk b/doc/concepts/symplectic_system.qbk index e0785973..1271a984 100644 --- a/doc/concepts/symplectic_system.qbk +++ b/doc/concepts/symplectic_system.qbk @@ -54,7 +54,7 @@ Symplectic systems are used in symplectic steppers like `symplectic_rkn_sb3a_mcl [table [[Name] [Expression] [Type] [Semantics]] - [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::true_`] [Check if System is a pair]] + [[Check for pair] [`boost::is_pair< System >::type`] [`std::integral_constant`] [Check if System is a pair]] [[Calculate ['dq/dt = f(p)]] [`sys.first( p , dqdt )`] [`void`] [Calculates ['f(p)], the result is stored into `dqdt`] ] [[Calculate ['dp/dt = g(q)]] [`sys.second( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ] ] @@ -92,7 +92,7 @@ We call this concept ['SimpleSymplecticSystem] [table [[Name] [Expression] [Type] [Semantics]] - [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::false_`] [Check if System is a pair, should be evaluated to false in this case.]] + [[Check for pair] [`boost::is_pair< System >::type`] [`std::integral_constant`] [Check if System is a pair, should be evaluated to false in this case.]] [[Calculate ['dp/dt = g(q)]] [`sys( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ] ] diff --git a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp index 9c3e5d57..32330d6e 100644 --- a/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp +++ b/include/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp @@ -20,6 +20,7 @@ #define BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED #include +#include #include #include @@ -182,7 +183,7 @@ private: // stepper for systems with function for dq/dt = f(p) and dp/dt = -f(q) template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::true_ ) + void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , std::integral_constant ) { typedef typename odeint::unwrap_reference< System >::type system_type; typedef typename odeint::unwrap_reference< typename system_type::first_type >::type coor_deriv_func_type; @@ -236,7 +237,7 @@ private: // stepper for systems with only function dp /dt = -f(q), dq/dt = p, time not required but still expected for compatibility reasons template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::false_ ) + void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , std::integral_constant ) { typedef typename odeint::unwrap_reference< System >::type momentum_deriv_func_type; momentum_deriv_func_type &momentum_func = system; diff --git a/include/boost/numeric/odeint/util/copy.hpp b/include/boost/numeric/odeint/util/copy.hpp index 161f1355..686257e5 100644 --- a/include/boost/numeric/odeint/util/copy.hpp +++ b/include/boost/numeric/odeint/util/copy.hpp @@ -18,6 +18,7 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED +#include #include @@ -43,6 +44,18 @@ namespace detail { to = from; } + template< class Container1 , class Container2 > + void do_copying( const Container1 &from , Container2 &to , std::integral_constant) + { + boost::range::copy( from , boost::begin( to ) ); + } + + template< class Container1 , class Container2 > + void do_copying( const Container1 &from , Container2 &to , std::integral_constant) + { + to = from; + } + } // namespace detail diff --git a/include/boost/numeric/odeint/util/detail/is_range.hpp b/include/boost/numeric/odeint/util/detail/is_range.hpp index a1768554..ed63ba98 100644 --- a/include/boost/numeric/odeint/util/detail/is_range.hpp +++ b/include/boost/numeric/odeint/util/detail/is_range.hpp @@ -26,9 +26,9 @@ #endif #include +#include #include #include -#include #include namespace boost { @@ -56,12 +56,12 @@ struct is_range : boost::mpl::and_, range_deta ////////////////////////////////////////////////////////////////////////// template< typename iteratorT > -struct is_range< std::pair > : boost::mpl::true_ +struct is_range< std::pair > : std::integral_constant { }; template< typename iteratorT > -struct is_range< const std::pair > : boost::mpl::true_ +struct is_range< const std::pair > : std::integral_constant { }; @@ -70,12 +70,12 @@ struct is_range< const std::pair > : boost::mpl::true_ ////////////////////////////////////////////////////////////////////////// template< typename elementT, std::size_t sz > -struct is_range< elementT[sz] > : boost::mpl::true_ +struct is_range< elementT[sz] > : std::integral_constant { }; template< typename elementT, std::size_t sz > -struct is_range< const elementT[sz] > : boost::mpl::true_ +struct is_range< const elementT[sz] > : std::integral_constant { }; @@ -84,42 +84,42 @@ struct is_range< const elementT[sz] > : boost::mpl::true_ ////////////////////////////////////////////////////////////////////////// template<> -struct is_range< char* > : boost::mpl::true_ +struct is_range< char* > : std::integral_constant { }; template<> -struct is_range< wchar_t* > : boost::mpl::true_ +struct is_range< wchar_t* > : std::integral_constant { }; template<> -struct is_range< const char* > : boost::mpl::true_ +struct is_range< const char* > : std::integral_constant { }; template<> -struct is_range< const wchar_t* > : boost::mpl::true_ +struct is_range< const wchar_t* > : std::integral_constant { }; template<> -struct is_range< char* const > : boost::mpl::true_ +struct is_range< char* const > : std::integral_constant { }; template<> -struct is_range< wchar_t* const > : boost::mpl::true_ +struct is_range< wchar_t* const > : std::integral_constant { }; template<> -struct is_range< const char* const > : boost::mpl::true_ +struct is_range< const char* const > : std::integral_constant { }; template<> -struct is_range< const wchar_t* const > : boost::mpl::true_ +struct is_range< const wchar_t* const > : std::integral_constant { }; diff --git a/include/boost/numeric/odeint/util/is_pair.hpp b/include/boost/numeric/odeint/util/is_pair.hpp index 1827840f..b6519f41 100644 --- a/include/boost/numeric/odeint/util/is_pair.hpp +++ b/include/boost/numeric/odeint/util/is_pair.hpp @@ -18,22 +18,19 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED - -#include -#include - +#include namespace boost { namespace numeric { namespace odeint { template< class T > -struct is_pair : public boost::mpl::false_ +struct is_pair : public std::integral_constant { }; template< class T1 , class T2 > -struct is_pair< std::pair< T1 , T2 > > : public boost::mpl::true_ +struct is_pair< std::pair< T1 , T2 > > : public std::integral_constant { }; From 0fc091f92f6e71e460cbfad2feee9e5cb5c61be1 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 17:12:39 +0100 Subject: [PATCH 8/9] Remove boost::mpl::and --- include/boost/numeric/odeint/util/copy.hpp | 12 ------------ .../boost/numeric/odeint/util/detail/is_range.hpp | 3 +-- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/boost/numeric/odeint/util/copy.hpp b/include/boost/numeric/odeint/util/copy.hpp index 686257e5..7e263ff5 100644 --- a/include/boost/numeric/odeint/util/copy.hpp +++ b/include/boost/numeric/odeint/util/copy.hpp @@ -32,18 +32,6 @@ namespace odeint { namespace detail { - template< class Container1 , class Container2 > - void do_copying( const Container1 &from , Container2 &to , boost::mpl::true_ ) - { - boost::range::copy( from , boost::begin( to ) ); - } - - template< class Container1 , class Container2 > - void do_copying( const Container1 &from , Container2 &to , boost::mpl::false_ ) - { - to = from; - } - template< class Container1 , class Container2 > void do_copying( const Container1 &from , Container2 &to , std::integral_constant) { diff --git a/include/boost/numeric/odeint/util/detail/is_range.hpp b/include/boost/numeric/odeint/util/detail/is_range.hpp index ed63ba98..07676a87 100644 --- a/include/boost/numeric/odeint/util/detail/is_range.hpp +++ b/include/boost/numeric/odeint/util/detail/is_range.hpp @@ -29,7 +29,6 @@ #include #include #include -#include namespace boost { namespace numeric { @@ -47,7 +46,7 @@ namespace detail { template< typename Range > -struct is_range : boost::mpl::and_, range_detail::has_const_iterator > +struct is_range : std::integral_constant::value && range_detail::has_const_iterator::value)> { }; From d22fbb4ee7c7653cd25800ca2b98877e913255ac Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 20 Dec 2023 17:25:52 +0100 Subject: [PATCH 9/9] Define our own replacement for BOOST_MPL_HAS_XXX_TRAIT --- include/boost/numeric/odeint/tools/traits.hpp | 39 +++++++++++++++++++ .../numeric/odeint/util/detail/is_range.hpp | 16 +++----- 2 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 include/boost/numeric/odeint/tools/traits.hpp diff --git a/include/boost/numeric/odeint/tools/traits.hpp b/include/boost/numeric/odeint/tools/traits.hpp new file mode 100644 index 00000000..f321412c --- /dev/null +++ b/include/boost/numeric/odeint/tools/traits.hpp @@ -0,0 +1,39 @@ +// Copyright Matt Borland 2021 - 2023. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_NUMERIC_ODEINT_TOOLS_TRAITS +#define BOOST_NUMERIC_ODEINT_TOOLS_TRAITS + +#include + +namespace boost { +namespace numeric { +namespace odeint { +namespace detail { + +#define BOOST_NUMERIC_ODEINT_HAS_NAMED_TRAIT(trait, name) \ +template \ +class trait \ +{ \ +private: \ + using yes = char; \ + struct no { char x[2]; }; \ + \ + template \ + static yes test(typename U::name* = nullptr); \ + \ + template \ + static no test(...); \ + \ +public: \ + static constexpr bool value = (sizeof(test(0)) == sizeof(char)); \ +}; + +} //namespace detail +} //namespace odeint +} //namespace numeric +} //namespace boost + +#endif //BOOST_NUMERIC_ODEINT_TOOLS_TRAITS diff --git a/include/boost/numeric/odeint/util/detail/is_range.hpp b/include/boost/numeric/odeint/util/detail/is_range.hpp index 07676a87..b77ca595 100644 --- a/include/boost/numeric/odeint/util/detail/is_range.hpp +++ b/include/boost/numeric/odeint/util/detail/is_range.hpp @@ -28,25 +28,19 @@ #include #include #include -#include +#include namespace boost { namespace numeric { namespace odeint { +namespace detail { - -namespace range_detail -{ -BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator) - BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator) -} - -namespace detail -{ +BOOST_NUMERIC_ODEINT_HAS_NAMED_TRAIT(has_iterator, iterator); +BOOST_NUMERIC_ODEINT_HAS_NAMED_TRAIT(has_const_iterator, const_iterator); template< typename Range > -struct is_range : std::integral_constant::value && range_detail::has_const_iterator::value)> +struct is_range : std::integral_constant::value && has_const_iterator::value)> { };