diff --git a/boost/numeric/odeint.hpp b/boost/numeric/odeint.hpp index 2ce38d79..50f3ca2e 100644 --- a/boost/numeric/odeint.hpp +++ b/boost/numeric/odeint.hpp @@ -62,5 +62,7 @@ #include +#include + #endif // BOOST_NUMERIC_ODEINT_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation.hpp b/boost/numeric/odeint/stepper/generation.hpp new file mode 100644 index 00000000..cffbd099 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation.hpp @@ -0,0 +1,36 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation.hpp + + [begin_description] + Forward header for the factory functions. Includes all files from the generation directory. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED + +#include +#include + +#include +#include + +#include +#include +#include +#include + + +#include + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp b/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp new file mode 100644 index 00000000..5c3baadf --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp @@ -0,0 +1,53 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp + + [begin_description] + Specialization of the controller factory for the controlled_runge_kutta class. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED + +#include +#include + + +namespace boost { +namespace numeric { +namespace odeint { + + +// controller factory for controlled_runge_kutta +template< class Stepper > +struct controller_factory< Stepper , controlled_runge_kutta< Stepper > > +{ + typedef Stepper stepper_type; + typedef controlled_runge_kutta< stepper_type > controller_type; + typedef typename controller_type::error_checker_type error_checker_type; + typedef typename stepper_type::value_type value_type; + + controller_type operator()( const value_type &abs_error , const value_type &rel_error , const stepper_type &stepper ) + { + return controller_type( error_checker_type( abs_error , rel_error ) , stepper ); + } +}; + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp b/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp new file mode 100644 index 00000000..6bf8470e --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp @@ -0,0 +1,54 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp + + [begin_description] + Specialization of the controller factory for the dense_output_runge_kutta class. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED + +#include +#include +#include + +namespace boost { +namespace numeric { +namespace odeint { + +// controller factory for controlled_runge_kutta +template< class Stepper > +struct dense_output_factory< Stepper , dense_output_runge_kutta< controlled_runge_kutta< Stepper > > > +{ + typedef Stepper stepper_type; + typedef controlled_runge_kutta< stepper_type > controller_type; + typedef typename controller_type::error_checker_type error_checker_type; + typedef typename stepper_type::value_type value_type; + typedef dense_output_runge_kutta< controller_type > dense_output_type; + + dense_output_type operator()( const value_type &abs_error , const value_type &rel_error , const stepper_type &stepper ) + { + return dense_output_type( controller_type( error_checker_type( abs_error , rel_error ) , stepper ) ); + } +}; + + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp b/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp new file mode 100644 index 00000000..aba6f845 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp @@ -0,0 +1,72 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp + + [begin_description] + Enable the factory functions for the controller and the dense output of the Rosenbrock4 method. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED + +#include +#include +#include + + +namespace boost { +namespace numeric { +namespace odeint { + + +template< class Value , class Coefficients , class Resize > +struct get_controller< rosenbrock4< Value , Coefficients , Resize > > +{ + typedef rosenbrock4< Value , Coefficients , Resize > stepper_type; + typedef rosenbrock4_controller< stepper_type > type; +}; + + + +template< class Value , class Coefficients , class Resize > +struct get_dense_output< rosenbrock4< Value , Coefficients , Resize > > +{ + typedef rosenbrock4< Value , Coefficients , Resize > stepper_type; + typedef rosenbrock4_controller< stepper_type > controller_type; + typedef rosenbrock4_dense_output< controller_type > type; +}; + + + +// controller factory for controlled_runge_kutta +template< class Stepper > +struct dense_output_factory< Stepper , rosenbrock4_dense_output< rosenbrock4_controller< Stepper > > > +{ + typedef Stepper stepper_type; + typedef rosenbrock4_controller< stepper_type > controller_type; + typedef typename stepper_type::value_type value_type; + typedef rosenbrock4_dense_output< controller_type > dense_output_type; + + dense_output_type operator()( const value_type &abs_error , const value_type &rel_error , const stepper_type &stepper ) + { + return dense_output_type( controller_type( abs_error , rel_error , stepper ) ); + } +}; + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp new file mode 100644 index 00000000..9c31b0b0 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp @@ -0,0 +1,47 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp + + [begin_description] + Enable the factory functions for the controller and the dense output of the Runge-Kutta-Cash-Karp 54 method. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED + +#include +#include +#include + + +namespace boost { +namespace numeric { +namespace odeint { + +// Specializations for runge_kutta_cash_karp54 +template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > +struct get_controller< runge_kutta_cash_karp54< State , Value , Deriv , Time , Algebra , Operations , Resize > > +{ + typedef runge_kutta_cash_karp54< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; + typedef controlled_runge_kutta< stepper_type > type; +}; + + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp new file mode 100644 index 00000000..7ebf8c87 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp @@ -0,0 +1,48 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp + + [begin_description] + Enable the factory functions for the controller and the dense output of the + Runge-Kutta-Cash-Karp 54 method with the classical implementation. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED + +#include +#include +#include + + +namespace boost { +namespace numeric { +namespace odeint { + + +// Specializations for runge_kutta_cash_karp54 +template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > +struct get_controller< runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resize > > +{ + typedef runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; + typedef controlled_runge_kutta< stepper_type > type; +}; + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp new file mode 100644 index 00000000..b6122cd2 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp @@ -0,0 +1,56 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp + + [begin_description] + Enable the factory functions for the controller and the dense output of the Runge-Kutta-Dormand-Prince5 method. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost { +namespace numeric { +namespace odeint { + + +template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > +struct get_controller< runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > > +{ + typedef runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; + typedef controlled_runge_kutta< stepper_type > type; +}; + + +template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > +struct get_dense_output< runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > > +{ + typedef runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; + typedef controlled_runge_kutta< stepper_type > controller_type; + typedef dense_output_runge_kutta< controller_type > type; +}; + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp new file mode 100644 index 00000000..331c1ed8 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp @@ -0,0 +1,46 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp + + [begin_description] + Enable the factory functions for the controller and the dense output of the Runge-Kutta-Fehlberg 78 method. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED + +#include +#include +#include + +namespace boost { +namespace numeric { +namespace odeint { + + +template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > +struct get_controller< runge_kutta_fehlberg78< State , Value , Deriv , Time , Algebra , Operations , Resize > > +{ + typedef runge_kutta_fehlberg78< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; + typedef controlled_runge_kutta< stepper_type > type; +}; + + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/make_controlled.hpp b/boost/numeric/odeint/stepper/generation/make_controlled.hpp new file mode 100644 index 00000000..16f191e1 --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/make_controlled.hpp @@ -0,0 +1,81 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/make_controlled.hpp + + [begin_description] + Factory function to simplify the creation of controlled steppers from error steppers. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED + + + + +namespace boost { +namespace numeric { +namespace odeint { + + + +// default template for the controller +template< class Stepper > struct get_controller { }; + + + +// default controller factory +template< class Stepper , class Controller > +struct controller_factory +{ + Controller operator()( + const typename Stepper::value_type &abs_error , + const typename Stepper::value_type &rel_error , + const Stepper &stepper ) + { + return Controller( abs_error , rel_error , stepper ); + } +}; + + + + +namespace result_of +{ + template< class Stepper > + struct make_controlled + { + typedef typename get_controller< Stepper >::type type; + }; +} + + +template< class Stepper > +typename result_of::make_controlled< Stepper >::type make_controlled( + const typename Stepper::value_type abs_error , + const typename Stepper::value_type rel_error , + const Stepper & stepper = Stepper() ) +{ + typedef Stepper stepper_type; + typedef typename result_of::make_controlled< stepper_type >::type controller_type; + typedef controller_factory< stepper_type , controller_type > factory_type; + factory_type factory; + return factory( abs_error , rel_error , stepper ); +} + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED diff --git a/boost/numeric/odeint/stepper/generation/make_dense_output.hpp b/boost/numeric/odeint/stepper/generation/make_dense_output.hpp new file mode 100644 index 00000000..f187560a --- /dev/null +++ b/boost/numeric/odeint/stepper/generation/make_dense_output.hpp @@ -0,0 +1,78 @@ +/* + [auto_generated] + boost/numeric/odeint/stepper/generation/make_dense_output.hpp + + [begin_description] + Factory function to simplify the creation of dense output steppers from error steppers. + [end_description] + + Copyright 2009-2011 Karsten Ahnert + Copyright 2009-2011 Mario Mulansky + + Distributed under 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_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED +#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED + +namespace boost { +namespace numeric { +namespace odeint { + + +// default template for the dense output +template< class Stepper > struct get_dense_output { }; + + + +// default dense output factory +template< class Stepper , class DenseOutput > +struct dense_output_factory +{ + DenseOutput operator()( + const typename Stepper::value_type &abs_error , + const typename Stepper::value_type &rel_error , + const Stepper &stepper ) + { + return DenseOutput( abs_error , rel_error , stepper ); + } +}; + + + +namespace result_of +{ + template< class Stepper > + struct make_dense_output + { + typedef typename get_dense_output< Stepper >::type type; + }; +} + + + +template< class Stepper > +typename result_of::make_dense_output< Stepper >::type make_dense_output( + const typename Stepper::value_type abs_error , + const typename Stepper::value_type rel_error , + const Stepper &stepper = Stepper() ) +{ + typedef Stepper stepper_type; + typedef typename result_of::make_dense_output< stepper_type >::type dense_output_type; + typedef dense_output_factory< stepper_type , dense_output_type > factory_type; + factory_type factory; + return factory( abs_error , rel_error , stepper ); +} + + + + +} // odeint +} // numeric +} // boost + + +#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED diff --git a/libs/numeric/odeint/test/Jamfile b/libs/numeric/odeint/test/Jamfile index e89169a7..b7ce30d7 100644 --- a/libs/numeric/odeint/test/Jamfile +++ b/libs/numeric/odeint/test/Jamfile @@ -40,5 +40,6 @@ test-suite "odeint" [ run integrate_times.cpp ] [ run integrate.cpp ] [ run integrate_implicit.cpp ] + [ run generation.cpp ] : valgrind ; \ No newline at end of file