Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81491 - in trunk: boost/numeric/odeint boost/numeric/odeint/algebra boost/numeric/odeint/algebra/detail boost/numeric/odeint/external boost/numeric/odeint/external/gsl boost/numeric/odeint/external/mkl boost/numeric/odeint/external/mtl4 boost/numeric/odeint/external/thrust boost/numeric/odeint/external/vexcl boost/numeric/odeint/external/viennacl boost/numeric/odeint/integrate boost/numeric/odeint/integrate/detail boost/numeric/odeint/iterator boost/numeric/odeint/iterator/detail boost/numeric/odeint/stepper boost/numeric/odeint/stepper/base boost/numeric/odeint/stepper/detail boost/numeric/odeint/stepper/generation boost/numeric/odeint/util boost/numeric/odeint/util/detail libs/numeric/odeint libs/numeric/odeint/doc libs/numeric/odeint/doc/concepts libs/numeric/odeint/doc/html libs/numeric/odeint/examples libs/numeric/odeint/examples/2d_lattice libs/numeric/odeint/examples/gmpxx libs/numeric/odeint/examples/mtl libs/numeric/odeint/examples/quadmath libs/numeric/odeint/examples/thrust libs/numeric/odeint/examples/ublas libs/numeric/odeint/examples/vexcl libs/numeric/odeint/performance libs/numeric/odeint/test libs/numeric/odeint/test/numeric libs/numeric/odeint/test_external libs/numeric/odeint/test_external/gmp libs/numeric/odeint/test_external/gsl libs/numeric/odeint/test_external/mkl libs/numeric/odeint/test_external/mtl4 libs/numeric/odeint/test_external/thrust libs/numeric/odeint/test_external/vexcl status
From: karsten.ahnert_at_[hidden]
Date: 2012-11-23 09:22:51


Author: karsten
Date: 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
New Revision: 81491
URL: http://svn.boost.org/trac/boost/changeset/81491

Log:
initial odeint commit
Added:
   trunk/boost/numeric/odeint/
   trunk/boost/numeric/odeint/algebra/
   trunk/boost/numeric/odeint/algebra/array_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/default_operations.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/detail/
   trunk/boost/numeric/odeint/algebra/detail/for_each.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/detail/macros.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/detail/reduce.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/fusion_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/range_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/algebra/vector_space_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/config.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/
   trunk/boost/numeric/odeint/external/gsl/
   trunk/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/mkl/
   trunk/boost/numeric/odeint/external/mkl/mkl_operations.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/mtl4/
   trunk/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/thrust/
   trunk/boost/numeric/odeint/external/thrust/thrust_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/thrust/thrust_operations.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/thrust/thrust_resize.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/vexcl/
   trunk/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/viennacl/
   trunk/boost/numeric/odeint/external/viennacl/viennacl_operations.hpp (contents, props changed)
   trunk/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/
   trunk/boost/numeric/odeint/integrate/detail/
   trunk/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/detail/integrate_const.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/detail/integrate_times.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/integrate.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/integrate_adaptive.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/integrate_const.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/integrate_n_steps.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/integrate_times.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/null_observer.hpp (contents, props changed)
   trunk/boost/numeric/odeint/integrate/observer_collection.hpp (contents, props changed)
   trunk/boost/numeric/odeint/iterator/
   trunk/boost/numeric/odeint/iterator/adaptive_iterator.hpp (contents, props changed)
   trunk/boost/numeric/odeint/iterator/adaptive_time_iterator.hpp (contents, props changed)
   trunk/boost/numeric/odeint/iterator/const_step_iterator.hpp (contents, props changed)
   trunk/boost/numeric/odeint/iterator/const_step_time_iterator.hpp (contents, props changed)
   trunk/boost/numeric/odeint/iterator/detail/
   trunk/boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/iterator/detail/ode_time_iterator_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/
   trunk/boost/numeric/odeint/stepper/adams_bashforth.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/adams_moulton.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/base/
   trunk/boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/bulirsch_stoer.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/controlled_step_result.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/
   trunk/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/euler.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/explicit_generic_rk.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/
   trunk/boost/numeric/odeint/stepper/generation.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/make_controlled.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/generation/make_dense_output.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/implicit_euler.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/modified_midpoint.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/rosenbrock4.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/runge_kutta4.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/stepper_categories.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/symplectic_euler.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp (contents, props changed)
   trunk/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/
   trunk/boost/numeric/odeint/util/bind.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/copy.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/detail/
   trunk/boost/numeric/odeint/util/detail/is_range.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/detail/less_with_sign.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/is_pair.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/is_resizeable.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/resize.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/resizer.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/same_instance.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/same_size.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/state_wrapper.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/ublas_wrapper.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/unit_helper.hpp (contents, props changed)
   trunk/boost/numeric/odeint/util/unwrap_reference.hpp (contents, props changed)
   trunk/boost/numeric/odeint/version.hpp (contents, props changed)
   trunk/libs/numeric/odeint/
   trunk/libs/numeric/odeint/doc/
   trunk/libs/numeric/odeint/doc/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/doc/acknowledgements.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/
   trunk/libs/numeric/odeint/doc/concepts.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/controlled_stepper.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/dense_output_stepper.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/error_stepper.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/implicit_system.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/state_algebra_operations.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/state_wrapper.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/stepper.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/symplectic_system.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/concepts/system.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/controlled_stepper_table.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_bind_member_functions.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_boost_range.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_boost_ref.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_generation_functions.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_integrate_functions.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_iterators.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_state_types_algebras_operations.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/details_steppers.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/examples_table.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/getting_started.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/html/
   trunk/libs/numeric/odeint/doc/html/logo.jpg (contents, props changed)
   trunk/libs/numeric/odeint/doc/html/phase_lattice_2d_0000.jpg (contents, props changed)
   trunk/libs/numeric/odeint/doc/html/phase_lattice_2d_0100.jpg (contents, props changed)
   trunk/libs/numeric/odeint/doc/html/phase_lattice_2d_1000.jpg (contents, props changed)
   trunk/libs/numeric/odeint/doc/html/solar_system.jpg (contents, props changed)
   trunk/libs/numeric/odeint/doc/literature.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/make_controlled_table.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/make_dense_output_table.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/odeint.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/range_table.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/stepper_table.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_chaotic_system.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_solar_system.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_special_topics.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_stiff_systems.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_thrust_cuda.qbk (contents, props changed)
   trunk/libs/numeric/odeint/doc/tutorial_vexcl_opencl.qbk (contents, props changed)
   trunk/libs/numeric/odeint/examples/
   trunk/libs/numeric/odeint/examples/2d_lattice/
   trunk/libs/numeric/odeint/examples/2d_lattice/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/examples/2d_lattice/lattice2d.hpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/2d_lattice/nested_range_algebra.hpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/2d_lattice/spreading.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/2d_lattice/vector_vector_resize.hpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/examples/adaptive_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/bind_member_functions.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/bind_member_functions_cpp11.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/bulirsch_stoer.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/chaotic_system.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/const_step_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/elliptic.py (contents, props changed)
   trunk/libs/numeric/odeint/examples/elliptic_functions.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/fpu.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/generation_functions.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/gmpxx/
   trunk/libs/numeric/odeint/examples/gmpxx/Jamfile (contents, props changed)
   trunk/libs/numeric/odeint/examples/gmpxx/lorenz_gmpxx.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/gram_schmidt.hpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/harmonic_oscillator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/harmonic_oscillator_units.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/heun.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/list_lattice.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/lorenz_point.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/mtl/
   trunk/libs/numeric/odeint/examples/mtl/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/examples/mtl/gauss_packet.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/mtl/implicit_euler_mtl.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/my_vector.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/point_type.hpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/quadmath/
   trunk/libs/numeric/odeint/examples/quadmath/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/examples/quadmath/black_hole.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/resizing_lattice.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/simple1d.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/solar_system.agr (contents, props changed)
   trunk/libs/numeric/odeint/examples/solar_system.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/stepper_details.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/stiff_system.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/stochastic_euler.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/stuart_landau.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/thrust/
   trunk/libs/numeric/odeint/examples/thrust/Makefile (contents, props changed)
   trunk/libs/numeric/odeint/examples/thrust/lorenz_parameters.cu (contents, props changed)
   trunk/libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu (contents, props changed)
   trunk/libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu (contents, props changed)
   trunk/libs/numeric/odeint/examples/thrust/relaxation.cu (contents, props changed)
   trunk/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/ublas/
   trunk/libs/numeric/odeint/examples/ublas/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/examples/ublas/lorenz_ublas.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/van_der_pol_stiff.cpp (contents, props changed)
   trunk/libs/numeric/odeint/examples/vexcl/
   trunk/libs/numeric/odeint/examples/vexcl/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/examples/vexcl/lorenz_ensemble.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/
   trunk/libs/numeric/odeint/performance/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/performance/const_step_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/fusion_algebra.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/fusion_explicit_error_rk.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/fusion_explicit_rk_new.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/generic_odeint_rk4_lorenz.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/gsl_rk4_lorenz.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/lorenz.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/lorenz_gsl.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/nr_rk4_lorenz.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/nr_rk4_phase_lattice.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/odeint_rk4_lorenz_array.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/odeint_rk4_lorenz_range.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/odeint_rk4_phase_lattice.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/odeint_rk4_phase_lattice_mkl.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/performance.py (contents, props changed)
   trunk/libs/numeric/odeint/performance/phase_lattice.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/phase_lattice_mkl.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/plot_result.py (contents, props changed)
   trunk/libs/numeric/odeint/performance/rk4_lorenz.f (contents, props changed)
   trunk/libs/numeric/odeint/performance/rk_performance_test_case.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/rt_algebra.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/rt_explicit_rk.hpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/rt_generic_rk4_lorenz.cpp (contents, props changed)
   trunk/libs/numeric/odeint/performance/rt_generic_rk4_phase_lattice.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/
   trunk/libs/numeric/odeint/test/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test/adams_bashforth.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/adams_bashforth_moulton.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/adams_moulton.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/adaptive_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/adaptive_time_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/boost_units_helpers.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test/bulirsch_stoer.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/const_range.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test/const_step_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/const_step_time_iterator.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/default_operations.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/diagnostic_state_type.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test/dummy_odes.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test/dummy_steppers.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test/euler_stepper.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/fusion_algebra.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/generation.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/generic_error_stepper.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/generic_stepper.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/implicit_euler.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/integrate.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/integrate_implicit.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/integrate_times.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/is_pair.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/is_resizeable.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/numeric/
   trunk/libs/numeric/odeint/test/numeric/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test/numeric/rosenbrock.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/numeric/runge_kutta.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/numeric/symplectic.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/prepare_stepper_testing.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test/range_algebra.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/resize.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/resizing.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/rosenbrock4.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/runge_kutta_concepts.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/runge_kutta_controlled_concepts.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/runge_kutta_error_concepts.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/same_size.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/stepper_copying.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/stepper_with_ranges.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/stepper_with_units.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/symplectic_steppers.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/trivial_state.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test/vector_space_1d.hpp (contents, props changed)
   trunk/libs/numeric/odeint/test_external/
   trunk/libs/numeric/odeint/test_external/gmp/
   trunk/libs/numeric/odeint/test_external/gmp/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test_external/gmp/check_gmp.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test_external/gsl/
   trunk/libs/numeric/odeint/test_external/gsl/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test_external/gsl/check_gsl.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test_external/mkl/
   trunk/libs/numeric/odeint/test_external/mkl/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test_external/mkl/check_mkl.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test_external/mtl4/
   trunk/libs/numeric/odeint/test_external/mtl4/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test_external/mtl4/mtl4_resize.cpp (contents, props changed)
   trunk/libs/numeric/odeint/test_external/thrust/
   trunk/libs/numeric/odeint/test_external/thrust/Makefile (contents, props changed)
   trunk/libs/numeric/odeint/test_external/thrust/check_thrust.cu (contents, props changed)
   trunk/libs/numeric/odeint/test_external/vexcl/
   trunk/libs/numeric/odeint/test_external/vexcl/Jamfile.v2 (contents, props changed)
   trunk/libs/numeric/odeint/test_external/vexcl/lorenz.cpp (contents, props changed)
Text files modified:
   trunk/status/Jamfile.v2 | 1 +
   1 files changed, 1 insertions(+), 0 deletions(-)

Added: trunk/boost/numeric/odeint/algebra/array_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/array_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,265 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/array_algebra.hpp
+
+ [begin_description]
+ Algebra for boost::array. Highly specialized for odeint. Const arguments are introduce to work with odeint.
+ [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_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED
+
+#include <boost/array.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+struct array_algebra
+{
+ template< typename T , size_t dim , class Op >
+ static void for_each1( boost::array< T , dim > &s1 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] );
+ }
+
+
+ template< typename T1 , typename T2 , size_t dim , class Op >
+ static void for_each2( boost::array< T1 , dim > &s1 ,
+ const boost::array< T2 , dim > &s2 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each3( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] );
+ }
+
+ /* different const signature - required for the scale_sum_swap2 operation */
+ template< typename T , size_t dim , class Op >
+ static void for_each3( boost::array< T , dim > &s1 ,
+ boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each4( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each5( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each6( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each7( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each8( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each9( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each10( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 ,
+ const boost::array< T , dim > &s10 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each11( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 ,
+ const boost::array< T , dim > &s10 ,
+ const boost::array< T , dim > &s11 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each12( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 ,
+ const boost::array< T , dim > &s10 ,
+ const boost::array< T , dim > &s11 ,
+ const boost::array< T , dim > &s12 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each13( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 ,
+ const boost::array< T , dim > &s10 ,
+ const boost::array< T , dim > &s11 ,
+ const boost::array< T , dim > &s12 ,
+ const boost::array< T , dim > &s13 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] , s13[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each14( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 ,
+ const boost::array< T , dim > &s10 ,
+ const boost::array< T , dim > &s11 ,
+ const boost::array< T , dim > &s12 ,
+ const boost::array< T , dim > &s13 ,
+ const boost::array< T , dim > &s14 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] , s13[i] , s14[i] );
+ }
+
+ template< typename T , size_t dim , class Op >
+ static void for_each15( boost::array< T , dim > &s1 ,
+ const boost::array< T , dim > &s2 ,
+ const boost::array< T , dim > &s3 ,
+ const boost::array< T , dim > &s4 ,
+ const boost::array< T , dim > &s5 ,
+ const boost::array< T , dim > &s6 ,
+ const boost::array< T , dim > &s7 ,
+ const boost::array< T , dim > &s8 ,
+ const boost::array< T , dim > &s9 ,
+ const boost::array< T , dim > &s10 ,
+ const boost::array< T , dim > &s11 ,
+ const boost::array< T , dim > &s12 ,
+ const boost::array< T , dim > &s13 ,
+ const boost::array< T , dim > &s14 ,
+ const boost::array< T , dim > &s15 , Op op )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] , s13[i] , s14[i] , s15[i] );
+ }
+
+
+ template< class Value , class T , size_t dim , class Red >
+ static Value reduce( const boost::array< T , dim > &s , Red red , Value init)
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ init = red( init , s[i] );
+ return init;
+ }
+
+};
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/algebra/default_operations.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/default_operations.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,602 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/default_operations.hpp
+
+ [begin_description]
+ Default operations. They work with the default numerical types, like float, double, complex< double> ...
+ [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_ALGEBRA_DEFAULT_OPERATIONS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_DEFAULT_OPERATIONS_HPP_INCLUDED
+
+#include <algorithm>
+
+#include <boost/config.hpp>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+/*
+ * Notes:
+ *
+ * * the results structs are needed in order to work with fusion_algebra
+ */
+struct default_operations
+{
+
+ template< class Fac1 = double >
+ struct scale
+ {
+ const Fac1 m_alpha1;
+
+ scale( Fac1 alpha1 ) : m_alpha1( alpha1 ) { }
+
+ template< class T1 >
+ void operator()( T1 &t1 ) const
+ {
+ t1 *= m_alpha1;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double >
+ struct scale_sum1
+ {
+ const Fac1 m_alpha1;
+
+ scale_sum1( Fac1 alpha1 ) : m_alpha1( alpha1 ) { }
+
+ template< class T1 , class T2 >
+ void operator()( T1 &t1 , const T2 &t2 ) const
+ {
+ t1 = m_alpha1 * t2;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 >
+ struct scale_sum2
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+
+ scale_sum2( Fac1 alpha1 , Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+ template< class T1 , class T2 , class T3 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 >
+ struct scale_sum3
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+
+ scale_sum3( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 >
+ struct scale_sum4
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+
+ scale_sum4( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 >
+ struct scale_sum5
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+
+ scale_sum5( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 >
+ struct scale_sum6
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+
+ scale_sum6( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 , Fac6 alpha6 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ){ }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 ,const T7 &t7) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 >
+ struct scale_sum7
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+
+ scale_sum7( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 >
+ struct scale_sum8
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+
+ scale_sum8( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 >
+ struct scale_sum9
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+ const Fac9 m_alpha9;
+
+ scale_sum9( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 >
+ struct scale_sum10
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+ const Fac9 m_alpha9;
+ const Fac10 m_alpha10;
+
+ scale_sum10( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , Fac10 alpha10 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11;
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 >
+ struct scale_sum11
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+ const Fac9 m_alpha9;
+ const Fac10 m_alpha10;
+ const Fac11 m_alpha11;
+
+ scale_sum11( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
+ Fac10 alpha10 , Fac11 alpha11 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 , class Fac12 = Fac11 >
+ struct scale_sum12
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+ const Fac9 m_alpha9;
+ const Fac10 m_alpha10;
+ const Fac11 m_alpha11;
+ const Fac12 m_alpha12;
+
+ scale_sum12( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
+ Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 , const T13 &t13 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 , class Fac12 = Fac11 , class Fac13 = Fac12 >
+ struct scale_sum13
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+ const Fac9 m_alpha9;
+ const Fac10 m_alpha10;
+ const Fac11 m_alpha11;
+ const Fac12 m_alpha12;
+ const Fac13 m_alpha13;
+
+ scale_sum13( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
+ Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 , Fac13 alpha13 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) , m_alpha13( alpha13 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 , const T13 &t13 , const T14 &t14 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13 + m_alpha13 * t14;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 , class Fac12 = Fac11 , class Fac13 = Fac12 , class Fac14 = Fac13 >
+ struct scale_sum14
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+ const Fac8 m_alpha8;
+ const Fac9 m_alpha9;
+ const Fac10 m_alpha10;
+ const Fac11 m_alpha11;
+ const Fac12 m_alpha12;
+ const Fac13 m_alpha13;
+ const Fac14 m_alpha14;
+
+ scale_sum14( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ,
+ Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ,
+ Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 , Fac13 alpha13 , Fac14 alpha14 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) , m_alpha13( alpha13 ) , m_alpha14( alpha14 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 , const T13 &t13 , const T14 &t14 , const T15 &t15 ) const
+ {
+ t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13 + m_alpha13 * t14 + m_alpha14 * t15;
+ }
+
+ typedef void result_type;
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 >
+ struct scale_sum_swap2
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+
+ scale_sum_swap2( Fac1 alpha1 , Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+ template< class T1 , class T2 , class T3 >
+ void operator()( T1 &t1 , T2 &t2 , const T3 &t3) const
+ {
+ const T1 tmp( t1 );
+ t1 = m_alpha1 * t2 + m_alpha2 * t3;
+ t2 = tmp;
+ }
+
+ typedef void result_type;
+ };
+
+ /*
+ * for usage in for_each2
+ *
+ * Works with boost::units by eliminating the unit
+ */
+ template< class Fac1 = double >
+ struct rel_error
+ {
+ const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
+
+ rel_error( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) { }
+
+
+ template< class T1 , class T2 , class T3 >
+ void operator()( T3 &t3 , const T1 &t1 , const T2 &t2 ) const
+ {
+ using std::abs;
+ set_unit_value( t3 , abs( get_unit_value( t3 ) ) / ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( t1 ) ) + m_a_dxdt * abs( get_unit_value( t2 ) ) ) ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+ /*
+ * for usage in for_each3
+ *
+ * used in the controller for the rosenbrock4 method
+ *
+ * Works with boost::units by eliminating the unit
+ */
+ template< class Fac1 = double >
+ struct default_rel_error
+ {
+ const Fac1 m_eps_abs , m_eps_rel ;
+
+ default_rel_error( Fac1 eps_abs , Fac1 eps_rel )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) { }
+
+
+ /*
+ * xerr = xerr / ( eps_abs + eps_rel * max( x , x_old ) )
+ */
+ template< class T1 , class T2 , class T3 >
+ void operator()( T3 &t3 , const T1 &t1 , const T2 &t2 ) const
+ {
+ BOOST_USING_STD_MAX();
+ using std::abs;
+ Fac1 x1 = abs( get_unit_value( t1 ) ) , x2 = abs( get_unit_value( t2 ) );
+ set_unit_value( t3 , abs( get_unit_value( t3 ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( x1 , x2 ) ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+
+ /*
+ * for usage in reduce
+ */
+
+ template< class Value >
+ struct maximum
+ {
+ template< class Fac1 , class Fac2 >
+ Value operator()( Fac1 t1 , const Fac2 t2 ) const
+ {
+ using std::abs;
+ Value a1 = abs( get_unit_value( t1 ) ) , a2 = abs( get_unit_value( t2 ) );
+ return ( a1 < a2 ) ? a2 : a1 ;
+ }
+
+ typedef Value result_type;
+ };
+
+
+
+
+
+ template< class Fac1 = double >
+ struct rel_error_max
+ {
+ const Fac1 m_eps_abs , m_eps_rel;
+
+ rel_error_max( Fac1 eps_abs , Fac1 eps_rel )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel )
+ { }
+
+ template< class Res , class T1 , class T2 , class T3 >
+ Res operator()( Res r , const T1 &x_old , const T2 &x , const T3 &x_err )
+ {
+ BOOST_USING_STD_MAX();
+ using std::abs;
+ Res tmp = abs( get_unit_value( x_err ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( x_old ) , abs( x ) ) );
+ return max BOOST_PREVENT_MACRO_SUBSTITUTION ( r , tmp );
+ }
+ };
+
+
+ template< class Fac1 = double >
+ struct rel_error_max2
+ {
+ const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
+
+ rel_error_max2( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt )
+ { }
+
+ template< class Res , class T1 , class T2 , class T3 , class T4 >
+ Res operator()( Res r , const T1 &x_old , const T2 &x , const T3 &dxdt_old , const T4 &x_err )
+ {
+ BOOST_USING_STD_MAX();
+ using std::abs;
+ Res tmp = abs( get_unit_value( x_err ) ) /
+ ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( x_old ) ) + m_a_dxdt * abs( get_unit_value( dxdt_old ) ) ) );
+ return max BOOST_PREVENT_MACRO_SUBSTITUTION ( r , tmp );
+ }
+ };
+
+
+
+
+ template< class Fac1 = double >
+ struct rel_error_l2
+ {
+ const Fac1 m_eps_abs , m_eps_rel;
+
+ rel_error_l2( Fac1 eps_abs , Fac1 eps_rel )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel )
+ { }
+
+ template< class Res , class T1 , class T2 , class T3 >
+ Res operator()( Res r , const T1 &x_old , const T2 &x , const T3 &x_err )
+ {
+ BOOST_USING_STD_MAX();
+ using std::abs;
+ Res tmp = abs( get_unit_value( x_err ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( x_old ) , abs( x ) ) );
+ return r + tmp * tmp;
+ }
+ };
+
+
+
+
+ template< class Fac1 = double >
+ struct rel_error_l2_2
+ {
+ const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
+
+ rel_error_l2_2( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt )
+ { }
+
+ template< class Res , class T1 , class T2 , class T3 , class T4 >
+ Res operator()( Res r , const T1 &x_old , const T2 &x , const T3 &dxdt_old , const T4 &x_err )
+ {
+ using std::abs;
+ Res tmp = abs( get_unit_value( x_err ) ) /
+ ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( x_old ) ) + m_a_dxdt * abs( get_unit_value( dxdt_old ) ) ) );
+ return r + tmp * tmp;
+ }
+ };
+
+
+
+
+
+
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DEFAULT_OPERATIONS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/algebra/detail/for_each.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/detail/for_each.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,165 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/detail/for_each.hpp
+
+ [begin_description]
+ Default for_each implementations.
+ [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_ALGEBRA_DETAIL_FOR_EACH_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_FOR_EACH_HPP_INCLUDED
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+
+ template< class Iterator1 , class Operation >
+ inline void for_each1( Iterator1 first1 , Iterator1 last1 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ );
+ }
+
+
+ template< class Iterator1 , class Iterator2 , class Operation >
+ inline void for_each2( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ );
+ }
+
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Operation >
+ inline void for_each3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ );
+ }
+
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Operation >
+ inline void for_each4( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Iterator4 first4, Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ );
+ }
+
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Operation >
+ inline void for_each5( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ );
+ }
+
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Operation >
+ inline void for_each6( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ );
+ }
+
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Operation >
+ inline void for_each7( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Operation >
+ inline void for_each8( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Operation >
+ inline void for_each9( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Operation >
+ inline void for_each10( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Iterator10 first10 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Operation >
+ inline void for_each11( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Operation >
+ inline void for_each12( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Iterator13 , class Operation >
+ inline void for_each13( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Iterator13 first13 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Iterator13 , class Iterator14 , class Operation >
+ inline void for_each14( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Iterator13 first13 ,
+ Iterator14 first14 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ , *first14++ );
+ }
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Iterator13 , class Iterator14 , class Iterator15 , class Operation >
+ inline void for_each15( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3,
+ Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 ,
+ Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Iterator13 first13 ,
+ Iterator14 first14 , Iterator15 first15 , Operation op )
+ {
+ for( ; first1 != last1 ; )
+ op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ , *first14++ , *first15++ );
+ }
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_FOR_EACH_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/algebra/detail/macros.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/detail/macros.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,43 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/detail/macros.hpp
+
+ [begin_description]
+ Some macros for type checking.
+ [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_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED
+
+
+//type traits aren't working with nvcc
+#ifndef __CUDACC__
+#include <boost/type_traits.hpp>
+#include <boost/static_assert.hpp>
+
+#define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 ) \
+ BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< Type1 >::type , Type2 >::value ))
+
+#else
+//empty macro for nvcc
+#define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 )
+
+#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

Added: trunk/boost/numeric/odeint/algebra/detail/reduce.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/detail/reduce.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,67 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/detail/reduce.hpp
+
+ [begin_description]
+ Default reduce 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_ALGEBRA_DETAIL_REDUCE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_REDUCE_HPP_INCLUDED
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class ValueType , class Iterator1 , class Reduction >
+inline ValueType reduce( Iterator1 first1 , Iterator1 last1 , Reduction red, ValueType init)
+{
+ for( ; first1 != last1 ; )
+ init = red( init , *first1++ );
+ return init;
+}
+
+
+template< class ValueType , class Iterator1 , class Iterator2 , class Reduction >
+inline ValueType reduce2( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Reduction red, ValueType init)
+{
+ for( ; first1 != last1 ; )
+ init = red( init , *first1++ , *first2++ );
+ return init;
+}
+
+template< class ValueType , class Iterator1 , class Iterator2 , class Iterator3 , class Reduction >
+inline ValueType reduce3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3 , Reduction red, ValueType init)
+{
+ for( ; first1 != last1 ; )
+ init = red( init , *first1++ , *first2++ , *first3++ );
+ return init;
+}
+
+template< class ValueType , class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Reduction >
+inline ValueType reduce4( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3 , Iterator4 first4 , Reduction red, ValueType init)
+{
+ for( ; first1 != last1 ; )
+ init = red( init , *first1++ , *first2++ , *first3++ , *first4++ );
+ return init;
+}
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_REDUCE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/algebra/fusion_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/fusion_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,186 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/fusion_algebra.hpp
+
+ [begin_description]
+ Algebra for boost::fusion sequences.
+ [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_ALGEBRA_FUSION_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_HPP_INCLUDED
+
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/view/zip_view.hpp>
+#include <boost/fusion/functional/generation/make_fused.hpp>
+#include <boost/fusion/algorithm/iteration/accumulate.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+struct fusion_algebra
+{
+ template< class S1 , class Op >
+ static void for_each1( S1 &s1 , Op op )
+ {
+ boost::fusion::for_each( s1 , op );
+ };
+
+
+ template< class S1 , class S2 , class Op >
+ static void for_each2( S1 &s1 , S2 &s2 , Op op )
+ {
+ typedef boost::fusion::vector< S1& , S2& > Sequences;
+ Sequences sequences( s1 , s2 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) );
+ }
+
+
+ template< class S1 , class S2 , class S3 , class Op >
+ static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
+ {
+ typedef boost::fusion::vector< S1& , S2& , S3& > Sequences;
+ Sequences sequences( s1 , s2 , s3 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class Op >
+ static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op )
+ {
+ typedef boost::fusion::vector< S1& , S2& , S3& , S4& > Sequences;
+ Sequences sequences( s1 , s2 , s3 , s4 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) );
+ }
+
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
+ static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op )
+ {
+ typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& > Sequences;
+ Sequences sequences( s1 , s2 , s3 , s4 , s5 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) );
+ }
+
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
+ static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op )
+ {
+ typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& > Sequences;
+ Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) );
+ }
+
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class Op >
+ static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op )
+ {
+ typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& > Sequences;
+ Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) );
+ }
+
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ 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!" );
+ 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 ) );
+ }
+
+ template< class Value , class S , class Reduction >
+ static Value reduce( const S &s , Reduction red , Value init)
+ {
+ return boost::fusion::accumulate( s , init , red );
+ }
+};
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/algebra/range_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/range_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,159 @@
+/*
+ [auto_generated]
+ 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.
+ Internally is uses boost::range to obtain the begin and end iterator of the according sequence.
+ [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_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED
+
+#include <boost/range.hpp>
+#include <boost/mpl/size_t.hpp>
+
+#include <boost/numeric/odeint/algebra/detail/macros.hpp>
+#include <boost/numeric/odeint/algebra/detail/for_each.hpp>
+#include <boost/numeric/odeint/algebra/detail/reduce.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+struct range_algebra
+{
+ template< class S1 , class Op >
+ static void for_each1( S1 &s1 , Op op )
+ {
+ detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) ,
+ op );
+ }
+
+ template< class S1 , class S2 , class Op >
+ static void for_each2( S1 &s1 , S2 &s2 , Op op )
+ {
+ detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) ,
+ boost::begin( s2 ) , op );
+ }
+
+ template< class S1 , class S2 , class S3 , class Op >
+ static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
+ {
+ detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class Op >
+ static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op )
+ {
+ detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , op );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
+ static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op )
+ {
+ detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , op );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
+ static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op )
+ {
+ detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , op );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op >
+ static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op )
+ {
+ detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each9( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each10( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each11( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each12( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each13( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each14( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , boost::begin( s14 ) , op );
+ }
+
+ 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 )
+ {
+ detail::for_each15( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , boost::begin( s14 ) , boost::begin( s15 ) , op );
+ }
+
+ template< class Value , class S , class Red >
+ static Value reduce( const S &s , Red red , Value init)
+ {
+ return detail::reduce( boost::begin( s ) , boost::end( s ) , red , init );
+ }
+
+ template< class Value , class S1 , class S2 , class Red >
+ static Value reduce2( const S1 &s1 , const S2 &s2 , Red red , Value init )
+ {
+ return detail::reduce2( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , red , init );
+ }
+
+ template< class Value , class S1 , class S2 , class S3 , class Red >
+ static Value reduce3( const S1 &s1 , const S2 &s2 , const S3 &s3 , Red red , Value init )
+ {
+ return detail::reduce3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , red , init );
+ }
+
+ template< class Value , class S1 , class S2 , class S3 , class S4 , class Red >
+ static Value reduce4( const S1 &s1 , const S2 &s2 , const S3 &s3 , const S4 &s4 , Red red , Value init )
+ {
+ return detail::reduce4( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , red , init );
+ }
+
+
+};
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/algebra/vector_space_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/algebra/vector_space_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,156 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/algebra/vector_space_algebra.hpp
+
+ [begin_description]
+ An algebra for types which have vector space semantics, hence types on which the operators +,-,* are well defined.
+ [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_ALGEBRA_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ALGEBRA_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED
+
+#include <boost/type_traits/remove_reference.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * This class template has to be overload in order to call vector_space_algebra::reduce
+ */
+template< class State > struct vector_space_reduce;
+
+/*
+ * Example: instantiation for sole doubles
+ */
+template<>
+struct vector_space_reduce< double >
+{
+ template< class Op >
+ double operator()( double x , Op op , double init ) const
+ {
+ init = op( init , x );
+ return init;
+ }
+};
+
+
+struct vector_space_algebra
+{
+ template< class S1 , class Op >
+ static void for_each1( S1 &s1 , Op op )
+ {
+ // ToDo : build checks, that the +-*/ operators are well defined
+ op( s1 );
+ }
+
+ template< class S1 , class S2 , class Op >
+ static void for_each2( S1 &s1 , S2 &s2 , Op op )
+ {
+ op( s1 , s2 );
+ }
+
+ template< class S1 , class S2 , class S3 , class Op >
+ static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
+ {
+ op( s1 , s2 , s3 );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class Op >
+ static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op )
+ {
+ op( s1 , s2 , s3 , s4 );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
+ static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op )
+ {
+ op( s1 , s2 , s3 , s4 , s5 );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
+ static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 );
+ }
+
+ template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op >
+ static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 );
+ }
+
+ 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 )
+ {
+ op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 , s15 );
+ }
+
+ template< class Value , class S , class Red >
+ static Value reduce( const S &s , Red red , Value init )
+ {
+ boost::numeric::odeint::vector_space_reduce< S > r;
+ return r( s , red , init );
+ }
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/config.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/config.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,47 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/config.hpp
+
+ [begin_description]
+ Sets configurations for odeint and used libraries. Should be included before any other odeint library
+ [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_CONFIG_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED
+
+//increase macro variable to allow rk78 scheme
+#ifndef FUSION_MAX_VECTOR_SIZE
+#define FUSION_MAX_VECTOR_SIZE 15
+#endif
+
+/*
+ * the following definitions are only required if fusion vectors are used as state types
+ * in the rk78 scheme
+ * they should be defined by the user if required, see e.g. libs/numeric/examples/harmonic_oscillator_units.cpp
+ */
+#ifndef BOOST_FUSION_INVOKE_MAX_ARITY
+#define BOOST_FUSION_INVOKE_MAX_ARITY 15
+#endif
+
+#ifndef BOOST_RESULT_OF_NUM_ARGS
+#define BOOST_RESULT_OF_NUM_ARGS 15
+#endif
+/*
+ */
+
+#include <boost/config.hpp>
+
+#if __cplusplus >= 201103L
+#define BOOST_NUMERIC_ODEINT_CXX11 1
+#endif
+
+
+#endif // BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,229 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/gsl/gsl_wrapper.hpp
+
+ [begin_description]
+ Wrapper for gsl_vector.
+ [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_EXTERNAL_GSL_GSL_WRAPPER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_GSL_GSL_WRAPPER_HPP_INCLUDED
+
+#include <new>
+
+#include <gsl/gsl_vector.h>
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/range.hpp>
+#include <boost/iterator/iterator_facade.hpp>
+
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/copy.hpp>
+
+class const_gsl_vector_iterator;
+
+/*
+ * defines an iterator for gsl_vector
+ */
+class gsl_vector_iterator : public boost::iterator_facade< gsl_vector_iterator , double , boost::random_access_traversal_tag >
+{
+public :
+
+ gsl_vector_iterator( void ): m_p(0) , m_stride( 0 ) { }
+ explicit gsl_vector_iterator( gsl_vector *p ) : m_p( p->data ) , m_stride( p->stride ) { }
+ friend gsl_vector_iterator end_iterator( gsl_vector * );
+
+private :
+
+ friend class boost::iterator_core_access;
+ friend class const_gsl_vector_iterator;
+
+ void increment( void ) { m_p += m_stride; }
+ void decrement( void ) { m_p -= m_stride; }
+ void advance( ptrdiff_t n ) { m_p += n*m_stride; }
+ bool equal( const gsl_vector_iterator &other ) const { return this->m_p == other.m_p; }
+ bool equal( const const_gsl_vector_iterator &other ) const;
+ double& dereference( void ) const { return *m_p; }
+
+ double *m_p;
+ size_t m_stride;
+};
+
+
+
+/*
+ * defines an const iterator for gsl_vector
+ */
+class const_gsl_vector_iterator : public boost::iterator_facade< const_gsl_vector_iterator , const double , boost::random_access_traversal_tag >
+{
+public :
+
+ const_gsl_vector_iterator( void ): m_p(0) , m_stride( 0 ) { }
+ explicit const_gsl_vector_iterator( const gsl_vector *p ) : m_p( p->data ) , m_stride( p->stride ) { }
+ const_gsl_vector_iterator( const gsl_vector_iterator &p ) : m_p( p.m_p ) , m_stride( p.m_stride ) { }
+
+private :
+
+ friend class boost::iterator_core_access;
+ friend class gsl_vector_iterator;
+ friend const_gsl_vector_iterator end_iterator( const gsl_vector * );
+
+ void increment( void ) { m_p += m_stride; }
+ void decrement( void ) { m_p -= m_stride; }
+ void advance( ptrdiff_t n ) { m_p += n*m_stride; }
+ bool equal( const const_gsl_vector_iterator &other ) const { return this->m_p == other.m_p; }
+ bool equal( const gsl_vector_iterator &other ) const { return this->m_p == other.m_p; }
+ const double& dereference( void ) const { return *m_p; }
+
+ const double *m_p;
+ size_t m_stride;
+};
+
+
+bool gsl_vector_iterator::equal( const const_gsl_vector_iterator &other ) const { return this->m_p == other.m_p; }
+
+
+gsl_vector_iterator end_iterator( gsl_vector *x )
+{
+ gsl_vector_iterator iter( x );
+ iter.m_p += iter.m_stride * x->size;
+ return iter;
+}
+
+const_gsl_vector_iterator end_iterator( const gsl_vector *x )
+{
+ const_gsl_vector_iterator iter( x );
+ iter.m_p += iter.m_stride * x->size;
+ return iter;
+}
+
+
+
+
+namespace boost
+{
+template<>
+struct range_mutable_iterator< gsl_vector* >
+{
+ typedef gsl_vector_iterator type;
+};
+
+template<>
+struct range_const_iterator< gsl_vector* >
+{
+ typedef const_gsl_vector_iterator type;
+};
+} // namespace boost
+
+
+
+
+// template<>
+inline gsl_vector_iterator range_begin( gsl_vector *x )
+{
+ return gsl_vector_iterator( x );
+}
+
+// template<>
+inline const_gsl_vector_iterator range_begin( const gsl_vector *x )
+{
+ return const_gsl_vector_iterator( x );
+}
+
+// template<>
+inline gsl_vector_iterator range_end( gsl_vector *x )
+{
+ return end_iterator( x );
+}
+
+// template<>
+inline const_gsl_vector_iterator range_end( const gsl_vector *x )
+{
+ return end_iterator( x );
+}
+
+
+
+
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+template<>
+struct is_resizeable< gsl_vector* >
+{
+ //struct type : public boost::true_type { };
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+template <>
+struct same_size_impl< gsl_vector* , gsl_vector* >
+{
+ static bool same_size( const gsl_vector* x , const gsl_vector* y )
+ {
+ return x->size == y->size;
+ }
+};
+
+template <>
+struct resize_impl< gsl_vector* , gsl_vector* >
+{
+ static void resize( gsl_vector* x , const gsl_vector* y )
+ {
+ gsl_vector_free( x );
+ x = gsl_vector_alloc( y->size );
+ }
+};
+
+template<>
+struct state_wrapper< gsl_vector* >
+{
+ typedef double value_type;
+ typedef gsl_vector* state_type;
+ typedef state_wrapper< gsl_vector* > state_wrapper_type;
+
+ state_type m_v;
+
+ state_wrapper( )
+ {
+ m_v = gsl_vector_alloc( 1 );
+ }
+
+ state_wrapper( const state_wrapper_type &x )
+ {
+ resize( m_v , x.m_v );
+ gsl_vector_memcpy( m_v , x.m_v );
+ }
+
+
+ ~state_wrapper()
+ {
+ gsl_vector_free( m_v );
+ }
+
+};
+
+} // odeint
+} // numeric
+} // boost
+
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_GSL_GSL_WRAPPER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/mkl/mkl_operations.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/mkl/mkl_operations.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,181 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/mkl/mkl_operations.hpp
+
+ [begin_description]
+ Wrapper classes for intel math kernel library types.
+ Get a free, non-commercial download of MKL at
+ http://software.intel.com/en-us/articles/non-commercial-software-download/
+ [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_EXTERNAL_MKL_MKL_OPERATIONS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_MKL_MKL_OPERATIONS_HPP_INCLUDED
+
+#include <iostream>
+
+#include <mkl_cblas.h>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+/* exemplary example for writing bindings to the Intel MKL library
+ * see test/mkl for how to use mkl with odeint
+ * this is a quick and dirty implementation showing the general possibility.
+ * It works only with containers based on double and sequentiel memory allocation.
+ */
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/* only defined for doubles */
+struct mkl_operations
+{
+ //template< class Fac1 , class Fac2 > struct scale_sum2;
+
+ template< class F1 = double , class F2 = F1 >
+ struct scale_sum2
+ {
+ typedef double Fac1;
+ typedef double Fac2;
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+
+ scale_sum2( const Fac1 alpha1 , const Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+ template< class T1 , class T2 , class T3 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3) const
+ { // t1 = m_alpha1 * t2 + m_alpha2 * t3;
+ // we get Containers that have size() and [i]-access
+
+ const int n = t1.size();
+ //boost::numeric::odeint::copy( t1 , t3 );
+ if( &(t2[0]) != &(t1[0]) )
+ {
+ cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 );
+ }
+ cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 );
+ //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one );
+ }
+ };
+
+ template< class F1 = double , class F2 = F1 , class F3 = F2 >
+ struct scale_sum3
+ {
+ typedef double Fac1;
+ typedef double Fac2;
+ typedef double Fac3;
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+
+ scale_sum3( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 ) const
+ { // t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4;
+ // we get Containers that have size() and [i]-access
+
+ const int n = t1.size();
+ //boost::numeric::odeint::copy( t1 , t3 );
+ if( &(t2[0]) != &(t1[0]) )
+ {
+ cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 );
+ }
+ cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 );
+ //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one );
+ cblas_daxpy( n , m_alpha3 , &(t4[0]) , 1 , &(t1[0]) , 1 );
+ }
+ };
+
+ template< class F1 = double , class F2 = F1 , class F3 = F2 , class F4 = F3 >
+ struct scale_sum4
+ {
+ typedef double Fac1;
+ typedef double Fac2;
+ typedef double Fac3;
+ typedef double Fac4;
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+
+ scale_sum4( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , const Fac4 alpha4 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 ) const
+ { // t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5;
+ // we get Containers that have size() and [i]-access
+
+ const int n = t1.size();
+ //boost::numeric::odeint::copy( t1 , t3 );
+ if( &(t2[0]) != &(t1[0]) )
+ {
+ cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 );
+ }
+
+ cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 );
+ //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one );
+ cblas_daxpy( n , m_alpha3 , &(t4[0]) , 1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha4 , &(t5[0]) , 1 , &(t1[0]) , 1 );
+ }
+ };
+
+
+ template< class F1 = double , class F2 = F1 , class F3 = F2 , class F4 = F3 , class F5 = F4 >
+ struct scale_sum5
+ {
+ typedef double Fac1;
+ typedef double Fac2;
+ typedef double Fac3;
+ typedef double Fac4;
+ typedef double Fac5;
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+
+ scale_sum5( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , const Fac4 alpha4 , const Fac5 alpha5 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
+ void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 ) const
+ { // t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6;
+ // we get Containers that have size() and [i]-access
+
+ const int n = t1.size();
+ //boost::numeric::odeint::copy( t1 , t3 );
+ if( &(t2[0]) != &(t1[0]) )
+ {
+ cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 );
+ }
+
+ cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 );
+ //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one );
+ cblas_daxpy( n , m_alpha3 , &(t4[0]) , 1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha4 , &(t5[0]) , 1 , &(t1[0]) , 1 );
+ cblas_daxpy( n , m_alpha5 , &(t6[0]) , 1 , &(t1[0]) , 1 );
+ }
+ };
+
+};
+
+} // odeint
+} // numeric
+} // boost
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_MKL_MKL_OPERATIONS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,162 @@
+/*
+[begin_description]
+Modification of the implicit Euler method, works with the MTL4 matrix library only.
+[end_description]
+
+Copyright 2009-2011 Karsten Ahnert
+Copyright 2009-2011 Mario Mulansky
+Copyright 2012 Andreas Angelopoulos
+
+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_EXTERNAL_IMPLICIT_EULER_MTL4_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_IMPLICIT_EULER_MTL4_HPP_INCLUDED
+
+
+#include <utility>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/external/mtl4/mtl4_resize.hpp>
+
+#include <boost/numeric/mtl/mtl.hpp>
+#include <boost/numeric/itl/itl.hpp>
+
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+template< class ValueType , class Resizer = initially_resizer >
+class implicit_euler_mtl4
+{
+
+public:
+
+ typedef ValueType value_type;
+ typedef value_type time_type;
+ typedef mtl::dense_vector<value_type> state_type;
+
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_type deriv_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef mtl::compressed2D< value_type > matrix_type;
+ typedef state_wrapper< matrix_type > wrapped_matrix_type;
+
+ typedef Resizer resizer_type;
+ typedef stepper_tag stepper_category;
+
+ typedef implicit_euler_mtl4< ValueType , Resizer > stepper_type;
+
+
+ implicit_euler_mtl4( const value_type epsilon = 1E-6 )
+ : m_epsilon( epsilon ) , m_resizer() ,
+ m_dxdt() , m_x() ,
+ m_identity() , m_jacobi()
+ { }
+
+
+ template< class System >
+ void do_step( System system , state_type &x , time_type t , time_type dt )
+ {
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ typedef typename odeint::unwrap_reference< typename system_type::first_type >::type deriv_func_type;
+ typedef typename odeint::unwrap_reference< typename system_type::second_type >::type jacobi_func_type;
+ system_type &sys = system;
+ deriv_func_type &deriv_func = sys.first;
+ jacobi_func_type &jacobi_func = sys.second;
+
+ m_resizer.adjust_size( x , detail::bind(
+ &stepper_type::template resize_impl< state_type > , detail::ref( *this ) , detail::_1 ) );
+
+ m_identity.m_v = 1;
+
+ t += dt;
+ m_x.m_v = x;
+
+ deriv_func( x , m_dxdt.m_v , t );
+ jacobi_func( x , m_jacobi.m_v , t );
+
+
+ m_dxdt.m_v *= -dt;
+
+ m_jacobi.m_v *= dt;
+ m_jacobi.m_v -= m_identity.m_v ;
+
+
+
+ // using ilu_0 preconditioning -incomplete LU factorisation
+ // itl::pc::diagonal<matrix_type,double> L(m_jacobi.m_v);
+ itl::pc::ilu_0<matrix_type> L( m_jacobi.m_v );
+
+ solve( m_jacobi.m_v , m_x.m_v , m_dxdt.m_v , L );
+ x+= m_x.m_v;
+
+
+ }
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ }
+
+
+private:
+
+
+ /*
+ Applying approximate iteractive linear solvers
+ default solver is Biconjugate gradient stabilized method
+ itl::bicgstab(A, x, b, L, iter);
+ */
+ template < class LinearOperator, class HilbertSpaceX, class HilbertSpaceB, class Preconditioner>
+ void solve(const LinearOperator& A, HilbertSpaceX& x, const HilbertSpaceB& b,
+ const Preconditioner& L, int max_iteractions =500)
+ {
+ // Termination criterion: r < 1e-6 * b or N iterations
+ itl::basic_iteration< double > iter( b , max_iteractions , 1e-6 );
+ itl::bicgstab( A , x , b , L , iter );
+
+ }
+
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_identity , x , typename is_resizeable<matrix_type>::type() );
+ resized |= adjust_size_by_resizeability( m_jacobi , x , typename is_resizeable<matrix_type>::type() );
+ return resized;
+ }
+
+
+private:
+
+ value_type m_epsilon;
+ resizer_type m_resizer;
+ wrapped_deriv_type m_dxdt;
+ wrapped_state_type m_x;
+ wrapped_matrix_type m_identity;
+ wrapped_matrix_type m_jacobi;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_IMPLICIT_EULER_MTL4_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,133 @@
+/*
+[begin_description]
+Modification of the implicit Euler method, works with the MTL4 matrix library only.
+[end_description]
+
+Copyright 2009-2011 Karsten Ahnert
+Copyright 2009-2011 Mario Mulansky
+Copyright 2012 Andreas Angelopoulos
+
+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_EXTERNAL_MTL4_RESIZE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_RESIZE_HPP_INCLUDED
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resize.hpp>
+#include <boost/numeric/odeint/util/same_size.hpp>
+
+#include <boost/numeric/mtl/vector/dense_vector.hpp>
+#include <boost/numeric/mtl/matrix/dense2D.hpp>
+#include <boost/numeric/mtl/matrix/compressed2D.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+template< class Value , class Parameters >
+struct is_resizeable< mtl::dense_vector< Value , Parameters > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+template< class Value , class Parameters >
+struct is_resizeable< mtl::dense2D< Value , Parameters > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+template< class Value , class Parameters >
+struct is_resizeable< mtl::compressed2D< Value , Parameters > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+
+
+
+template< class Value , class Parameters >
+struct same_size_impl< mtl::dense_vector< Value , Parameters > , mtl::dense_vector< Value , Parameters > >
+{
+ static bool same_size( const mtl::dense_vector< Value , Parameters > &v1 ,
+ const mtl::dense_vector< Value , Parameters > &v2 )
+ {
+ return mtl::size( v1 ) == mtl::size( v2 );
+ }
+};
+
+template< class Value , class Parameters >
+struct resize_impl< mtl::dense_vector< Value , Parameters > , mtl::dense_vector< Value , Parameters > >
+{
+ static void resize( mtl::dense_vector< Value , Parameters > &v1 ,
+ const mtl::dense_vector< Value , Parameters > &v2 )
+ {
+ v1.change_dim( mtl::size( v2 ) );
+ }
+};
+
+
+
+template< class Value , class MatrixParameters , class VectorParameters >
+struct same_size_impl< mtl::dense2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > >
+{
+ static bool same_size( const mtl::dense2D< Value , MatrixParameters > &m ,
+ const mtl::dense_vector< Value , VectorParameters > &v )
+ {
+ return ( ( mtl::size( v ) == m.num_cols() ) && ( mtl::size( v ) == m.num_rows() ) );
+ }
+};
+
+template< class Value , class MatrixParameters , class VectorParameters >
+struct resize_impl< mtl::dense2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > >
+{
+ static void resize( mtl::dense2D< Value , MatrixParameters > &m ,
+ const mtl::dense_vector< Value , VectorParameters > &v )
+ {
+ m.change_dim( mtl::size( v ) , mtl::size( v ) , false );
+ }
+};
+
+
+
+
+template< class Value , class MatrixParameters , class VectorParameters >
+struct same_size_impl< mtl::compressed2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > >
+{
+ static bool same_size( const mtl::compressed2D< Value , MatrixParameters > &m ,
+ const mtl::dense_vector< Value , VectorParameters > &v )
+ {
+ return ( ( mtl::size( v ) == m.num_cols() ) && ( mtl::size( v ) == m.num_rows() ) );
+ }
+};
+
+template< class Value , class MatrixParameters , class VectorParameters >
+struct resize_impl< mtl::compressed2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > >
+{
+ static void resize( mtl::compressed2D< Value , MatrixParameters > &m ,
+ const mtl::dense_vector< Value , VectorParameters > &v )
+ {
+ m.change_dim( mtl::size( v ) , mtl::size( v ) );
+ }
+};
+
+
+
+
+
+
+
+
+} // namespace odeint
+} // namesapce numeric
+} // namespace boost
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_RESIZE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/thrust/thrust_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/thrust/thrust_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,198 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/thrust/thrust_algebra.hpp
+
+ [begin_description]
+ An algebra for thrusts device_vectors.
+ [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_EXTERNAL_THRUST_THRUST_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_HPP_INCLUDED
+
+
+#include <thrust/device_vector.h>
+#include <thrust/for_each.h>
+#include <thrust/iterator/zip_iterator.h>
+
+#include <boost/range.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+/** ToDO extend until for_each14 for rk78 */
+
+/*
+ * The const versions are needed for boost.range to work, i.e.
+ * it allows you to do
+ * for_each1( make_pair( vec1.begin() , vec1.begin() + 10 ) , op );
+ */
+
+struct thrust_algebra
+{
+ template< class StateType , class Operation >
+ static void for_each1( StateType &s , Operation op )
+ {
+ thrust::for_each( boost::begin(s) , boost::begin(s) , op );
+ }
+
+ template< class StateType1 , class StateType2 , class Operation >
+ static void for_each2( StateType1 &s1 , StateType2 &s2 , Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ) ) ,
+ op);
+ }
+
+ template< class StateType1 , class StateType2 , class StateType3 , class Operation >
+ static void for_each3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ,
+ boost::begin(s3) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ,
+ boost::end(s3) ) ) ,
+ op);
+ }
+
+ template< class StateType1 , class StateType2 , class StateType3 , class StateType4 ,
+ class Operation >
+ static void for_each4( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 ,
+ Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ,
+ boost::begin(s3) ,
+ boost::begin(s4) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ,
+ boost::end(s3) ,
+ boost::end(s4) ) ) ,
+ op);
+ }
+
+ template< class StateType1 , class StateType2 , class StateType3 ,
+ class StateType4 , class StateType5 ,class Operation >
+ static void for_each5( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 ,
+ StateType5 &s5 , Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ,
+ boost::begin(s3) ,
+ boost::begin(s4) ,
+ boost::begin(s5) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ,
+ boost::end(s3) ,
+ boost::end(s4) ,
+ boost::end(s5) ) ) ,
+ op);
+ }
+
+ template< class StateType1 , class StateType2 , class StateType3 ,
+ class StateType4 , class StateType5 , class StateType6 , class Operation >
+ static void for_each6( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 ,
+ StateType5 &s5 , StateType6 &s6 , Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ,
+ boost::begin(s3) ,
+ boost::begin(s4) ,
+ boost::begin(s5) ,
+ boost::begin(s6) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ,
+ boost::end(s3) ,
+ boost::end(s4) ,
+ boost::end(s5) ,
+ boost::end(s6) ) ) ,
+ op);
+ }
+
+ template< class StateType1 , class StateType2 , class StateType3 , class StateType4 ,
+ class StateType5 , class StateType6 , class StateType7 , class Operation >
+ static void for_each7( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 ,
+ StateType5 &s5 , StateType6 &s6 , StateType7 &s7 , Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ,
+ boost::begin(s3) ,
+ boost::begin(s4) ,
+ boost::begin(s5) ,
+ boost::begin(s6) ,
+ boost::begin(s7) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ,
+ boost::end(s3) ,
+ boost::end(s4) ,
+ boost::end(s5) ,
+ boost::end(s6) ,
+ boost::end(s7) ) ) ,
+ op);
+ }
+
+ template< class StateType1 , class StateType2 , class StateType3 , class StateType4 ,
+ class StateType5 , class StateType6 , class StateType7 , class StateType8 , class Operation >
+ static void for_each8( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 ,
+ StateType5 &s5 , StateType6 &s6 , StateType7 &s7 , StateType8 &s8 , Operation op )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) ,
+ boost::begin(s2) ,
+ boost::begin(s3) ,
+ boost::begin(s4) ,
+ boost::begin(s5) ,
+ boost::begin(s6) ,
+ boost::begin(s7) ,
+ boost::begin(s8) ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) ,
+ boost::end(s2) ,
+ boost::end(s3) ,
+ boost::end(s4) ,
+ boost::end(s5) ,
+ boost::end(s6) ,
+ boost::end(s7) ,
+ boost::end(s8) ) ) ,
+ op);
+ }
+
+
+ template< class Value , class S , class Red >
+ Value reduce( const S &s , Red red , Value init)
+ {
+ return thrust::reduce( boost::begin( s ) , boost::end( s ) , init , red );
+ }
+
+
+
+
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/thrust/thrust_operations.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/thrust/thrust_operations.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,252 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/thrust/thrust_operations.hpp
+
+ [begin_description]
+ Operations of thrust zipped iterators. Is the counterpart of the thrust_algebra.
+ [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_EXTERNAL_THRUST_THRUST_OPERATIONS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_HPP_INCLUDED
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+#include <thrust/tuple.h>
+#include <thrust/iterator/zip_iterator.h>
+
+/**ToDo extend to scale_sum13 for rk78 */
+
+struct thrust_operations
+{
+ template< class Fac1 = double , class Fac2 = Fac1 >
+ struct scale_sum2
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+
+ scale_sum2( const Fac1 alpha1 , const Fac2 alpha2 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + m_alpha2 * thrust::get<2>(t);
+ }
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 >
+ struct scale_sum_swap2
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+
+ scale_sum_swap2( const Fac1 alpha1 , const Fac2 alpha2 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ typename thrust::tuple_element<0,Tuple>::type tmp = thrust::get<0>(t);
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + m_alpha2 * thrust::get<2>(t);
+ thrust::get<1>(t) = tmp;
+ }
+ };
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 >
+ struct scale_sum3
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+
+ scale_sum3( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) +
+ m_alpha2 * thrust::get<2>(t) +
+ m_alpha3 * thrust::get<3>(t);
+ }
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 >
+ struct scale_sum4
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+
+ scale_sum4( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , const Fac4 alpha4 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ){ }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) +
+ m_alpha2 * thrust::get<2>(t) +
+ m_alpha3 * thrust::get<3>(t) +
+ m_alpha4 * thrust::get<4>(t);
+ }
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 ,
+ class Fac4 = Fac3 , class Fac5 = Fac4 >
+ struct scale_sum5
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+
+ scale_sum5( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 ,
+ const Fac4 alpha4 , const Fac5 alpha5 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) ,
+ m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) +
+ m_alpha2 * thrust::get<2>(t) +
+ m_alpha3 * thrust::get<3>(t) +
+ m_alpha4 * thrust::get<4>(t) +
+ m_alpha5 * thrust::get<5>(t);
+ }
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 ,
+ class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 >
+ struct scale_sum6
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+
+ scale_sum6( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 ,
+ const Fac4 alpha4 , const Fac5 alpha5 , const Fac6 alpha6 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) ,
+ m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) +
+ m_alpha2 * thrust::get<2>(t) +
+ m_alpha3 * thrust::get<3>(t) +
+ m_alpha4 * thrust::get<4>(t) +
+ m_alpha5 * thrust::get<5>(t) +
+ m_alpha6 * thrust::get<6>(t);
+ }
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 ,
+ class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 >
+ struct scale_sum7
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+ const Fac6 m_alpha6;
+ const Fac7 m_alpha7;
+
+ scale_sum7( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 ,
+ const Fac4 alpha4 , const Fac5 alpha5 , const Fac6 alpha6 , const Fac7 alpha7 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) ,
+ m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) +
+ m_alpha2 * thrust::get<2>(t) +
+ m_alpha3 * thrust::get<3>(t) +
+ m_alpha4 * thrust::get<4>(t) +
+ m_alpha5 * thrust::get<5>(t) +
+ m_alpha6 * thrust::get<6>(t) +
+ m_alpha7 * thrust::get<7>(t) ;
+ }
+ };
+
+
+
+
+ template< class Fac1 = double >
+ struct rel_error
+ {
+ const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt;
+
+ rel_error( const Fac1 eps_abs , const Fac1 eps_rel , const Fac1 a_x , const Fac1 a_dxdt )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) { }
+
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) const
+ {
+ using std::abs;
+ thrust::get< 0 >( t ) = abs( thrust::get< 0 >( t ) ) /
+ ( m_eps_abs + m_eps_rel * ( m_a_x * abs( thrust::get< 1 >( t ) + m_a_dxdt * abs( thrust::get< 2 >( t ) ) ) ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+ /*
+ * for usage in reduce
+ */
+
+ template< class Value >
+ struct maximum
+ {
+ template< class Fac1 , class Fac2 >
+ __host__ __device__
+ Value operator()( const Fac1 t1 , const Fac2 t2 ) const
+ {
+ using std::max;
+ return ( abs( t1 ) < abs( t2 ) ) ? t2 : t1 ;
+ }
+
+ typedef Value result_type;
+ };
+
+
+};
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/thrust/thrust_resize.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/thrust/thrust_resize.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,119 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/thrust/thrust_resize.hpp
+
+ [begin_description]
+ Enable resizing for thrusts device and host_vector.
+ [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_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED
+
+
+#include <thrust/device_vector.h>
+#include <thrust/host_vector.h>
+
+#include <boost/numeric/odeint/util/copy.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class T >
+struct is_resizeable< thrust::device_vector< T > >
+{
+ struct type : public boost::true_type { };
+ const static bool value = type::value;
+};
+
+template< class T >
+struct same_size_impl< thrust::device_vector< T > , thrust::device_vector< T > >
+{
+ static bool same_size( const thrust::device_vector< T > &x , const thrust::device_vector< T > &y )
+ {
+ return x.size() == y.size();
+ }
+};
+
+template< class T >
+struct resize_impl< thrust::device_vector< T > , thrust::device_vector< T > >
+{
+ static void resize( thrust::device_vector< T > &x , const thrust::device_vector< T > &y )
+ {
+ x.resize( y.size() );
+ }
+};
+
+
+template< class T >
+struct is_resizeable< thrust::host_vector< T > >
+{
+ struct type : public boost::true_type { };
+ const static bool value = type::value;
+};
+
+template< class T >
+struct same_size_impl< thrust::host_vector< T > , thrust::host_vector< T > >
+{
+ static bool same_size( const thrust::host_vector< T > &x , const thrust::host_vector< T > &y )
+ {
+ return x.size() == y.size();
+ }
+};
+
+template< class T >
+struct resize_impl< thrust::host_vector< T > , thrust::host_vector< T > >
+{
+ static void resize( thrust::host_vector< T > &x , const thrust::host_vector< T > &y )
+ {
+ x.resize( y.size() );
+ }
+};
+
+
+
+template< class Container1, class Value >
+struct copy_impl< Container1 , thrust::device_vector< Value > >
+{
+ static void copy( const Container1 &from , thrust::device_vector< Value > &to )
+ {
+ thrust::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
+ }
+};
+
+template< class Value , class Container2 >
+struct copy_impl< thrust::device_vector< Value > , Container2 >
+{
+ static void copy( const thrust::device_vector< Value > &from , Container2 &to )
+ {
+ thrust::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
+ }
+};
+
+template< class Value >
+struct copy_impl< thrust::device_vector< Value > , thrust::device_vector< Value > >
+{
+ static void copy( const thrust::device_vector< Value > &from , thrust::device_vector< Value > &to )
+ {
+ thrust::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) );
+ }
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,92 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/vexcl/vexcl_resize.hpp
+
+ [begin_description]
+ Enable resizing for vexcl vector and multivector.
+ [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_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
+
+#include <vexcl/vector.hpp>
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resize.hpp>
+#include <boost/numeric/odeint/util/same_size.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+/*
+ * specializations for vex::vector< T >
+ */
+template< typename T >
+struct is_resizeable< vex::vector< T > > : boost::true_type { };
+
+template< typename T >
+struct resize_impl< vex::vector< T > , vex::vector< T > >
+{
+ static void resize( vex::vector< T > &x1 , const vex::vector< T > &x2 )
+ {
+ x1.resize( x2.queue_list() , x2.size() );
+ }
+};
+
+template< typename T >
+struct same_size_impl< vex::vector< T > , vex::vector< T > >
+{
+ static bool same_size( const vex::vector< T > &x1 , const vex::vector< T > &x2 )
+ {
+ return x1.size() == x2.size();
+ }
+};
+
+
+
+
+
+/*
+ * specializations for vex::multivector< T >
+ */
+template< typename T , uint N >
+struct is_resizeable< vex::multivector< T , N > > : boost::true_type { };
+
+template< typename T , uint N >
+struct resize_impl< vex::multivector< T , N > , vex::multivector< T , N > >
+{
+ static void resize( vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
+ {
+ x1.resize( x2.queue_list() , x2.size() );
+ }
+};
+
+template< typename T , uint N >
+struct same_size_impl< vex::multivector< T , N > , vex::multivector< T , N > >
+{
+ static bool same_size( const vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 )
+ {
+ return x1.size() == x2.size();
+ }
+};
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/viennacl/viennacl_operations.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/viennacl/viennacl_operations.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,245 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/viennacl_operations.hpp
+
+ [begin_description]
+ ViennaCL operations.
+ [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_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED
+
+#include <viennacl/vector.hpp>
+#include <viennacl/generator/custom_operation.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+struct viennacl_operations
+{
+
+ template< class Fac1 = double , class Fac2 = Fac1 >
+ struct scale_sum2
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+
+ scale_sum2( Fac1 alpha1 , Fac2 alpha2 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 )
+ { }
+
+ template< class T1 , class T2 , class T3 >
+ void operator()( viennacl::vector<T1> &v1 ,
+ const viennacl::vector<T2> &v2 ,
+ const viennacl::vector<T3> &v3
+ ) const
+ {
+ using namespace viennacl;
+
+ static generator::symbolic_vector <0, T1> sym_v1;
+ static generator::symbolic_vector <1, T2> sym_v2;
+ static generator::symbolic_vector <2, T3> sym_v3;
+ static generator::cpu_symbolic_scalar<3, Fac1> sym_a1;
+ static generator::cpu_symbolic_scalar<4, Fac2> sym_a2;
+
+ static generator::custom_operation op(
+ sym_v1 = sym_a1 * sym_v2
+ + sym_a2 * sym_v3
+ );
+
+ ocl::enqueue( op(v1,
+ const_cast< viennacl::vector<T2>& >(v2),
+ const_cast< viennacl::vector<T3>& >(v3),
+ const_cast< Fac1& >(m_alpha1),
+ const_cast< Fac2& >(m_alpha2)
+ ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 >
+ struct scale_sum3
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+
+ scale_sum3( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 )
+ { }
+
+ template< class T1 , class T2 , class T3 , class T4 >
+ void operator()( viennacl::vector<T1> &v1 ,
+ const viennacl::vector<T2> &v2 ,
+ const viennacl::vector<T3> &v3 ,
+ const viennacl::vector<T4> &v4
+ ) const
+ {
+ using namespace viennacl;
+
+ static generator::symbolic_vector <0, T1> sym_v1;
+ static generator::symbolic_vector <1, T2> sym_v2;
+ static generator::symbolic_vector <2, T3> sym_v3;
+ static generator::symbolic_vector <3, T4> sym_v4;
+ static generator::cpu_symbolic_scalar<4, Fac1> sym_a1;
+ static generator::cpu_symbolic_scalar<5, Fac2> sym_a2;
+ static generator::cpu_symbolic_scalar<6, Fac3> sym_a3;
+
+ static generator::custom_operation op(
+ sym_v1 = sym_a1 * sym_v2
+ + sym_a2 * sym_v3
+ + sym_a3 * sym_v4
+ );
+
+ ocl::enqueue( op(v1,
+ const_cast< viennacl::vector<T2>& >(v2),
+ const_cast< viennacl::vector<T3>& >(v3),
+ const_cast< viennacl::vector<T4>& >(v4),
+ const_cast< Fac1& >(m_alpha1),
+ const_cast< Fac2& >(m_alpha2),
+ const_cast< Fac3& >(m_alpha3)
+ ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 >
+ struct scale_sum4
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+
+ scale_sum4( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 >
+ void operator()( viennacl::vector<T1> &v1 ,
+ const viennacl::vector<T2> &v2 ,
+ const viennacl::vector<T3> &v3 ,
+ const viennacl::vector<T4> &v4 ,
+ const viennacl::vector<T5> &v5
+ ) const
+ {
+ using namespace viennacl;
+
+ static generator::symbolic_vector <0, T1> sym_v1;
+ static generator::symbolic_vector <1, T2> sym_v2;
+ static generator::symbolic_vector <2, T3> sym_v3;
+ static generator::symbolic_vector <3, T4> sym_v4;
+ static generator::symbolic_vector <4, T5> sym_v5;
+ static generator::cpu_symbolic_scalar<5, Fac1> sym_a1;
+ static generator::cpu_symbolic_scalar<6, Fac2> sym_a2;
+ static generator::cpu_symbolic_scalar<7, Fac3> sym_a3;
+ static generator::cpu_symbolic_scalar<8, Fac4> sym_a4;
+
+ static generator::custom_operation op(
+ sym_v1 = sym_a1 * sym_v2
+ + sym_a2 * sym_v3
+ + sym_a3 * sym_v4
+ + sym_a4 * sym_v5
+ );
+
+ ocl::enqueue( op(v1,
+ const_cast< viennacl::vector<T2>& >(v2),
+ const_cast< viennacl::vector<T3>& >(v3),
+ const_cast< viennacl::vector<T4>& >(v4),
+ const_cast< viennacl::vector<T5>& >(v5),
+ const_cast< Fac1& >(m_alpha1),
+ const_cast< Fac2& >(m_alpha2),
+ const_cast< Fac3& >(m_alpha3),
+ const_cast< Fac4& >(m_alpha4)
+ ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+ template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 >
+ struct scale_sum5
+ {
+ const Fac1 m_alpha1;
+ const Fac2 m_alpha2;
+ const Fac3 m_alpha3;
+ const Fac4 m_alpha4;
+ const Fac5 m_alpha5;
+
+ scale_sum5( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 )
+ : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
+
+ template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
+ void operator()( viennacl::vector<T1> &v1 ,
+ const viennacl::vector<T2> &v2 ,
+ const viennacl::vector<T3> &v3 ,
+ const viennacl::vector<T4> &v4 ,
+ const viennacl::vector<T5> &v5 ,
+ const viennacl::vector<T6> &v6
+ ) const
+ {
+ using namespace viennacl;
+
+ static generator::symbolic_vector < 0, T1> sym_v1;
+ static generator::symbolic_vector < 1, T2> sym_v2;
+ static generator::symbolic_vector < 2, T3> sym_v3;
+ static generator::symbolic_vector < 3, T4> sym_v4;
+ static generator::symbolic_vector < 4, T5> sym_v5;
+ static generator::symbolic_vector < 5, T6> sym_v6;
+ static generator::cpu_symbolic_scalar< 6, Fac1> sym_a1;
+ static generator::cpu_symbolic_scalar< 7, Fac2> sym_a2;
+ static generator::cpu_symbolic_scalar< 8, Fac3> sym_a3;
+ static generator::cpu_symbolic_scalar< 9, Fac4> sym_a4;
+ static generator::cpu_symbolic_scalar<10, Fac5> sym_a5;
+
+ static generator::custom_operation op(
+ sym_v1 = sym_a1 * sym_v2
+ + sym_a2 * sym_v3
+ + sym_a3 * sym_v4
+ + sym_a4 * sym_v5
+ + sym_a5 * sym_v6
+ );
+
+ ocl::enqueue( op(v1,
+ const_cast< viennacl::vector<T2>& >(v2),
+ const_cast< viennacl::vector<T3>& >(v3),
+ const_cast< viennacl::vector<T4>& >(v4),
+ const_cast< viennacl::vector<T5>& >(v5),
+ const_cast< viennacl::vector<T6>& >(v6),
+ const_cast< Fac1& >(m_alpha1),
+ const_cast< Fac2& >(m_alpha2),
+ const_cast< Fac3& >(m_alpha3),
+ const_cast< Fac4& >(m_alpha4),
+ const_cast< Fac5& >(m_alpha5)
+ ) );
+ }
+
+ typedef void result_type;
+ };
+
+
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,65 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/external/viennacl/viennacl_resize.hpp
+
+ [begin_description]
+ Enable resizing for viennacl vector.
+ [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_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
+
+#include <viennacl/vector.hpp>
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resize.hpp>
+#include <boost/numeric/odeint/util/same_size.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+/*
+ * specializations for viennacl::vector< T >
+ */
+template< typename T >
+struct is_resizeable< viennacl::vector< T > > : boost::true_type { };
+
+template< typename T >
+struct resize_impl< viennacl::vector< T > , viennacl::vector< T > >
+{
+ static void resize( viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
+ {
+ x1.resize( x2.size() , false );
+ }
+};
+
+template< typename T >
+struct same_size_impl< viennacl::vector< T > , viennacl::vector< T > >
+{
+ static bool same_size( const viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 )
+ {
+ return x1.size() == x2.size();
+ }
+};
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,154 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp
+
+ [begin_description]
+ Default Integrate adaptive 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_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED
+
+#include <stdexcept>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp>
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/util/copy.hpp>
+
+#include <boost/numeric/odeint/util/detail/less_with_sign.hpp>
+
+
+#include <iostream>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+// forward declaration
+template< class Stepper , class System , class State , class Time , class Observer>
+Time integrate_n_steps(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps ,
+ Observer observer , stepper_tag );
+
+/*
+ * integrate_adaptive for simple stepper is basically an integrate_const + some last step
+ */
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer , stepper_tag
+)
+{
+ size_t steps = static_cast< size_t >( (end_time-start_time)/dt );
+ Time end = detail::integrate_n_steps( stepper , system , start_state , start_time ,
+ dt , steps , observer , stepper_tag() );
+ if( less_with_sign( end , end_time , dt ) )
+ { //make a last step to end exactly at end_time
+ stepper.do_step( system , start_state , end , end_time - end );
+ steps++;
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+ obs( start_state , end_time );
+ }
+ return steps;
+}
+
+
+/*
+ * classical integrate adpative
+ */
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time &start_time , Time end_time , Time &dt ,
+ Observer observer , controlled_stepper_tag
+)
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ const size_t max_attempts = 1000;
+ const char *error_string = "Integrate adaptive : Maximal number of iterations reached. A step size could not be found.";
+ size_t count = 0;
+ while( less_with_sign( start_time , end_time , dt ) )
+ {
+ obs( start_state , start_time );
+ if( less_with_sign( end_time , start_time + dt , dt ) )
+ {
+ dt = end_time - start_time;
+ }
+
+ size_t trials = 0;
+ controlled_step_result res = success;
+ do
+ {
+ res = stepper.try_step( system , start_state , start_time , dt );
+ ++trials;
+ }
+ while( ( res == fail ) && ( trials < max_attempts ) );
+ if( trials == max_attempts ) throw std::overflow_error( error_string );
+
+ ++count;
+ }
+ obs( start_state , start_time );
+ return count;
+}
+
+
+/*
+ * integrate adaptive for dense output steppers
+ *
+ * step size control is used if the stepper supports it
+ */
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer , dense_output_stepper_tag )
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ size_t count = 0;
+ stepper.initialize( start_state , start_time , dt );
+
+ while( less_with_sign( stepper.current_time() , end_time , stepper.current_time_step() ) )
+ {
+ while( less_eq_with_sign( stepper.current_time() + stepper.current_time_step() ,
+ end_time ,
+ stepper.current_time_step() ) )
+ { //make sure we don't go beyond the end_time
+ obs( stepper.current_state() , stepper.current_time() );
+ stepper.do_step( system );
+ ++count;
+ }
+ stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
+ }
+ obs( stepper.current_state() , stepper.current_time() );
+ // overwrite start_state with the final point
+ boost::numeric::odeint::copy( stepper.current_state() , start_state );
+ return count;
+}
+
+
+
+
+} // namespace detail
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/detail/integrate_const.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/detail/integrate_const.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,159 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/detail/integrate_const.hpp
+
+ [begin_description]
+ integrate const implementation
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED
+
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
+
+#include <boost/numeric/odeint/util/detail/less_with_sign.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+// forward declaration
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time &start_time , Time end_time , Time &dt ,
+ Observer observer , controlled_stepper_tag
+);
+
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer , stepper_tag
+)
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ Time time = start_time;
+ int step = 0;
+
+ while( less_eq_with_sign( time+dt , end_time , dt ) )
+ {
+ obs( start_state , time );
+ stepper.do_step( system , start_state , time , dt );
+ // direct computation of the time avoids error propagation happening when using time += dt
+ // we need clumsy type analysis to get boost units working here
+ ++step;
+ time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * dt;
+ }
+ obs( start_state , time );
+
+ return step;
+}
+
+
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer , controlled_stepper_tag
+)
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ Time time = start_time;
+ const Time time_step = dt;
+ int step = 0;
+
+ while( less_eq_with_sign( time+time_step , end_time , dt ) )
+ {
+ obs( start_state , time );
+ detail::integrate_adaptive( stepper , system , start_state , time , time+time_step , dt ,
+ null_observer() , controlled_stepper_tag() );
+ // direct computation of the time avoids error propagation happening when using time += dt
+ // we need clumsy type analysis to get boost units working here
+ ++step;
+ time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * time_step;
+ }
+ obs( start_state , time );
+
+ return step;
+}
+
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer , dense_output_stepper_tag
+)
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ Time time = start_time;
+
+ stepper.initialize( start_state , time , dt );
+ obs( start_state , time );
+ time += dt;
+
+ int obs_step( 1 );
+ int real_step( 0 );
+
+ while( less_with_sign( time+dt , end_time , dt ) )
+ {
+ while( less_eq_with_sign( time , stepper.current_time() , dt ) )
+ {
+ stepper.calc_state( time , start_state );
+ obs( start_state , time );
+ ++obs_step;
+ // direct computation of the time avoids error propagation happening when using time += dt
+ // we need clumsy type analysis to get boost units working here
+ time = start_time + static_cast< typename unit_value_type<Time>::type >(obs_step) * dt;
+ }
+ // we have not reached the end, do another real step
+ if( less_with_sign( stepper.current_time()+stepper.current_time_step() ,
+ end_time ,
+ stepper.current_time_step() ) )
+ {
+ while( less_eq_with_sign( stepper.current_time() , time , dt ) )
+ {
+ stepper.do_step( system );
+ ++real_step;
+ }
+ }
+ else if( less_with_sign( stepper.current_time() , end_time , stepper.current_time_step() ) )
+ { // do the last step ending exactly on the end point
+ stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
+ stepper.do_step( system );
+ ++real_step;
+ }
+
+ }
+ // last observation, if we are still in observation interval
+ if( less_eq_with_sign( time , end_time , dt ) )
+ {
+ stepper.calc_state( time , start_state );
+ obs( start_state , time );
+ }
+
+ return real_step;
+}
+
+
+} } } }
+
+#endif

Added: trunk/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,156 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp
+
+ [begin_description]
+ integrate steps implementation
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED
+
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+
+#include <boost/numeric/odeint/util/detail/less_with_sign.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+// forward declaration
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time &start_time , Time end_time , Time &dt ,
+ Observer observer , controlled_stepper_tag
+);
+
+
+/* basic version */
+template< class Stepper , class System , class State , class Time , class Observer>
+Time integrate_n_steps(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps ,
+ Observer observer , stepper_tag )
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ Time time = start_time;
+
+ for( size_t step = 0; step < num_of_steps ; ++step )
+ {
+ obs( start_state , time );
+ stepper.do_step( system , start_state , time , dt );
+ // direct computation of the time avoids error propagation happening when using time += dt
+ // we need clumsy type analysis to get boost units working here
+ time = start_time + static_cast< typename unit_value_type<Time>::type >( step+1 ) * dt;
+ }
+ obs( start_state , time );
+
+ return time;
+}
+
+
+/* controlled version */
+template< class Stepper , class System , class State , class Time , class Observer>
+Time integrate_n_steps(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps ,
+ Observer observer , controlled_stepper_tag )
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ Time time = start_time;
+ Time time_step = dt;
+
+ for( size_t step = 0; step < num_of_steps ; ++step )
+ {
+ obs( start_state , time );
+ detail::integrate_adaptive( stepper , system , start_state , time , time+time_step , dt ,
+ null_observer() , controlled_stepper_tag() );
+ // direct computation of the time avoids error propagation happening when using time += dt
+ // we need clumsy type analysis to get boost units working here
+ time = start_time + static_cast< typename unit_value_type<Time>::type >(step+1) * time_step;
+ }
+ obs( start_state , time );
+
+ return time;
+}
+
+
+/* dense output version */
+template< class Stepper , class System , class State , class Time , class Observer>
+Time integrate_n_steps(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps ,
+ Observer observer , dense_output_stepper_tag )
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ Time time = start_time;
+ const Time end_time = start_time + static_cast< typename unit_value_type<Time>::type >(num_of_steps) * dt;
+
+ stepper.initialize( start_state , time , dt );
+
+ size_t step = 0;
+
+ while( step < num_of_steps )
+ {
+ while( less_with_sign( time , stepper.current_time() , stepper.current_time_step() ) )
+ {
+ stepper.calc_state( time , start_state );
+ obs( start_state , time );
+ ++step;
+ // direct computation of the time avoids error propagation happening when using time += dt
+ // we need clumsy type analysis to get boost units working here
+ time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * dt;
+ }
+
+ // we have not reached the end, do another real step
+ if( less_with_sign( stepper.current_time()+stepper.current_time_step() ,
+ end_time ,
+ stepper.current_time_step() ) )
+ {
+ stepper.do_step( system );
+ }
+ else if( less_with_sign( stepper.current_time() , end_time , stepper.current_time_step() ) )
+ { // do the last step ending exactly on the end point
+ stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
+ stepper.do_step( system );
+ }
+ }
+
+ while( stepper.current_time() < end_time )
+ {
+ if( less_with_sign( end_time ,
+ stepper.current_time()+stepper.current_time_step() ,
+ stepper.current_time_step() ) )
+ stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() );
+ stepper.do_step( system );
+ }
+
+ // observation at end point, only if we ended exactly on the end-point (or above due to finite precision)
+ obs( stepper.current_state() , end_time );
+
+ return time;
+}
+
+
+}
+}
+}
+}
+
+#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED */

Added: trunk/boost/numeric/odeint/integrate/detail/integrate_times.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/detail/integrate_times.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,166 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/detail/integrate_times.hpp
+
+ [begin_description]
+ Default integrate times implementation.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_INTEGRATE_DETAIL_INTEGRATE_TIMES_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_TIMES_HPP_INCLUDED
+
+#include <stdexcept>
+
+#include <boost/config.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/util/detail/less_with_sign.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+
+
+/*
+ * integrate_times for simple stepper
+ */
+template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , State &start_state ,
+ TimeIterator start_time , TimeIterator end_time , Time dt ,
+ Observer observer , stepper_tag
+)
+{
+ BOOST_USING_STD_MIN();
+
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ size_t steps = 0;
+ Time current_dt = dt;
+ while( true )
+ {
+ Time current_time = *start_time++;
+ obs( start_state , current_time );
+ if( start_time == end_time )
+ break;
+ while( less_with_sign( current_time , *start_time , current_dt ) )
+ {
+ current_dt = min BOOST_PREVENT_MACRO_SUBSTITUTION ( dt , *start_time - current_time );
+ stepper.do_step( system , start_state , current_time , current_dt );
+ current_time += current_dt;
+ steps++;
+ }
+ }
+ return steps;
+}
+
+/*
+ * integrate_times for controlled stepper
+ */
+template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , State &start_state ,
+ TimeIterator start_time , TimeIterator end_time , Time dt ,
+ Observer observer , controlled_stepper_tag
+)
+{
+ BOOST_USING_STD_MIN();
+
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+ const size_t max_attempts = 1000;
+ const char *error_string = "Integrate adaptive : Maximal number of iterations reached. A step size could not be found.";
+ size_t steps = 0;
+ while( true )
+ {
+ size_t fail_steps = 0;
+ Time current_time = *start_time++;
+ obs( start_state , current_time );
+ if( start_time == end_time )
+ break;
+ while( less_with_sign( current_time , *start_time , dt ) )
+ {
+ dt = min BOOST_PREVENT_MACRO_SUBSTITUTION ( dt , *start_time - current_time );
+ if( stepper.try_step( system , start_state , current_time , dt ) == success )
+ {
+ ++steps;
+ }
+ else
+ {
+ ++fail_steps;
+ }
+ if( fail_steps == max_attempts ) throw std::overflow_error( error_string );
+ }
+ }
+ return steps;
+}
+
+/*
+ * integrate_times for dense output stepper
+ */
+template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , State &start_state ,
+ TimeIterator start_time , TimeIterator end_time , Time dt ,
+ Observer observer , dense_output_stepper_tag
+)
+{
+ typename odeint::unwrap_reference< Observer >::type &obs = observer;
+
+
+ if( start_time == end_time )
+ return 0;
+
+ Time last_time_point = *(end_time-1);
+
+ stepper.initialize( start_state , *start_time , dt );
+ obs( start_state , *start_time++ );
+
+ size_t count = 0;
+ while( start_time != end_time )
+ {
+ while( ( start_time != end_time ) && less_eq_with_sign( *start_time , stepper.current_time() , stepper.current_time_step() ) )
+ {
+ stepper.calc_state( *start_time , start_state );
+ obs( start_state , *start_time );
+ start_time++;
+ }
+
+ // we have not reached the end, do another real step
+ if( less_eq_with_sign( stepper.current_time() + stepper.current_time_step() ,
+ last_time_point ,
+ stepper.current_time_step() ) )
+ {
+ stepper.do_step( system );
+ ++count;
+ }
+ else if( start_time != end_time )
+ { // do the last step ending exactly on the end point
+ stepper.initialize( stepper.current_state() , stepper.current_time() , last_time_point - stepper.current_time() );
+ stepper.do_step( system );
+ ++count;
+ }
+ }
+ return count;
+}
+
+
+} // namespace detail
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/integrate.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/integrate.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,82 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/integrate.hpp
+
+ [begin_description]
+ Convenience methods which choose the stepper for the current ODE.
+ [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_INTEGRATE_INTEGRATE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED
+
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/integrate/null_observer.hpp>
+#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp>
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * ToDo :
+ *
+ * determine type of dxdt for units
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class System , class State , class Time , class Observer >
+size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer )
+{
+ return integrate_adaptive( controlled_runge_kutta< runge_kutta_dopri5< State > >() , system , start_state , start_time , end_time , dt , observer );
+}
+
+template< class System , class State , class Time , class Observer >
+size_t integrate( System system , const State &start_state , Time start_time , Time end_time , Time dt , Observer observer )
+{
+ return integrate_adaptive( controlled_runge_kutta< runge_kutta_dopri5< State > >() , system , start_state , start_time , end_time , dt , observer );
+}
+
+
+
+
+
+
+
+/*
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class System , class State , class Time >
+size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt )
+{
+ return integrate( system , start_state , start_time , end_time , dt , null_observer() );
+}
+
+template< class System , class State , class Time >
+size_t integrate( System system , const State &start_state , Time start_time , Time end_time , Time dt )
+{
+ return integrate( system , start_state , start_time , end_time , dt , null_observer() );
+}
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/integrate_adaptive.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/integrate_adaptive.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,95 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/integrate_adaptive.hpp
+
+ [begin_description]
+ Adaptive integration of ODEs.
+ [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_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/null_observer.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer )
+{
+ return detail::integrate_adaptive(
+ stepper , system , start_state ,
+ start_time , end_time , dt ,
+ observer , typename Stepper::stepper_category() );
+
+ /*
+ * Suggestion for a new extendable version:
+ *
+ * integrator_adaptive< Stepper , System, State , Time , Observer , typename Stepper::stepper_category > integrator;
+ * return integrator.run( stepper , system , start_state , start_time , end_time , dt , observer );
+ */
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_adaptive(
+ Stepper stepper , System system , const State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer )
+{
+ return detail::integrate_adaptive(
+ stepper , system , start_state ,
+ start_time , end_time , dt ,
+ observer , typename Stepper::stepper_category() );
+}
+
+
+
+
+/*
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class Stepper , class System , class State , class Time >
+size_t integrate_adaptive(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt )
+{
+ return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() );
+}
+
+template< class Stepper , class System , class State , class Time >
+size_t integrate_adaptive(
+ Stepper stepper , System system , const State &start_state ,
+ Time start_time , Time end_time , Time dt )
+{
+ return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() );
+}
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/integrate_const.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/integrate_const.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,124 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/integrate_const.hpp
+
+ [begin_description]
+ Constant integration of ODEs, meaning that the state of the ODE is observed on constant time intervals.
+ The routines makes full use of adaptive and dense-output methods.
+ [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_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/null_observer.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_const.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+
+
+/*
+ * Integrates with constant time step dt.
+ */
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer
+)
+{
+ // we want to get as fast as possible to the end
+ if( boost::is_same< null_observer , Observer >::value )
+ {
+ return detail::integrate_adaptive(
+ stepper , system , start_state ,
+ start_time , end_time , dt ,
+ observer , typename Stepper::stepper_category() );
+ }
+ else
+ {
+ return detail::integrate_const( stepper , system , start_state ,
+ start_time , end_time , dt ,
+ observer , typename Stepper::stepper_category() );
+ }
+}
+
+
+template< class Stepper , class System , class State , class Time , class Observer >
+size_t integrate_const(
+ Stepper stepper , System system , const State &start_state ,
+ Time start_time , Time end_time , Time dt ,
+ Observer observer
+)
+{
+ // we want to get as fast as possible to the end
+ if( boost::is_same< null_observer , Observer >::value )
+ {
+ return detail::integrate_adaptive(
+ stepper , system , start_state ,
+ start_time , end_time , dt ,
+ observer , typename Stepper::stepper_category() );
+ }
+ else
+ {
+ return detail::integrate_const( stepper , system , start_state ,
+ start_time , end_time , dt ,
+ observer , typename Stepper::stepper_category() );
+ }
+}
+
+
+
+
+
+/*
+ * Without observers
+ */
+template< class Stepper , class System , class State , class Time >
+size_t integrate_const(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time end_time , Time dt
+)
+{
+ return integrate_const( stepper , system , start_state , start_time , end_time , dt , null_observer() );
+}
+
+template< class Stepper , class System , class State , class Time >
+size_t integrate_const(
+ Stepper stepper , System system , const State &start_state ,
+ Time start_time , Time end_time , Time dt
+)
+{
+ return integrate_const( stepper , system , start_state , start_time , end_time , dt , null_observer() );
+}
+
+
+
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/integrate_n_steps.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/integrate_n_steps.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,97 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/integrate_n_steps.hpp
+
+ [begin_description]
+ Integration of n steps with constant time size. Adaptive and dense-output methods are fully supported.
+ [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_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/null_observer.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * Integrates n steps
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class Stepper , class System , class State , class Time , class Observer>
+Time integrate_n_steps(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps ,
+ Observer observer )
+{
+
+ return detail::integrate_n_steps(
+ stepper , system , start_state ,
+ start_time , dt , num_of_steps ,
+ observer , typename Stepper::stepper_category() );
+}
+
+template< class Stepper , class System , class State , class Time , class Observer >
+Time integrate_n_steps(
+ Stepper stepper , System system , const State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps ,
+ Observer observer )
+{
+ return detail::integrate_n_steps(
+ stepper , system , start_state ,
+ start_time , dt , num_of_steps ,
+ observer , typename Stepper::stepper_category() );
+}
+
+
+
+
+
+
+
+
+/*
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class Stepper , class System , class State , class Time >
+Time integrate_n_steps(
+ Stepper stepper , System system , State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps )
+{
+ return integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , null_observer() );
+}
+
+template< class Stepper , class System , class State , class Time >
+Time integrate_n_steps(
+ Stepper stepper , System system , const State &start_state ,
+ Time start_time , Time dt , size_t num_of_steps )
+{
+ return integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , null_observer() );
+}
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/integrate_times.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/integrate_times.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,93 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/integrate_times.hpp
+
+ [begin_description]
+ Integration of ODEs with observation at user defined points
+ [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_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
+
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/range.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/integrate/null_observer.hpp>
+#include <boost/numeric/odeint/integrate/detail/integrate_times.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , State &start_state ,
+ TimeIterator times_start , TimeIterator times_end , Time dt ,
+ Observer observer )
+{
+ return detail::integrate_times(
+ stepper , system , start_state ,
+ times_start , times_end , dt ,
+ observer , typename Stepper::stepper_category() );
+}
+
+template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , const State &start_state ,
+ TimeIterator times_start , TimeIterator times_end , Time dt ,
+ Observer observer )
+{
+ return detail::integrate_times(
+ stepper , system , start_state ,
+ times_start , times_end , dt ,
+ observer , typename Stepper::stepper_category() );
+}
+
+/*
+ * Range Version:
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , State &start_state ,
+ const TimeRange &times , Time dt ,
+ Observer observer )
+{
+ return integrate_times(
+ stepper , system , start_state ,
+ boost::begin( times ) , boost::end( times ) , dt , observer );
+}
+
+template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
+size_t integrate_times(
+ Stepper stepper , System system , const State &start_state ,
+ const TimeRange &times , Time dt ,
+ Observer observer )
+{
+ return integrate_times(
+ stepper , system , start_state ,
+ boost::begin( times ) , boost::end( times ) , dt , observer );
+}
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/null_observer.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/null_observer.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,38 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/null_observer.hpp
+
+ [begin_description]
+ null_observer
+ [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_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+struct null_observer
+{
+ template< class State , class Time >
+ void operator()( const State& /* x */ , Time /* t */ ) const
+ {
+
+ }
+};
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/integrate/observer_collection.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/integrate/observer_collection.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,56 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/observer_collection.hpp
+
+ [begin_description]
+ Collection of observers, which are all called during the evolution of the ODE.
+ [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_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
+
+#include <vector>
+
+#include <boost/function.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class State , class Time >
+class observer_collection
+{
+public:
+
+ typedef boost::function< void( const State& , const Time& ) > observer_type;
+ typedef std::vector< observer_type > collection_type;
+
+ void operator()( const State& x , Time t )
+ {
+ for( size_t i=0 ; i<m_observers.size() ; ++i )
+ m_observers[i]( x , t );
+ }
+
+ collection_type& observers( void ) { return m_observers; }
+ const collection_type& observers( void ) const { return m_observers; }
+
+private:
+
+ collection_type m_observers;
+};
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/iterator/adaptive_iterator.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/iterator/adaptive_iterator.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,211 @@
+
+/*
+ [auto_generated]
+ boost/numeric/odeint/iterator/adaptive_iterator.hpp
+
+ [begin_description]
+ Iterator for iterating throught the solution of an ODE with adaptive step size. The dereferenced types containes also the time.
+ [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_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED
+
+#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp>
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+ template< class Stepper , class System , class StepperTag = typename base_tag< typename Stepper::stepper_category >::type >
+ class adaptive_iterator;
+
+
+ /*
+ * Specilization for controlled steppers
+ */
+ template< class Stepper , class System >
+ class adaptive_iterator< Stepper , System , controlled_stepper_tag > : public detail::ode_iterator_base
+ <
+ adaptive_iterator< Stepper , System , controlled_stepper_tag > ,
+ Stepper , System , controlled_stepper_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_iterator_base<
+ adaptive_iterator< Stepper , System , controlled_stepper_tag > ,
+ Stepper , System , controlled_stepper_tag
+ > base_type;
+
+ public:
+
+ adaptive_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt ) { }
+
+ adaptive_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) { }
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ const size_t max_attempts = 1000;
+ size_t trials = 0;
+ controlled_step_result res = success;
+ do
+ {
+ res = this->m_stepper.try_step( this->m_system , this->m_state , this->m_t , this->m_dt );
+ ++trials;
+ }
+ while( ( res == fail ) && ( trials < max_attempts ) );
+ if( trials == max_attempts )
+ {
+ throw std::overflow_error( "Adaptive iterator : Maximal number of iterations reached. A step size could not be found." );
+ }
+ this->check_end();
+ }
+ };
+
+
+
+
+
+
+ /*
+ * Specilization for dense outputer steppers
+ */
+ template< class Stepper , class System >
+ class adaptive_iterator< Stepper , System , dense_output_stepper_tag > : public detail::ode_iterator_base
+ <
+ adaptive_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_iterator_base<
+ adaptive_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag
+ > base_type;
+
+ public:
+
+
+ adaptive_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt )
+ {
+ this->m_stepper.initialize( this->m_state , this->m_t , this->m_dt );
+ }
+
+ adaptive_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) { }
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ this->m_stepper.do_step( this->m_system );
+ this->m_t = this->m_stepper.current_time();
+ this->check_end();
+ }
+
+ // overwrite dereference from ode_iterator_base
+ const state_type& dereference() const
+ {
+ return this->m_stepper.current_state();
+ }
+
+
+ };
+
+
+
+
+
+
+
+
+ template< class Stepper , class System >
+ adaptive_iterator< Stepper , System > make_adaptive_iterator_begin(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return adaptive_iterator< Stepper , System >( stepper , system , x , t , t_end , dt );
+ }
+
+ template< class Stepper , class System >
+ adaptive_iterator< Stepper , System > make_adaptive_iterator_end(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x )
+ {
+ return adaptive_iterator< Stepper , System >( stepper , system , x );
+ }
+
+
+ template< class Stepper , class System >
+ std::pair< adaptive_iterator< Stepper , System > , adaptive_iterator< Stepper , System > >
+ make_adaptive_range(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t_start ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return std::make_pair(
+ adaptive_iterator< Stepper , System >( stepper , system , x , t_start , t_end , dt ) ,
+ adaptive_iterator< Stepper , System >( stepper , system , x )
+ );
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/iterator/adaptive_time_iterator.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/iterator/adaptive_time_iterator.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,205 @@
+
+/*
+ [auto_generated]
+ boost/numeric/odeint/iterator/adaptive_time_iterator.hpp
+
+ [begin_description]
+ Iterator for iterating throught the solution of an ODE with adaptive step size. The dereferenced types containes also the time.
+ [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_ITERATOR_ADAPTIVE_TIME_ITERATOR_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_TIME_ITERATOR_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/iterator/detail/ode_time_iterator_base.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+ template< class Stepper , class System , class StepperTag = typename base_tag< typename Stepper::stepper_category >::type >
+ class adaptive_time_iterator;
+
+
+ /*
+ * Specilization for controlled steppers
+ */
+ template< class Stepper , class System >
+ class adaptive_time_iterator< Stepper , System , controlled_stepper_tag > : public detail::ode_time_iterator_base
+ <
+ adaptive_time_iterator< Stepper , System , controlled_stepper_tag > ,
+ Stepper , System , controlled_stepper_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_time_iterator_base<
+ adaptive_time_iterator< Stepper , System , controlled_stepper_tag > ,
+ Stepper , System , controlled_stepper_tag > base_type;
+
+
+ public:
+
+ adaptive_time_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt ) {}
+
+ adaptive_time_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) {}
+
+ private:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ const size_t max_attempts = 1000;
+ size_t trials = 0;
+ controlled_step_result res = success;
+ do
+ {
+ res = this->m_stepper.try_step( this->m_system , this->m_state.first , this->m_state.second , this->m_dt );
+ ++trials;
+ }
+ while( ( res == fail ) && ( trials < max_attempts ) );
+ if( trials == max_attempts )
+ {
+ throw std::overflow_error( "Adaptive iterator : Maximal number of iterations reached. A step size could not be found." );
+ }
+ this->check_end();
+ }
+ };
+
+
+
+
+
+
+ /*
+ * Specilization for steppers and error steppers
+ */
+ template< class Stepper , class System >
+ class adaptive_time_iterator< Stepper , System , dense_output_stepper_tag > : public detail::ode_time_iterator_base
+ <
+ adaptive_time_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_time_iterator_base<
+ adaptive_time_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag > base_type;
+
+ public:
+
+ adaptive_time_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt )
+ {
+ this->m_stepper.initialize( this->m_state.first , this->m_state.second , this->m_dt );
+ }
+
+ adaptive_time_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s )
+ {
+ }
+
+
+ private:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ this->m_stepper.do_step( this->m_system );
+ this->m_state.second = this->m_stepper.current_time();
+ this->m_stepper.calc_state( this->m_state.second , this->m_state.first );
+ this->check_end();
+ }
+ };
+
+
+
+
+
+
+
+
+ template< class Stepper , class System >
+ adaptive_time_iterator< Stepper , System > make_adaptive_time_iterator_begin(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return adaptive_time_iterator< Stepper , System >( stepper , system , x , t , t_end , dt );
+ }
+
+ template< class Stepper , class System >
+ adaptive_time_iterator< Stepper , System > make_adaptive_time_iterator_end(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x )
+ {
+ return adaptive_time_iterator< Stepper , System >( stepper , system , x );
+ }
+
+
+ template< class Stepper , class System >
+ std::pair< adaptive_time_iterator< Stepper , System > , adaptive_time_iterator< Stepper , System > >
+ make_adaptive_time_range(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t_start ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return std::make_pair(
+ adaptive_time_iterator< Stepper , System >( stepper , system , x , t_start , t_end , dt ) ,
+ adaptive_time_iterator< Stepper , System >( stepper , system , x ) );
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_TIME_ITERATOR_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/iterator/const_step_iterator.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/iterator/const_step_iterator.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,194 @@
+
+/*
+ [auto_generated]
+ boost/numeric/odeint/iterator/const_step_ode_iterator.hpp
+
+ [begin_description]
+ Iterator for iterating throught the solution of an ODE with constant step size.
+ [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_ITERATOR_CONST_STEP_ODE_ITERATOR_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_ODE_ITERATOR_HPP_INCLUDED
+
+#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp>
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+ template< class Stepper , class System , class StepperTag = typename base_tag< typename Stepper::stepper_category >::type >
+ class const_step_iterator;
+
+
+
+
+
+ /*
+ * Specilization for steppers and error steppers
+ */
+ template< class Stepper , class System >
+ class const_step_iterator< Stepper , System , stepper_tag >
+ : public detail::ode_iterator_base<
+ const_step_iterator< Stepper , System , stepper_tag > ,
+ Stepper , System , stepper_tag >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_iterator_base<
+ const_step_iterator< Stepper , System , stepper_tag > ,
+ Stepper , System , stepper_tag > base_type;
+
+ public:
+
+ const_step_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt ) { }
+
+ const_step_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) { }
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ this->m_stepper.do_step( this->m_system , this->m_state , this->m_t , this->m_dt );
+ this->m_t += this->m_dt;
+ this->check_end();
+ }
+ };
+
+
+
+ /*
+ * Specilization for dense output stepper
+ */
+ template< class Stepper , class System >
+ class const_step_iterator< Stepper , System , dense_output_stepper_tag >
+ : public detail::ode_iterator_base<
+ const_step_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_iterator_base<
+ const_step_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag > base_type;
+
+ public:
+
+ const_step_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt )
+ {
+ this->m_stepper.initialize( this->m_state , this->m_t , this->m_dt );
+ }
+
+ const_step_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) { }
+
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ void increment( void )
+ {
+ this->m_t += this->m_dt;
+ if( get_unit_value( this->m_dt ) > static_cast< ode_value_type >( 0.0 ) )
+ {
+ while( this->m_stepper.current_time() < this->m_t )
+ this->m_stepper.do_step( this->m_system );
+ }
+ else
+ {
+ while( this->m_stepper.current_time() > this->m_t )
+ this->m_stepper.do_step( this->m_system );
+ }
+ this->m_stepper.calc_state( this->m_t , this->m_state );
+ this->check_end();
+ }
+ };
+
+
+
+
+
+ template< class Stepper , class System >
+ const_step_iterator< Stepper , System > make_const_step_iterator_begin(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return const_step_iterator< Stepper , System >( stepper , system , x , t , t_end , dt );
+ }
+
+ template< class Stepper , class System >
+ const_step_iterator< Stepper , System > make_const_step_iterator_end(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x )
+ {
+ return const_step_iterator< Stepper , System >( stepper , system , x );
+ }
+
+
+ template< class Stepper , class System >
+ std::pair< const_step_iterator< Stepper , System > , const_step_iterator< Stepper , System > >
+ make_const_step_range(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t_start ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return std::make_pair(
+ const_step_iterator< Stepper , System >( stepper , system , x , t_start , t_end , dt ) ,
+ const_step_iterator< Stepper , System >( stepper , system , x )
+ );
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_ODE_ITERATOR_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/iterator/const_step_time_iterator.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/iterator/const_step_time_iterator.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,192 @@
+
+/*
+ [auto_generated]
+ boost/numeric/odeint/iterator/const_step_time_iterator.hpp
+
+ [begin_description]
+ Iterator for iterating throught the solution of an ODE with constant step size. The dereferences types containes also the time.
+ [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_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/iterator/detail/ode_time_iterator_base.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+ template< class Stepper , class System , class StepperTag = typename base_tag< typename Stepper::stepper_category >::type >
+ class const_step_time_iterator;
+
+
+ /*
+ * Specilization for steppers and error steppers
+ */
+ template< class Stepper , class System >
+ class const_step_time_iterator< Stepper , System , stepper_tag > : public detail::ode_time_iterator_base
+ <
+ const_step_time_iterator< Stepper , System , stepper_tag > ,
+ Stepper , System , stepper_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_time_iterator_base<
+ const_step_time_iterator< Stepper , System , stepper_tag > ,
+ Stepper , System , stepper_tag > base_type;
+
+ public:
+
+ const_step_time_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt ) {}
+
+ const_step_time_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) {}
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ this->m_stepper.do_step( this->m_system , this->m_state.first , this->m_state.second , this->m_dt );
+ this->m_state.second += this->m_dt;
+ this->check_end();
+ }
+
+ };
+
+
+
+
+
+
+ /*
+ * Specilization for steppers and error steppers
+ */
+ template< class Stepper , class System >
+ class const_step_time_iterator< Stepper , System , dense_output_stepper_tag > : public detail::ode_time_iterator_base
+ <
+ const_step_time_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+ typedef detail::ode_time_iterator_base<
+ const_step_time_iterator< Stepper , System , dense_output_stepper_tag > ,
+ Stepper , System , dense_output_stepper_tag > base_type;
+
+
+ public:
+
+ const_step_time_iterator( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : base_type( stepper , sys , s , t , t_end , dt )
+ {
+ this->m_stepper.initialize( this->m_state.first , this->m_state.second , this->m_dt );
+ }
+
+ const_step_time_iterator( stepper_type stepper , system_type sys , state_type &s )
+ : base_type( stepper , sys , s ) {}
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ void increment()
+ {
+ this->m_state.second += this->m_dt;
+ if( get_unit_value( this->m_dt ) > static_cast< ode_value_type >( 0.0 ) )
+ {
+ while( this->m_stepper.current_time() < this->m_state.second )
+ this->m_stepper.do_step( this->m_system );
+ }
+ else
+ {
+ while( this->m_stepper.current_time() > this->m_state.second )
+ this->m_stepper.do_step( this->m_system );
+ }
+ this->m_stepper.calc_state( this->m_state.second , this->m_state.first );
+ this->check_end();
+ }
+ };
+
+
+
+
+
+
+
+
+ template< class Stepper , class System >
+ const_step_time_iterator< Stepper , System > make_const_step_time_iterator_begin(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return const_step_time_iterator< Stepper , System >( stepper , system , x , t , t_end , dt );
+ }
+
+ template< class Stepper , class System >
+ const_step_time_iterator< Stepper , System > make_const_step_time_iterator_end(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x )
+ {
+ return const_step_time_iterator< Stepper , System >( stepper , system , x );
+ }
+
+
+ template< class Stepper , class System >
+ std::pair< const_step_time_iterator< Stepper , System > , const_step_time_iterator< Stepper , System > >
+ make_const_step_time_range(
+ Stepper stepper ,
+ System system ,
+ typename Stepper::state_type &x ,
+ typename Stepper::time_type t_start ,
+ typename Stepper::time_type t_end ,
+ typename Stepper::time_type dt )
+ {
+ return std::make_pair(
+ const_step_time_iterator< Stepper , System >( stepper , system , x , t_start , t_end , dt ) ,
+ const_step_time_iterator< Stepper , System >( stepper , system , x ) );
+ }
+
+
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,127 @@
+
+/*
+ [auto_generated]
+ boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp
+
+ [begin_description]
+ Base class for const_step_iterator and adaptive_iterator.
+ [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_ITERATOR_DETAIL_ODE_ITERATOR_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_ITERATOR_BASE_HPP_INCLUDED
+
+#include <boost/iterator/iterator_facade.hpp>
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+
+
+
+ template< class Iterator , class Stepper , class System , class StepperTag >
+ class ode_iterator_base : public boost::iterator_facade
+ <
+ Iterator ,
+ typename Stepper::state_type const ,
+ boost::single_pass_traversal_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+
+ public:
+
+ ode_iterator_base( stepper_type stepper , system_type sys , state_type &s ,
+ time_type t , time_type t_end , time_type dt )
+ : m_stepper( stepper ) , m_system( sys ) , m_state( s ) , m_t( t ) , m_t_end( t_end ) , m_dt( dt ) , m_first( true )
+ {
+ check_end();
+ }
+
+ ode_iterator_base( stepper_type stepper , system_type sys , state_type &s )
+ : m_stepper( stepper ) , m_system( sys ) , m_state( s ) , m_t() , m_t_end() , m_dt() , m_first( false )
+ {
+ }
+
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ bool equal( ode_iterator_base const& other ) const
+ {
+ if( m_first == other.m_first )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ const state_type& dereference() const
+ {
+ return m_state;
+ }
+
+ void check_end( void )
+ {
+ if( get_unit_value( m_dt ) > static_cast< ode_value_type >( 0.0 ) )
+ {
+ if( m_t > m_t_end )
+ {
+ m_first = false;
+ }
+ }
+ else
+ {
+ if( m_t < m_t_end )
+ {
+ m_first = false;
+ }
+ }
+ }
+
+ stepper_type m_stepper;
+ system_type m_system;
+ state_type &m_state;
+ time_type m_t;
+ time_type m_t_end;
+ time_type m_dt;
+ bool m_first;
+ };
+
+
+
+
+
+
+
+} // namespace detail
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_ITERATOR_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/iterator/detail/ode_time_iterator_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/iterator/detail/ode_time_iterator_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,126 @@
+
+/*
+ [auto_generated]
+ boost/numeric/odeint/iterator/detail/ode_time_iterator_base.hpp
+
+ [begin_description]
+ Base class for const_step_time_iterator and adaptive_time_iterator.
+ [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_ITERATOR_DETAIL_ODE_TIME_ITERATOR_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_TIME_ITERATOR_BASE_HPP_INCLUDED
+
+#include <boost/iterator/iterator_facade.hpp>
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+
+
+
+ template< class Iterator , class Stepper , class System , class StepperTag >
+ class ode_time_iterator_base : public boost::iterator_facade
+ <
+ Iterator ,
+ std::pair< typename Stepper::state_type& , typename Stepper::time_type > const ,
+ boost::single_pass_traversal_tag
+ >
+ {
+ private:
+
+ typedef Stepper stepper_type;
+ typedef System system_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::value_type ode_value_type;
+
+ public:
+
+ ode_time_iterator_base( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt )
+ : m_stepper( stepper ) , m_system( sys ) , m_state( s , t ) , m_t_end( t_end ) , m_dt( dt ) , m_first( true )
+ {
+ check_end();
+ }
+
+ ode_time_iterator_base( stepper_type stepper , system_type sys , state_type &s )
+ : m_stepper( stepper ) , m_system( sys ) , m_state( s , 0.0 ) , m_t_end() , m_dt() , m_first( false )
+ {
+ }
+
+
+ protected:
+
+ friend class boost::iterator_core_access;
+
+ bool equal( ode_time_iterator_base const& other ) const
+ {
+ if( m_first == other.m_first )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ const std::pair< state_type& , time_type >& dereference() const
+ {
+ return m_state;
+ }
+
+ void check_end( void )
+ {
+ if( get_unit_value( m_dt ) > static_cast< ode_value_type >( 0.0 ) )
+ {
+ if( m_state.second > m_t_end )
+ {
+ m_first = false;
+ }
+ }
+ else
+ {
+ if( m_state.second < m_t_end )
+ {
+ m_first = false;
+ }
+ }
+ }
+
+ stepper_type m_stepper;
+ system_type m_system;
+ std::pair< state_type& , time_type > m_state;
+ time_type m_t_end;
+ time_type m_dt;
+ bool m_first;
+
+ };
+
+
+
+
+
+
+
+} // namespace detail
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_TIME_ITERATOR_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/adams_bashforth.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/adams_bashforth.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,285 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/adams_bashforth.hpp
+
+ [begin_description]
+ Implementaton of the Adam-Bashforth method a multistep method used for the predictor step in the
+ Adams-Bashforth-Moulton 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_ADAMS_BASHFORTH_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_HPP_INCLUDED
+
+#include <boost/static_assert.hpp>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+
+#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
+
+#include <boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp>
+#include <boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp>
+#include <boost/numeric/odeint/stepper/detail/rotating_buffer.hpp>
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * Static explicit Adams-Bashforth multistep-solver without step size control and without dense output.
+ */
+template<
+size_t Steps ,
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer ,
+class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer >
+>
+class adams_bashforth : public algebra_stepper_base< Algebra , Operations >
+{
+ BOOST_STATIC_ASSERT(( Steps > 0 ));
+
+public :
+
+ typedef State state_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef Time time_type;
+ typedef Resizer resizer_type;
+ typedef stepper_tag stepper_category;
+
+ typedef typename algebra_stepper_base< Algebra , Operations >::algebra_type algebra_type;
+ typedef typename algebra_stepper_base< Algebra , Operations >::operations_type operations_type;
+ typedef adams_bashforth< Steps , State , Value , Deriv , Time , Algebra , Operations , Resizer , InitializingStepper > stepper_type;
+ typedef InitializingStepper initializing_stepper_type;
+
+ static const size_t steps = Steps;
+
+
+
+ typedef unsigned short order_type;
+ static const order_type order_value = steps;
+
+ typedef detail::rotating_buffer< wrapped_deriv_type , steps > step_storage_type;
+
+
+ order_type order( void ) const { return order_value; }
+
+
+ adams_bashforth( const algebra_type &algebra = algebra_type() )
+ : m_step_storage() , m_resizer() , m_coefficients() ,
+ m_steps_initialized( 0 ) , m_initializing_stepper() ,
+ m_algebra( algebra )
+ { }
+
+ adams_bashforth( const adams_bashforth &stepper )
+ : m_step_storage( stepper.m_step_storage ) , m_resizer( stepper.m_resizer ) , m_coefficients() ,
+ m_steps_initialized( stepper.m_steps_initialized ) , m_initializing_stepper( stepper.m_initializing_stepper ) ,
+ m_algebra( stepper.m_algebra )
+ { }
+
+ adams_bashforth& operator=( const adams_bashforth &stepper )
+ {
+ m_resizer = stepper.m_resizer;
+ m_step_storage = stepper.m_step_storage;
+ m_algebra = stepper.m_algebra;
+ return *this;
+ }
+
+
+ /*
+ * Version 1 : do_step( system , x , t , dt );
+ *
+ * solves the forwarding problem
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ do_step( system , x , t , x , dt );
+ }
+
+ template< class System , class StateInOut >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt )
+ {
+ do_step( system , x , t , x , dt );
+ }
+
+
+
+ /*
+ * Version 2 : do_step( system , in , t , out , dt );
+ *
+ * solves the forwarding problem
+ */
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ do_step_impl( system , in , t , out , dt );
+ }
+
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , time_type t , const StateOut &out , time_type dt )
+ {
+ do_step_impl( system , in , t , out , dt );
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ }
+
+ const step_storage_type& step_storage( void ) const
+ {
+ return m_step_storage;
+ }
+
+ step_storage_type& step_storage( void )
+ {
+ return m_step_storage;
+ }
+
+ template< class ExplicitStepper , class System , class StateIn >
+ void initialize( ExplicitStepper explicit_stepper , System system , StateIn &x , time_type &t , time_type dt )
+ {
+ typename odeint::unwrap_reference< ExplicitStepper >::type &stepper = explicit_stepper;
+ typename odeint::unwrap_reference< System >::type &sys = system;
+
+ m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+
+ for( size_t i=0 ; i<steps-1 ; ++i )
+ {
+ if( i != 0 ) m_step_storage.rotate();
+ sys( x , m_step_storage[0].m_v , t );
+ stepper.do_step( system , x , m_step_storage[0].m_v , t , dt );
+ t += dt;
+ }
+ m_steps_initialized = steps;
+ }
+
+ template< class System , class StateIn >
+ void initialize( System system , StateIn &x , time_type &t , time_type dt )
+ {
+ initialize( detail::ref( m_initializing_stepper ) , system , x , t , dt );
+ }
+
+ void reset( void )
+ {
+ m_steps_initialized = 0;
+ }
+
+ bool is_initialized( void ) const
+ {
+ return m_steps_initialized >= steps;
+ }
+
+ const initializing_stepper_type& initializing_stepper( void ) const { return m_initializing_stepper; }
+
+ initializing_stepper_type& initializing_stepper( void ) { return m_initializing_stepper; }
+
+private:
+
+ template< class System , class StateIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ if( m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ) )
+ {
+ m_steps_initialized = 0;
+ }
+
+ if( m_steps_initialized < steps - 1 )
+ {
+ if( m_steps_initialized != 0 ) m_step_storage.rotate();
+ sys( in , m_step_storage[0].m_v , t );
+ m_initializing_stepper.do_step( system , in , m_step_storage[0].m_v , t , out , dt );
+ m_steps_initialized++;
+ }
+ else
+ {
+ m_step_storage.rotate();
+ sys( in , m_step_storage[0].m_v , t );
+ detail::adams_bashforth_call_algebra< steps , algebra_type , operations_type >()( m_algebra , in , out , m_step_storage , m_coefficients , dt );
+ }
+ }
+
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized( false );
+ for( size_t i=0 ; i<steps ; ++i )
+ {
+ resized |= adjust_size_by_resizeability( m_step_storage[i] , x , typename is_resizeable<deriv_type>::type() );
+ }
+ return resized;
+ }
+
+ step_storage_type m_step_storage;
+ resizer_type m_resizer;
+ const detail::adams_bashforth_coefficients< value_type , steps > m_coefficients;
+ size_t m_steps_initialized;
+ initializing_stepper_type m_initializing_stepper;
+
+
+
+
+
+
+
+protected:
+
+ algebra_type m_algebra;
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,152 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp
+
+ [begin_description]
+ Implementation of the Adams-Bashforth-Moulton method, a predictor-corrector multistep 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_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/stepper/adams_bashforth.hpp>
+#include <boost/numeric/odeint/stepper/adams_moulton.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * Static Adams-Bashforth-Moulton multistep-solver without step size control and without dense output.
+ */
+template<
+size_t Steps ,
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class adams_bashforth_moulton
+{
+
+public :
+
+ typedef State state_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef Resizer resizer_type;
+ typedef stepper_tag stepper_category;
+
+ static const size_t steps = Steps;
+
+ typedef adams_bashforth< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > adams_bashforth_type;
+ typedef adams_moulton< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > adams_moulton_type;
+
+ typedef unsigned short order_type;
+ static const order_type order_value = steps + 1;
+
+ adams_bashforth_moulton( void )
+ : m_adams_bashforth() , m_adams_moulton( m_adams_bashforth.algebra() )
+ { }
+
+ adams_bashforth_moulton( const algebra_type &algebra )
+ : m_adams_bashforth( algebra ) , m_adams_moulton( m_adams_bashforth.algebra() )
+ { }
+
+ order_type order( void ) const { return order_value; }
+
+ template< class System , class StateInOut >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ m_adams_bashforth.do_step( system , x , t , dt );
+ m_adams_moulton.do_step( system , x , t , dt , m_adams_bashforth.step_storage() );
+ }
+
+ template< class System , class StateInOut >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt )
+ {
+ m_adams_bashforth.do_step( system , x , t , dt );
+ m_adams_moulton.do_step( system , x , t , dt , m_adams_bashforth.step_storage() );
+ }
+
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , time_type t , const StateOut &out , time_type dt )
+ {
+ m_adams_bashforth.do_step( system , in , t , out , dt );
+ m_adams_moulton.do_step( system , out , t , dt , m_adams_bashforth.step_storage() );
+ }
+
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ m_adams_bashforth.do_step( system , in , t , out , dt );
+ m_adams_moulton.do_step( system , out , t , dt , m_adams_bashforth.step_storage() );
+ }
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ m_adams_bashforth.adjust_size( x );
+ m_adams_moulton.adjust_size( x );
+ }
+
+
+ template< class ExplicitStepper , class System , class StateIn >
+ void initialize( ExplicitStepper explicit_stepper , System system , StateIn &x , time_type &t , time_type dt )
+ {
+ m_adams_bashforth.initialize( explicit_stepper , system , x , t , dt );
+ }
+
+ template< class System , class StateIn >
+ void initialize( System system , StateIn &x , time_type &t , time_type dt )
+ {
+ m_adams_bashforth.initialize( system , x , t , dt );
+ }
+
+
+
+private:
+
+ adams_bashforth_type m_adams_bashforth;
+ adams_moulton_type m_adams_moulton;
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/adams_moulton.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/adams_moulton.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,195 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/adams_moulton.hpp
+
+ [begin_description]
+ Implementation of the Adams-Moulton method. This is method is not a real stepper, it is more a helper class
+ which computes the corrector step in the Adams-Bashforth-Moulton 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_ADAMS_MOULTON_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_MOULTON_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+
+#include <boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp>
+#include <boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp>
+#include <boost/numeric/odeint/stepper/detail/rotating_buffer.hpp>
+
+
+
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * Static implicit Adams-Moulton multistep-solver without step size control and without dense output.
+ */
+template<
+size_t Steps ,
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class adams_moulton
+{
+private:
+
+
+public :
+
+ typedef State state_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef Resizer resizer_type;
+ typedef stepper_tag stepper_category;
+
+ typedef adams_moulton< Steps , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_type;
+
+ static const size_t steps = Steps;
+
+ typedef unsigned short order_type;
+ static const order_type order_value = steps + 1;
+
+ typedef detail::rotating_buffer< wrapped_deriv_type , steps > step_storage_type;
+
+ adams_moulton( )
+ : m_coefficients() , m_dxdt() , m_resizer() ,
+ m_algebra_instance() , m_algebra( m_algebra_instance )
+ { }
+
+ adams_moulton( algebra_type &algebra )
+ : m_coefficients() , m_dxdt() , m_resizer() ,
+ m_algebra_instance() , m_algebra( algebra )
+ { }
+
+ adams_moulton& operator=( const adams_moulton &stepper )
+ {
+ m_dxdt = stepper.m_dxdt;
+ m_resizer = stepper.m_resizer;
+ m_algebra = stepper.m_algebra;
+ return *this;
+ }
+
+ order_type order( void ) const { return order_value; }
+
+
+ /*
+ * Version 1 : do_step( system , x , t , dt , buf );
+ *
+ * solves the forwarding problem
+ */
+ template< class System , class StateInOut , class ABBuf >
+ void do_step( System system , StateInOut &in , time_type t , time_type dt , const ABBuf &buf )
+ {
+ do_step( system , in , t , in , dt , buf );
+ }
+
+ template< class System , class StateInOut , class ABBuf >
+ void do_step( System system , const StateInOut &in , time_type t , time_type dt , const ABBuf &buf )
+ {
+ do_step( system , in , t , in , dt , buf );
+ }
+
+
+
+ /*
+ * Version 2 : do_step( system , in , t , out , dt , buf );
+ *
+ * solves the forwarding problem
+ */
+ template< class System , class StateIn , class StateOut , class ABBuf >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , const ABBuf &buf )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v , t );
+ detail::adams_moulton_call_algebra< steps , algebra_type , operations_type >()( m_algebra , in , out , m_dxdt.m_v , buf , m_coefficients , dt );
+ }
+
+ template< class System , class StateIn , class StateOut , class ABBuf >
+ void do_step( System system , const StateIn &in , time_type t , const StateOut &out , time_type dt , const ABBuf &buf )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v , t );
+ detail::adams_moulton_call_algebra< steps , algebra_type , operations_type >()( m_algebra , in , out , m_dxdt.m_v , buf , m_coefficients , dt );
+ }
+
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ }
+
+ algebra_type& algebra()
+ { return m_algebra; }
+
+ const algebra_type& algebra() const
+ { return m_algebra; }
+
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+
+ const detail::adams_moulton_coefficients< value_type , steps > m_coefficients;
+ wrapped_deriv_type m_dxdt;
+ resizer_type m_resizer;
+
+protected:
+
+ algebra_type m_algebra_instance;
+ algebra_type &m_algebra;
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_MOULTON_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,81 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp
+
+ [begin_description]
+ Base class for all steppers with an algebra and operations.
+ [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_BASE_ALGEBRA_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_ALGEBRA_STEPPER_BASE_HPP_INCLUDED
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/**
+ * \class algebra_stepper_base
+ * \brief Base class for all steppers with algebra and operations.
+ *
+ * This class serves a base class for all steppers with algebra and operations. It holds the
+ * algebra and provides access to the algebra. The operations are not instantiated, since they are
+ * static classes inside the operations class.
+ *
+ * \tparam Algebra The type of the algebra. Must fullfil the Algebra Concept, at least partially to work
+ * with the stepper.
+ * \tparam Operations The type of the operations. Must fullfil the Operations Concept, at least partially
+ * to work with the stepper.
+ */
+template< class Algebra , class Operations >
+class algebra_stepper_base
+{
+public:
+
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+
+ /**
+ * \brief Constructs a algebra_stepper_base and creates the algebra. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra The algebra_stepper_base stores and uses a copy of algebra.
+ */
+ algebra_stepper_base( const algebra_type &algebra = algebra_type() )
+ : m_algebra( algebra ) { }
+
+ /**
+ * \return A reference to the algebra which is held by this class.
+ */
+ algebra_type& algebra()
+ {
+ return m_algebra;
+ }
+
+ /**
+ * \return A const reference to the algebra which is held by this class.
+ */
+ const algebra_type& algebra() const
+ {
+ return m_algebra;
+ }
+
+protected:
+
+ algebra_type m_algebra;
+};
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_ALGEBRA_STEPPER_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,543 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp
+
+ [begin_description]
+ Base class for all explicit Runge Kutta stepper which are also 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_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * base class for explicit stepper and error steppers
+ * models the stepper AND the error stepper concept
+ *
+ * this class provides the following do_step variants:
+ * do_step( sys , x , t , dt )
+ * do_step( sys , x , dxdt , t , dt )
+ * do_step( sys , in , t , out , dt )
+ * do_step( sys , in , dxdt , t , out , dt )
+ * do_step( sys , x , t , dt , xerr )
+ * do_step( sys , x , dxdt , t , dt , xerr )
+ * do_step( sys , in , t , out , dt , xerr )
+ * do_step( sys , in , dxdt , t , out , dt , xerr )
+ */
+/**
+ * \class explicit_error_stepper_base
+ * \brief Base class for explicit steppers with error estimation. This class can used with
+ * controlled steppers for step size control.
+ *
+ * This class serves as the base class for all explicit steppers with algebra and operations. In contrast to
+ * explicit_stepper_base it also estimates the error and can be used in a controlled stepper to provide
+ * step size control.
+ *
+ * \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders,
+ * one for the order of a step if the error is not estimated. The other two orders are the orders of the step and
+ * the error step if the error estimation is performed.
+ *
+ * explicit_error_stepper_base is used as the interface in a CRTP (currently recurring template
+ * pattern). In order to work correctly the parent class needs to have a method
+ * `do_step_impl( system , in , dxdt_in , t , out , dt , xerr )`.
+ * explicit_error_stepper_base derives from algebra_stepper_base.
+ *
+ * explicit_error_stepper_base provides several overloaded `do_step` methods, see the list below. Only two of them
+ * are needed to fullfil the Error Stepper concept. The other ones are for convenience and for performance. Some
+ * of them simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the
+ * stepper.
+ *
+ * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fullfil the Error Stepper concept. The
+ * state is updated in-place. A type modelling a Boost.Range can be used for x.
+ * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state in-place, but the derivative at the point `t`
+ * must be explicitely passed in `dxdt`.
+ * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step
+ * is stored in `out`.
+ * - `do_step( sys , in , dxdt , t , out , dt )` - This method update the state out-of-place and expects that the
+ * derivative at the point `t` is explicitely passed in `dxdt`. It is a combination of the two `do_step` methods
+ * above.
+ * - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fullfil the Error Stepper concept. The
+ * state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x.
+ * - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state in-place, but the derivative at the
+ * point `t` must be passed in `dxdt`. An error estimate is calculated.
+ * - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error
+ * during the step.
+ * - `do_step( sys , in , dxdt , t , out , dt , xerr )` - This methods updates the state out-of-place and estimates
+ * the error during the step. Furthermore, the derivative at `t` must be passed in `dxdt`.
+ *
+ * \note The system is always passed as value, which might result in poor performance if it contains data. In this
+ * case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );`
+ *
+ * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate`
+ * routines or `iterator`s.
+ *
+ * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base
+ * provides the interface for the Stepper.
+ * \tparam Order The order of a stepper if the stepper is used without error estimation.
+ * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have
+ * the same value.
+ * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation.
+ * \tparam State The state type for the stepper.
+ * \tparam Value The value type for the stepper. This should be a floating point type, like float,
+ * double, or a multiprecision type. It must not neccessary be the value_type of the State. For example
+ * the State can be a `vector< complex< double > >` in this case the Value must be double.
+ * The default value is double.
+ * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the
+ * state type, only if used with Boost.Units both types differ.
+ * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is
+ * used, this type has usually a unit.
+ * \tparam Algebra The algebra type which must fullfil the Algebra Concept.
+ * \tparam Operations The type for the operations wich must fullfil the Operations Concept.
+ * \tparam Resizer The resizer policy class.
+ */
+template<
+class Stepper ,
+unsigned short Order ,
+unsigned short StepperOrder ,
+unsigned short ErrorOrder ,
+class State ,
+class Value ,
+class Deriv ,
+class Time ,
+class Algebra ,
+class Operations ,
+class Resizer
+>
+class explicit_error_stepper_base : public algebra_stepper_base< Algebra , Operations >
+{
+public:
+
+ typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
+ typedef typename algebra_stepper_base_type::algebra_type algebra_type;
+
+
+ typedef State state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef Time time_type;
+ typedef Resizer resizer_type;
+ typedef Stepper stepper_type;
+ typedef explicit_error_stepper_tag stepper_category;
+ #ifndef DOXYGEN_SKIP
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef explicit_error_stepper_base< Stepper , Order , StepperOrder , ErrorOrder ,
+ State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
+ #endif
+
+ typedef unsigned short order_type;
+ static const order_type order_value = Order;
+ static const order_type stepper_order_value = StepperOrder;
+ static const order_type error_order_value = ErrorOrder;
+
+
+ /**
+ * \brief Constructs a explicit_stepper_base class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ explicit_error_stepper_base( const algebra_type &algebra = algebra_type() )
+ : algebra_stepper_base_type( algebra )
+ { }
+
+ /**
+ * \return Returns the order of the stepper if it used without error estimation.
+ */
+ order_type order( void ) const
+ {
+ return order_value;
+ }
+
+ /**
+ * \return Returns the order of a step if the stepper is used without error estimation.
+ */
+ order_type stepper_order( void ) const
+ {
+ return stepper_order_value;
+ }
+
+ /**
+ * \return Returns the order of an error step if the stepper is used without error estimation.
+ */
+ order_type error_order( void ) const
+ {
+ return error_order_value;
+ }
+
+
+
+ /*
+ * Version 1 : do_step( sys , x , t , dt )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+ /**
+ * \brief This method performs one step. It transforms the result in-place.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ do_step_v1( system , x , t , dt );
+ }
+
+ /**
+ * \brief This method performs one step with the stepper passed by Stepper.
+ * It transforms the result in-place. This method is needed in order to solve the forwarding problem.
+ * The difference to the other version is that it can be used like
+ * `stepper.do_step( sys , make_range( iter1 , iter2 ) , t , dt )`
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt )
+ {
+ do_step_v1( system , x , t , dt );
+ }
+
+
+
+ /*
+ * Version 2 : do_step( sys , x , dxdt , t , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
+ * the derivative of x is also passed to this method. It is equivalent to
+ *
+ * \code
+ * sys( x , dxdt , t );
+ * stepper.do_step( sys , x , dxdt , t , dt );
+ * \endcode
+ *
+ * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this
+ * case the method could not be distinguished from other `do_step` versions.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut , class DerivIn >
+ typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
+ do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , t , x , dt );
+ }
+
+
+ /*
+ * Version 3 : do_step( sys , in , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from
+ * other `do_step` variants.
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class StateOut >
+ typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type
+ do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt );
+ }
+
+ /*
+ * Version 4 :do_step( sys , in , dxdt , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the derivative of x at t is passed to the stepper. It is equivalent to:
+ *
+ * \code
+ * sys( in , dxdt , t );
+ * stepper.do_step( sys , in , dxdt , t , out , dt );
+ * \endcode
+ *
+ * This method is disabled if DerivIn and Time are of same type.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
+ do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , t , out , dt );
+ }
+
+
+
+
+
+ /*
+ * Version 5 :do_step( sys , x , t , dt , xerr )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE
+ * is updated in-place.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. x is updated by this method.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ * \param xerr The estimation of the error is stored in xerr.
+ */
+ template< class System , class StateInOut , class Err >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
+ {
+ do_step_v5( system , x , t , dt , xerr );
+ }
+
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE
+ * is updated in-place. This method is needed in order to solve the forwarding problem.
+ * The difference to the other version is that it can be used like
+ * `stepper.do_step( sys , make_range( iter1 , iter2 ) , t , dt )`
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. x is updated by this method.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ * \param xerr The estimation of the error is stored in xerr.
+ */
+ template< class System , class StateInOut , class Err >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr )
+ {
+ do_step_v5( system , x , t , dt , xerr );
+ }
+
+
+ /*
+ * Version 6 :do_step( sys , x , dxdt , t , dt , xerr )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
+ * the derivative of x is also passed to this method. It is equivalent to
+ *
+ * \code
+ * sys( x , dxdt , t );
+ * stepper.do_step( sys , x , dxdt , t , dt , xerr );
+ * \endcode
+ *
+ * The result is updated in place in x. This method is disabled if Time and DerivIn are of the same type. In this
+ * case the method could not be distinguished from other `do_step` versions.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ * \param xerr The error estimate is stored in xerr.
+ */
+ template< class System , class StateInOut , class DerivIn , class Err >
+ typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
+ do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , t , x , dt , xerr );
+ }
+
+
+ /*
+ * Version 7 : do_step( sys , in , t , out , dt , xerr )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the error is estimated.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ * \param xerr The error estimate.
+ */
+ template< class System , class StateIn , class StateOut , class Err >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt , xerr );
+ }
+
+
+ /*
+ * Version 8 : do_step( sys , in , dxdt , t , out , dt , xerr )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the derivative of x at t is passed to the stepper and the error is estimated. It is equivalent to:
+ *
+ * \code
+ * sys( in , dxdt , t );
+ * stepper.do_step( sys , in , dxdt , t , out , dt );
+ * \endcode
+ *
+ * This method is disabled if DerivIn and Time are of same type.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ * \param xerr The error estimate.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class Err >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , t , out , dt , xerr );
+ }
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_impl( x );
+ }
+
+
+
+private:
+
+ template< class System , class StateInOut >
+ void do_step_v1( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) );
+ sys( x , m_dxdt.m_v ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt );
+ }
+
+ template< class System , class StateInOut , class Err >
+ void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) );
+ sys( x , m_dxdt.m_v ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt , xerr );
+ }
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+ stepper_type& stepper( void )
+ {
+ return *static_cast< stepper_type* >( this );
+ }
+
+ const stepper_type& stepper( void ) const
+ {
+ return *static_cast< const stepper_type* >( this );
+ }
+
+
+ resizer_type m_resizer;
+
+protected:
+
+ wrapped_deriv_type m_dxdt;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,641 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp
+
+ [begin_description]
+ Base class for all explicit first-same-as-last Runge Kutta 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_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/copy.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * base class for explicit stepper and error steppers with the fsal property
+ * models the stepper AND the error stepper fsal concept
+ *
+ * this class provides the following do_step overloads
+ * do_step( sys , x , t , dt )
+ * do_step( sys , x , dxdt , t , dt )
+ * do_step( sys , in , t , out , dt )
+ * do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )
+ * do_step( sys , x , t , dt , xerr )
+ * do_step( sys , x , dxdt , t , dt , xerr )
+ * do_step( sys , in , t , out , dt , xerr )
+ * do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )
+ */
+/**
+ * \class explicit_error_stepper_fsal_base
+ * \brief Base class for explicit steppers with error estimation and stepper fullfiling the FSAL (first-same-as-last)
+ * property. This class can be used with controlled steppers for step size control.
+ *
+ * This class serves as the base class for all explicit steppers with algebra and operations and which fullfil the FSAL
+ * property. In contrast to explicit_stepper_base it also estimates the error and can be used in a controlled stepper
+ * to provide step size control.
+ *
+ * The FSAL property means that the derivative of the system at t+dt is already used in the current step going from
+ * t to t +dt. Therefore, some more do_steps method can be introduced and the controlled steppers can explicitely make use
+ * of this property.
+ *
+ * \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders,
+ * one for the order of a step if the error is not estimated. The other two orders are the orders of the step and
+ * the error step if the error estimation is performed.
+ *
+ * explicit_error_stepper_fsal_base is used as the interface in a CRTP (currently recurring template
+ * pattern). In order to work correctly the parent class needs to have a method
+ * `do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt , xerr )`.
+ * explicit_error_stepper_fsal_base derives from algebra_stepper_base.
+ *
+ * This class can have an intrinsic state depending on the explicit usage of the `do_step` method. This means that some
+ * `do_step` methods are expected to be called in order. For example the `do_step( sys , x , t , dt , xerr )` will keep track
+ * of the derivative of `x` which is the internal state. The first call of this method is recognized such that one
+ * does not explicitely initialize the internal state, so it is safe to use this method like
+ *
+ * \code
+ * stepper_type stepper;
+ * stepper.do_step( sys , x , t , dt , xerr );
+ * stepper.do_step( sys , x , t , dt , xerr );
+ * stepper.do_step( sys , x , t , dt , xerr );
+ * \endcode
+ *
+ * But it is unsafe to call this method with different system functions after each other. Do do so, one must initialize the
+ * internal state with the `initialize` method or reset the internal state with the `reset` method.
+ *
+ * explicit_error_stepper_fsal_base provides several overloaded `do_step` methods, see the list below. Only two of them are needed
+ * to fullfil the Error Stepper concept. The other ones are for convenience and for better performance. Some of them
+ * simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the stepper.
+ *
+ * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fullfil the Error Stepper concept. The
+ * state is updated in-place. A type modelling a Boost.Range can be used for x.
+ * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state x and the derivative dxdt in-place. It is expected
+ * that dxdt has the value of the derivative of x at time t.
+ * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step
+ * is stored in `out`.
+ * - `do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )` - This method updates the state and the derivative
+ * out-of-place. It expects that the derivative at the point `t` is explicitely passed in `dxdt_in`.
+ * - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fullfil the Error Stepper concept. The
+ * state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x.
+ * - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state and the derivative in-place. It is assumed
+ * that the dxdt has the value of the derivative of x at time t. An error estimate is calculated.
+ * - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error
+ * during the step.
+ * - `do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )` - This methods updates the state and the derivative
+ * out-of-place and estimates the error during the step. It is assumed the dxdt_in is derivative of in at time t.
+ *
+ * \note The system is always passed as value, which might result in poor performance if it contains data. In this
+ * case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );`
+ *
+ * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate`
+ * routines or `iterator`s.
+ *
+ * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base
+ * provides the interface for the Stepper.
+ * \tparam Order The order of a stepper if the stepper is used without error estimation.
+ * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have
+ * the same value.
+ * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation.
+ * \tparam State The state type for the stepper.
+ * \tparam Value The value type for the stepper. This should be a floating point type, like float,
+ * double, or a multiprecision type. It must not neccessary be the value_type of the State. For example
+ * the State can be a `vector< complex< double > >` in this case the Value must be double.
+ * The default value is double.
+ * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the
+ * state type, only if used with Boost.Units both types differ.
+ * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is
+ * used, this type has usually a unit.
+ * \tparam Algebra The algebra type which must fullfil the Algebra Concept.
+ * \tparam Operations The type for the operations wich must fullfil the Operations Concept.
+ * \tparam Resizer The resizer policy class.
+ */
+template<
+class Stepper ,
+unsigned short Order ,
+unsigned short StepperOrder ,
+unsigned short ErrorOrder ,
+class State ,
+class Value ,
+class Deriv ,
+class Time ,
+class Algebra ,
+class Operations ,
+class Resizer
+>
+class explicit_error_stepper_fsal_base : public algebra_stepper_base< Algebra , Operations >
+{
+public:
+
+ typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
+ typedef typename algebra_stepper_base_type::algebra_type algebra_type;
+
+ typedef State state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef Time time_type;
+ typedef Resizer resizer_type;
+ typedef Stepper stepper_type;
+ typedef explicit_error_stepper_fsal_tag stepper_category;
+
+ #ifndef DOXYGEN_SKIP
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef explicit_error_stepper_fsal_base< Stepper , Order , StepperOrder , ErrorOrder ,
+ State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
+ #endif
+
+
+ typedef unsigned short order_type;
+ static const order_type order_value = Order;
+ static const order_type stepper_order_value = StepperOrder;
+ static const order_type error_order_value = ErrorOrder;
+
+ /**
+ * \brief Constructs a explicit_stepper_fsal_base class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ explicit_error_stepper_fsal_base( const algebra_type &algebra = algebra_type() )
+ : algebra_stepper_base_type( algebra ) , m_first_call( true )
+ { }
+
+ /**
+ * \return Returns the order of the stepper if it used without error estimation.
+ */
+ order_type order( void ) const
+ {
+ return order_value;
+ }
+
+ /**
+ * \return Returns the order of a step if the stepper is used without error estimation.
+ */
+ order_type stepper_order( void ) const
+ {
+ return stepper_order_value;
+ }
+
+ /**
+ * \return Returns the order of an error step if the stepper is used without error estimation.
+ */
+ order_type error_order( void ) const
+ {
+ return error_order_value;
+ }
+
+
+ /*
+ * version 1 : do_step( sys , x , t , dt )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+ /**
+ * \brief This method performs one step. It transforms the result in-place.
+ *
+ * \note This method uses the internal state of the stepper.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ do_step_v1( system , x , t , dt );
+ }
+
+ /**
+ * \brief This method performs one step with the stepper passed by Stepper.
+ * It transforms the result in-place. This method is needed in order to solve the forwarding problem.
+ * The difference to the other version is that it can be used like
+ * `stepper.do_step( sys , make_range( iter1 , iter2 ) , t , dt )`
+ *
+ * \note This method uses the internal state of the stepper.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt )
+ {
+ do_step_v1( system , x , t , dt );
+ }
+
+
+ /*
+ * version 2 : do_step( sys , x , dxdt , t , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other methods
+ * the derivative of x is also passed to this method. Therefore, dxdt must be evaluated initially:
+ *
+ * \code
+ * ode( x , dxdt , t );
+ * for( ... )
+ * {
+ * stepper.do_step( ode , x , dxdt , t , dt );
+ * t += dt;
+ * }
+ * \endcode
+ *
+ * \note This method does NOT use the initial state, since the first derivative is explicitely passed to this method.
+ *
+ * The result is updated in place in x as well as the derivative dxdt. This method is disabled if
+ * Time and StateInOut are of the same type. In this case the method could not be distinguished from other `do_step`
+ * versions.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param dxdt The derivative of x at t. After calling `do_step` dxdt is updated to the new value.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut , class DerivInOut >
+ typename boost::disable_if< boost::is_same< StateInOut , time_type > , void >::type
+ do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt )
+ {
+ m_first_call = true;
+ this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt );
+ }
+
+
+ /*
+ * version 3 : do_step( sys , in , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from
+ * other `do_step` variants.
+ *
+ * \note This method uses the internal state of the stepper.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class StateOut >
+ typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type
+ do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
+ {
+ initialize( system , in , t );
+ }
+ this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , m_dxdt.m_v , dt );
+ }
+
+
+ /*
+ * version 4 : do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the derivative of x at t is passed to the stepper and updated by the stepper to its new value at
+ * t+dt.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \note This method does NOT use the internal state of the stepper.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt_in The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dxdt_out The updated derivative of `out` at `t+dt`.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t ,
+ StateOut &out , DerivOut &dxdt_out , time_type dt )
+ {
+ m_first_call = true;
+ this->stepper().do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt );
+ }
+
+
+
+
+
+ /*
+ * version 5 : do_step( sys , x , t , dt , xerr )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE
+ * is updated in-place.
+ *
+ *
+ * \note This method uses the internal state of the stepper.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. x is updated by this method.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ * \param xerr The estimation of the error is stored in xerr.
+ */
+ template< class System , class StateInOut , class Err >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
+ {
+ do_step_v5( system , x , t , dt , xerr );
+ }
+
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE
+ * is updated in-place. This method is needed in order to solve the forwarding problem.
+ * The difference to the other version is that it can be used like
+ * `stepper.do_step( sys , make_range( iter1 , iter2 ) , t , dt )`
+ *
+ * \note This method uses the internal state of the stepper.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. x is updated by this method.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ * \param xerr The estimation of the error is stored in xerr.
+ */
+ template< class System , class StateInOut , class Err >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr )
+ {
+ do_step_v5( system , x , t , dt , xerr );
+ }
+
+
+ /*
+ * version 6 : do_step( sys , x , dxdt , t , dt , xerr )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
+ * the derivative of x is also passed to this method and updated by this method.
+ *
+ * \note This method does NOT use the internal state of the stepper.
+ *
+ * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this
+ * case the method could not be distinguished from other `do_step` versions. This method is disabled if StateInOut and
+ * Time are of the same type.
+ *
+ * \note This method does NOT use the internal state of the stepper.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param dxdt The derivative of x at t. After calling `do_step` this value is updated to the new value at `t+dt`.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ * \param xerr The error estimate is stored in xerr.
+ */
+ template< class System , class StateInOut , class DerivInOut , class Err >
+ typename boost::disable_if< boost::is_same< StateInOut , time_type > , void >::type
+ do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt , Err &xerr )
+ {
+ m_first_call = true;
+ this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt , xerr );
+ }
+
+
+
+
+ /*
+ * version 7 : do_step( sys , in , t , out , dt , xerr )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the error is estimated.
+ *
+ * \note This method uses the internal state of the stepper.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ * \param xerr The error estimate.
+ */
+ template< class System , class StateIn , class StateOut , class Err >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr )
+ {
+ if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
+ {
+ initialize( system , in , t );
+ }
+ this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , m_dxdt.m_v , dt , xerr );
+ }
+
+
+ /*
+ * version 8 : do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the derivative of x at t is passed to the stepper and the error is estimated.
+ *
+ * \note This method does NOT use the internal state of the stepper.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt_in The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dxdt_out The new derivative at `t+dt` is written into this variable.
+ * \param dt The step size.
+ * \param xerr The error estimate.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut , class Err >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t ,
+ StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr )
+ {
+ m_first_call = true;
+ this->stepper().do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt , xerr );
+ }
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_impl( x );
+ }
+
+
+ /**
+ * \brief Resets the internal state of this stepper. After calling this method it is safe to use all
+ * `do_step` method without explicitly initializing the stepper.
+ */
+ void reset( void )
+ {
+ m_first_call = true;
+ }
+
+ /**
+ * \brief Initializes the interal state of the stepper.
+ * \param deriv The derivative of x. The next call of `do_step` expects that the derivative of `x` passed to `do_step`
+ * has the value of `deriv`.
+ */
+ template< class DerivIn >
+ void initialize( const DerivIn &deriv )
+ {
+ boost::numeric::odeint::copy( deriv , m_dxdt.m_v );
+ m_first_call = false;
+ }
+
+ /**
+ * \brief Initializes the interal state of the stepper.
+ *
+ * This method is equivalent to
+ * \code
+ * Deriv dxdt;
+ * system( x , dxdt , t );
+ * stepper.initialize( dxdt );
+ * \endcode
+ *
+ * \param system The system function for the next calls of `do_step`.
+ * \param x The current state of the ODE.
+ * \param t The current time of the ODE.
+ */
+ template< class System , class StateIn >
+ void initialize( System system , const StateIn &x , time_type t )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ sys( x , m_dxdt.m_v , t );
+ m_first_call = false;
+ }
+
+ /**
+ * \brief Returns if the stepper is already initialized. If the stepper is not initialized, the first
+ * call of `do_step` will initialize the state of the stepper. If the stepper is already initialized
+ * the system function can not be safely exchanged between consecutive `do_step` calls.
+ */
+ bool is_initialized( void ) const
+ {
+ return ! m_first_call;
+ }
+
+
+
+private:
+
+ template< class System , class StateInOut >
+ void do_step_v1( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
+ {
+ initialize( system , x , t );
+ }
+ this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , m_dxdt.m_v , dt );
+ }
+
+ template< class System , class StateInOut , class Err >
+ void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr )
+ {
+ if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
+ {
+ initialize( system , x , t );
+ }
+ this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , m_dxdt.m_v , dt , xerr );
+ }
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+
+ stepper_type& stepper( void )
+ {
+ return *static_cast< stepper_type* >( this );
+ }
+
+ const stepper_type& stepper( void ) const
+ {
+ return *static_cast< const stepper_type* >( this );
+ }
+
+
+ resizer_type m_resizer;
+ bool m_first_call;
+
+protected:
+
+
+ wrapped_deriv_type m_dxdt;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,371 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp
+
+ [begin_description]
+ Base class for all explicit Runge Kutta 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_BASE_EXPLICIT_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_STEPPER_BASE_HPP_INCLUDED
+
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * base class for explicit steppers
+ * models the stepper concept
+ *
+ * this class provides the following overloads
+ * do_step( sys , x , t , dt )
+ * do_step( sys , in , t , out , dt )
+ * do_step( sys , x , dxdt_in , t , dt )
+ * do_step( sys , in , dxdt_in , t , out , dt )
+ */
+
+/**
+ * \class explicit_stepper_base
+ * \brief Base class for explicit steppers without step size control and without dense output.
+ *
+ * This class serves as the base class for all explicit steppers with algebra and operations.
+ * Step size control and error estimation as well as dense output are not provided. explicit_stepper_base
+ * is used as the interface in a CRTP (currently recurring template pattern). In order to work
+ * correctly the parent class needs to have a method `do_step_impl( system , in , dxdt_in , t , out , dt )`.
+ * This is method is used by explicit_stepper_base. explicit_stepper_base derives from
+ * algebra_stepper_base. An example how this class can be used is
+ *
+ * \code
+ * template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resizer >
+ * class custom_euler : public explicit_stepper_base< 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+ * {
+ * public:
+ *
+ * typedef explicit_stepper_base< 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer > base_type;
+ *
+ * custom_euler( const Algebra &algebra = Algebra() ) { }
+ *
+ * template< class Sys , class StateIn , class DerivIn , class StateOut >
+ * void do_step_impl( Sys sys , const StateIn &in , const DerivIn &dxdt , Time t , StateOut &out , Time dt )
+ * {
+ * m_algebra.for_each3( out , in , dxdt , Operations::scale_sum2< Value , Time >( 1.0 , dt );
+ * }
+ *
+ * template< class State >
+ * void adjust_size( const State &x )
+ * {
+ * base_type::adjust_size( x );
+ * }
+ * };
+ * \endcode
+ *
+ * For the Stepper concept only the `do_step( sys , x , t , dt )` needs to be implemented. But this class
+ * provides additional `do_step` variants since the stepper is explicit. These methods can be used to increase
+ * the performance in some situation, for example if one needs to analyze `dxdt` during each step. In this case
+ * one can use
+ *
+ * \code
+ * sys( x , dxdt , t );
+ * stepper.do_step( sys , x , dxdt , t , dt ); // the value of dxdt is used here
+ * t += dt;
+ * \endcode
+ *
+ * In detail explicit_stepper_base provides the following `do_step` variants
+ * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fullfil the Stepper concept. The state is updated in-place.
+ * A type modelling a Boost.Range can be used for x.
+ * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step is stored in `out`.
+ * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state in-place, but the derivative at the point `t` must be
+ * explicitely passed in `dxdt`. For an example see the code snippet above.
+ * - `do_step( sys , in , dxdt , t , out , dt )` - This method update the state out-of-place and expects that the derivative at the point
+ * `t` is explicitely passed in `dxdt`. It is a combination of the two `do_step` methods above.
+ *
+ * \note The system is always passed as value, which might result in poor performance if it contains data. In this case it can be used with `boost::ref`
+ * or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );`
+ *
+ * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate` routines or `iterator`s.
+ *
+ * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base
+ * provides the interface for the Stepper.
+ * \tparam Order The order of the stepper.
+ * \tparam State The state type for the stepper.
+ * \tparam Value The value type for the stepper. This should be a floating point type, like float,
+ * double, or a multiprecision type. It must not neccessary be the value_type of the State. For example
+ * the State can be a `vector< complex< double > >` in this case the Value must be double.
+ * The default value is double.
+ * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the
+ * state type, only if used with Boost.Units both types differ.
+ * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is
+ * used, this type has usually a unit.
+ * \tparam Algebra The algebra type which must fullfil the Algebra Concept.
+ * \tparam Operations The type for the operations wich must fullfil the Operations Concept.
+ * \tparam Resizer The resizer policy class.
+ */
+template<
+class Stepper ,
+unsigned short Order ,
+class State ,
+class Value ,
+class Deriv ,
+class Time ,
+class Algebra ,
+class Operations ,
+class Resizer
+>
+class explicit_stepper_base : public algebra_stepper_base< Algebra , Operations >
+{
+public:
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_stepper_base< Stepper , Order , State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
+ #endif // DOXYGEN_SKIP
+
+
+ typedef State state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef Time time_type;
+ typedef Resizer resizer_type;
+ typedef Stepper stepper_type;
+ typedef stepper_tag stepper_category;
+ typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
+ typedef typename algebra_stepper_base_type::algebra_type algebra_type;
+ typedef typename algebra_stepper_base_type::operations_type operations_type;
+ typedef unsigned short order_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ #endif // DOXYGEN_SKIP
+
+
+ static const order_type order_value = Order;
+
+
+ /**
+ * \brief Constructs a explicit_stepper_base class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ explicit_stepper_base( const algebra_type &algebra = algebra_type() )
+ : algebra_stepper_base_type( algebra )
+ { }
+
+ /**
+ * \return Returns the order of the stepper.
+ */
+ order_type order( void ) const
+ {
+ return order_value;
+ }
+
+
+ /*
+ * Version 1 : do_step( sys , x , t , dt )
+ *
+ * the two overloads are needed in order to solve the forwarding problem
+ */
+
+ /**
+ * \brief This method performs one step. It transforms the result in-place.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ do_step_v1( system , x , t , dt );
+ }
+
+ /**
+ * \brief This method performs one step with the stepper passed by Stepper.
+ * It transforms the result in-place. This method is needed in order to solve the forwarding problem.
+ * The difference to the other version is that it can be used like
+ * `stepper.do_step( sys , make_range( iter1 , iter2 ) , t , dt )`
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , const StateInOut &x , time_type t , time_type dt )
+ {
+ do_step_v1( system , x , t , dt );
+ }
+
+
+ /*
+ * Version 2 : do_step( sys , x , dxdt , t , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method
+ * the derivative of x is also passed to this method. It is equivalent to
+ *
+ * \code
+ * sys( x , dxdt , t );
+ * stepper.do_step( sys , x , dxdt , t , dt );
+ * \endcode
+ *
+ * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this
+ * case the method could not be distinguished from other `do_step` versions.
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x.
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param dt The step size.
+ */
+ template< class System , class StateInOut , class DerivIn >
+ typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type
+ do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt )
+ {
+ this->stepper().do_step_impl( system , x , dxdt , t , x , dt );
+ }
+
+
+ /*
+ * Version 3 : do_step( sys , in , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v ,t );
+ this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt );
+ }
+
+
+ /*
+ * Version 4 : do_step( sys , in , dxdt , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ /**
+ * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place.
+ * Furthermore, the derivative of x at t is passed to the stepper. It is equivalent to:
+ *
+ * \code
+ * sys( in , dxdt , t );
+ * stepper.do_step( sys , in , dxdt , t , out , dt );
+ * \endcode
+ *
+ * \note This method does not solve the forwarding problem.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
+ {
+ this->stepper().do_step_impl( system , in , dxdt , t , out , dt );
+ }
+
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_impl( x );
+ }
+
+private:
+
+ stepper_type& stepper( void )
+ {
+ return *static_cast< stepper_type* >( this );
+ }
+
+ const stepper_type& stepper( void ) const
+ {
+ return *static_cast< const stepper_type* >( this );
+ }
+
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+
+ template< class System , class StateInOut >
+ void do_step_v1( System system , StateInOut &x , time_type t , time_type dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ sys( x , m_dxdt.m_v ,t );
+ this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt );
+ }
+
+
+ resizer_type m_resizer;
+
+protected:
+
+ wrapped_deriv_type m_dxdt;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_STEPPER_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,418 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp
+
+ [begin_description]
+ Base class for symplectic Runge-Kutta-Nystrom 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_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+
+#include <boost/numeric/odeint/util/copy.hpp>
+#include <boost/numeric/odeint/util/is_pair.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp>
+
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/**
+ * \class symplectic_nystroem_stepper_base
+ * \brief Base class for all symplectic steppers of Nystroem type.
+ *
+ * This class is the base class for the symplectic Runge-Kutta-Nystroem steppers. Symplectic steppers are usually
+ * used to solve Hamiltonian systems and they conserve the phase space volume, see
+ * en.wikipedia.org/wiki/Symplectic_integrator.
+ * Furthermore, the energy is conserved
+ * in average. In detail this class of steppers can be used to solve separable Hamiltonian systems which can be written
+ * in the form H(q,p) = H1(p) + H2(q). q is usually called the coordinate, while p is the momentum. The equations of motion
+ * are dq/dt = dH1/dp, dp/dt = -dH2/dq.
+ *
+ * ToDo : add formula for solver and explanation of the coefficients
+ *
+ * symplectic_nystroem_stepper_base uses odeints algebra and operation system. Step size and error estimation are not
+ * provided for this class of solvers. It derives from algebra_stepper_base. Several `do_step` variants are provided:
+ *
+ * - `do_step( sys , x , t , dt )` - The classical `do_step` method. The sys can be either a pair of function objects
+ * for the coordinate or the momentum part or one function object for the momentum part. `x` is a pair of coordinate
+ * and momentum. The state is updated in-place.
+ * - `do_step( sys , q , p , t , dt )` - This method is similar to the method above with the difference that the coordinate
+ * and the momentum are passed explicitely and not packed into a pair.
+ * - `do_step( sys , x_in , t , x_out , dt )` - This method transforms the state out-of-place. `x_in` and `x_out` are here pairs
+ * of coordinate and momentum.
+ *
+ * \tparam NumOfStages Number of stages.
+ * \tparam Order The order of the stepper.
+ * \tparam Coor The type representing the coordinates q.
+ * \tparam Momentum The type representing the coordinates p.
+ * \tparam Value The basic value type. Should be somethink like float, double or a high-precision type.
+ * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt.
+ * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt.
+ * \tparam Time The type representing the time t.
+ * \tparam Algebra The algebra.
+ * \tparam Operations The operations.
+ * \tparam Resizer The resizer policy.
+ */
+template<
+size_t NumOfStages ,
+unsigned short Order ,
+class Coor ,
+class Momentum ,
+class Value ,
+class CoorDeriv ,
+class MomentumDeriv ,
+class Time ,
+class Algebra ,
+class Operations ,
+class Resizer
+>
+class symplectic_nystroem_stepper_base : public algebra_stepper_base< Algebra , Operations >
+{
+
+public:
+
+ typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type;
+ typedef typename algebra_stepper_base_type::algebra_type algebra_type;
+ typedef typename algebra_stepper_base_type::operations_type operations_type;
+
+ const static size_t num_of_stages = NumOfStages;
+ typedef Coor coor_type;
+ typedef Momentum momentum_type;
+ typedef std::pair< coor_type , momentum_type > state_type;
+ typedef CoorDeriv coor_deriv_type;
+ typedef state_wrapper< coor_deriv_type> wrapped_coor_deriv_type;
+ typedef MomentumDeriv momentum_deriv_type;
+ typedef state_wrapper< momentum_deriv_type > wrapped_momentum_deriv_type;
+ typedef std::pair< coor_deriv_type , momentum_deriv_type > deriv_type;
+ typedef Value value_type;
+ typedef Time time_type;
+ typedef Resizer resizer_type;
+ typedef stepper_tag stepper_category;
+
+ #ifndef DOXYGEN_SKIP
+ typedef symplectic_nystroem_stepper_base< NumOfStages , Order , Coor , Momentum , Value ,
+ CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type;
+ #endif
+ typedef unsigned short order_type;
+
+ static const order_type order_value = Order;
+
+ typedef boost::array< value_type , num_of_stages > coef_type;
+
+ /**
+ * \brief Constructs a symplectic_nystroem_stepper_base class. The parameters of the specific Nystroem method and the
+ * algebra have to be passed.
+ * \param coef_a The coefficients a.
+ * \param coef_b The coefficients b.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ 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 ) ,
+ m_dqdt_resizer() , m_dpdt_resizer() , m_dqdt() , m_dpdt()
+ { }
+
+
+ /**
+ * \return Returns the order of the stepper.
+ */
+ order_type order( void ) const
+ {
+ return order_value;
+ }
+
+ /*
+ * Version 1 : do_step( system , x , t , dt )
+ *
+ * This version does not solve the forwarding problem, boost.range can not be used.
+ */
+ /**
+ * \brief This method performs one step. The system can be either a pair of two function object
+ * decribing the momentum part and the coordinate part or one function object describing only
+ * the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state
+ * is updated in-place.
+ *
+ * \note boost::ref or std::ref can be used for the system as well as for the state. So, it is correct
+ * to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , make_pair( std::ref( q ) , std::ref( p ) ) , t , dt )`.
+ *
+ * \note This method solves the forwarding problem.
+ *
+ * \param system The system, can be represented as a pair of two function object or one function object. See above.
+ * \param state The state of the ODE. It is a pair of Coor and Momentum. The state is updated in-place, therefore, the
+ * new value of the state will be written into this variable.
+ * \param t The time of the ODE. It is not advanced by this method.
+ * \param dt The time step.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , const StateInOut &state , time_type t , time_type dt )
+ {
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ do_step_impl( system , state , t , state , dt , typename is_pair< system_type >::type() );
+ }
+
+ /**
+ * \brief Same function as do_step( system , x , t , dt ). It differs only in a different const specifier in order
+ * to solve the forwarding problem.
+ */
+ template< class System , class StateInOut >
+ void do_step( System system , StateInOut &state , time_type t , time_type dt )
+ {
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ do_step_impl( system , state , t , state , dt , typename is_pair< system_type >::type() );
+ }
+
+
+
+
+ /*
+ * Version 2 : do_step( system , q , p , t , dt );
+ *
+ * For Convenience
+ *
+ * The two overloads are needed in order to solve the forwarding problem.
+ */
+ /**
+ * \brief This method performs one step. The system can be either a pair of two function object
+ * decribing the momentum part and the coordinate part or one function object describing only
+ * the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state
+ * is updated in-place.
+ *
+ * \note boost::ref or std::ref can be used for the system. So, it is correct
+ * to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , q , p , t , dt )`.
+ *
+ * \note This method solves the forwarding problem.
+ *
+ * \param system The system, can be represented as a pair of two function object or one function object. See above.
+ * \param q The coordinate of the ODE. It is updated in-place. Therefore, the new value of the coorindate will be written
+ * into this variable.
+ * \param p The momentum of the ODE. It is updated in-place. Therefore, the new value of the momentum will be written info
+ * this variable.
+ * \param t The time of the ODE. It is not advanced by this method.
+ * \param dt The time step.
+ */
+ template< class System , class CoorInOut , class MomentumInOut >
+ void do_step( System system , CoorInOut &q , MomentumInOut &p , time_type t , time_type dt )
+ {
+ do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt );
+ }
+
+ /**
+ * \brief Same function as do_step( system , q , p , t , dt ). It differs only in a different const specifier in order
+ * to solve the forwarding problem.
+ */
+ template< class System , class CoorInOut , class MomentumInOut >
+ void do_step( System system , const CoorInOut &q , const MomentumInOut &p , time_type t , time_type dt )
+ {
+ do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt );
+ }
+
+
+
+
+
+ /*
+ * Version 3 : do_step( system , in , t , out , dt )
+ *
+ * The forwarding problem is not solved in this version
+ */
+ /**
+ * \brief This method performs one step. The system can be either a pair of two function object
+ * decribing the momentum part and the coordinate part or one function object describing only
+ * the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state
+ * is updated out-of-place.
+ *
+ * \note boost::ref or std::ref can be used for the system. So, it is correct
+ * to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , x_in , t , x_out , dt )`.
+ *
+ * \note This method NOT solve the forwarding problem.
+ *
+ * \param system The system, can be represented as a pair of two function object or one function object. See above.
+ * \param in The state of the ODE, which is a pair of coordinate and momentum. The state is updated out-of-place, therefore the
+ * new value is written into out
+ * \param t The time of the ODE. It is not advanced by this method.
+ * \param out The new state of the ODE.
+ * \param dt The time step.
+ */
+ template< class System , class StateIn , class StateOut >
+ void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt )
+ {
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ do_step_impl( system , in , t , out , dt , typename is_pair< system_type >::type() );
+ }
+
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_dqdt( x );
+ resize_dpdt( x );
+ }
+
+ /** \brief Returns the coefficients a. */
+ const coef_type& coef_a( void ) const { return m_coef_a; }
+
+ /** \brief Returns the coefficients b. */
+ const coef_type& coef_b( void ) const { return m_coef_b; }
+
+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_ )
+ {
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ typedef typename odeint::unwrap_reference< typename system_type::first_type >::type coor_deriv_func_type;
+ typedef typename odeint::unwrap_reference< typename system_type::second_type >::type momentum_deriv_func_type;
+ system_type &sys = system;
+ coor_deriv_func_type &coor_func = sys.first;
+ momentum_deriv_func_type &momentum_func = sys.second;
+
+ typedef typename odeint::unwrap_reference< StateIn >::type state_in_type;
+ typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type;
+ typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type;
+ const state_in_type &state_in = in;
+ const coor_in_type &coor_in = state_in.first;
+ const momentum_in_type &momentum_in = state_in.second;
+
+ typedef typename odeint::unwrap_reference< StateOut >::type state_out_type;
+ typedef typename odeint::unwrap_reference< typename state_out_type::first_type >::type coor_out_type;
+ typedef typename odeint::unwrap_reference< typename state_out_type::second_type >::type momentum_out_type;
+ state_out_type &state_out = out;
+ coor_out_type &coor_out = state_out.first;
+ momentum_out_type &momentum_out = state_out.second;
+
+ m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) );
+ m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) );
+
+ // ToDo: check sizes?
+
+ for( size_t l=0 ; l<num_of_stages ; ++l )
+ {
+ if( l == 0 )
+ {
+ coor_func( momentum_in , m_dqdt.m_v );
+ this->m_algebra.for_each3( coor_out , coor_in , m_dqdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
+ momentum_func( coor_out , m_dpdt.m_v );
+ this->m_algebra.for_each3( momentum_out , momentum_in , m_dpdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
+ }
+ else
+ {
+ coor_func( momentum_out , m_dqdt.m_v );
+ this->m_algebra.for_each3( coor_out , coor_out , m_dqdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
+ momentum_func( coor_out , m_dpdt.m_v );
+ this->m_algebra.for_each3( momentum_out , momentum_out , m_dpdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
+ }
+ }
+ }
+
+
+ // 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_ )
+ {
+ typedef typename odeint::unwrap_reference< System >::type momentum_deriv_func_type;
+ momentum_deriv_func_type &momentum_func = system;
+
+ typedef typename odeint::unwrap_reference< StateIn >::type state_in_type;
+ typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type;
+ typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type;
+ const state_in_type &state_in = in;
+ const coor_in_type &coor_in = state_in.first;
+ const momentum_in_type &momentum_in = state_in.second;
+
+ typedef typename odeint::unwrap_reference< StateOut >::type state_out_type;
+ typedef typename odeint::unwrap_reference< typename state_out_type::first_type >::type coor_out_type;
+ typedef typename odeint::unwrap_reference< typename state_out_type::second_type >::type momentum_out_type;
+ state_out_type &state_out = out;
+ coor_out_type &coor_out = state_out.first;
+ momentum_out_type &momentum_out = state_out.second;
+
+
+ m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) );
+ m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) );
+
+
+ // ToDo: check sizes?
+
+ for( size_t l=0 ; l<num_of_stages ; ++l )
+ {
+ if( l == 0 )
+ {
+ this->m_algebra.for_each3( coor_out , coor_in , momentum_in ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
+ momentum_func( coor_out , m_dpdt.m_v );
+ this->m_algebra.for_each3( momentum_out , momentum_in , m_dpdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
+ }
+ else
+ {
+ this->m_algebra.for_each3( coor_out , coor_out , momentum_out ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) );
+ momentum_func( coor_out , m_dpdt.m_v );
+ this->m_algebra.for_each3( momentum_out , momentum_out , m_dpdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) );
+ }
+ }
+ }
+
+ template< class StateIn >
+ bool resize_dqdt( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dqdt , x , typename is_resizeable<coor_deriv_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_dpdt( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dpdt , x , typename is_resizeable<momentum_deriv_type>::type() );
+ }
+
+
+ const coef_type m_coef_a;
+ const coef_type m_coef_b;
+
+ resizer_type m_dqdt_resizer;
+ resizer_type m_dpdt_resizer;
+ wrapped_coor_deriv_type m_dqdt;
+ wrapped_momentum_deriv_type m_dpdt;
+
+};
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/bulirsch_stoer.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/bulirsch_stoer.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,507 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/bulirsch_stoer.hpp
+
+ [begin_description]
+ Implementaiton of the Burlish-Stoer method. As described in
+ Ernst Hairer, Syvert Paul Norsett, Gerhard Wanner
+ Solving Ordinary Differential Equations I. Nonstiff Problems.
+ Springer Series in Comput. Mathematics, Vol. 8, Springer-Verlag 1987, Second revised edition 1993.
+ [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_BULIRSCH_STOER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED
+
+
+#include <iostream>
+
+#include <algorithm>
+
+#include <boost/config.hpp> // for min/max guidelines
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/modified_midpoint.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+#include <boost/numeric/odeint/util/detail/less_with_sign.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/** ToDo try_step stepsize changed return values doesn't make too much sense here as we have order control as well */
+
+template<
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class Resizer = initially_resizer
+ >
+class bulirsch_stoer {
+
+public:
+
+ typedef State state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef Resizer resizer_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef controlled_stepper_tag stepper_category;
+
+ typedef bulirsch_stoer< State , Value , Deriv , Time , Algebra , Operations , Resizer > controlled_error_bs_type;
+
+ typedef typename inverse_time< time_type >::type inv_time_type;
+
+ typedef std::vector< value_type > value_vector;
+ typedef std::vector< time_type > time_vector;
+ typedef std::vector< inv_time_type > inv_time_vector; //should be 1/time_type for boost.units
+ typedef std::vector< value_vector > value_matrix;
+ typedef std::vector< size_t > int_vector;
+ typedef std::vector< wrapped_state_type > state_table_type;
+
+ const static size_t m_k_max = 8;
+
+
+ bulirsch_stoer(
+ value_type eps_abs = 1E-6 , value_type eps_rel = 1E-6 ,
+ value_type factor_x = 1.0 , value_type factor_dxdt = 1.0 )
+ : m_error_checker( eps_abs , eps_rel , factor_x, factor_dxdt ) , m_midpoint() ,
+ m_last_step_rejected( false ) , m_first( true ) ,
+ /* , m_t_last() ,
+ m_current_k_opt() ,
+ m_algebra() ,
+ m_dxdt_resizer() , m_xnew_resizer() , m_resizer() ,
+ m_xnew() , m_err() , m_dxdt() ,*/
+ m_interval_sequence( m_k_max+1 ) ,
+ m_coeff( m_k_max+1 ) ,
+ m_cost( m_k_max+1 ) ,
+ m_table( m_k_max ) ,
+ STEPFAC1( 0.65 ) , STEPFAC2( 0.94 ) , STEPFAC3( 0.02 ) , STEPFAC4( 4.0 ) , KFAC1( 0.8 ) , KFAC2( 0.9 )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+ //m_dt_last = 1.0E30;
+ for( unsigned short i = 0; i < m_k_max+1; i++ )
+ {
+ m_interval_sequence[i] = 2 * (i+1);
+ if( i == 0 )
+ m_cost[i] = m_interval_sequence[i];
+ else
+ m_cost[i] = m_cost[i-1] + m_interval_sequence[i];
+ m_coeff[i].resize(i);
+ for( size_t k = 0 ; k < i ; ++k )
+ {
+ const value_type r = static_cast< value_type >( m_interval_sequence[i] ) / static_cast< value_type >( m_interval_sequence[k] );
+ m_coeff[i][k] = 1.0 / ( r*r - static_cast< value_type >( 1.0 ) ); // coefficients for extrapolation
+ //std::cout << i << "," << k << " " << m_coeff[i][k] << '\t' ;
+ }
+ //std ::cout << std::endl;
+ // crude estimate of optimal order
+ const value_type logfact( -log10( max BOOST_PREVENT_MACRO_SUBSTITUTION( eps_rel , 1.0E-12 ) ) * 0.6 + 0.5 );
+ m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 1 , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>( m_k_max-1 ) , static_cast<int>( logfact ) ));
+ //m_current_k_opt = m_k_max - 1;
+ //std::cout << m_cost[i] << std::endl;
+ }
+
+ }
+
+
+ /*
+ * Version 1 : try_step( sys , x , t , dt )
+ *
+ * The overloads are needed to solve the forwarding problem
+ */
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ return try_step_v1( system , x , t, dt );
+ }
+
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , const StateInOut &x , time_type &t , time_type &dt )
+ {
+ return try_step_v1( system , x , t, dt );
+ }
+
+ /*
+ * Version 2 : try_step( sys , x , dxdt , t , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ template< class System , class StateInOut , class DerivIn >
+ controlled_step_result try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt )
+ {
+ m_xnew_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_xnew< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , dt );
+ if( res == success )
+ {
+ boost::numeric::odeint::copy( m_xnew.m_v , x );
+ }
+ return res;
+ }
+
+ /*
+ * Version 3 : try_step( sys , in , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ template< class System , class StateIn , class StateOut >
+ controlled_step_result try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_m_dxdt< StateIn > , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v , t );
+ return try_step( system , in , m_dxdt.m_v , t , out , dt );
+ }
+
+
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , time_type &dt )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+
+ static const value_type val1( 1.0 );
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ if( m_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) )
+ {
+ reset(); // system resized -> reset
+ }
+
+ if( dt != m_dt_last )
+ {
+ reset(); // step size changed from outside -> reset
+ }
+
+ bool reject( true );
+
+ time_vector h_opt( m_k_max+1 );
+ inv_time_vector work( m_k_max+1 );
+
+ //std::cout << "t=" << t <<", dt=" << dt << "(" << m_dt_last << ")" << ", k_opt=" << m_current_k_opt << std::endl;
+
+ time_type new_h = dt;
+
+ for( size_t k = 0 ; k <= m_current_k_opt+1 ; k++ )
+ {
+ //std::cout << " k=" << k; //<<": " << ", first: " << m_first << std::endl;
+ m_midpoint.set_steps( m_interval_sequence[k] );
+ if( k == 0 )
+ {
+ m_midpoint.do_step( sys , in , dxdt , t , out , dt );
+ }
+ else
+ {
+ m_midpoint.do_step( sys , in , dxdt , t , m_table[k-1].m_v , dt );
+ extrapolate( k , m_table , m_coeff , out );
+ // get error estimate
+ m_algebra.for_each3( m_err.m_v , out , m_table[0].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 , -val1 ) );
+ const value_type error = m_error_checker.error( m_algebra , in , dxdt , m_err.m_v , dt );
+ h_opt[k] = calc_h_opt( dt , error , k );
+ work[k] = static_cast<value_type>( m_cost[k] ) / h_opt[k];
+ //std::cout << '\t' << "h_opt=" << h_opt[k] << ", work=" << work[k] << std::endl;
+ //std::cout << '\t' << "error: " << error << std::endl;
+
+ if( (k == m_current_k_opt-1) || m_first )
+ { // convergence before k_opt ?
+ if( error < 1.0 )
+ {
+ //convergence
+ reject = false;
+ if( (work[k] < KFAC2*work[k-1]) || (m_current_k_opt <= 2) )
+ {
+ // leave order as is (except we were in first round)
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k)+1 ) );
+ new_h = h_opt[k];
+ new_h *= static_cast<value_type>( m_cost[k+1] ) / static_cast<value_type>( m_cost[k] );
+ } else {
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k) ) );
+ new_h = h_opt[k];
+ }
+ break;
+ }
+ else if( should_reject( error , k ) && !m_first )
+ {
+ reject = true;
+ new_h = h_opt[k];
+ break;
+ }
+ }
+ if( k == m_current_k_opt )
+ { // convergence at k_opt ?
+ if( error < 1.0 )
+ {
+ //convergence
+ reject = false;
+ if( (work[k-1] < KFAC2*work[k]) )
+ {
+ m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 );
+ new_h = h_opt[m_current_k_opt];
+ }
+ else if( (work[k] < KFAC2*work[k-1]) && !m_last_step_rejected )
+ {
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max-1) , static_cast<int>(m_current_k_opt)+1 );
+ new_h = h_opt[k];
+ new_h *= m_cost[m_current_k_opt]/m_cost[k];
+ //std::cout << new_h << std::endl;
+ } else
+ new_h = h_opt[m_current_k_opt];
+ break;
+ }
+ else if( should_reject( error , k ) )
+ {
+ reject = true;
+ new_h = h_opt[m_current_k_opt];
+ break;
+ }
+ }
+ if( k == m_current_k_opt+1 )
+ { // convergence at k_opt+1 ?
+ //std::cout << "convergence at k_opt+1 ?" << std::endl;
+ if( error < 1.0 )
+ { //convergence
+ reject = false;
+ if( work[k-2] < KFAC2*work[k-1] )
+ m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 );
+ if( (work[k] < KFAC2*work[m_current_k_opt]) && !m_last_step_rejected )
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , static_cast<int>(k) );
+ new_h = h_opt[m_current_k_opt];
+ } else
+ {
+ reject = true;
+ new_h = h_opt[m_current_k_opt];
+ }
+ break;
+ }
+ }
+ }
+
+ if( !reject )
+ {
+ t += dt;
+ }// else
+ // std::cout << "REJECT!" << std::endl;
+
+ if( !m_last_step_rejected || boost::numeric::odeint::detail::less_with_sign(new_h, dt, dt) )
+ {
+ m_dt_last = new_h;
+ dt = new_h;
+ }
+
+ m_last_step_rejected = reject;
+ m_first = false;
+
+ if( reject )
+ return fail;
+ else
+ return success;
+ }
+
+ void reset()
+ {
+ //std::cout << "reset" << std::endl;
+ m_first = true;
+ m_last_step_rejected = false;
+ }
+
+
+ /* Resizer methods */
+
+
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_m_dxdt( x );
+ resize_m_xnew( x );
+ resize_impl( x );
+ m_midpoint.adjust_size();
+ }
+
+
+private:
+
+ template< class StateIn >
+ bool resize_m_dxdt( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_xnew( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized( false );
+ for( size_t i = 0 ; i < m_k_max ; ++i )
+ resized |= adjust_size_by_resizeability( m_table[i] , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable<state_type>::type() );
+ return resized;
+ }
+
+
+ template< class System , class StateInOut >
+ controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_dxdt< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ sys( x , m_dxdt.m_v ,t );
+ return try_step( system , x , m_dxdt.m_v , t , dt );
+ }
+
+
+ template< class StateInOut >
+ void extrapolate( size_t k , state_table_type &table , const value_matrix &coeff , StateInOut &xest )
+ //polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf
+ {
+ //std::cout << "extrapolate k=" << k << ":" << std::endl;
+ static const value_type val1 = static_cast< value_type >( 1.0 );
+ for( int j=k-1 ; j>0 ; --j )
+ {
+ //std::cout << '\t' << m_coeff[k][j];
+ m_algebra.for_each3( table[j-1].m_v , table[j].m_v , table[j-1].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k][j] , -coeff[k][j] ) );
+ }
+ //std::cout << std::endl << m_coeff[k][0] << std::endl;
+ m_algebra.for_each3( xest , table[0].m_v , xest ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k][0] , -coeff[k][0]) );
+ }
+
+ time_type calc_h_opt( time_type h , value_type error , size_t k ) const
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+ using std::pow;
+ value_type expo=1.0/(2*k+1);
+ value_type facmin = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , expo );
+ value_type fac;
+ if (error == 0.0)
+ fac=1.0/facmin;
+ else
+ {
+ fac = STEPFAC2 / pow BOOST_PREVENT_MACRO_SUBSTITUTION( error / STEPFAC1 , expo );
+ fac = max BOOST_PREVENT_MACRO_SUBSTITUTION( facmin/STEPFAC4 , min BOOST_PREVENT_MACRO_SUBSTITUTION( 1.0/facmin , fac ) );
+ }
+ //return std::abs(h*fac);
+ return h*fac;
+ }
+
+ controlled_step_result set_k_opt( size_t k , const inv_time_vector &work , const time_vector &h_opt , time_type &dt )
+ {
+ //std::cout << "finding k_opt..." << std::endl;
+ if( k == 1 )
+ {
+ m_current_k_opt = 2;
+ //dt = h_opt[ m_current_k_opt-1 ] * m_cost[ m_current_k_opt ] / m_cost[ m_current_k_opt-1 ] ;
+ return success;
+ }
+ if( (work[k-1] < KFAC1*work[k]) || (k == m_k_max) )
+ { // order decrease
+ m_current_k_opt = k-1;
+ dt = h_opt[ m_current_k_opt ];
+ return success;
+ }
+ else if( (work[k] < KFAC2*work[k-1]) || m_last_step_rejected || (k == m_k_max-1) )
+ { // same order - also do this if last step got rejected
+ m_current_k_opt = k;
+ dt = h_opt[ m_current_k_opt ];
+ return success;
+ }
+ else
+ { // order increase - only if last step was not rejected
+ m_current_k_opt = k+1;
+ dt = h_opt[ m_current_k_opt-1 ] * m_cost[ m_current_k_opt ] / m_cost[ m_current_k_opt-1 ] ;
+ return success;
+ }
+ }
+
+ bool in_convergence_window( size_t k ) const
+ {
+ if( (k == m_current_k_opt-1) && !m_last_step_rejected )
+ return true; // decrease stepsize only if last step was not rejected
+ return ( (k == m_current_k_opt) || (k == m_current_k_opt+1) );
+ }
+
+ bool should_reject( value_type error , size_t k ) const
+ {
+ if( k == m_current_k_opt-1 )
+ {
+ const value_type d = m_interval_sequence[m_current_k_opt] * m_interval_sequence[m_current_k_opt+1] /
+ (m_interval_sequence[0]*m_interval_sequence[0]);
+ //step will fail, criterion 17.3.17 in NR
+ return ( error > d*d );
+ }
+ else if( k == m_current_k_opt )
+ {
+ const value_type d = m_interval_sequence[m_current_k_opt] / m_interval_sequence[0];
+ return ( error > d*d );
+ } else
+ return error > 1.0;
+ }
+
+ default_error_checker< value_type, algebra_type , operations_type > m_error_checker;
+ modified_midpoint< state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > m_midpoint;
+
+ bool m_last_step_rejected;
+ bool m_first;
+
+ time_type m_dt_last;
+ time_type m_t_last;
+
+ size_t m_current_k_opt;
+
+ algebra_type m_algebra;
+
+ resizer_type m_dxdt_resizer;
+ resizer_type m_xnew_resizer;
+ resizer_type m_resizer;
+
+ wrapped_state_type m_xnew;
+ wrapped_state_type m_err;
+ wrapped_deriv_type m_dxdt;
+
+ int_vector m_interval_sequence; // stores the successive interval counts
+ value_matrix m_coeff;
+ int_vector m_cost; // costs for interval count
+
+ state_table_type m_table; // sequence of states for extrapolation
+
+ const value_type STEPFAC1 , STEPFAC2 , STEPFAC3 , STEPFAC4 , KFAC1 , KFAC2;
+};
+
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,830 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp
+
+ [begin_description]
+ Implementaiton of the Burlish-Stoer method with dense output
+ [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_BULIRSCH_STOER_DENSE_OUT_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_DENSE_OUT_HPP_INCLUDED
+
+
+#include <iostream>
+
+#include <algorithm>
+
+#include <boost/config.hpp> // for min/max guidelines
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/math/special_functions/binomial.hpp>
+
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/modified_midpoint.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+
+#include <boost/type_traits.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+
+template< class T , size_t N >
+std::ostream& operator<<( std::ostream& output , const boost::array< T , N >& a ) {
+ output << "[ " << a[0] ;
+ for( size_t n = 1 ; n<N ; ++n )
+ output << " , " << a[n];
+ output << " ]";
+ return output; // for multiple << operators.
+}
+
+*/
+
+
+
+
+template<
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class Resizer = initially_resizer
+ >
+class bulirsch_stoer_dense_out {
+
+
+public:
+
+ typedef State state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef Resizer resizer_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef dense_output_stepper_tag stepper_category;
+
+ typedef bulirsch_stoer_dense_out< State , Value , Deriv , Time , Algebra , Operations , Resizer > controlled_error_bs_type;
+
+ typedef typename inverse_time< time_type >::type inv_time_type;
+
+ typedef std::vector< value_type > value_vector;
+ typedef std::vector< time_type > time_vector;
+ typedef std::vector< inv_time_type > inv_time_vector; //should be 1/time_type for boost.units
+ typedef std::vector< value_vector > value_matrix;
+ typedef std::vector< size_t > int_vector;
+ typedef std::vector< wrapped_state_type > state_vector_type;
+ typedef std::vector< wrapped_deriv_type > deriv_vector_type;
+ typedef std::vector< deriv_vector_type > deriv_table_type;
+
+ const static size_t m_k_max = 8;
+
+
+
+
+ bulirsch_stoer_dense_out(
+ value_type eps_abs = 1E-6 , value_type eps_rel = 1E-6 ,
+ value_type factor_x = 1.0 , value_type factor_dxdt = 1.0 ,
+ bool control_interpolation = false )
+ : m_error_checker( eps_abs , eps_rel , factor_x, factor_dxdt ) ,
+ m_control_interpolation( control_interpolation) ,
+ m_last_step_rejected( false ) , m_first( true ) ,
+ m_current_state_x1( true ) ,
+ m_error( m_k_max ) ,
+ m_interval_sequence( m_k_max+1 ) ,
+ m_coeff( m_k_max+1 ) ,
+ m_cost( m_k_max+1 ) ,
+ m_table( m_k_max ) ,
+ m_mp_states( m_k_max+1 ) ,
+ m_derivs( m_k_max+1 ) ,
+ m_diffs( 2*m_k_max+1 ) ,
+ STEPFAC1( 0.65 ) , STEPFAC2( 0.94 ) , STEPFAC3( 0.02 ) , STEPFAC4( 4.0 ) , KFAC1( 0.8 ) , KFAC2( 0.9 )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+
+ for( unsigned short i = 0; i < m_k_max+1; i++ )
+ {
+ m_interval_sequence[i] = 2 + 4*i; // 2 6 10 14 ...
+ m_derivs[i].resize( m_interval_sequence[i] );
+ if( i == 0 )
+ m_cost[i] = m_interval_sequence[i];
+ else
+ m_cost[i] = m_cost[i-1] + m_interval_sequence[i];
+ m_coeff[i].resize(i);
+ for( size_t k = 0 ; k < i ; ++k )
+ {
+ const value_type r = static_cast< value_type >( m_interval_sequence[i] ) / static_cast< value_type >( m_interval_sequence[k] );
+ m_coeff[i][k] = 1.0 / ( r*r - static_cast< value_type >( 1.0 ) ); // coefficients for extrapolation
+ //std::cout << i << "," << k << " " << m_coeff[i][k] << '\t' ;
+ }
+ //std ::cout << std::endl;
+ // crude estimate of optimal order
+ const value_type logfact( -log10( max BOOST_PREVENT_MACRO_SUBSTITUTION( eps_rel , static_cast< value_type >( 1.0E-12 ) ) ) * 0.6 + 0.5 );
+ m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 1 , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>( m_k_max-1 ) , static_cast<int>( logfact ) ));
+ //m_current_k_opt = m_k_max - 1;
+ //std::cout << m_cost[i] << std::endl;
+ }
+ int num = 1;
+ for( int i = 2*(m_k_max) ; i >=0 ; i-- )
+ {
+ m_diffs[i].resize( num );
+ //std::cout << "m_diffs[" << i << "] size: " << num << std::endl;
+ num += (i+1)%2;
+ }
+ }
+
+
+
+/*
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ m_xnew_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_xnew< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ controlled_step_result res = try_step( system , x , t , m_xnew.m_v , dt );
+ if( ( res == success_step_size_increased ) || ( res == success_step_size_unchanged ) )
+ {
+ boost::numeric::odeint::copy( m_xnew.m_v , x );
+ }
+ return res;
+ }
+*/
+
+ template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut >
+ controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , DerivOut &dxdt_new , time_type &dt )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+ using std::pow;
+
+ static const value_type val1( 1.0 );
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+// if( m_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) )
+// reset(); // system resized -> reset
+// if( dt != m_dt_last )
+// reset(); // step size changed from outside -> reset
+
+ bool reject( true );
+
+ time_vector h_opt( m_k_max+1 );
+ inv_time_vector work( m_k_max+1 );
+
+ m_k_final = 0;
+ time_type new_h = dt;
+
+ //std::cout << "t=" << t <<", dt=" << dt << ", k_opt=" << m_current_k_opt << ", first: " << m_first << std::endl;
+
+ for( size_t k = 0 ; k <= m_current_k_opt+1 ; k++ )
+ {
+ //std::cout << "k=" << k <<" (steps=" << m_interval_sequence[k] << "): " << std::endl;
+ m_midpoint.set_steps( m_interval_sequence[k] );
+ if( k == 0 )
+ {
+ m_midpoint.do_step( sys , in , dxdt , t , out , dt , m_mp_states[k].m_v , m_derivs[k]);
+ }
+ else
+ {
+ m_midpoint.do_step( sys , in , dxdt , t , m_table[k-1].m_v , dt , m_mp_states[k].m_v , m_derivs[k] );
+ extrapolate( k , m_table , m_coeff , out );
+ // get error estimate
+ m_algebra.for_each3( m_err.m_v , out , m_table[0].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 , -val1 ) );
+ const value_type error = m_error_checker.error( m_algebra , in , dxdt , m_err.m_v , dt );
+ h_opt[k] = calc_h_opt( dt , error , k );
+ work[k] = static_cast<value_type>( m_cost[k] ) / h_opt[k];
+ //std::cout << '\t' << "h_opt=" << h_opt[k] << ", work=" << work[k] << std::endl;
+ //std::cout << '\t' << "error: " << error << std::endl;
+
+ m_k_final = k;
+
+ if( (k == m_current_k_opt-1) || m_first )
+ { // convergence before k_opt ?
+ if( error < 1.0 )
+ {
+ //convergence
+ reject = false;
+ if( (work[k] < KFAC2*work[k-1]) || (m_current_k_opt <= 2) )
+ {
+ // leave order as is (except we were in first round)
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k)+1 ) );
+ new_h = h_opt[k] * static_cast<value_type>( m_cost[k+1] ) / static_cast<value_type>( m_cost[k] );
+ } else {
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k) ) );
+ new_h = h_opt[k];
+ }
+ break;
+ }
+ else if( should_reject( error , k ) && !m_first )
+ {
+ reject = true;
+ new_h = h_opt[k];
+ break;
+ }
+ }
+ if( k == m_current_k_opt )
+ { // convergence at k_opt ?
+ if( error < 1.0 )
+ {
+ //convergence
+ reject = false;
+ if( (work[k-1] < KFAC2*work[k]) )
+ {
+ m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 );
+ new_h = h_opt[m_current_k_opt];
+ }
+ else if( (work[k] < KFAC2*work[k-1]) && !m_last_step_rejected )
+ {
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , static_cast<int>(m_current_k_opt)+1 );
+ new_h = h_opt[k]*static_cast<value_type>( m_cost[m_current_k_opt] ) / static_cast<value_type>( m_cost[k] );
+ } else
+ new_h = h_opt[m_current_k_opt];
+ break;
+ }
+ else if( should_reject( error , k ) )
+ {
+ reject = true;
+ new_h = h_opt[m_current_k_opt];
+ break;
+ }
+ }
+ if( k == m_current_k_opt+1 )
+ { // convergence at k_opt+1 ?
+ if( error < 1.0 )
+ { //convergence
+ reject = false;
+ if( work[k-2] < KFAC2*work[k-1] )
+ m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 );
+ if( (work[k] < KFAC2*work[m_current_k_opt]) && !m_last_step_rejected )
+ m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , static_cast<int>(k) );
+ new_h = h_opt[m_current_k_opt];
+ } else
+ {
+ reject = true;
+ new_h = h_opt[m_current_k_opt];
+ }
+ break;
+ }
+ }
+ }
+
+ if( !reject )
+ {
+
+ //calculate dxdt for next step and dense output
+ sys( out , dxdt_new , t+dt );
+
+ //prepare dense output
+ value_type error = prepare_dense_output( m_k_final , in , dxdt , out , dxdt_new , dt );
+
+ if( error > static_cast<value_type>(10) ) // we are not as accurate for interpolation as for the steps
+ {
+ reject = true;
+ new_h = dt * pow BOOST_PREVENT_MACRO_SUBSTITUTION( error , static_cast<value_type>(-1)/(2*m_k_final+2) );
+ //std::cout << "####### rejected #######! (t=" << t << ") interpolation error: " << error << " , new dt: " << new_h << std::endl;
+ } else {
+ //std::cout << "####### accepted ####### - new k: " << m_current_k_opt << ", new stepsize: " << new_h << std::endl;
+ //increase time
+ t += dt;
+ }
+ }// else std::cout << "####### rejected #######!" << std::endl;
+
+ //set next stepsize
+ if( !m_last_step_rejected || (new_h < dt) )
+ dt = new_h;
+
+ m_last_step_rejected = reject;
+ if( reject )
+ return fail;
+ else
+ return success;
+ }
+
+ template< class StateType >
+ void initialize( const StateType &x0 , const time_type &t0 , const time_type &dt0 )
+ {
+ m_resizer.adjust_size( x0 , detail::bind( &controlled_error_bs_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) );
+ boost::numeric::odeint::copy( x0 , get_current_state() );
+ m_t = t0;
+ m_dt = dt0;
+ reset();
+ }
+
+
+ /* =======================================================
+ * the actual step method that should be called from outside (maybe make try_step private?)
+ */
+ template< class System >
+ std::pair< time_type , time_type > do_step( System system )
+ {
+ const size_t max_count = 1000;
+
+ if( m_first )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ sys( get_current_state() , get_current_deriv() , m_t );
+ }
+
+ controlled_step_result res = fail;
+ m_t_last = m_t;
+ size_t count = 0;
+ while( res == fail )
+ {
+ res = try_step( system , get_current_state() , get_current_deriv() , m_t , get_old_state() , get_old_deriv() , m_dt );
+ m_first = false;
+ if( count++ == max_count )
+ throw std::overflow_error( "bulirsch_stoer : too much iterations!");
+ }
+ toggle_current_state();
+ return std::make_pair( m_t_last , m_t );
+ }
+
+ /* performs the interpolation from a calculated step */
+ template< class StateOut >
+ void calc_state( time_type t , StateOut &x ) const
+ {
+ //std::cout << "===========" << std::endl << "doing interpolation for t=" << t << std::endl;
+ do_interpolation( t , x );
+ //std::cout << "===========" << std::endl;
+ }
+
+
+ const state_type& current_state( void ) const
+ {
+ return get_current_state();
+ }
+
+ time_type current_time( void ) const
+ {
+ return m_t;
+ }
+
+ const state_type& previous_state( void ) const
+ {
+ return get_old_state();
+ }
+
+ time_type previous_time( void ) const
+ {
+ return m_t_last;
+ }
+
+ time_type current_time_step( void ) const
+ {
+ return m_dt;
+ }
+
+
+ void reset()
+ {
+ m_first = true;
+ m_last_step_rejected = false;
+ }
+
+
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_impl( x );
+ m_midpoint.adjust_size();
+ }
+
+
+private:
+
+ template< class StateInOut , class StateVector >
+ void extrapolate( size_t k , StateVector &table , const value_matrix &coeff , StateInOut &xest , size_t order_start_index = 0 )
+ //polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf
+ {
+ static const value_type val1( 1.0 );
+ for( int j=k-1 ; j>0 ; --j )
+ {
+ m_algebra.for_each3( table[j-1].m_v , table[j].m_v , table[j-1].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][j + order_start_index] ,
+ -coeff[k + order_start_index][j + order_start_index] ) );
+ }
+ m_algebra.for_each3( xest , table[0].m_v , xest ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][0 + order_start_index] ,
+ -coeff[k + order_start_index][0 + order_start_index]) );
+ }
+
+
+ template< class StateVector >
+ void extrapolate_dense_out( size_t k , StateVector &table , const value_matrix &coeff , size_t order_start_index = 0 )
+ //polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf
+ {
+ // result is written into table[0]
+ //std::cout << "extrapolate k=" << k << ":" << std::endl;
+ static const value_type val1( 1.0 );
+ for( int j=k ; j>1 ; --j )
+ {
+ //std::cout << '\t' << coeff[k + order_start_index][j + order_start_index - 1];
+ m_algebra.for_each3( table[j-1].m_v , table[j].m_v , table[j-1].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][j + order_start_index - 1] ,
+ -coeff[k + order_start_index][j + order_start_index - 1] ) );
+ }
+ //std::cout << std::endl << coeff[k + order_start_index][order_start_index] << std::endl;
+ m_algebra.for_each3( table[0].m_v , table[1].m_v , table[0].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][order_start_index] ,
+ -coeff[k + order_start_index][order_start_index]) );
+ }
+
+ time_type calc_h_opt( time_type h , value_type error , size_t k ) const
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+ using std::pow;
+
+ value_type expo=1.0/(m_interval_sequence[k-1]);
+ value_type facmin = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , expo );
+ value_type fac;
+ if (error == 0.0)
+ fac=1.0/facmin;
+ else
+ {
+ fac = STEPFAC2 / pow BOOST_PREVENT_MACRO_SUBSTITUTION( error / STEPFAC1 , expo );
+ fac = max BOOST_PREVENT_MACRO_SUBSTITUTION( facmin/STEPFAC4 , min BOOST_PREVENT_MACRO_SUBSTITUTION( 1.0/facmin , fac ) );
+ }
+ //return std::abs(h*fac); //std::min( 0.1 , std::abs(h*fac) );
+ return h*fac;
+ }
+
+ bool in_convergence_window( size_t k ) const
+ {
+ if( (k == m_current_k_opt-1) && !m_last_step_rejected )
+ return true; // decrease order only if last step was not rejected
+ return ( (k == m_current_k_opt) || (k == m_current_k_opt+1) );
+ }
+
+ bool should_reject( value_type error , size_t k ) const
+ {
+ if( k == m_current_k_opt-1 )
+ {
+ const value_type d = m_interval_sequence[m_current_k_opt] * m_interval_sequence[m_current_k_opt+1] /
+ (m_interval_sequence[0]*m_interval_sequence[0]);
+ //step will fail, criterion 17.3.17 in NR
+ return ( error > d*d );
+ }
+ else if( k == m_current_k_opt )
+ {
+ const value_type d = m_interval_sequence[m_current_k_opt+1] / m_interval_sequence[0];
+ return ( error > d*d );
+ } else
+ return error > 1.0;
+ }
+
+ template< class StateIn1 , class DerivIn1 , class StateIn2 , class DerivIn2 >
+ value_type prepare_dense_output( int k , const StateIn1 &x_start , const DerivIn1 &dxdt_start ,
+ const StateIn2 & /* x_end */ , const DerivIn2 & /*dxdt_end */ , time_type dt ) // k is the order to which the result was approximated
+ {
+
+ // compute the coefficients of the interpolation polynomial
+ // we parametrize the interval t .. t+dt by theta = -1 .. 1
+ // we use 2k+3 values at the interval center theta=0 to obtain the interpolation coefficients
+ // the values are x(t+dt/2) and the derivatives dx/dt , ... d^(2k+2) x / dt^(2k+2) at the midpoints
+ // the derivatives are approximated via finite differences
+ // all values are obtained from interpolation of the results from the increasing orders of the midpoint calls
+
+ // calculate finite difference approximations to derivatives at the midpoint
+ for( int j = 0 ; j<=k ; j++ )
+ {
+ /* not working with boost units... */
+ const value_type d = m_interval_sequence[j] / ( static_cast<value_type>(2) * dt );
+ value_type f = 1.0; //factor 1/2 here because our interpolation interval has length 2 !!!
+ for( int kappa = 0 ; kappa <= 2*j+1 ; ++kappa )
+ {
+ calculate_finite_difference( j , kappa , f , dxdt_start );
+ f *= d;
+ }
+ //std::cout << "x_mp[" << j << "] = " << m_mp_states[j].m_v << std::endl;
+
+ if( j > 0 )
+ extrapolate_dense_out( j , m_mp_states , m_coeff );
+ }
+
+ //std::cout << "a_0 = " << m_mp_states[0].m_v << std::endl;
+
+ time_type d = dt/2;
+
+ // extrapolate finite differences
+ for( int kappa = 0 ; kappa<=2*k+1 ; kappa++ )
+ {
+ for( int j=1 ; j<=(k-kappa/2) ; ++j )
+ extrapolate_dense_out( j , m_diffs[kappa] , m_coeff , kappa/2 );
+
+ // extrapolation results are now stored in m_diffs[kappa][0]
+ //std::cout << "extrapolation result: " << m_diffs[kappa][0].m_v << std::endl;
+
+ // divide kappa-th derivative by kappa because we need these terms for dense output interpolation
+ m_algebra.for_each1( m_diffs[kappa][0].m_v , typename operations_type::template scale< time_type >( static_cast<time_type>(d) ) );
+
+ d *= dt/(2*(kappa+2));
+
+ //std::cout << "a_" << kappa+1 << " = " << m_diffs[kappa][0].m_v << std::endl;
+ }
+
+ // dense output coefficients a_0 is stored in m_mp_states[0], a_i for i = 1...2k are stored in m_diffs[i-1][0]
+
+ // the error is just the highest order coefficient of the interpolation polynomial
+ // this is because we use only the midpoint theta=0 as support for the interpolation (remember that theta = -1 .. 1)
+
+ value_type error = 0.0;
+ if( m_control_interpolation )
+ {
+ boost::numeric::odeint::copy( m_diffs[2*k+1][0].m_v , m_err.m_v );
+ error = m_error_checker.error( m_algebra , x_start , dxdt_start , m_err.m_v , dt );
+ }
+
+ return error;
+
+ // calculate coefficient a_{2k+1} = (2k+5)/4 * x_end - (2k+5)/4 * x_start - 1/4 * dxdt_end - 1/4 * dxdt_start + sum_i=0...k-1 (i-k-2)*a_{2i+1}
+
+
+ //std::cout << std::endl << x_start << std::endl << x_end << std::endl;
+ //std::cout << std::endl << dxdt_start << std::endl << dxdt_end << std::endl << std::endl;
+
+ // we don't use additional terms in the polynomial, the following calculations are thus not required
+
+/*
+ m_algebra.for_each5( m_a1.m_v , x_end , x_start , dxdt_end , dxdt_start ,
+ typename operations_type::template scale_sum4< value_type >( static_cast<value_type>(2*k+5)/static_cast<value_type>(4),
+ static_cast<value_type>(-2*k-5)/static_cast<value_type>(4),
+ static_cast<value_type>(-dt)/static_cast<value_type>(8) ,
+ static_cast<value_type>(-dt)/static_cast<value_type>(8) ) );
+ for( int i = 0 ; i<k ; ++i )
+ m_algebra.for_each3( m_a1.m_v , m_a1.m_v , m_diffs[2*i][0].m_v ,
+ typename operations_type::template scale_sum2< value_type >( 1 , i-k-2 ) );
+
+ //std::cout << "a_" << 2*k+1 << " = " << m_a1.m_v << std::endl;
+
+ // calculate coefficient a_{2k+2} = (k+2)/2 * x_end + (k+2)/2 * x_start - 1/4 * dxdt_end + 1/4 * dxdt_start + (k+2)/2 * x_mp + sum_i=1...k (i-k-2)*a_{2i}
+ m_algebra.for_each6( m_a2.m_v , x_end , x_start , dxdt_end , dxdt_start , m_mp_states[0].m_v ,
+ typename operations_type::template scale_sum5< value_type >( static_cast<value_type>(k+2)/static_cast<value_type>(2),
+ static_cast<value_type>(k+2)/static_cast<value_type>(2),
+ static_cast<value_type>(-dt)/static_cast<value_type>(8) ,
+ static_cast<value_type>(dt)/static_cast<value_type>(8) ,
+ static_cast<value_type>(-k-2) ) );
+ for( int i = 1 ; i<=k ; ++i )
+ m_algebra.for_each3( m_a2.m_v , m_a2.m_v , m_diffs[2*i-1][0].m_v ,
+ typename operations_type::template scale_sum2< value_type >( 1 , i-k-2 ) );
+
+ //std::cout << "a_" << 2*k+2 << " = " << m_a2.m_v << std::endl;
+
+ // calculate coefficient a_{2k+3} = -(2k+3)/4 * x_end + (2k+3)/4 * x_start + 1/4 * dxdt_end + 1/4 * dxdt_start + sum_i=0...k-1 (k+1-i)*a_{2i+1}
+ m_algebra.for_each5( m_a3.m_v , x_end , x_start , dxdt_end , dxdt_start ,
+ typename operations_type::template scale_sum4< value_type >( static_cast<value_type>(-2*k-3)/static_cast<value_type>(4),
+ static_cast<value_type>(2*k+3)/static_cast<value_type>(4),
+ static_cast<value_type>(dt)/static_cast<value_type>(8) ,
+ static_cast<value_type>(dt)/static_cast<value_type>(8) ) );
+ for( int i = 0 ; i<k ; ++i )
+ m_algebra.for_each3( m_a3.m_v , m_a3.m_v , m_diffs[2*i][0].m_v ,
+ typename operations_type::template scale_sum2< value_type >( 1 , k+1-i ) );
+
+ //std::cout << "a_" << 2*k+3 << " = " << m_a3.m_v << std::endl;
+
+ // calculate coefficient a_{2k+4} = -(k+1)/2 * x_end - (k+1)/2 * x_start + 1/4 * dxdt_end - 1/4 * dxdt_start - (k+1)/2 * x_mp + sum_i=0...k-1 (k+1-i)*a_{2i}
+ m_algebra.for_each6( m_a4.m_v , x_end , x_start , dxdt_end , dxdt_start , m_mp_states[0].m_v ,
+ typename operations_type::template scale_sum5< value_type >( static_cast<value_type>(-k-1)/static_cast<value_type>(2),
+ static_cast<value_type>(-k-1)/static_cast<value_type>(2),
+ static_cast<value_type>(dt)/static_cast<value_type>(8) ,
+ static_cast<value_type>(-dt)/static_cast<value_type>(8),
+ static_cast<value_type>(k+1) ) );
+ for( int i = 1 ; i<=k ; ++i )
+ m_algebra.for_each3( m_a4.m_v , m_a4.m_v , m_diffs[2*i-1][0].m_v ,
+ typename operations_type::template scale_sum2< value_type >( 1 , k+1-i ) );
+*/
+ //std::cout << "a_" << 2*k+4 << " = " << m_a4.m_v << std::endl;
+ }
+
+ template< class DerivIn >
+ void calculate_finite_difference( size_t j , size_t kappa , value_type fac , const DerivIn &dxdt )
+ {
+ const int m = m_interval_sequence[j]/2-1;
+ if( kappa == 0) // no calculation required for 0th derivative of f
+ {
+ m_algebra.for_each2( m_diffs[0][j].m_v , m_derivs[j][m].m_v ,
+ typename operations_type::template scale_sum1< value_type >( fac ) );
+ //std::cout << "j=" << j << ", kappa=" << kappa << ", m=" << m;
+ //std::cout << ": m_diffs[" << kappa << "][" << j << "] = " << fac << " * f[" << m << "] ";
+ //std::cout << "(size(f)=" << m_derivs[j].size() << ") = " << m_diffs[0][j].m_v << std::endl;
+
+ }
+ else
+ {
+ //std::cout << m_derivs[j][1].m_v << " , " << dxdt << std::endl;
+
+ // calculate the index of m_diffs for this kappa-j-combination
+ const int j_diffs = j - kappa/2;
+
+ //std::cout << "j=" << j << ", kappa=" << kappa << ", m=" << m << ": m_diffs[" << kappa << "][" << j_diffs << "] = " << fac << " ( 1*f[" << m+kappa << "]";
+
+ m_algebra.for_each2( m_diffs[kappa][j_diffs].m_v , m_derivs[j][m+kappa].m_v ,
+ typename operations_type::template scale_sum1< value_type >( fac ) );
+ value_type sign = -1.0;
+ int c = 1;
+ //computes the j-th order finite difference for the kappa-th derivative of f at t+dt/2 using function evaluations stored in m_derivs
+ for( int i = m+static_cast<int>(kappa)-2 ; i >= m-static_cast<int>(kappa) ; i -= 2 )
+ {
+ if( i >= 0 )
+ {
+ m_algebra.for_each3( m_diffs[kappa][j_diffs].m_v , m_diffs[kappa][j_diffs].m_v , m_derivs[j][i].m_v ,
+ typename operations_type::template scale_sum2< value_type , value_type >( 1.0 ,
+ sign * fac * boost::math::binomial_coefficient< value_type >( kappa , c ) ) );
+ //std::cout << ( (sign > 0.0) ? " + " : " - " ) <<
+ // boost::math::binomial_coefficient< double >( kappa , c ) << "*f[" << i << "]";
+ }
+ else
+ {
+ m_algebra.for_each3( m_diffs[kappa][j_diffs].m_v , m_diffs[kappa][j_diffs].m_v , dxdt ,
+ typename operations_type::template scale_sum2< value_type , value_type >( 1.0 , sign * fac ) );
+ //std::cout << ( (sign > 0.0) ? " + " : " - " ) << "dxdt";
+ }
+ sign *= -1;
+ ++c;
+ }
+ //std::cout << " ) = " << m_diffs[kappa][j_diffs].m_v << std::endl;
+ }
+ }
+
+ template< class StateOut >
+ void do_interpolation( time_type t , StateOut &out ) const
+ {
+ // interpolation polynomial is defined for theta = -1 ... 1
+ // m_k_final is the number of order-iterations done for the last step - it governs the order of the interpolation polynomial
+ const value_type theta = 2 * get_unit_value( (t - m_t_last) / (m_t - m_t_last) ) - 1;
+ //std::cout << "theta=" << theta << std::endl;
+ //start with x = a0 + a_{2k+1} theta^{2k+1} + a_{2k+2} theta^{2k+2} + a_{2k+3} theta^{2k+3} + a_{2k+4} theta^{2k+4}
+ //std::cout << "x = a_0 + ";
+
+/* m_algebra.for_each6( out , m_mp_states[0].m_v , m_a1.m_v , m_a2.m_v , m_a3.m_v , m_a4.m_v ,
+ typename operations_type::template scale_sum5< time_type >(
+ static_cast<time_type>( 1 ) ,
+ std::pow( theta , 2*m_k_final+1 ) ,
+ std::pow( theta , 2*m_k_final+2 ) ,
+ std::pow( theta , 2*m_k_final+3 ) ,
+ std::pow( theta , 2*m_k_final+4 ) ) );
+*/
+
+ // we use only values at interval center, that is theta=0, for interpolation
+ // our interpolation polynomial is thus of order 2k+2, hence we have 2k+3 terms
+
+ boost::numeric::odeint::copy( m_mp_states[0].m_v , out );
+ // add remaining terms: x += a_1 theta + a2 theta^2 + ... + a_{2k} theta^{2k}
+ value_type theta_pow( theta );
+ for( size_t i=0 ; i<=2*m_k_final+1 ; ++i )
+ {
+ //std::cout << "a_" << i+1 << " theta^" << i+1 << " = " << m_diffs[i][0].m_v[0] * std::pow( theta , i+1 ) << std::endl;
+ m_algebra.for_each3( out , out , m_diffs[i][0].m_v ,
+ typename operations_type::template scale_sum2< value_type >( static_cast<value_type>(1) , theta_pow ) );
+ theta_pow *= theta;
+ }
+ }
+
+ /* Resizer methods */
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized( false );
+
+ resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable<state_type>::type() );
+
+ for( size_t i = 0 ; i < m_k_max ; ++i )
+ resized |= adjust_size_by_resizeability( m_table[i] , x , typename is_resizeable<state_type>::type() );
+ for( size_t i = 0 ; i < m_k_max+1 ; ++i )
+ resized |= adjust_size_by_resizeability( m_mp_states[i] , x , typename is_resizeable<state_type>::type() );
+ for( size_t i = 0 ; i < m_k_max+1 ; ++i )
+ for( size_t j = 0 ; j < m_derivs[i].size() ; ++j )
+ resized |= adjust_size_by_resizeability( m_derivs[i][j] , x , typename is_resizeable<deriv_type>::type() );
+ for( size_t i = 0 ; i < 2*m_k_max+1 ; ++i )
+ for( size_t j = 0 ; j < m_diffs[i].size() ; ++j )
+ resized |= adjust_size_by_resizeability( m_diffs[i][j] , x , typename is_resizeable<deriv_type>::type() );
+
+ return resized;
+ }
+
+
+ state_type& get_current_state( void )
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ const state_type& get_current_state( void ) const
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ state_type& get_old_state( void )
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ const state_type& get_old_state( void ) const
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ deriv_type& get_current_deriv( void )
+ {
+ return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ;
+ }
+
+ const deriv_type& get_current_deriv( void ) const
+ {
+ return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ;
+ }
+
+ deriv_type& get_old_deriv( void )
+ {
+ return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ;
+ }
+
+ const deriv_type& get_old_deriv( void ) const
+ {
+ return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ;
+ }
+
+
+ void toggle_current_state( void )
+ {
+ m_current_state_x1 = ! m_current_state_x1;
+ }
+
+
+
+ default_error_checker< value_type, algebra_type , operations_type > m_error_checker;
+ modified_midpoint_dense_out< state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > m_midpoint;
+
+ bool m_control_interpolation;
+
+ bool m_last_step_rejected;
+ bool m_first;
+
+ time_type m_t;
+ time_type m_dt;
+ time_type m_dt_last;
+ time_type m_t_last;
+
+ size_t m_current_k_opt;
+ size_t m_k_final;
+
+ algebra_type m_algebra;
+
+ resizer_type m_resizer;
+
+ wrapped_state_type m_x1 , m_x2;
+ wrapped_deriv_type m_dxdt1 , m_dxdt2;
+ wrapped_state_type m_err;
+ bool m_current_state_x1;
+
+
+
+ value_vector m_error; // errors of repeated midpoint steps and extrapolations
+ int_vector m_interval_sequence; // stores the successive interval counts
+ value_matrix m_coeff;
+ int_vector m_cost; // costs for interval count
+
+ state_vector_type m_table; // sequence of states for extrapolation
+
+ //for dense output:
+ state_vector_type m_mp_states; // sequence of approximations of x at distance center
+ deriv_table_type m_derivs; // table of function values
+ deriv_table_type m_diffs; // table of function values
+
+ //wrapped_state_type m_a1 , m_a2 , m_a3 , m_a4;
+
+ const value_type STEPFAC1 , STEPFAC2 , STEPFAC3 , STEPFAC4 , KFAC1 , KFAC2;
+};
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,607 @@
+/* [auto_generated]
+ boost/numeric/odeint/stepper/controlled_runge_kutta.hpp
+
+ [begin_description]
+ The default controlled stepper which can be used with all explicit Runge-Kutta 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_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED
+
+
+
+#include <cmath>
+
+#include <boost/config.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/util/copy.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * Error checker for controlled_error_stepper
+ */
+template
+<
+class Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations
+>
+class default_error_checker
+{
+public:
+
+ typedef Value value_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+
+
+ default_error_checker(
+ value_type eps_abs = static_cast< value_type >( 1.0e-6 ) ,
+ value_type eps_rel = static_cast< value_type >( 1.0e-6 ) ,
+ value_type a_x = static_cast< value_type >( 1 ) ,
+ value_type a_dxdt = static_cast< value_type >( 1 ) )
+ : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt )
+ { }
+
+
+ template< class State , class Deriv , class Err , class Time >
+ value_type error( const State &x_old , const Deriv &dxdt_old , Err &x_err , Time dt ) const
+ {
+ return error( algebra_type() , x_old , dxdt_old , x_err , dt );
+ }
+
+ template< class State , class Deriv , class Err , class Time >
+ value_type error( algebra_type &algebra , const State &x_old , const Deriv &dxdt_old , Err &x_err , Time dt ) const
+ {
+ // this overwrites x_err !
+ algebra.for_each3( x_err , x_old , dxdt_old ,
+ typename operations_type::template rel_error< value_type >( m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt * get_unit_value( dt ) ) );
+
+ value_type res = algebra.reduce( x_err ,
+ typename operations_type::template maximum< value_type >() , static_cast< value_type >( 0 ) );
+ return res;
+ }
+
+private:
+
+ value_type m_eps_abs;
+ value_type m_eps_rel;
+ value_type m_a_x;
+ value_type m_a_dxdt;
+
+};
+
+
+
+
+
+
+
+
+/*
+ * error stepper category dispatcher
+ */
+template<
+class ErrorStepper ,
+class ErrorChecker = default_error_checker< typename ErrorStepper::value_type ,
+typename ErrorStepper::algebra_type ,
+typename ErrorStepper::operations_type > ,
+class Resizer = typename ErrorStepper::resizer_type ,
+class ErrorStepperCategory = typename ErrorStepper::stepper_category
+>
+class controlled_runge_kutta ;
+
+
+
+
+/*
+ * explicit stepper version
+ *
+ * this class introduces the following try_step overloads
+ * try_step( sys , x , t , dt )
+ * try_step( sys , x , dxdt , t , dt )
+ * try_step( sys , in , t , out , dt )
+ * try_step( sys , in , dxdt , t , out , dt )
+ */
+template<
+class ErrorStepper ,
+class ErrorChecker ,
+class Resizer
+>
+class controlled_runge_kutta< ErrorStepper , ErrorChecker , Resizer , explicit_error_stepper_tag >
+{
+
+public:
+
+ typedef ErrorStepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+ typedef Resizer resizer_type;
+ typedef ErrorChecker error_checker_type;
+ typedef explicit_controlled_stepper_tag stepper_category;
+ typedef typename stepper_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
+
+ typedef controlled_runge_kutta< ErrorStepper , ErrorChecker , Resizer , explicit_error_stepper_tag > controlled_stepper_type;
+
+
+
+ controlled_runge_kutta(
+ const error_checker_type &error_checker = error_checker_type( ) ,
+ const stepper_type &stepper = stepper_type( )
+ )
+ : m_stepper( stepper ) , m_error_checker( error_checker )
+ { }
+
+
+
+ /*
+ * Version 1 : try_step( sys , x , t , dt )
+ *
+ * The overloads are needed to solve the forwarding problem
+ */
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ return try_step_v1( system , x , t, dt );
+ }
+
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , const StateInOut &x , time_type &t , time_type &dt )
+ {
+ return try_step_v1( system , x , t, dt );
+ }
+
+
+
+ /*
+ * Version 2 : try_step( sys , x , dxdt , t , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ template< class System , class StateInOut , class DerivIn >
+ controlled_step_result try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt )
+ {
+ m_xnew_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_xnew_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , dt );
+ if( res == success )
+ {
+ boost::numeric::odeint::copy( m_xnew.m_v , x );
+ }
+ return res;
+ }
+
+ /*
+ * Version 3 : try_step( sys , in , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ *
+ * the disable is needed to avoid ambiguous overloads if state_type = time_type
+ */
+ template< class System , class StateIn , class StateOut >
+ typename boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type
+ try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+ sys( in , m_dxdt.m_v , t );
+ return try_step( system , in , m_dxdt.m_v , t , out , dt );
+ }
+
+
+ /*
+ * Version 4 : try_step( sys , in , dxdt , t , out , dt )
+ *
+ * this version does not solve the forwarding problem, boost.range can not be used
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , time_type &dt )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+ using std::pow;
+
+ m_xerr_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_xerr_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ // do one step with error calculation
+ m_stepper.do_step( system , in , dxdt , t , out , dt , m_xerr.m_v );
+
+ m_max_rel_error = m_error_checker.error( m_stepper.algebra() , in , dxdt , m_xerr.m_v , dt );
+
+ if( m_max_rel_error > 1.0 )
+ {
+ // error too large - decrease dt ,limit scaling factor to 0.2 and reset state
+ dt *= max BOOST_PREVENT_MACRO_SUBSTITUTION ( static_cast<value_type>(9)/static_cast<value_type>(10) * pow( m_max_rel_error ,
+ static_cast<value_type>(-1) / ( m_stepper.error_order() - 1 ) ) ,
+ static_cast<value_type>(1)/static_cast<value_type> (5) );
+ return fail;
+ }
+ else
+ {
+ if( m_max_rel_error < 0.5 )
+ {
+ //error too small - increase dt and keep the evolution and limit scaling factor to 5.0
+ t += dt;
+ dt *= min BOOST_PREVENT_MACRO_SUBSTITUTION ( static_cast<value_type>(9)/static_cast<value_type>(10) * pow( m_max_rel_error ,
+ static_cast<value_type>(-1) / m_stepper.stepper_order() ) ,
+ static_cast<value_type>(5) );
+ return success;
+ }
+ else
+ {
+ t += dt;
+ return success;
+ }
+ }
+ }
+
+ value_type last_error( void ) const
+ {
+ return m_max_rel_error;
+ }
+
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_m_xerr_impl( x );
+ resize_m_dxdt_impl( x );
+ resize_m_xnew_impl( x );
+ m_stepper.adjust_size( x );
+ }
+
+ stepper_type& stepper( void )
+ {
+ return m_stepper;
+ }
+
+ const stepper_type& stepper( void ) const
+ {
+ return m_stepper;
+ }
+
+private:
+
+
+ template< class System , class StateInOut >
+ controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ sys( x , m_dxdt.m_v ,t );
+ return try_step( system , x , m_dxdt.m_v , t , dt );
+ }
+
+ template< class StateIn >
+ bool resize_m_xerr_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_dxdt_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_xnew_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
+ }
+
+
+
+ stepper_type m_stepper;
+ error_checker_type m_error_checker;
+
+ resizer_type m_dxdt_resizer;
+ resizer_type m_xerr_resizer;
+ resizer_type m_xnew_resizer;
+
+ wrapped_deriv_type m_dxdt;
+ wrapped_state_type m_xerr;
+ wrapped_state_type m_xnew;
+ value_type m_max_rel_error;
+};
+
+
+
+
+
+
+
+
+
+
+/*
+ * explicit stepper fsal version
+ *
+ * the class introduces the following try_step overloads
+ * try_step( sys , x , t , dt )
+ * try_step( sys , in , t , out , dt )
+ * try_step( sys , x , dxdt , t , dt )
+ * try_step( sys , in , dxdt_in , t , out , dxdt_out , dt )
+ */
+template<
+class ErrorStepper ,
+class ErrorChecker ,
+class Resizer
+>
+class controlled_runge_kutta< ErrorStepper , ErrorChecker , Resizer , explicit_error_stepper_fsal_tag >
+{
+
+public:
+
+ typedef ErrorStepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+ typedef Resizer resizer_type;
+ typedef ErrorChecker error_checker_type;
+ typedef explicit_controlled_stepper_fsal_tag stepper_category;
+ typedef typename stepper_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
+
+ typedef controlled_runge_kutta< ErrorStepper , ErrorChecker , Resizer , explicit_error_stepper_tag > controlled_stepper_type;
+
+ controlled_runge_kutta(
+ const error_checker_type &error_checker = error_checker_type() ,
+ const stepper_type &stepper = stepper_type()
+ )
+ : m_stepper( stepper ) , m_error_checker( error_checker ) ,
+ m_first_call( true )
+ { }
+
+ /*
+ * Version 1 : try_step( sys , x , t , dt )
+ *
+ * The two overloads are needed in order to solve the forwarding problem
+ */
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ return try_step_v1( system , x , t , dt );
+ }
+
+ template< class System , class StateInOut >
+ controlled_step_result try_step( System system , const StateInOut &x , time_type &t , time_type &dt )
+ {
+ return try_step_v1( system , x , t , dt );
+ }
+
+
+
+ /*
+ * Version 2 : try_step( sys , in , t , out , dt );
+ *
+ * This version does not solve the forwarding problem, boost::range can not be used.
+ *
+ * The disabler is needed to solve ambigous overloads
+ */
+ template< class System , class StateIn , class StateOut >
+ typename boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type
+ try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt )
+ {
+ if( m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
+ {
+ initialize( system , in , t );
+ }
+ return try_step( system , in , m_dxdt.m_v , t , out , dt );
+ }
+
+
+ /*
+ * Version 3 : try_step( sys , x , dxdt , t , dt )
+ *
+ * This version does not solve the forwarding problem, boost::range can not be used.
+ */
+ template< class System , class StateInOut , class DerivInOut >
+ controlled_step_result try_step( System system , StateInOut &x , DerivInOut &dxdt , time_type &t , time_type &dt )
+ {
+ m_xnew_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_xnew_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ m_dxdt_new_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_new_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) );
+ controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , m_dxdtnew.m_v , dt );
+ if( res == success )
+ {
+ boost::numeric::odeint::copy( m_xnew.m_v , x );
+ boost::numeric::odeint::copy( m_dxdtnew.m_v , dxdt );
+ }
+ return res;
+ }
+
+
+ /*
+ * Version 4 : try_step( sys , in , dxdt_in , t , out , dxdt_out , dt )
+ *
+ * This version does not solve the forwarding problem, boost::range can not be used.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut >
+ controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type &t ,
+ StateOut &out , DerivOut &dxdt_out , time_type &dt )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+
+ using std::pow;
+
+ m_xerr_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_xerr_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ //fsal: m_stepper.get_dxdt( dxdt );
+ //fsal: m_stepper.do_step( sys , x , dxdt , t , dt , m_x_err );
+ m_stepper.do_step( system , in , dxdt_in , t , out , dxdt_out , dt , m_xerr.m_v );
+
+ // this potentially overwrites m_x_err! (standard_error_checker does, at least)
+ value_type max_rel_err = m_error_checker.error( m_stepper.algebra() , in , dxdt_in , m_xerr.m_v , dt );
+
+ if( max_rel_err > 1.0 )
+ {
+ // error too large - decrease dt ,limit scaling factor to 0.2 and reset state
+ dt *= max BOOST_PREVENT_MACRO_SUBSTITUTION ( static_cast<value_type>( static_cast<value_type>(9)/static_cast<value_type>(10) * pow( max_rel_err , static_cast<value_type>(-1) / ( m_stepper.error_order() - 1 ) ) ) , static_cast<value_type>( static_cast<value_type>(1)/static_cast<value_type> (5)) );
+ return fail;
+ }
+ else
+ {
+ if( max_rel_err < 0.5 )
+ { //error too small - increase dt and keep the evolution and limit scaling factor to 5.0
+ t += dt;
+ dt *= min BOOST_PREVENT_MACRO_SUBSTITUTION ( static_cast<value_type>( static_cast<value_type>(9)/static_cast<value_type>(10) * pow( max_rel_err , static_cast<value_type>(-1) / m_stepper.stepper_order() ) ) , static_cast<value_type>(5) );
+ return success;
+ }
+ else
+ {
+ t += dt;
+ return success;
+ }
+ }
+ }
+
+
+
+ void reset( void )
+ {
+ m_first_call = true;
+ }
+
+ template< class DerivIn >
+ void initialize( const DerivIn &deriv )
+ {
+ boost::numeric::odeint::copy( deriv , m_dxdt.m_v );
+ m_first_call = false;
+ }
+
+ template< class System , class StateIn >
+ void initialize( System system , const StateIn &x , time_type t )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ sys( x , m_dxdt.m_v , t );
+ m_first_call = false;
+ }
+
+ bool is_initialized( void ) const
+ {
+ return ! m_first_call;
+ }
+
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_m_xerr_impl( x );
+ resize_m_dxdt_impl( x );
+ resize_m_dxdt_new_impl( x );
+ resize_m_xnew_impl( x );
+ }
+
+
+ stepper_type& stepper( void )
+ {
+ return m_stepper;
+ }
+
+ const stepper_type& stepper( void ) const
+ {
+ return m_stepper;
+ }
+
+
+
+private:
+
+
+ template< class StateIn >
+ bool resize_m_xerr_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_dxdt_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_dxdt_new_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_xnew_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
+ }
+
+
+ template< class System , class StateInOut >
+ controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt )
+ {
+ if( m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call )
+ {
+ initialize( system , x , t );
+ }
+ return try_step( system , x , m_dxdt.m_v , t , dt );
+ }
+
+
+ stepper_type m_stepper;
+ error_checker_type m_error_checker;
+
+ resizer_type m_dxdt_resizer;
+ resizer_type m_xerr_resizer;
+ resizer_type m_xnew_resizer;
+ resizer_type m_dxdt_new_resizer;
+
+ wrapped_deriv_type m_dxdt;
+ wrapped_state_type m_xerr;
+ wrapped_state_type m_xnew;
+ wrapped_deriv_type m_dxdtnew;
+ bool m_first_call;
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/controlled_step_result.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/controlled_step_result.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,40 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/controlled_step_result.hpp
+
+ [begin_description]
+ Defines the result type for all controlled stepper.
+ [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_CONTROLLED_STEP_RESULT_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_STEP_RESULT_HPP_INCLUDED
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/**
+ * \enum Enum representing the return values of the controlled steppers.
+ */
+typedef enum
+{
+ success , /** <The trial step war successful, hence the state and the time have been advanced. */
+ fail /** <The step was not succesful and might possibly be repeated with a small step size. */
+} controlled_step_result;
+
+} // namespace odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_STEP_RESULT_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,390 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp
+
+ [begin_description]
+ Implementation of the Dense-output stepper for all steppers. Note, that this class does
+ not computes the result but serves as an interface.
+ [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_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED
+
+
+#include <utility>
+#include <stdexcept>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/util/copy.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class Stepper , class StepperCategory = typename Stepper::stepper_category >
+class dense_output_runge_kutta;
+
+
+
+
+template< class Stepper >
+class dense_output_runge_kutta< Stepper , stepper_tag >
+{
+
+public:
+
+ /*
+ * We do not need all typedefs.
+ */
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+ typedef typename stepper_type::resizer_type resizer_type;
+ typedef dense_output_stepper_tag stepper_category;
+ typedef dense_output_runge_kutta< Stepper > dense_output_stepper_type;
+
+
+
+ dense_output_runge_kutta( const stepper_type &stepper = stepper_type() )
+ : m_stepper( stepper ) , m_resizer() ,
+ m_x1() , m_x2() , m_current_state_x1( true ) ,
+ m_t() , m_t_old() , m_dt()
+ { }
+
+
+ template< class StateType >
+ void initialize( const StateType &x0 , time_type t0 , time_type dt0 )
+ {
+ m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) );
+ boost::numeric::odeint::copy( x0 , get_current_state() );
+ m_t = t0;
+ m_dt = dt0;
+ }
+
+ template< class System >
+ std::pair< time_type , time_type > do_step( System system )
+ {
+ m_stepper.do_step( system , get_current_state() , m_t , get_old_state() , m_dt );
+ m_t_old = m_t;
+ m_t += m_dt;
+ toggle_current_state();
+ return std::make_pair( m_t_old , m_dt );
+ }
+
+ /*
+ * The next two overloads are needed to solve the forwarding problem
+ */
+ template< class StateOut >
+ void calc_state( time_type t , StateOut &x ) const
+ {
+ m_stepper.calc_state( x , t , get_old_state() , m_t_old , get_current_state() , m_t );
+ }
+
+ template< class StateOut >
+ void calc_state( time_type t , const StateOut &x ) const
+ {
+ m_stepper.calc_state( x , t , get_old_state() , m_t_old , get_current_state() , m_t );
+ }
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ m_stepper.stepper().resize( x );
+ }
+
+ const state_type& current_state( void ) const
+ {
+ return get_current_state();
+ }
+
+ time_type current_time( void ) const
+ {
+ return m_t;
+ }
+
+ const state_type& previous_state( void ) const
+ {
+ return get_old_state();
+ }
+
+ time_type previous_time( void ) const
+ {
+ return m_t_old;
+ }
+
+
+private:
+
+ state_type& get_current_state( void )
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ const state_type& get_current_state( void ) const
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ state_type& get_old_state( void )
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ const state_type& get_old_state( void ) const
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ void toggle_current_state( void )
+ {
+ m_current_state_x1 = ! m_current_state_x1;
+ }
+
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
+ return resized;
+ }
+
+
+ stepper_type m_stepper;
+ resizer_type m_resizer;
+ wrapped_state_type m_x1 , m_x2;
+ bool m_current_state_x1; // if true, the current state is m_x1
+ time_type m_t , m_t_old , m_dt;
+
+};
+
+
+
+
+
+
+template< class Stepper >
+class dense_output_runge_kutta< Stepper , explicit_controlled_stepper_fsal_tag >
+{
+public:
+
+ /*
+ * We do not need all typedefs.
+ */
+ typedef Stepper controlled_stepper_type;
+
+ typedef typename controlled_stepper_type::stepper_type stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+ typedef typename stepper_type::resizer_type resizer_type;
+ typedef dense_output_stepper_tag stepper_category;
+ typedef dense_output_runge_kutta< Stepper > dense_output_stepper_type;
+
+
+ dense_output_runge_kutta( const controlled_stepper_type &stepper = controlled_stepper_type() )
+ : m_stepper( stepper ) , m_resizer() ,
+ m_current_state_x1( true ) ,
+ m_x1() , m_x2() , m_dxdt1() , m_dxdt2() ,
+ m_t() , m_t_old() , m_dt() ,
+ m_is_deriv_initialized( false )
+ { }
+
+
+ template< class StateType >
+ void initialize( const StateType &x0 , time_type t0 , time_type dt0 )
+ {
+ m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize< StateType > , detail::ref( *this ) , detail::_1 ) );
+ boost::numeric::odeint::copy( x0 , get_current_state() );
+ m_t = t0;
+ m_dt = dt0;
+ m_is_deriv_initialized = false;
+ }
+
+ template< class System >
+ std::pair< time_type , time_type > do_step( System system )
+ {
+ const size_t max_count = 1000;
+
+ if( !m_is_deriv_initialized )
+ {
+ typename odeint::unwrap_reference< System >::type &sys = system;
+ sys( get_current_state() , get_current_deriv() , m_t );
+ m_is_deriv_initialized = true;
+ }
+
+ controlled_step_result res = fail;
+ m_t_old = m_t;
+ size_t count = 0;
+ do
+ {
+ res = m_stepper.try_step( system , get_current_state() , get_current_deriv() , m_t ,
+ get_old_state() , get_old_deriv() , m_dt );
+ if( count++ == max_count )
+ throw std::overflow_error( "dense_output_controlled_explicit : too much iterations!");
+ }
+ while( res == fail );
+ toggle_current_state();
+ return std::make_pair( m_t_old , m_t );
+ }
+
+
+ /*
+ * The two overloads are needed in order to solve the forwarding problem.
+ */
+ template< class StateOut >
+ void calc_state( time_type t , StateOut &x ) const
+ {
+ m_stepper.stepper().calc_state( t , x , get_old_state() , get_old_deriv() , m_t_old ,
+ get_current_state() , get_current_deriv() , m_t );
+ }
+
+ template< class StateOut >
+ void calc_state( time_type t , const StateOut &x ) const
+ {
+ m_stepper.stepper().calc_state( t , x , get_old_state() , get_old_deriv() , m_t_old ,
+ get_current_state() , get_current_deriv() , m_t );
+ }
+
+
+ template< class StateIn >
+ bool resize( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable<deriv_type>::type() );
+ return resized;
+ }
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize( x );
+ m_stepper.stepper().resize( x );
+ }
+
+ const state_type& current_state( void ) const
+ {
+ return get_current_state();
+ }
+
+ time_type current_time( void ) const
+ {
+ return m_t;
+ }
+
+ const state_type& previous_state( void ) const
+ {
+ return get_old_state();
+ }
+
+ time_type previous_time( void ) const
+ {
+ return m_t_old;
+ }
+
+ time_type current_time_step( void ) const
+ {
+ return m_dt;
+ }
+
+
+private:
+
+ state_type& get_current_state( void )
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ const state_type& get_current_state( void ) const
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ state_type& get_old_state( void )
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ const state_type& get_old_state( void ) const
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ deriv_type& get_current_deriv( void )
+ {
+ return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ;
+ }
+
+ const deriv_type& get_current_deriv( void ) const
+ {
+ return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ;
+ }
+
+ deriv_type& get_old_deriv( void )
+ {
+ return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ;
+ }
+
+ const deriv_type& get_old_deriv( void ) const
+ {
+ return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ;
+ }
+
+
+ void toggle_current_state( void )
+ {
+ m_current_state_x1 = ! m_current_state_x1;
+ }
+
+
+ controlled_stepper_type m_stepper;
+ resizer_type m_resizer;
+ bool m_current_state_x1;
+ wrapped_state_type m_x1 , m_x2;
+ wrapped_deriv_type m_dxdt1 , m_dxdt2;
+ time_type m_t , m_t_old , m_dt;
+ bool m_is_deriv_initialized;
+
+};
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,151 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp
+
+ [begin_description]
+ Algebra caller for the Adams Bashforth stepper.
+ [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_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED
+
+#include <boost/assert.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< size_t Step , class Algebra , class Operations >
+struct adams_bashforth_call_algebra;
+
+template< class Algebra , class Operations >
+struct adams_bashforth_call_algebra< 1 , 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
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each3( out , in , steps[0].m_v , typename Operations::template scale_sum2< value_type , Time >( 1.0 , dt * coef[0] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_bashforth_call_algebra< 2 , 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
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each4( out , in , steps[0].m_v , steps[1].m_v ,
+ typename Operations::template scale_sum3< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_bashforth_call_algebra< 3 , 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
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each5( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v ,
+ typename Operations::template scale_sum4< value_type , Time , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_bashforth_call_algebra< 4 , 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
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each6( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v ,
+ typename Operations::template scale_sum5< value_type , Time , Time , Time >(
+ 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_bashforth_call_algebra< 5 , 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
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each7( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v ,
+ typename Operations::template scale_sum6< value_type , Time , Time , Time , Time >(
+ 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_bashforth_call_algebra< 6 , 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
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each8( 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 ,
+ typename Operations::template scale_sum7< value_type , Time , Time , Time , Time , Time >(
+ 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+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] , steps[1] , steps[2] , steps[3] , steps[4] , steps[5] , steps[6]
+ // typename Operations::template scale_sum8< value_type , Time , Time , Time , Time , Time , Time >(
+ // 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+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] , steps[1] , steps[2] , steps[3] , steps[4] , steps[5] , steps[6] , steps[7] ,
+ // typename Operations::template scale_sum9< value_type , Time , Time , Time , Time , Time , Time , Time >(
+ // 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] , dt * coef[7] ) );
+ }
+};
+
+
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,168 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp
+
+ [begin_description]
+ Definition of the coefficients for the Adams-Bashforth 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_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
+
+#include <boost/array.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class Value , size_t Steps >
+class adams_bashforth_coefficients ;
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 1 > : public boost::array< Value , 1 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 1 >()
+ {
+ (*this)[0] = static_cast< Value >( 1 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 2 > : public boost::array< Value , 2 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 2 >()
+ {
+ (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 2 );
+ (*this)[1] = -static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 3 > : public boost::array< Value , 3 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 3 >()
+ {
+ (*this)[0] = static_cast< Value >( 23 ) / static_cast< Value >( 12 );
+ (*this)[1] = -static_cast< Value >( 4 ) / static_cast< Value >( 3 );
+ (*this)[2] = static_cast< Value >( 5 ) / static_cast< Value >( 12 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 4 > : public boost::array< Value , 4 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 4 >()
+ {
+ (*this)[0] = static_cast< Value >( 55 ) / static_cast< Value >( 24 );
+ (*this)[1] = -static_cast< Value >( 59 ) / static_cast< Value >( 24 );
+ (*this)[2] = static_cast< Value >( 37 ) / static_cast< Value >( 24 );
+ (*this)[3] = -static_cast< Value >( 3 ) / static_cast< Value >( 8 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 5 > : public boost::array< Value , 5 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 5 >()
+ {
+ (*this)[0] = static_cast< Value >( 1901 ) / static_cast< Value >( 720 );
+ (*this)[1] = -static_cast< Value >( 1387 ) / static_cast< Value >( 360 );
+ (*this)[2] = static_cast< Value >( 109 ) / static_cast< Value >( 30 );
+ (*this)[3] = -static_cast< Value >( 637 ) / static_cast< Value >( 360 );
+ (*this)[4] = static_cast< Value >( 251 ) / static_cast< Value >( 720 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 6 > : public boost::array< Value , 6 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 6 >()
+ {
+ (*this)[0] = static_cast< Value >( 4277 ) / static_cast< Value >( 1440 );
+ (*this)[1] = -static_cast< Value >( 2641 ) / static_cast< Value >( 480 );
+ (*this)[2] = static_cast< Value >( 4991 ) / static_cast< Value >( 720 );
+ (*this)[3] = -static_cast< Value >( 3649 ) / static_cast< Value >( 720 );
+ (*this)[4] = static_cast< Value >( 959 ) / static_cast< Value >( 480 );
+ (*this)[5] = -static_cast< Value >( 95 ) / static_cast< Value >( 288 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 7 > : public boost::array< Value , 7 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 7 >()
+ {
+ (*this)[0] = static_cast< Value >( 198721 ) / static_cast< Value >( 60480 );
+ (*this)[1] = -static_cast< Value >( 18637 ) / static_cast< Value >( 2520 );
+ (*this)[2] = static_cast< Value >( 235183 ) / static_cast< Value >( 20160 );
+ (*this)[3] = -static_cast< Value >( 10754 ) / static_cast< Value >( 945 );
+ (*this)[4] = static_cast< Value >( 135713 ) / static_cast< Value >( 20160 );
+ (*this)[5] = -static_cast< Value >( 5603 ) / static_cast< Value >( 2520 );
+ (*this)[6] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 );
+ }
+};
+
+
+template< class Value >
+class adams_bashforth_coefficients< Value , 8 > : public boost::array< Value , 8 >
+{
+public:
+ adams_bashforth_coefficients( void )
+ : boost::array< Value , 8 >()
+ {
+ (*this)[0] = static_cast< Value >( 16083 ) / static_cast< Value >( 4480 );
+ (*this)[1] = -static_cast< Value >( 1152169 ) / static_cast< Value >( 120960 );
+ (*this)[2] = static_cast< Value >( 242653 ) / static_cast< Value >( 13440 );
+ (*this)[3] = -static_cast< Value >( 296053 ) / static_cast< Value >( 13440 );
+ (*this)[4] = static_cast< Value >( 2102243 ) / static_cast< Value >( 120960 );
+ (*this)[5] = -static_cast< Value >( 115747 ) / static_cast< Value >( 13440 );
+ (*this)[6] = static_cast< Value >( 32863 ) / static_cast< Value >( 13440 );
+ (*this)[7] = -static_cast< Value >( 5257 ) / static_cast< Value >( 17280 );
+ }
+};
+
+
+
+
+
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,142 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp
+
+ [begin_description]
+ Algebra caller for the Adams Moulton 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_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED
+
+#include <boost/assert.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< size_t Step , class Algebra , class Operations >
+struct adams_moulton_call_algebra;
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 1 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each3( out , in , dxdt , typename Operations::template scale_sum2< value_type , Time >( 1.0 , dt * coef[0] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 2 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each4( out , in , dxdt , steps[0].m_v ,
+ typename Operations::template scale_sum3< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 3 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each5( out , in , dxdt , steps[0].m_v , steps[1].m_v ,
+ typename Operations::template scale_sum4< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 4 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each6( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v ,
+ typename Operations::template scale_sum5< value_type , Time , Time , Time >(
+ 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 5 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each7( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v ,
+ typename Operations::template scale_sum6< value_type , Time , Time , Time , Time >(
+ 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 6 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ typedef typename Coefficients::value_type value_type;
+ algebra.for_each8( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v ,
+ typename Operations::template scale_sum7< value_type , Time , Time , Time , Time , Time >(
+ 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] ) );
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 7 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ BOOST_ASSERT( false ); // not implemented
+ }
+};
+
+
+template< class Algebra , class Operations >
+struct adams_moulton_call_algebra< 8 , Algebra , Operations >
+{
+ template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
+ void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
+ {
+ BOOST_ASSERT( false ); // not implemented
+ }
+};
+
+
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,168 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp
+
+ [begin_description]
+ Coefficients for the Adams Moulton 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_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED
+
+
+#include <boost/array.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class Value , size_t Steps >
+class adams_moulton_coefficients ;
+
+template< class Value >
+class adams_moulton_coefficients< Value , 1 > : public boost::array< Value , 1 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 1 >()
+ {
+ (*this)[0] = static_cast< Value >( 1 );
+ }
+};
+
+
+template< class Value >
+class adams_moulton_coefficients< Value , 2 > : public boost::array< Value , 2 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 2 >()
+ {
+ (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ }
+};
+
+
+template< class Value >
+class adams_moulton_coefficients< Value , 3 > : public boost::array< Value , 3 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 3 >()
+ {
+ (*this)[0] = static_cast< Value >( 5 ) / static_cast< Value >( 12 );
+ (*this)[1] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
+ (*this)[2] = -static_cast< Value >( 1 ) / static_cast< Value >( 12 );
+ }
+};
+
+
+template< class Value >
+class adams_moulton_coefficients< Value , 4 > : public boost::array< Value , 4 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 4 >()
+ {
+ (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 8 );
+ (*this)[1] = static_cast< Value >( 19 ) / static_cast< Value >( 24 );
+ (*this)[2] = -static_cast< Value >( 5 ) / static_cast< Value >( 24 );
+ (*this)[3] = static_cast< Value >( 1 ) / static_cast< Value >( 24 );
+ }
+};
+
+
+template< class Value >
+class adams_moulton_coefficients< Value , 5 > : public boost::array< Value , 5 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 5 >()
+ {
+ (*this)[0] = static_cast< Value >( 251 ) / static_cast< Value >( 720 );
+ (*this)[1] = static_cast< Value >( 323 ) / static_cast< Value >( 360 );
+ (*this)[2] = -static_cast< Value >( 11 ) / static_cast< Value >( 30 );
+ (*this)[3] = static_cast< Value >( 53 ) / static_cast< Value >( 360 );
+ (*this)[4] = -static_cast< Value >( 19 ) / static_cast< Value >( 720 );
+ }
+};
+
+
+template< class Value >
+class adams_moulton_coefficients< Value , 6 > : public boost::array< Value , 6 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 6 >()
+ {
+ (*this)[0] = static_cast< Value >( 95 ) / static_cast< Value >( 288 );
+ (*this)[1] = static_cast< Value >( 1427 ) / static_cast< Value >( 1440 );
+ (*this)[2] = -static_cast< Value >( 133 ) / static_cast< Value >( 240 );
+ (*this)[3] = static_cast< Value >( 241 ) / static_cast< Value >( 720 );
+ (*this)[4] = -static_cast< Value >( 173 ) / static_cast< Value >( 1440 );
+ (*this)[5] = static_cast< Value >( 3 ) / static_cast< Value >( 160 );
+ }
+};
+
+template< class Value >
+class adams_moulton_coefficients< Value , 7 > : public boost::array< Value , 7 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 7 >()
+ {
+ (*this)[0] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 );
+ (*this)[1] = static_cast< Value >( 2713 ) / static_cast< Value >( 2520 );
+ (*this)[2] = -static_cast< Value >( 15487 ) / static_cast< Value >( 20160 );
+ (*this)[3] = static_cast< Value >( 586 ) / static_cast< Value >( 945 );
+ (*this)[4] = -static_cast< Value >( 6737 ) / static_cast< Value >( 20160 );
+ (*this)[5] = static_cast< Value >( 263 ) / static_cast< Value >( 2520 );
+ (*this)[6] = -static_cast< Value >( 863 ) / static_cast< Value >( 60480 );
+ }
+};
+
+
+template< class Value >
+class adams_moulton_coefficients< Value , 8 > : public boost::array< Value , 8 >
+{
+public:
+ adams_moulton_coefficients( void )
+ : boost::array< Value , 8 >()
+ {
+ (*this)[0] = static_cast< Value >( 5257 ) / static_cast< Value >( 17280 );
+ (*this)[1] = static_cast< Value >( 139849 ) / static_cast< Value >( 120960 );
+ (*this)[2] = -static_cast< Value >( 4511 ) / static_cast< Value >( 4480 );
+ (*this)[3] = static_cast< Value >( 123133 ) / static_cast< Value >( 120960 );
+ (*this)[4] = -static_cast< Value >( 88547 ) / static_cast< Value >( 120960 );
+ (*this)[5] = static_cast< Value >( 1537 ) / static_cast< Value >( 4480 );
+ (*this)[6] = -static_cast< Value >( 11351 ) / static_cast< Value >( 120960 );
+ (*this)[7] = static_cast< Value >( 275 ) / static_cast< Value >( 24192 );
+ }
+};
+
+
+
+
+
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,246 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp
+
+ [begin_description]
+ Implementation of the generic Runge-Kutta 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_DETAIL_GENERIC_RK_ALGORITHM_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_ALGORITHM_HPP_INCLUDED
+
+#include <boost/static_assert.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/size_t.hpp>
+
+#include <boost/fusion/algorithm.hpp>
+#include <boost/fusion/iterator.hpp>
+#include <boost/fusion/mpl.hpp>
+#include <boost/fusion/sequence.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp>
+#include <boost/numeric/odeint/util/bind.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class T , class Constant >
+struct array_wrapper
+{
+ typedef const typename boost::array< T , Constant::value > type;
+};
+
+template< class T , size_t i >
+struct stage
+{
+ T c;
+ boost::array< T , i > a;
+};
+
+
+template< class T , class Constant >
+struct stage_wrapper
+{
+ typedef stage< T , Constant::value > type;
+};
+
+
+template<
+size_t StageCount,
+class Value = double ,
+class Algebra = range_algebra,
+class Operations = default_operations
+>
+class generic_rk_algorithm {
+
+public:
+ typedef mpl::range_c< size_t , 1 , StageCount > stage_indices;
+
+ typedef typename boost::fusion::result_of::as_vector
+ <
+ typename boost::mpl::copy
+ <
+ stage_indices ,
+ boost::mpl::inserter
+ <
+ boost::mpl::vector0< > ,
+ boost::mpl::push_back< boost::mpl::_1 , array_wrapper< Value , boost::mpl::_2 > >
+ >
+ >::type
+ >::type coef_a_type;
+
+ typedef boost::array< Value , StageCount > coef_b_type;
+ typedef boost::array< Value , StageCount > coef_c_type;
+
+ typedef typename boost::fusion::result_of::as_vector
+ <
+ typename boost::mpl::push_back
+ <
+ typename boost::mpl::copy
+ <
+ stage_indices,
+ boost::mpl::inserter
+ <
+ boost::mpl::vector0<> ,
+ boost::mpl::push_back< boost::mpl::_1 , stage_wrapper< Value , boost::mpl::_2 > >
+ >
+ >::type ,
+ stage< Value , StageCount >
+ >::type
+ >::type stage_vector_base;
+
+
+ struct stage_vector : public stage_vector_base
+ {
+ struct do_insertion
+ {
+ stage_vector_base &m_base;
+ const coef_a_type &m_a;
+ const coef_c_type &m_c;
+
+ do_insertion( stage_vector_base &base , const coef_a_type &a , const coef_c_type &c )
+ : m_base( base ) , m_a( a ) , m_c( c ) { }
+
+ template< class Index >
+ void operator()( Index ) const
+ {
+ //boost::fusion::at< Index >( m_base ) = stage< double , Index::value+1 , intermediate_stage >( m_c[ Index::value ] , boost::fusion::at< Index >( m_a ) );
+ boost::fusion::at< Index >( m_base ).c = m_c[ Index::value ];
+ boost::fusion::at< Index >( m_base ).a = boost::fusion::at< Index >( m_a );
+ }
+ };
+
+ struct print_butcher
+ {
+ const stage_vector_base &m_base;
+ std::ostream &m_os;
+
+ print_butcher( const stage_vector_base &base , std::ostream &os )
+ : m_base( base ) , m_os( os )
+ { }
+
+ template<class Index>
+ void operator()(Index) const {
+ m_os << boost::fusion::at<Index>(m_base).c << " | ";
+ for( size_t i=0 ; i<Index::value ; ++i )
+ m_os << boost::fusion::at<Index>(m_base).a[i] << " ";
+ m_os << std::endl;
+ }
+ };
+
+
+ stage_vector( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c )
+ {
+ typedef boost::mpl::range_c< size_t , 0 , StageCount-1 > indices;
+ boost::mpl::for_each< indices >( do_insertion( *this , a , c ) );
+ boost::fusion::at_c< StageCount - 1 >( *this ).c = c[ StageCount - 1 ];
+ boost::fusion::at_c< StageCount - 1 >( *this ).a = b;
+ }
+
+ void print( std::ostream &os ) const
+ {
+ typedef boost::mpl::range_c< size_t , 0 , StageCount > indices;
+ boost::mpl::for_each< indices >( print_butcher( *this , os ) );
+ }
+ };
+
+
+
+ template< class System , class StateIn , class StateTemp , class DerivIn , class Deriv ,
+ class StateOut , class Time >
+ struct calculate_stage
+ {
+ Algebra &algebra;
+ System &system;
+ const StateIn &x;
+ StateTemp &x_tmp;
+ StateOut &x_out;
+ const DerivIn &dxdt;
+ Deriv *F;
+ Time t;
+ Time dt;
+
+ calculate_stage( Algebra &_algebra , System &_system , const StateIn &_x , const DerivIn &_dxdt , StateOut &_out ,
+ StateTemp &_x_tmp , Deriv *_F , Time _t , Time _dt )
+ : algebra( _algebra ) , system( _system ) , x( _x ) , x_tmp( _x_tmp ) , x_out( _out) , dxdt( _dxdt ) , F( _F ) , t( _t ) , dt( _dt )
+ {}
+
+
+ template< typename T , size_t stage_number >
+ void inline operator()( stage< T , stage_number > const &stage ) const
+ //typename stage_fusion_wrapper< T , mpl::size_t< stage_number > , intermediate_stage >::type const &stage ) const
+ {
+ if( stage_number > 1 )
+ {
+#ifdef BOOST_MSVC
+#pragma warning( disable : 4307 34 )
+#endif
+ system( x_tmp , F[stage_number-2].m_v , t + stage.c * dt );
+#ifdef BOOST_MSVC
+#pragma warning( default : 4307 34 )
+#endif
+ }
+ //std::cout << stage_number-2 << ", t': " << t + stage.c * dt << std::endl;
+
+ if( stage_number < StageCount )
+ detail::template generic_rk_call_algebra< stage_number , Algebra >()( algebra , x_tmp , x , dxdt , F ,
+ detail::generic_rk_scale_sum< stage_number , Operations , Value , Time >( stage.a , dt) );
+ // algebra_type::template for_eachn<stage_number>( x_tmp , x , dxdt , F ,
+ // typename operations_type::template scale_sumn< stage_number , time_type >( stage.a , dt ) );
+ else
+ detail::template generic_rk_call_algebra< stage_number , Algebra >()( algebra , x_out , x , dxdt , F ,
+ detail::generic_rk_scale_sum< stage_number , Operations , Value , Time >( stage.a , dt ) );
+ // algebra_type::template for_eachn<stage_number>( x_out , x , dxdt , F ,
+ // typename operations_type::template scale_sumn< stage_number , time_type >( stage.a , dt ) );
+ }
+
+ };
+
+ generic_rk_algorithm( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c )
+ : m_stages( a , b , c )
+ { }
+
+ template< class System , class StateIn , class DerivIn , class Time , class StateOut , class StateTemp , class Deriv >
+ void inline do_step( Algebra &algebra , System system , const StateIn &in , const DerivIn &dxdt ,
+ Time t , StateOut &out , Time dt ,
+ StateTemp &x_tmp , Deriv F[StageCount-1] ) const
+ {
+ typedef typename odeint::unwrap_reference< System >::type unwrapped_system_type;
+ unwrapped_system_type &sys = system;
+ boost::fusion::for_each( m_stages , calculate_stage<
+ unwrapped_system_type , StateIn , StateTemp , DerivIn , Deriv , StateOut , Time >
+ ( algebra , sys , in , dxdt , out , x_tmp , F , t , dt ) );
+ }
+
+private:
+ stage_vector m_stages;
+};
+
+
+}
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_ALGORITHM_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,263 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp
+
+ [begin_description]
+ Algebra caller for the generic Runge-Kutta methods.
+ [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_DETAIL_GENERIC_RK_CALL_ALGEBRA_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_CALL_ALGEBRA_HPP_INCLUDED
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< size_t StageNumber , class Algebra >
+struct generic_rk_call_algebra;
+
+template< class Algebra >
+struct generic_rk_call_algebra< 1 , Algebra >
+{
+ typedef Algebra algebra_type;
+
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( algebra_type &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 * /* s4_array */ , Op op ) const
+ {
+ algebra.for_each3( s1 , s2 , s3 , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( algebra_type &algebra , S1 &s1 , S2 &s2 , S4 * /* s4_array */ , Op op ) const
+ {
+ algebra.for_each2( s1 , s2 , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 2 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[1] , Op op ) const
+ {
+ algebra.for_each4( s1 , s2 , s3 , s4_array[0].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[1] , Op op ) const
+ {
+ algebra.for_each3( s1 , s2 , s4_array[0].m_v , op );
+ }
+};
+
+
+template< class Algebra >
+struct generic_rk_call_algebra< 3 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[2] , Op op ) const
+ {
+ algebra.for_each5( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[2] , Op op ) const
+ {
+ algebra.for_each4( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , op );
+ }
+};
+
+
+template< class Algebra >
+struct generic_rk_call_algebra< 4 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[3] , Op op ) const
+ {
+ algebra.for_each6( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[3] , Op op ) const
+ {
+ algebra.for_each5( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , op );
+ }
+};
+
+
+template< class Algebra >
+struct generic_rk_call_algebra< 5 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[4] , Op op ) const
+ {
+ algebra.for_each7( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[4] , Op op ) const
+ {
+ algebra.for_each6( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 6 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[5] , Op op ) const
+ {
+ algebra.for_each8( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[5] , Op op ) const
+ {
+ algebra.for_each7( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 7 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[6] , Op op ) const
+ {
+ algebra.for_each9( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[6] , Op op ) const
+ {
+ algebra.for_each8( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 8 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[7] , Op op ) const
+ {
+ algebra.for_each10( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[7] , Op op ) const
+ {
+ algebra.for_each9( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 9 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[8] , Op op ) const
+ {
+ algebra.for_each11( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[8] , Op op ) const
+ {
+ algebra.for_each10( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 10 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[9] , Op op ) const
+ {
+ algebra.for_each12( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[9] , Op op ) const
+ {
+ algebra.for_each11( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , op );
+ }
+};
+
+
+template< class Algebra >
+struct generic_rk_call_algebra< 11 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[10] , Op op ) const
+ {
+ algebra.for_each13( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[10] , Op op ) const
+ {
+ algebra.for_each12( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 12 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[11] , Op op ) const
+ {
+ algebra.for_each14( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[11] , Op op ) const
+ {
+ algebra.for_each13( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , op );
+ }
+};
+
+template< class Algebra >
+struct generic_rk_call_algebra< 13 , Algebra >
+{
+ template< class S1 , class S2 , class S3 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[12] , Op op ) const
+ {
+ algebra.for_each15( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , s4_array[11].m_v , op );
+ }
+
+ template< class S1 , class S2 , class S4 , class Op>
+ void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[12] , Op op ) const
+ {
+ algebra.for_each14( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v ,
+ s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , s4_array[11].m_v , op );
+ }
+};
+
+}
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_CALL_ALGEBRA_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,252 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp
+
+ [begin_description]
+ Operations caller for the generic Runge Kutta 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_DETAIL_GENERIC_RK_OPERATIONS_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_OPERATIONS_HPP_INCLUDED
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< size_t StageNumber , class Operations , class Fac , class Time >
+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<Fac,1> &a , Time dt ) : Operations::template scale_sum2< Fac , Time >( 1.0 , a[0]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+
+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<Fac,2> &a , Time dt )
+ : Operations::template scale_sum3< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,3> &a , Time dt )
+ : Operations::template scale_sum4< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,4> &a , Time dt )
+ : Operations::template scale_sum5< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,5> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,6> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,7> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,8> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,9> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,10> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,11> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,12> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,13> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+
+// for error estimates
+template< size_t StageNumber , class Operations , class Fac , class Time >
+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<Fac,1> &a , Time dt ) : Operations::template scale_sum1< Time >( a[0]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+
+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<Fac,2> &a , Time dt )
+ : Operations::template scale_sum2< Time >( a[0]*dt , a[1]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,3> &a , Time dt )
+ : Operations::template scale_sum3< Time >( a[0]*dt , a[1]*dt , a[2]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,4> &a , Time dt )
+ : Operations::template scale_sum4< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+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<Fac,5> &a , Time dt )
+ : Operations::template scale_sum5< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt )
+ { }
+
+ typedef void result_type;
+};
+
+
+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<Fac,6> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+
+// for rk87
+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<Fac,13> &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 )
+ { }
+
+ typedef void result_type;
+};
+
+
+}
+}
+}
+}
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_OPERATIONS_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,84 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/detail/rotating_buffer.hpp
+
+ [begin_description]
+ Implemetation of a rotating (cyclic) buffer for use in the Adam Bashforth stepper
+ [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_DETAIL_ROTATING_BUFFER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED
+
+#include <boost/array.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+template< class T , size_t N >
+class rotating_buffer
+{
+public:
+
+ typedef T value_type;
+ const static size_t dim = N;
+
+ rotating_buffer( void ) : m_first( 0 )
+ { }
+
+ size_t size( void ) const
+ {
+ return dim;
+ }
+
+ value_type& operator[]( size_t i )
+ {
+ return m_data[ get_index( i ) ];
+ }
+
+ const value_type& operator[]( size_t i ) const
+ {
+ return m_data[ get_index( i ) ];
+ }
+
+ void rotate( void )
+ {
+ if( m_first == 0 )
+ m_first = dim-1;
+ else
+ --m_first;
+ }
+
+protected:
+
+ value_type m_data[N];
+
+private:
+
+ size_t get_index( size_t i ) const
+ {
+ return ( ( i + m_first ) % dim );
+ }
+
+ size_t m_first;
+
+};
+
+
+} // detail
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/euler.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/euler.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,154 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/euler.hpp
+
+ [begin_description]
+ Implementation of the classical explicit Euler stepper. This method is really simple and should only
+ be used for demonstration purposes.
+ [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_EULER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+/**
+ * \class euler
+ * \brief An implementation of the Euler method.
+ *
+ * The Euler method is a very simply solver for ordinary differential equations. This method should not be used
+ * for real applications. It is only useful for demonstration purposes. Step size control is not provided but
+ * trivial continous output is available.
+ *
+ * This class derives from explicit_stepper_base and inherits its interface via CRTP (current recurring template pattern),
+ * see explicit_stepper_base
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+#ifndef DOXYGEN_SKIP
+class euler
+: public explicit_stepper_base<
+ euler< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+#else
+class euler : public explicit_stepper_base< euler< ... > , ... >
+#endif
+{
+public :
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_stepper_base< euler< State , Value , Deriv , Time , Algebra , Operations , Resizer > , 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type;
+ #else
+ typedef explicit_stepper_base< euler< ... > , ... > stepper_base_type;
+ #endif
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ #endif
+
+
+ /**
+ * \brief Constructs the euler class. This constructor can be used as a default
+ * constructor of the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ euler( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra )
+ { }
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out of place, hence the input is in `in` and the output in `out`. `do_step_impl` is
+ * used by explicit_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
+ {
+ stepper_base_type::m_algebra.for_each3( out , in , dxdt ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt ) );
+
+ }
+
+
+ /**
+ * \brief This method is used for continous output and it calculates the state `x` at a time `t` from the
+ * knowledge of two states `old_state` and `current_state` at time points `t_old` and `t_new`.
+ */
+ template< class StateOut , class StateIn1 , class StateIn2 >
+ void calc_state( StateOut &x , time_type t , const StateIn1 &old_state , time_type t_old , const StateIn2 &current_state , time_type t_new ) const
+ {
+ const time_type delta = t - t_old;
+ stepper_base_type::m_algebra.for_each3( x , old_state , stepper_base_type::m_dxdt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , delta ) );
+ }
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ stepper_base_type::adjust_size( x );
+ }
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,225 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp
+
+ [begin_description]
+ Implementation of the generic Runge Kutta error stepper. Base class for many RK 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_EXPLICIT_ERROR_GENERIC_RK_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_ERROR_GENERIC_RK_HPP_INCLUDED
+
+#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp>
+
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/**
+ * \class explicit_error_generic_rk
+ * \brief A generic implementation of explicit Runge-Kutta algorithms with error estimation. This class is as a
+ * base class for all explicit Runge-Kutta steppers with error estimateion.
+ *
+ * This class implements the explicit Runge-Kutta algorithms with error estimation in a generic way.
+ * The Butcher tableau is passed to the stepper which constructs the stepper scheme with the help of a
+ * template-metaprogramming algorithm. ToDo : Add example!
+ *
+ * This class derives explicit_error_stepper_base which provides the stepper interface.
+ *
+ * \tparam StageCount The number of stages of the Runge-Kutta algorithm.
+ * \tparam Order The order of a stepper if the stepper is used without error estimation.
+ * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have
+ * the same value.
+ * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation.
+ * \tparam State The type representing the state of the ODE.
+ * \tparam Value The floating point type which is used in the computations.
+ * \tparam Time The type representing the independent variable - the time - of the ODE.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+size_t StageCount,
+size_t Order,
+size_t StepperOrder ,
+size_t ErrorOrder ,
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class explicit_error_generic_rk
+: public explicit_error_stepper_base<
+ explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State ,
+ Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ Order , StepperOrder , ErrorOrder , State , Value , Deriv , Time , Algebra ,
+ Operations , Resizer >
+{
+
+public:
+
+ typedef explicit_error_stepper_base<
+ explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State ,
+ Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ Order , StepperOrder , ErrorOrder , State , Value , Deriv , Time , Algebra ,
+ Operations , Resizer > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+ //typedef typename stepper_base_type::stepper_type stepper_type;
+ typedef explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State ,
+ Value , Deriv , Time , Algebra , Operations , Resizer > stepper_type;
+
+ typedef detail::generic_rk_algorithm< StageCount , Value , Algebra , Operations > rk_algorithm_type;
+
+ typedef typename rk_algorithm_type::coef_a_type coef_a_type;
+ typedef typename rk_algorithm_type::coef_b_type coef_b_type;
+ typedef typename rk_algorithm_type::coef_c_type coef_c_type;
+
+ static const size_t stage_count = StageCount;
+
+private:
+
+
+public:
+
+ // we use an explicit_generic_rk to do the normal rk step
+ // and add a separate calculation of the error estimate afterwards
+ explicit_error_generic_rk( const coef_a_type &a ,
+ const coef_b_type &b ,
+ const coef_b_type &b2 ,
+ const coef_c_type &c ,
+ const algebra_type &algebra = algebra_type() )
+ : stepper_base_type( algebra ) , m_rk_algorithm( a , b , c ) , m_b2( b2 )
+ { }
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out-of-place, hence the input is in `in` and the output in `out`. Futhermore, an
+ * estimation of the error is stored in `xerr`. `do_step_impl` is used by explicit_error_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ * \param xerr The result of the error estimation is written in xerr.
+ */
+
+ template< class System , class StateIn , class DerivIn , class StateOut , class Err >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt ,
+ time_type t , StateOut &out , time_type dt , Err &xerr )
+ {
+ // normal step
+ do_step_impl( system , in , dxdt , t , out , dt );
+
+ // additionally, perform the error calculation
+ detail::template generic_rk_call_algebra< StageCount , algebra_type >()( stepper_base_type::m_algebra ,
+ xerr , dxdt , m_F , detail::generic_rk_scale_sum_err< StageCount , operations_type , value_type , time_type >( m_b2 , dt) );
+ }
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out-of-place, hence the input is in `in` and the output in `out`. `do_step_impl` is
+ * used by explicit_error_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt ,
+ time_type t , StateOut &out , time_type dt )
+ {
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ // actual calculation done in generic_rk.hpp
+ m_rk_algorithm.do_step( stepper_base_type::m_algebra , system , in , dxdt , t , out , dt , m_x_tmp.m_v , m_F );
+ }
+
+
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ stepper_base_type::adjust_size( x );
+ }
+
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized( false );
+ resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
+ for( size_t i = 0 ; i < StageCount-1 ; ++i )
+ {
+ resized |= adjust_size_by_resizeability( m_F[i] , x , typename is_resizeable<deriv_type>::type() );
+ }
+ return resized;
+ }
+
+
+ rk_algorithm_type m_rk_algorithm;
+ coef_b_type m_b2;
+
+ resizer_type m_resizer;
+
+ wrapped_state_type m_x_tmp;
+ wrapped_deriv_type m_F[StageCount-1];
+
+
+};
+
+}
+}
+}
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_ERROR_GENERIC_RK_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/explicit_generic_rk.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/explicit_generic_rk.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,228 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/explicit_generic_rk.hpp
+
+ [begin_description]
+ Implementation of the generic Runge-Kutta steppers. This is the base class for many Runge-Kutta 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_EXPLICIT_GENERIC_RK_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_GENERIC_RK_HPP_INCLUDED
+
+
+#include <boost/array.hpp>
+
+
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+//forward declarations
+
+#ifndef DOXYGEN_SKIP
+template<
+size_t StageCount,
+size_t Order,
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class explicit_generic_rk;
+
+
+struct stage_vector;
+
+template< class T , class Constant >
+struct array_wrapper
+{
+ typedef const typename boost::array< T , Constant::value > type;
+};
+
+template< class T , size_t i >
+struct stage
+{
+ T c;
+ boost::array< T , i > a;
+};
+
+
+template< class T , class Constant >
+struct stage_wrapper
+{
+ typedef stage< T , Constant::value > type;
+};
+#endif
+
+
+/**
+ * \class explicit_generic_rk
+ * \brief A generic implementation of explicit Runge-Kutta algorithms. This class is as a base class
+ * for all explicit Runge-Kutta steppers.
+ *
+ * This class implements the explicit Runge-Kutta algorithms without error estimation in a generic way.
+ * The Butcher tableau is passed to the stepper which constructs the stepper scheme with the help of a
+ * template-metaprogramming algorithm. ToDo : Add example!
+ *
+ * This class derives explicit_stepper_base which provides the stepper interface.
+ *
+ * \tparam StageCount The number of stages of the Runge-Kutta algorithm.
+ * \tparam Order The order of the stepper.
+ * \tparam State The type representing the state of the ODE.
+ * \tparam Value The floating point type which is used in the computations.
+ * \tparam Time The type representing the independent variable - the time - of the ODE.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+size_t StageCount,
+size_t Order,
+class State ,
+class Value ,
+class Deriv ,
+class Time ,
+class Algebra ,
+class Operations ,
+class Resizer
+>
+class explicit_generic_rk : public explicit_stepper_base<
+explicit_generic_rk< StageCount , Order , State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+Order , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+{
+
+public:
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_stepper_base<
+ explicit_generic_rk< StageCount , Order , State , Value , Deriv ,Time , Algebra , Operations , Resizer > ,
+ Order , State , Value , Deriv , Time , Algebra ,
+ Operations , Resizer > stepper_base_type;
+ #else
+ typedef explicit_stepper_base< ... > stepper_base_type;
+ #endif
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_generic_rk< StageCount , Order , State , Value , Deriv ,Time , Algebra , Operations , Resizer > stepper_type;
+ #endif
+
+ typedef detail::generic_rk_algorithm< StageCount , Value , Algebra , Operations > rk_algorithm_type;
+
+ typedef typename rk_algorithm_type::coef_a_type coef_a_type;
+ typedef typename rk_algorithm_type::coef_b_type coef_b_type;
+ typedef typename rk_algorithm_type::coef_c_type coef_c_type;
+
+ #ifndef DOXYGEN_SKIP
+ static const size_t stage_count = StageCount;
+ #endif
+
+private:
+
+public:
+
+ /**
+ * \brief Constructs the explicit_generic_rk class.
+ * \param a The coefficients a in the butcher tableau, see the details section for an example.
+ * \param b The coefficients b in the butcher tableau, see the details section for an example.
+ * \param c The coefficients c in the butcher tableau, see the details section for an example.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ explicit_generic_rk( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c ,
+ const algebra_type &algebra = algebra_type() )
+ : stepper_base_type( algebra ) , m_rk_algorithm( a , b , c )
+ { }
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out of place, hence the input is in `in` and the output in `out`. `do_step_impl` is
+ * used by explicit_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt ,
+ time_type t , StateOut &out , time_type dt )
+ {
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ // actual calculation done in generic_rk.hpp
+ m_rk_algorithm.do_step( stepper_base_type::m_algebra , system , in , dxdt , t , out , dt , m_x_tmp.m_v , m_F );
+ }
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ stepper_base_type::adjust_size( x );
+ }
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized( false );
+ resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
+ for( size_t i = 0 ; i < StageCount-1 ; ++i )
+ {
+ resized |= adjust_size_by_resizeability( m_F[i] , x , typename is_resizeable<deriv_type>::type() );
+ }
+ return resized;
+ }
+
+
+ rk_algorithm_type m_rk_algorithm;
+
+ resizer_type m_resizer;
+
+ wrapped_state_type m_x_tmp;
+ wrapped_deriv_type m_F[StageCount-1];
+
+};
+
+}
+}
+}
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_GENERIC_RK_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/generation.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_dense_output.hpp>
+
+#include <boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp>
+
+#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp>
+
+
+#include <boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp>
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
+
+
+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()( value_type abs_error , 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

Added: trunk/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_dense_output.hpp>
+
+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()( value_type abs_error , 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

Added: trunk/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp>
+
+
+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()( value_type abs_error , 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

Added: trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
+
+
+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

Added: trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
+
+
+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

Added: trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_dense_output.hpp>
+
+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

Added: trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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 <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
+#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
+
+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

Added: trunk/boost/numeric/odeint/stepper/generation/make_controlled.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/make_controlled.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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()(
+ typename Stepper::value_type abs_error ,
+ 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(
+ typename Stepper::value_type abs_error ,
+ 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

Added: trunk/boost/numeric/odeint/stepper/generation/make_dense_output.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/generation/make_dense_output.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -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()(
+ typename Stepper::value_type abs_error ,
+ 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(
+ typename Stepper::value_type abs_error ,
+ 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

Added: trunk/boost/numeric/odeint/stepper/implicit_euler.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/implicit_euler.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,169 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/implicit_euler.hpp
+
+ [begin_description]
+ Impementation of the implicit Euler method. Works with ublas::vector as state type.
+ [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_IMPLICIT_EULER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED
+
+
+#include <utility>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/util/ublas_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/lu.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+
+
+
+
+
+template< class ValueType , class Resizer = initially_resizer >
+class implicit_euler
+{
+
+public:
+
+ typedef ValueType value_type;
+ typedef value_type time_type;
+ typedef boost::numeric::ublas::vector< value_type > state_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_type deriv_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef boost::numeric::ublas::matrix< value_type > matrix_type;
+ typedef state_wrapper< matrix_type > wrapped_matrix_type;
+ typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type;
+ typedef state_wrapper< pmatrix_type > wrapped_pmatrix_type;
+ typedef Resizer resizer_type;
+ typedef stepper_tag stepper_category;
+ typedef implicit_euler< ValueType , Resizer > stepper_type;
+
+ implicit_euler( value_type epsilon = 1E-6 )
+ : m_epsilon( epsilon )
+ { }
+
+
+ template< class System >
+ void do_step( System system , state_type &x , time_type t , time_type dt )
+ {
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ typedef typename odeint::unwrap_reference< typename system_type::first_type >::type deriv_func_type;
+ typedef typename odeint::unwrap_reference< typename system_type::second_type >::type jacobi_func_type;
+ system_type &sys = system;
+ deriv_func_type &deriv_func = sys.first;
+ jacobi_func_type &jacobi_func = sys.second;
+
+ m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl<state_type> , detail::ref( *this ) , detail::_1 ) );
+
+ for( size_t i=0 ; i<x.size() ; ++i )
+ m_pm.m_v[i] = i;
+
+ t += dt;
+
+ // apply first Newton step
+ deriv_func( x , m_dxdt.m_v , t );
+
+ m_b.m_v = dt * m_dxdt.m_v;
+
+ jacobi_func( x , m_jacobi.m_v , t );
+ m_jacobi.m_v *= dt;
+ m_jacobi.m_v -= boost::numeric::ublas::identity_matrix< value_type >( x.size() );
+
+ solve( m_b.m_v , m_jacobi.m_v );
+
+ m_x.m_v = x - m_b.m_v;
+
+ // iterate Newton until some precision is reached
+ // ToDo: maybe we should apply only one Newton step -> linear implicit one-step scheme
+ while( boost::numeric::ublas::norm_2( m_b.m_v ) > m_epsilon )
+ {
+ deriv_func( m_x.m_v , m_dxdt.m_v , t );
+ m_b.m_v = x - m_x.m_v + dt*m_dxdt.m_v;
+
+ // simplified version, only the first Jacobian is used
+ // jacobi( m_x , m_jacobi , t );
+ // m_jacobi *= dt;
+ // m_jacobi -= boost::numeric::ublas::identity_matrix< value_type >( x.size() );
+
+ solve( m_b.m_v , m_jacobi.m_v );
+
+ m_x.m_v -= m_b.m_v;
+ }
+ x = m_x.m_v;
+ }
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ }
+
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_b , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_jacobi , x , typename is_resizeable<matrix_type>::type() );
+ resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable<pmatrix_type>::type() );
+ return resized;
+ }
+
+
+ void solve( state_type &x , matrix_type &m )
+ {
+ int res = boost::numeric::ublas::lu_factorize( m , m_pm.m_v );
+ if( res != 0 ) exit(0);
+ boost::numeric::ublas::lu_substitute( m , m_pm.m_v , x );
+ }
+
+private:
+
+ value_type m_epsilon;
+ resizer_type m_resizer;
+ wrapped_deriv_type m_dxdt;
+ wrapped_state_type m_x;
+ wrapped_deriv_type m_b;
+ wrapped_matrix_type m_jacobi;
+ wrapped_pmatrix_type m_pm;
+
+
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/modified_midpoint.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/modified_midpoint.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,285 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/modified_midpoint.hpp
+
+ [begin_description]
+ Modified midpoint method for the use in Burlish-Stoer stepper.
+ [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_MODIFIED_MIDPOINT_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_MODIFIED_MIDPOINT_HPP_INCLUDED
+
+#include <vector>
+
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/util/copy.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class modified_midpoint
+: public explicit_stepper_base<
+ modified_midpoint< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 2 , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+{
+
+public :
+
+ typedef explicit_stepper_base<
+ modified_midpoint< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 2 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+ typedef typename stepper_base_type::stepper_type stepper_type;
+
+
+ modified_midpoint( unsigned short steps = 2 , const algebra_type &algebra = algebra_type() )
+ : stepper_base_type( algebra ) , m_steps( steps )
+ { }
+
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
+ {
+ static const value_type val1 = static_cast< value_type >( 1 );
+ static const value_type val05 = static_cast< value_type >( 1 ) / static_cast< value_type >( 2 );
+
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ const time_type h = dt / static_cast<value_type>( m_steps );
+ const time_type h2 = static_cast<value_type>(2) * h;
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+
+ time_type th = t + h;
+
+ // m_x1 = x + h*dxdt
+ stepper_base_type::m_algebra.for_each3( m_x1.m_v , in , dxdt ,
+ typename operations_type::template scale_sum2< value_type , time_type >( val1 , h ) );
+
+ sys( m_x1.m_v , m_dxdt.m_v , th );
+
+ boost::numeric::odeint::copy( in , m_x0.m_v );
+
+ unsigned short i = 1;
+ while( i != m_steps )
+ {
+ // general step
+ //tmp = m_x1; m_x1 = m_x0 + h2*m_dxdt; m_x0 = tmp
+ stepper_base_type::m_algebra.for_each3( m_x1.m_v , m_x0.m_v , m_dxdt.m_v ,
+ typename operations_type::template scale_sum_swap2< value_type , time_type >( val1 , h2 ) );
+ th += h;
+ sys( m_x1.m_v , m_dxdt.m_v , th);
+ i++;
+ }
+
+ // last step
+ // x = 0.5*( m_x0 + m_x1 + h*m_dxdt )
+ stepper_base_type::m_algebra.for_each4( out , m_x0.m_v , m_x1.m_v , m_dxdt.m_v ,
+ typename operations_type::template scale_sum3< value_type , value_type , time_type >( val05 , val05 , val05*h ) );
+ }
+
+
+ void set_steps( unsigned short steps )
+ { m_steps = steps; }
+
+
+ unsigned short steps( void ) const
+ { return m_steps; }
+
+
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_impl( x );
+ stepper_base_type::adjust_size( x );
+ }
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized( false );
+ resized |= adjust_size_by_resizeability( m_x0 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ return resized;
+ }
+
+
+ unsigned short m_steps;
+
+ resizer_type m_resizer;
+
+ wrapped_state_type m_x0;
+ wrapped_state_type m_x1;
+ wrapped_deriv_type m_dxdt;
+
+};
+
+
+/* Modified midpoint which stores derivatives and state at dt/2 in some external storage for later usage in dense output calculation
+ * This Stepper is for use in Bulirsch Stoer only. It DOES NOT meet any stepper concept.
+ */
+
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class modified_midpoint_dense_out
+{
+
+public :
+
+ typedef State state_type;
+ typedef Value value_type;
+ typedef Deriv deriv_type;
+ typedef Time time_type;
+ typedef Algebra algebra_type;
+ typedef Operations operations_type;
+ typedef Resizer resizer_type;
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+
+ typedef modified_midpoint_dense_out< State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_type;
+ typedef std::vector< wrapped_deriv_type > deriv_table_type;
+
+ modified_midpoint_dense_out( unsigned short steps = 2 , const algebra_type &algebra = algebra_type() )
+ : m_algebra( algebra ) , m_steps( steps )
+ { }
+
+ /*
+ * performs a modified midpoint step with m_steps intermediate points
+ * stores approximation for x(t+dt/2) in x_mp and all evaluated function results in derivs
+ *
+ */
+
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ,
+ state_type &x_mp , deriv_table_type &derivs )
+ {
+
+ static const value_type val1 = static_cast< value_type >( 1 );
+ static const value_type val05 = static_cast< value_type >( 1 ) / static_cast< value_type >( 2 );
+
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ const time_type h = dt / static_cast<value_type>( m_steps );
+ const time_type h2 = static_cast<value_type>( 2 ) * h;
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+
+ time_type th = t + h;
+
+ // m_x1 = x + h*dxdt
+ m_algebra.for_each3( m_x1.m_v , in , dxdt ,
+ typename operations_type::template scale_sum2< value_type , time_type >( val1 , h ) );
+
+ if( m_steps == 2 )
+ // result of first step already gives approximation at the center of the interval
+ boost::numeric::odeint::copy( m_x1.m_v , x_mp );
+
+ sys( m_x1.m_v , derivs[0].m_v , th );
+
+ boost::numeric::odeint::copy( in , m_x0.m_v );
+
+ unsigned short i = 1;
+ while( i != m_steps )
+ {
+ // general step
+ //tmp = m_x1; m_x1 = m_x0 + h2*m_dxdt; m_x0 = tmp
+ m_algebra.for_each3( m_x1.m_v , m_x0.m_v , derivs[i-1].m_v ,
+ typename operations_type::template scale_sum_swap2< value_type , time_type >( val1 , h2 ) );
+ if( i == m_steps/2-1 )
+ // save approximation at the center of the interval
+ boost::numeric::odeint::copy( m_x1.m_v , x_mp );
+
+ th += h;
+ sys( m_x1.m_v , derivs[i].m_v , th);
+ i++;
+ }
+
+ // last step
+ // x = 0.5*( m_x0 + m_x1 + h*m_dxdt )
+ m_algebra.for_each4( out , m_x0.m_v , m_x1.m_v , derivs[m_steps-1].m_v ,
+ typename operations_type::template scale_sum3< value_type , value_type , time_type >( val05 , val05 , val05*h ) );
+ }
+
+
+ void set_steps( unsigned short steps )
+ { m_steps = steps; }
+
+
+ unsigned short steps( void ) const
+ { return m_steps; }
+
+
+ template< class StateIn >
+ bool resize( const StateIn &x )
+ {
+ bool resized( false );
+ resized |= adjust_size_by_resizeability( m_x0 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
+ return resized;
+ }
+
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize( x );
+ }
+
+private:
+
+ algebra_type m_algebra;
+
+ unsigned short m_steps;
+
+ resizer_type m_resizer;
+
+ wrapped_state_type m_x0;
+ wrapped_state_type m_x1;
+
+};
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_MODIFIED_MIDPOINT_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/rosenbrock4.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/rosenbrock4.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,345 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/rosenbrock4.hpp
+
+ [begin_description]
+ Implementation of the Rosenbrock 4 method for solving stiff ODEs. Note, that a
+ controller and a dense-output stepper exist for this 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_ROSENBROCK4_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+#include <boost/numeric/odeint/util/unwrap_reference.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/lu.hpp>
+
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/util/ublas_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/lu.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * ToDo:
+ *
+ * 2. Interfacing for odeint, check if controlled_error_stepper can be used
+ * 3. dense output
+ */
+
+
+
+template< class Value >
+struct default_rosenbrock_coefficients
+{
+ typedef Value value_type;
+ typedef unsigned short order_type;
+
+ default_rosenbrock_coefficients( void )
+ : gamma ( static_cast< value_type >( 0.25 ) ) ,
+ d1 ( static_cast< value_type >( 0.25 ) ) ,
+ d2 ( static_cast< value_type >( -0.1043 ) ) ,
+ d3 ( static_cast< value_type >( 0.1035 ) ) ,
+ d4 ( static_cast< value_type >( 0.3620000000000023e-01 ) ) ,
+ c2 ( static_cast< value_type >( 0.386 ) ) ,
+ c3 ( static_cast< value_type >( 0.21 ) ) ,
+ c4 ( static_cast< value_type >( 0.63 ) ) ,
+ c21 ( static_cast< value_type >( -0.5668800000000000e+01 ) ) ,
+ a21 ( static_cast< value_type >( 0.1544000000000000e+01 ) ) ,
+ c31 ( static_cast< value_type >( -0.2430093356833875e+01 ) ) ,
+ c32 ( static_cast< value_type >( -0.2063599157091915e+00 ) ) ,
+ a31 ( static_cast< value_type >( 0.9466785280815826e+00 ) ) ,
+ a32 ( static_cast< value_type >( 0.2557011698983284e+00 ) ) ,
+ c41 ( static_cast< value_type >( -0.1073529058151375e+00 ) ) ,
+ c42 ( static_cast< value_type >( -0.9594562251023355e+01 ) ) ,
+ c43 ( static_cast< value_type >( -0.2047028614809616e+02 ) ) ,
+ a41 ( static_cast< value_type >( 0.3314825187068521e+01 ) ) ,
+ a42 ( static_cast< value_type >( 0.2896124015972201e+01 ) ) ,
+ a43 ( static_cast< value_type >( 0.9986419139977817e+00 ) ) ,
+ c51 ( static_cast< value_type >( 0.7496443313967647e+01 ) ) ,
+ c52 ( static_cast< value_type >( -0.1024680431464352e+02 ) ) ,
+ c53 ( static_cast< value_type >( -0.3399990352819905e+02 ) ) ,
+ c54 ( static_cast< value_type >( 0.1170890893206160e+02 ) ) ,
+ a51 ( static_cast< value_type >( 0.1221224509226641e+01 ) ) ,
+ a52 ( static_cast< value_type >( 0.6019134481288629e+01 ) ) ,
+ a53 ( static_cast< value_type >( 0.1253708332932087e+02 ) ) ,
+ a54 ( static_cast< value_type >( -0.6878860361058950e+00 ) ) ,
+ c61 ( static_cast< value_type >( 0.8083246795921522e+01 ) ) ,
+ c62 ( static_cast< value_type >( -0.7981132988064893e+01 ) ) ,
+ c63 ( static_cast< value_type >( -0.3152159432874371e+02 ) ) ,
+ c64 ( static_cast< value_type >( 0.1631930543123136e+02 ) ) ,
+ c65 ( static_cast< value_type >( -0.6058818238834054e+01 ) ) ,
+ d21 ( static_cast< value_type >( 0.1012623508344586e+02 ) ) ,
+ d22 ( static_cast< value_type >( -0.7487995877610167e+01 ) ) ,
+ d23 ( static_cast< value_type >( -0.3480091861555747e+02 ) ) ,
+ d24 ( static_cast< value_type >( -0.7992771707568823e+01 ) ) ,
+ d25 ( static_cast< value_type >( 0.1025137723295662e+01 ) ) ,
+ d31 ( static_cast< value_type >( -0.6762803392801253e+00 ) ) ,
+ d32 ( static_cast< value_type >( 0.6087714651680015e+01 ) ) ,
+ d33 ( static_cast< value_type >( 0.1643084320892478e+02 ) ) ,
+ d34 ( static_cast< value_type >( 0.2476722511418386e+02 ) ) ,
+ d35 ( static_cast< value_type >( -0.6594389125716872e+01 ) )
+ {}
+
+ const value_type gamma;
+ const value_type d1 , d2 , d3 , d4;
+ const value_type c2 , c3 , c4;
+ const value_type c21 ;
+ const value_type a21;
+ const value_type c31 , c32;
+ const value_type a31 , a32;
+ const value_type c41 , c42 , c43;
+ const value_type a41 , a42 , a43;
+ const value_type c51 , c52 , c53 , c54;
+ const value_type a51 , a52 , a53 , a54;
+ const value_type c61 , c62 , c63 , c64 , c65;
+ const value_type d21 , d22 , d23 , d24 , d25;
+ const value_type d31 , d32 , d33 , d34 , d35;
+
+ static const order_type stepper_order = 4;
+ static const order_type error_order = 3;
+};
+
+
+
+template< class Value , class Coefficients = default_rosenbrock_coefficients< Value > , class Resizer = initially_resizer >
+class rosenbrock4
+{
+private:
+
+public:
+
+ typedef Value value_type;
+ typedef boost::numeric::ublas::vector< value_type > state_type;
+ typedef state_type deriv_type;
+ typedef value_type time_type;
+ typedef boost::numeric::ublas::matrix< value_type > matrix_type;
+ typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type;
+ typedef Resizer resizer_type;
+ typedef Coefficients rosenbrock_coefficients;
+ typedef stepper_tag stepper_category;
+ typedef unsigned short order_type;
+
+ typedef state_wrapper< state_type > wrapped_state_type;
+ typedef state_wrapper< deriv_type > wrapped_deriv_type;
+ typedef state_wrapper< matrix_type > wrapped_matrix_type;
+ typedef state_wrapper< pmatrix_type > wrapped_pmatrix_type;
+
+ typedef rosenbrock4< Value , Coefficients , Resizer > stepper_type;
+
+ const static order_type stepper_order = rosenbrock_coefficients::stepper_order;
+ const static order_type error_order = rosenbrock_coefficients::error_order;
+
+ rosenbrock4( void )
+ : m_resizer() , m_x_err_resizer() ,
+ m_jac() , m_pm() ,
+ m_dfdt() , m_dxdt() , m_dxdtnew() ,
+ m_g1() , m_g2() , m_g3() , m_g4() , m_g5() ,
+ m_cont3() , m_cont4() , m_xtmp() , m_x_err() ,
+ m_coef()
+ { }
+
+
+ order_type order() const { return stepper_order; }
+
+ template< class System >
+ void do_step( System system , const state_type &x , time_type t , state_type &xout , time_type dt , state_type &xerr )
+ {
+ // get the systen and jacobi function
+ typedef typename odeint::unwrap_reference< System >::type system_type;
+ typedef typename odeint::unwrap_reference< typename system_type::first_type >::type deriv_func_type;
+ typedef typename odeint::unwrap_reference< typename system_type::second_type >::type jacobi_func_type;
+ system_type &sys = system;
+ deriv_func_type &deriv_func = sys.first;
+ jacobi_func_type &jacobi_func = sys.second;
+
+ const size_t n = x.size();
+
+ m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl<state_type> , detail::ref( *this ) , detail::_1 ) );
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_pm.m_v( i ) = i;
+
+ deriv_func( x , m_dxdt.m_v , t );
+ jacobi_func( x , m_jac.m_v , t , m_dfdt.m_v );
+
+ m_jac.m_v *= -1.0;
+ m_jac.m_v += 1.0 / m_coef.gamma / dt * boost::numeric::ublas::identity_matrix< value_type >( n );
+ boost::numeric::ublas::lu_factorize( m_jac.m_v , m_pm.m_v );
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_g1.m_v[i] = m_dxdt.m_v[i] + dt * m_coef.d1 * m_dfdt.m_v[i];
+ boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g1.m_v );
+
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_xtmp.m_v[i] = x[i] + m_coef.a21 * m_g1.m_v[i];
+ deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + m_coef.c2 * dt );
+ for( size_t i=0 ; i<n ; ++i )
+ m_g2.m_v[i] = m_dxdtnew.m_v[i] + dt * m_coef.d2 * m_dfdt.m_v[i] + m_coef.c21 * m_g1.m_v[i] / dt;
+ boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g2.m_v );
+
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_xtmp.m_v[i] = x[i] + m_coef.a31 * m_g1.m_v[i] + m_coef.a32 * m_g2.m_v[i];
+ deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + m_coef.c3 * dt );
+ for( size_t i=0 ; i<n ; ++i )
+ m_g3.m_v[i] = m_dxdtnew.m_v[i] + dt * m_coef.d3 * m_dfdt.m_v[i] + ( m_coef.c31 * m_g1.m_v[i] + m_coef.c32 * m_g2.m_v[i] ) / dt;
+ boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g3.m_v );
+
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_xtmp.m_v[i] = x[i] + m_coef.a41 * m_g1.m_v[i] + m_coef.a42 * m_g2.m_v[i] + m_coef.a43 * m_g3.m_v[i];
+ deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + m_coef.c4 * dt );
+ for( size_t i=0 ; i<n ; ++i )
+ m_g4.m_v[i] = m_dxdtnew.m_v[i] + dt * m_coef.d4 * m_dfdt.m_v[i] + ( m_coef.c41 * m_g1.m_v[i] + m_coef.c42 * m_g2.m_v[i] + m_coef.c43 * m_g3.m_v[i] ) / dt;
+ boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g4.m_v );
+
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_xtmp.m_v[i] = x[i] + m_coef.a51 * m_g1.m_v[i] + m_coef.a52 * m_g2.m_v[i] + m_coef.a53 * m_g3.m_v[i] + m_coef.a54 * m_g4.m_v[i];
+ deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + dt );
+ for( size_t i=0 ; i<n ; ++i )
+ m_g5.m_v[i] = m_dxdtnew.m_v[i] + ( m_coef.c51 * m_g1.m_v[i] + m_coef.c52 * m_g2.m_v[i] + m_coef.c53 * m_g3.m_v[i] + m_coef.c54 * m_g4.m_v[i] ) / dt;
+ boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g5.m_v );
+
+ for( size_t i=0 ; i<n ; ++i )
+ m_xtmp.m_v[i] += m_g5.m_v[i];
+ deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + dt );
+ for( size_t i=0 ; i<n ; ++i )
+ xerr[i] = m_dxdtnew.m_v[i] + ( m_coef.c61 * m_g1.m_v[i] + m_coef.c62 * m_g2.m_v[i] + m_coef.c63 * m_g3.m_v[i] + m_coef.c64 * m_g4.m_v[i] + m_coef.c65 * m_g5.m_v[i] ) / dt;
+ boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , xerr );
+
+ for( size_t i=0 ; i<n ; ++i )
+ xout[i] = m_xtmp.m_v[i] + xerr[i];
+ }
+
+ template< class System >
+ void do_step( System system , state_type &x , time_type t , time_type dt , state_type &xerr )
+ {
+ do_step( system , x , t , x , dt , xerr );
+ }
+
+ /*
+ * do_step without error output - just calls above functions with and neglects the error estimate
+ */
+ template< class System >
+ void do_step( System system , const state_type &x , time_type t , state_type &xout , time_type dt )
+ {
+ m_x_err_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_x_err<state_type> , detail::ref( *this ) , detail::_1 ) );
+ do_step( system , x , t , xout , dt , m_x_err.m_v );
+ }
+
+ template< class System >
+ void do_step( System system , state_type &x , time_type t , time_type dt )
+ {
+ m_x_err_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_x_err<state_type> , detail::ref( *this ) , detail::_1 ) );
+ do_step( system , x , t , dt , m_x_err.m_v );
+ }
+
+ void prepare_dense_output()
+ {
+ const size_t n = m_g1.m_v.size();
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ m_cont3.m_v[i] = m_coef.d21 * m_g1.m_v[i] + m_coef.d22 * m_g2.m_v[i] + m_coef.d23 * m_g3.m_v[i] + m_coef.d24 * m_g4.m_v[i] + m_coef.d25 * m_g5.m_v[i];
+ m_cont4.m_v[i] = m_coef.d31 * m_g1.m_v[i] + m_coef.d32 * m_g2.m_v[i] + m_coef.d33 * m_g3.m_v[i] + m_coef.d34 * m_g4.m_v[i] + m_coef.d35 * m_g5.m_v[i];
+ }
+ }
+
+
+ void calc_state( time_type t , state_type &x ,
+ const state_type &x_old , time_type t_old ,
+ const state_type &x_new , time_type t_new )
+ {
+ const size_t n = m_g1.m_v.size();
+ time_type dt = t_new - t_old;
+ time_type s = ( t - t_old ) / dt;
+ time_type s1 = 1.0 - s;
+ for( size_t i=0 ; i<n ; ++i )
+ x[i] = x_old[i] * s1 + s * ( x_new[i] + s1 * ( m_cont3.m_v[i] + s * m_cont4.m_v[i] ) );
+ }
+
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ resize_x_err( x );
+ }
+
+
+protected:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dfdt , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_xtmp , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_g1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_g2 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_g3 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_g4 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_g5 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_cont3 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_cont4 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_jac , x , typename is_resizeable<matrix_type>::type() );
+ resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable<pmatrix_type>::type() );
+ return resized;
+ }
+
+ template< class StateIn >
+ bool resize_x_err( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_x_err , x , typename is_resizeable<state_type>::type() );
+ }
+
+private:
+
+
+ resizer_type m_resizer;
+ resizer_type m_x_err_resizer;
+
+ wrapped_matrix_type m_jac;
+ wrapped_pmatrix_type m_pm;
+ wrapped_deriv_type m_dfdt , m_dxdt , m_dxdtnew;
+ wrapped_state_type m_g1 , m_g2 , m_g3 , m_g4 , m_g5;
+ wrapped_state_type m_cont3 , m_cont4;
+ wrapped_state_type m_xtmp;
+ wrapped_state_type m_x_err;
+
+ const rosenbrock_coefficients m_coef;
+};
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,208 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/rosenbrock4_controller.hpp
+
+ [begin_description]
+ Controller for 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_ROSENBROCK4_CONTROLLER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_CONTROLLER_HPP_INCLUDED
+
+#include <boost/config.hpp>
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/util/copy.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+
+#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class Stepper >
+class rosenbrock4_controller
+{
+private:
+
+
+public:
+
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_type::resizer_type resizer_type;
+ typedef controlled_stepper_tag stepper_category;
+
+ typedef rosenbrock4_controller< Stepper > controller_type;
+
+
+ rosenbrock4_controller( value_type atol = 1.0e-6 , value_type rtol = 1.0e-6 , const stepper_type &stepper = stepper_type() )
+ : m_stepper( stepper ) , m_atol( atol ) , m_rtol( rtol ) ,
+ m_first_step( true ) , m_err_old( 0.0 ) , m_dt_old( 0.0 ) ,
+ m_last_rejected( false )
+ { }
+
+
+ value_type error( const state_type &x , const state_type &xold , const state_type &xerr )
+ {
+ BOOST_USING_STD_MAX();
+ using std::abs;
+
+ const size_t n = x.size();
+ value_type err = 0.0 , sk = 0.0;
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ sk = m_atol + m_rtol * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( xold[i] ) , abs( x[i] ) );
+ err += xerr[i] * xerr[i] / sk / sk;
+ }
+ return sqrt( err / value_type( n ) );
+ }
+
+ value_type last_error( void ) const
+ {
+ return m_err_old;
+ }
+
+
+
+
+ template< class System >
+ boost::numeric::odeint::controlled_step_result
+ try_step( System sys , state_type &x , time_type &t , time_type &dt )
+ {
+ m_xnew_resizer.adjust_size( x , detail::bind( &controller_type::template resize_m_xnew< state_type > , detail::ref( *this ) , detail::_1 ) );
+ boost::numeric::odeint::controlled_step_result res = try_step( sys , x , t , m_xnew.m_v , dt );
+ if( res == success )
+ {
+ boost::numeric::odeint::copy( m_xnew.m_v , x );
+ }
+ return res;
+ }
+
+
+ template< class System >
+ boost::numeric::odeint::controlled_step_result
+ try_step( System sys , const state_type &x , time_type &t , state_type &xout , time_type &dt )
+ {
+ BOOST_USING_STD_MIN();
+ BOOST_USING_STD_MAX();
+ using std::pow;
+
+ static const value_type safe = 0.9 , fac1 = 5.0 , fac2 = 1.0 / 6.0;
+
+ m_xerr_resizer.adjust_size( x , detail::bind( &controller_type::template resize_m_xerr< state_type > , detail::ref( *this ) , detail::_1 ) );
+
+ m_stepper.do_step( sys , x , t , xout , dt , m_xerr.m_v );
+ value_type err = error( xout , x , m_xerr.m_v );
+
+ value_type fac = max BOOST_PREVENT_MACRO_SUBSTITUTION ( fac2 , min BOOST_PREVENT_MACRO_SUBSTITUTION ( fac1 , pow( err , 0.25 ) / safe ) );
+ value_type dt_new = dt / fac;
+ if ( err <= 1.0 )
+ {
+ if( m_first_step )
+ {
+ m_first_step = false;
+ }
+ else
+ {
+ value_type fac_pred = ( m_dt_old / dt ) * pow( err * err / m_err_old , 0.25 ) / safe;
+ fac_pred = max BOOST_PREVENT_MACRO_SUBSTITUTION ( fac2 , min BOOST_PREVENT_MACRO_SUBSTITUTION ( fac1 , fac_pred ) );
+ fac = max BOOST_PREVENT_MACRO_SUBSTITUTION ( fac , fac_pred );
+ dt_new = dt / fac;
+ }
+
+ m_dt_old = dt;
+ m_err_old = max BOOST_PREVENT_MACRO_SUBSTITUTION ( 0.01 , err );
+ if( m_last_rejected )
+ dt_new = ( dt >= 0.0 ? min BOOST_PREVENT_MACRO_SUBSTITUTION ( dt_new , dt ) : max BOOST_PREVENT_MACRO_SUBSTITUTION ( dt_new , dt ) );
+ t += dt;
+ dt = dt_new;
+ m_last_rejected = false;
+ return success;
+ }
+ else
+ {
+ dt = dt_new;
+ m_last_rejected = true;
+ return fail;
+ }
+ }
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_m_xerr( x );
+ resize_m_xnew( x );
+ }
+
+
+
+ stepper_type& stepper( void )
+ {
+ return m_stepper;
+ }
+
+ const stepper_type& stepper( void ) const
+ {
+ return m_stepper;
+ }
+
+
+
+
+private:
+
+ template< class StateIn >
+ bool resize_m_xerr( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() );
+ }
+
+ template< class StateIn >
+ bool resize_m_xnew( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() );
+ }
+
+
+ stepper_type m_stepper;
+ resizer_type m_xerr_resizer;
+ resizer_type m_xnew_resizer;
+ wrapped_state_type m_xerr;
+ wrapped_state_type m_xnew;
+ value_type m_atol , m_rtol;
+ bool m_first_step;
+ value_type m_err_old , m_dt_old;
+ bool m_last_rejected;
+};
+
+
+
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_CONTROLLER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,199 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp
+
+ [begin_description]
+ Dense output for Rosenbrock 4.
+ [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_ROSENBROCK4_DENSE_OUTPUT_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_DENSE_OUTPUT_HPP_INCLUDED
+
+
+#include <utility>
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class ControlledStepper >
+class rosenbrock4_dense_output
+{
+
+public:
+
+ typedef ControlledStepper controlled_stepper_type;
+ typedef typename controlled_stepper_type::stepper_type stepper_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_type::resizer_type resizer_type;
+ typedef dense_output_stepper_tag stepper_category;
+
+ typedef rosenbrock4_dense_output< ControlledStepper > dense_output_stepper_type;
+
+ rosenbrock4_dense_output( const controlled_stepper_type &stepper = controlled_stepper_type() )
+ : m_stepper( stepper ) ,
+ m_x1() , m_x2() ,
+ m_current_state_x1( true ) ,
+ m_t() , m_t_old() , m_dt()
+ {
+ }
+
+
+
+ template< class StateType >
+ void initialize( const StateType &x0 , time_type t0 , time_type dt0 )
+ {
+ m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) );
+ get_current_state() = x0;
+ m_t = t0;
+ m_dt = dt0;
+ }
+
+ template< class System >
+ std::pair< time_type , time_type > do_step( System system )
+ {
+ const size_t max_count = 1000;
+
+ controlled_step_result res = fail;
+ m_t_old = m_t;
+ size_t count = 0;
+ do
+ {
+ res = m_stepper.try_step( system , get_current_state() , m_t , get_old_state() , m_dt );
+ if( count++ == max_count )
+ throw std::overflow_error( "rosenbrock4 : too much iterations!");
+ }
+ while( res == fail );
+ m_stepper.stepper().prepare_dense_output();
+ this->toggle_current_state();
+ return std::make_pair( m_t_old , m_t );
+ }
+
+
+ /*
+ * The two overloads are needed in order to solve the forwarding problem.
+ */
+ template< class StateOut >
+ void calc_state( time_type t , StateOut &x )
+ {
+ m_stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t );
+ }
+
+ template< class StateOut >
+ void calc_state( time_type t , const StateOut &x )
+ {
+ m_stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t );
+ }
+
+
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ m_stepper.adjust_size( x );
+ resize_impl( x );
+ }
+
+
+
+
+ const state_type& current_state( void ) const
+ {
+ return get_current_state();
+ }
+
+ time_type current_time( void ) const
+ {
+ return m_t;
+ }
+
+ const state_type& previous_state( void ) const
+ {
+ return get_old_state();
+ }
+
+ time_type previous_time( void ) const
+ {
+ return m_t_old;
+ }
+
+ time_type current_time_step( void ) const
+ {
+ return m_dt;
+ }
+
+
+
+
+private:
+
+ state_type& get_current_state( void )
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ const state_type& get_current_state( void ) const
+ {
+ return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ;
+ }
+
+ state_type& get_old_state( void )
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ const state_type& get_old_state( void ) const
+ {
+ return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ;
+ }
+
+ void toggle_current_state( void )
+ {
+ m_current_state_x1 = ! m_current_state_x1;
+ }
+
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() );
+ return resized;
+ }
+
+
+ controlled_stepper_type m_stepper;
+ resizer_type m_resizer;
+ wrapped_state_type m_x1 , m_x2;
+ bool m_current_state_x1;
+ time_type m_t , m_t_old , m_dt;
+};
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_DENSE_OUTPUT_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/runge_kutta4.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/runge_kutta4.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,171 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/runge_kutta4.hpp
+
+ [begin_description]
+ Implementation of the classical Runge-Kutta stepper with the generic stepper.
+ [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_RUNGE_KUTTA4_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_HPP_INCLUDED
+
+
+
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+#ifndef DOXYGEN_SKIP
+template< class Value = double >
+struct rk4_coefficients_a1 : boost::array< Value , 1 >
+{
+ rk4_coefficients_a1( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ }
+};
+
+template< class Value = double >
+struct rk4_coefficients_a2 : boost::array< Value , 2 >
+{
+ rk4_coefficients_a2( void )
+ {
+ (*this)[0] = static_cast<Value>(0);
+ (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ }
+};
+
+
+template< class Value = double >
+struct rk4_coefficients_a3 : boost::array< Value , 3 >
+{
+ rk4_coefficients_a3( void )
+ {
+ (*this)[0] = static_cast<Value>(0);
+ (*this)[1] = static_cast<Value>(0);
+ (*this)[2] = static_cast<Value>(1);
+ }
+};
+
+template< class Value = double >
+struct rk4_coefficients_b : boost::array< Value , 4 >
+{
+ rk4_coefficients_b( void )
+ {
+ (*this)[0] = static_cast<Value>(1)/static_cast<Value>(6);
+ (*this)[1] = static_cast<Value>(1)/static_cast<Value>(3);
+ (*this)[2] = static_cast<Value>(1)/static_cast<Value>(3);
+ (*this)[3] = static_cast<Value>(1)/static_cast<Value>(6);
+ }
+};
+
+template< class Value = double >
+struct rk4_coefficients_c : boost::array< Value , 4 >
+{
+ rk4_coefficients_c( void )
+ {
+ (*this)[0] = static_cast<Value>(0);
+ (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ (*this)[2] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
+ (*this)[3] = static_cast<Value>(1);
+ }
+};
+#endif
+
+
+
+/**
+ * \class runge_kutta4
+ * \brief The classical Runge-Kutta stepper of fourth order.
+ *
+ * The Runge-Kutta method of fourth order is one standard method for
+ * solving ordinary differential equations and is widely used, see also
+ * en.wikipedia.org/wiki/Runge-Kutta_methods
+ * The method is explicit and fullfils the Stepper concept. Step size control
+ * or continous output are not provided.
+ *
+ * This class derives from explicit_stepper_base and inherits its interface via CRTP (current recurring template pattern).
+ * Furthermore, it derivs from explicit_generic_rk which is a generic Runge-Kutta algorithm. For more details see
+ * explicit_stepper_base and explicit_generic_rk.
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class runge_kutta4 : public explicit_generic_rk< 4 , 4 , State , Value , Deriv , Time ,
+Algebra , Operations , Resizer >
+{
+
+public:
+
+ typedef explicit_generic_rk< 4 , 4 , State , Value , Deriv , Time ,
+ Algebra , Operations , Resizer > stepper_base_type;
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ #endif
+
+
+ /**
+ * \brief Constructs the runge_kutta4 class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ runge_kutta4( const algebra_type &algebra = algebra_type() ) : stepper_base_type(
+ boost::fusion::make_vector( rk4_coefficients_a1<Value>() , rk4_coefficients_a2<Value>() , rk4_coefficients_a3<Value>() ) ,
+ rk4_coefficients_b<Value>() , rk4_coefficients_c<Value>() , algebra )
+ { }
+
+};
+
+}
+}
+}
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,212 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/runge_kutta4_classic.hpp
+
+ [begin_description]
+ Implementation for the classical Runge Kutta stepper.
+ [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_RUNGE_KUTTA4_CLASSIC_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_CLASSIC_HPP_INCLUDED
+
+
+
+#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/**
+ * \class runge_kutta4_classic
+ * \brief The classical Runge-Kutta stepper of fourth order.
+ *
+ * The Runge-Kutta method of fourth order is one standard method for
+ * solving ordinary differential equations and is widely used, see also
+ * en.wikipedia.org/wiki/Runge-Kutta_methods
+ * The method is explicit and fullfils the Stepper concept. Step size control
+ * or continous output are not provided. This class implements the method directly, hence the
+ * generic Runge-Kutta algorithm is not used.
+ *
+ * This class derives from explicit_stepper_base and inherits its interface via
+ * CRTP (current recurring template pattern). For more details see
+ * explicit_stepper_base.
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+#ifndef DOXYGEN_SKIP
+class runge_kutta4_classic
+: public explicit_stepper_base<
+ runge_kutta4_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+#else
+class runge_kutta4_classic
+ : public explicit_stepper_base< runge_kutta4_classic< ... > , ... >
+#endif
+{
+
+public :
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_stepper_base<
+ runge_kutta4_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type;
+ #else
+ typedef explicit_stepper_base< runge_kutta4_classic< ... > , ... > stepper_base_type;
+ #endif
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ #endif // DOXYGEN_SKIP
+
+
+
+ /**
+ * \brief Constructs the runge_kutta4_classic class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ runge_kutta4_classic( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra )
+ { }
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out of place, hence the input is in `in` and the output in `out`. `do_step_impl` is
+ * used by explicit_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
+ {
+ // ToDo : check if size of in,dxdt,out are equal?
+
+ static const value_type val1 = static_cast< value_type >( 1 );
+
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) );
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+
+ const time_type dh = dt / static_cast< value_type >( 2 );
+ const time_type th = t + dh;
+
+ // dt * dxdt = k1
+ // m_x_tmp = x + dh*dxdt
+ stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt ,
+ typename operations_type::template scale_sum2< value_type , time_type >( val1 , dh ) );
+
+
+ // dt * m_dxt = k2
+ sys( m_x_tmp.m_v , m_dxt.m_v , th );
+
+ // m_x_tmp = x + dh*m_dxt
+ stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , m_dxt.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( val1 , dh ) );
+
+
+ // dt * m_dxm = k3
+ sys( m_x_tmp.m_v , m_dxm.m_v , th );
+ //m_x_tmp = x + dt*m_dxm
+ stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , m_dxm.m_v ,
+ typename operations_type::template scale_sum2< value_type , time_type >( val1 , dt ) );
+
+
+ // dt * m_dxh = k4
+ sys( m_x_tmp.m_v , m_dxh.m_v , t + dt );
+ //x += dt/6 * ( m_dxdt + m_dxt + val2*m_dxm )
+ time_type dt6 = dt / static_cast< value_type >( 6 );
+ time_type dt3 = dt / static_cast< value_type >( 3 );
+ stepper_base_type::m_algebra.for_each6( out , in , dxdt , m_dxt.m_v , m_dxm.m_v , m_dxh.m_v ,
+ typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt6 , dt3 , dt3 , dt6 ) );
+ }
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateType >
+ void adjust_size( const StateType &x )
+ {
+ resize_impl( x );
+ stepper_base_type::adjust_size( x );
+ }
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxm , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxt , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_dxh , x , typename is_resizeable<deriv_type>::type() );
+ return resized;
+ }
+
+
+ resizer_type m_resizer;
+
+ wrapped_deriv_type m_dxt;
+ wrapped_deriv_type m_dxm;
+ wrapped_deriv_type m_dxh;
+ wrapped_state_type m_x_tmp;
+
+};
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_CLASSIC_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,219 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp
+
+ [begin_description]
+ Implementation of the Runge Kutta Cash Karp 5(4) method. It uses the generic error stepper.
+ [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_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+#include <boost/array.hpp>
+
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+#ifndef DOXYGEN_SKIP
+template< class Value = double >
+struct rk54_ck_coefficients_a1 : boost::array< Value , 1 >
+{
+ rk54_ck_coefficients_a1( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 5 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_a2 : boost::array< Value , 2 >
+{
+ rk54_ck_coefficients_a2( void )
+ {
+ (*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 40 );
+ (*this)[1] = static_cast<Value>( 9 )/static_cast<Value>( 40 );
+ }
+};
+
+
+template< class Value = double >
+struct rk54_ck_coefficients_a3 : boost::array< Value , 3 >
+{
+ rk54_ck_coefficients_a3( void )
+ {
+ (*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 10 );
+ (*this)[1] = static_cast<Value>( -9 )/static_cast<Value>( 10 );
+ (*this)[2] = static_cast<Value>( 6 )/static_cast<Value>( 5 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_a4 : boost::array< Value , 4 >
+{
+ rk54_ck_coefficients_a4( void )
+ {
+ (*this)[0] = static_cast<Value>( -11 )/static_cast<Value>( 54 );
+ (*this)[1] = static_cast<Value>( 5 )/static_cast<Value>( 2 );
+ (*this)[2] = static_cast<Value>( -70 )/static_cast<Value>( 27 );
+ (*this)[3] = static_cast<Value>( 35 )/static_cast<Value>( 27 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_a5 : boost::array< Value , 5 >
+{
+ rk54_ck_coefficients_a5( void )
+ {
+ (*this)[0] = static_cast<Value>( 1631 )/static_cast<Value>( 55296 );
+ (*this)[1] = static_cast<Value>( 175 )/static_cast<Value>( 512 );
+ (*this)[2] = static_cast<Value>( 575 )/static_cast<Value>( 13824 );
+ (*this)[3] = static_cast<Value>( 44275 )/static_cast<Value>( 110592 );
+ (*this)[4] = static_cast<Value>( 253 )/static_cast<Value>( 4096 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_b : boost::array< Value , 6 >
+{
+ rk54_ck_coefficients_b( void )
+ {
+ (*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 );
+ (*this)[1] = static_cast<Value>( 0 );
+ (*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 );
+ (*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 );
+ (*this)[4] = static_cast<Value>( 0 );
+ (*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 );
+ }
+};
+
+template< class Value = double >
+struct rk54_ck_coefficients_db : boost::array< Value , 6 >
+{
+ rk54_ck_coefficients_db( void )
+ {
+ (*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 ) - static_cast<Value>( 2825 )/static_cast<Value>( 27648 );
+ (*this)[1] = static_cast<Value>( 0 );
+ (*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 ) - static_cast<Value>( 18575 )/static_cast<Value>( 48384 );
+ (*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 ) - static_cast<Value>( 13525 )/static_cast<Value>( 55296 );
+ (*this)[4] = static_cast<Value>( -277 )/static_cast<Value>( 14336 );
+ (*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 ) - static_cast<Value>( 1 )/static_cast<Value>( 4 );
+ }
+};
+
+
+template< class Value = double >
+struct rk54_ck_coefficients_c : boost::array< Value , 6 >
+{
+ rk54_ck_coefficients_c( void )
+ {
+ (*this)[0] = static_cast<Value>(0);
+ (*this)[1] = static_cast<Value>( 1 )/static_cast<Value>( 5 );
+ (*this)[2] = static_cast<Value>( 3 )/static_cast<Value>( 10 );
+ (*this)[3] = static_cast<Value>( 3 )/static_cast<Value>( 5 );
+ (*this)[4] = static_cast<Value>( 1 );
+ (*this)[5] = static_cast<Value>( 7 )/static_cast<Value>( 8 );
+ }
+};
+#endif
+
+
+/**
+ * \class runge_kutta_cash_karp54
+ * \brief The Runge-Kutta Cash-Karp method.
+ *
+ * The Runge-Kutta Cash-Karp method is one of the standard methods for
+ * solving ordinary differential equations, see
+ * en.wikipedia.org/wiki/Cash-Karp_methods.
+ * The method is explicit and fullfils the Error Stepper concept. Step size control
+ * is provided but continous output is not available for this method.
+ *
+ * This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring template pattern).
+ * Furthermore, it derivs from explicit_error_generic_rk which is a generic Runge-Kutta algorithm with error estimation.
+ * For more details see explicit_error_stepper_base and explicit_error_generic_rk.
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class Resizer = initially_resizer
+ >
+class runge_kutta_cash_karp54 : public explicit_error_generic_rk< 6 , 5 , 5 , 4 ,
+ State , Value , Deriv , Time , Algebra , Operations , Resizer >
+{
+
+public:
+
+ typedef explicit_error_generic_rk< 6 , 5 , 5 , 4 , State , Value , Deriv , Time ,
+ Algebra , Operations , Resizer > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_typ;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ #endif
+
+
+ /**
+ * \brief Constructs the runge_kutta_cash_karp54 class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ runge_kutta_cash_karp54( const algebra_type &algebra = algebra_type() ) : stepper_base_type(
+ boost::fusion::make_vector( rk54_ck_coefficients_a1<Value>() ,
+ rk54_ck_coefficients_a2<Value>() ,
+ rk54_ck_coefficients_a3<Value>() ,
+ rk54_ck_coefficients_a4<Value>() ,
+ rk54_ck_coefficients_a5<Value>() ) ,
+ rk54_ck_coefficients_b<Value>() , rk54_ck_coefficients_db<Value>() , rk54_ck_coefficients_c<Value>() ,
+ algebra )
+ { }
+};
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,275 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp
+
+ [begin_description]
+ Classical implementation of the Runge-Kutta Cash-Karp 5(4) 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_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+
+/**
+ * \class runge_kutta_cash_karp54_classic
+ * \brief The Runge-Kutta Cash-Karp method implemented without the generic Runge-Kutta algorithm.
+ *
+ * The Runge-Kutta Cash-Karp method is one of the standard methods for
+ * solving ordinary differential equations, see
+ * en.wikipedia.org/wiki/Cash-Karp_method.
+ * The method is explicit and fullfils the Error Stepper concept. Step size control
+ * is provided but continous output is not available for this method.
+ *
+ * This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring
+ * template pattern). This class implements the method directly, hence the generic Runge-Kutta algorithm is not used.
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = double ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+#ifndef DOXYGEN_SKIP
+class runge_kutta_cash_karp54_classic
+: public explicit_error_stepper_base<
+ runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+#else
+class runge_kutta_cash_karp54_classic
+ : public explicit_error_stepper_base< runge_kutta_cash_karp54_classic< ... > , ... >
+#endif
+{
+
+
+public :
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_error_stepper_base<
+ runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type;
+ #else
+ typedef explicit_error_stepper_base< runge_kutta_cash_karp54_classic< ... > , ... > stepper_base_type;
+ #endif
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ #endif
+
+
+ /**
+ * \brief Constructs the runge_kutta_cash_karp54_classic class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ runge_kutta_cash_karp54_classic( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra )
+ { }
+
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out-of-place, hence the input is in `in` and the output in `out`. Futhermore, an
+ * estimation of the error is stored in `xerr`. `do_step_impl` is used by explicit_error_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ * \param xerr The result of the error estimation is written in xerr.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class Err >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr )
+ {
+ const value_type c1 = static_cast<value_type> ( 37 ) / static_cast<value_type>( 378 );
+ const value_type c3 = static_cast<value_type> ( 250 ) / static_cast<value_type>( 621 );
+ const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 594 );
+ const value_type c6 = static_cast<value_type> ( 512 ) / static_cast<value_type>( 1771 );
+
+ const value_type dc1 = c1 - static_cast<value_type> ( 2825 ) / static_cast<value_type>( 27648 );
+ const value_type dc3 = c3 - static_cast<value_type> ( 18575 ) / static_cast<value_type>( 48384 );
+ const value_type dc4 = c4 - static_cast<value_type> ( 13525 ) / static_cast<value_type>( 55296 );
+ const value_type dc5 = static_cast<value_type> ( -277 ) / static_cast<value_type>( 14336 );
+ const value_type dc6 = c6 - static_cast<value_type> ( 1 ) / static_cast<value_type> ( 4 );
+
+ do_step_impl( system , in , dxdt , t , out , dt );
+
+ //error estimate
+ stepper_base_type::m_algebra.for_each6( xerr , dxdt , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v ,
+ typename operations_type::template scale_sum5< time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 ));
+
+ }
+
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method.
+ * The result is updated out-of-place, hence the input is in `in` and the output in `out`. `do_step_impl` is
+ * used by explicit_error_stepper_base.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt The derivative of x at t.
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt )
+ {
+ const value_type a2 = static_cast<value_type> ( 1 ) / static_cast<value_type> ( 5 );
+ const value_type a3 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 10 );
+ const value_type a4 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 5 );
+ const value_type a5 = static_cast<value_type> ( 1 );
+ const value_type a6 = static_cast<value_type> ( 7 ) / static_cast<value_type> ( 8 );
+
+ const value_type b21 = static_cast<value_type> ( 1 ) / static_cast<value_type> ( 5 );
+ const value_type b31 = static_cast<value_type> ( 3 ) / static_cast<value_type>( 40 );
+ const value_type b32 = static_cast<value_type> ( 9 ) / static_cast<value_type>( 40 );
+ const value_type b41 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 10 );
+ const value_type b42 = static_cast<value_type> ( -9 ) / static_cast<value_type> ( 10 );
+ const value_type b43 = static_cast<value_type> ( 6 ) / static_cast<value_type> ( 5 );
+ const value_type b51 = static_cast<value_type> ( -11 ) / static_cast<value_type>( 54 );
+ const value_type b52 = static_cast<value_type> ( 5 ) / static_cast<value_type> ( 2 );
+ const value_type b53 = static_cast<value_type> ( -70 ) / static_cast<value_type>( 27 );
+ const value_type b54 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 27 );
+ const value_type b61 = static_cast<value_type> ( 1631 ) / static_cast<value_type>( 55296 );
+ const value_type b62 = static_cast<value_type> ( 175 ) / static_cast<value_type>( 512 );
+ const value_type b63 = static_cast<value_type> ( 575 ) / static_cast<value_type>( 13824 );
+ const value_type b64 = static_cast<value_type> ( 44275 ) / static_cast<value_type>( 110592 );
+ const value_type b65 = static_cast<value_type> ( 253 ) / static_cast<value_type>( 4096 );
+
+ const value_type c1 = static_cast<value_type> ( 37 ) / static_cast<value_type>( 378 );
+ const value_type c3 = static_cast<value_type> ( 250 ) / static_cast<value_type>( 621 );
+ const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 594 );
+ const value_type c6 = static_cast<value_type> ( 512 ) / static_cast<value_type>( 1771 );
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+
+ m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+
+ //m_x1 = x + dt*b21*dxdt
+ stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) );
+
+ sys( m_x_tmp.m_v , m_k2.m_v , t + dt*a2 );
+ // m_x_tmp = x + dt*b31*dxdt + dt*b32*m_x2
+ stepper_base_type::m_algebra.for_each4( m_x_tmp.m_v , in , dxdt , m_k2.m_v ,
+ typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt*b31 , dt*b32 ));
+
+ sys( m_x_tmp.m_v , m_k3.m_v , t + dt*a3 );
+ // m_x_tmp = x + dt * (b41*dxdt + b42*m_x2 + b43*m_x3)
+ stepper_base_type::m_algebra.for_each5( m_x_tmp.m_v , in , dxdt , m_k2.m_v , m_k3.m_v ,
+ typename operations_type::template scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt*b41 , dt*b42 , dt*b43 ));
+
+ sys( m_x_tmp.m_v, m_k4.m_v , t + dt*a4 );
+ stepper_base_type::m_algebra.for_each6( m_x_tmp.m_v , in , dxdt , m_k2.m_v , m_k3.m_v , m_k4.m_v ,
+ typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b51 , dt*b52 , dt*b53 , dt*b54 ));
+
+ sys( m_x_tmp.m_v , m_k5.m_v , t + dt*a5 );
+ stepper_base_type::m_algebra.for_each7( m_x_tmp.m_v , in , dxdt , m_k2.m_v , m_k3.m_v , m_k4.m_v , m_k5.m_v ,
+ typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b61 , dt*b62 , dt*b63 , dt*b64 , dt*b65 ));
+
+ sys( m_x_tmp.m_v , m_k6.m_v , t + dt*a6 );
+ stepper_base_type::m_algebra.for_each6( out , in , dxdt , m_k3.m_v , m_k4.m_v , m_k6.m_v ,
+ typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*c1 , dt*c3 , dt*c4 , dt*c6 ));
+
+ }
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_impl( x );
+ stepper_base_type::adjust_size( x );
+ }
+
+private:
+
+ template< class StateIn >
+ bool resize_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable<deriv_type>::type() );
+ return resized;
+ }
+
+
+ wrapped_state_type m_x_tmp;
+ wrapped_deriv_type m_k2, m_k3, m_k4, m_k5, m_k6;
+ resizer_type m_resizer;
+
+};
+
+
+
+
+
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,384 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp
+
+ [begin_description]
+ Implementation of the Dormand-Prince 5(4) method. This stepper can also be used with the dense-output controlled stepper.
+ [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_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/bind.hpp>
+
+#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/same_instance.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+/**
+ * \class runge_kutta_dopri5
+ * \brief The Runge-Kutta Dormand-Prince 5 method.
+ *
+ * The Runge-Kutta Dormand-Prince 5 method is a very popular method for solving ODEs, see
+ * .
+ * The method is explicit and fullfils the Error Stepper concept. Step size control
+ * is provided but continous output is available which make this method favourable for many applications.
+ *
+ * This class derives from explicit_error_stepper_fsal_base and inherits its interface via CRTP (current recurring
+ * template pattern). The method possesses the FSAL (first-same-as-last) property. See
+ * explicit_error_stepper_fsal_base for more details.
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class runge_kutta_dopri5
+#ifndef DOXYGEN_SKIP
+: public explicit_error_stepper_fsal_base<
+ runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer >
+#else
+: public explicit_error_stepper_fsal_base< runge_kutta_dopri5< ... > , ... >
+#endif
+{
+
+public :
+
+ #ifndef DOXYGEN_SKIP
+ typedef explicit_error_stepper_fsal_base<
+ runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resizer > ,
+ 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type;
+ #else
+ typedef explicit_error_stepper_fsal_base< runge_kutta_dopri5< ... > , ... > stepper_base_type;
+ #endif
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ #endif // DOXYGEN_SKIP
+
+
+ /**
+ * \brief Constructs the runge_kutta_dopri5 class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ runge_kutta_dopri5( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra )
+ { }
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt_in` of `in` at the time `t` is passed to the
+ * method. The result is updated out-of-place, hence the input is in `in` and the output in `out`. Furthermore,
+ * the derivative is update out-of-place, hence the input is assumed to be in `dxdt_in` and the output in
+ * `dxdt_out`. `do_step_impl` is used by explicit_error_stepper_fsalbase.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt_in The derivative of x at t. dxdt_in is not modified by this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dxdt_out The result of the new derivative at time t+dt.
+ * \param dt The step size.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t ,
+ StateOut &out , DerivOut &dxdt_out , time_type dt )
+ {
+ const value_type a2 = static_cast<value_type> ( 1 ) / static_cast<value_type>( 5 );
+ const value_type a3 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 10 );
+ const value_type a4 = static_cast<value_type> ( 4 ) / static_cast<value_type> ( 5 );
+ const value_type a5 = static_cast<value_type> ( 8 )/static_cast<value_type> ( 9 );
+
+ const value_type b21 = static_cast<value_type> ( 1 ) / static_cast<value_type> ( 5 );
+
+ const value_type b31 = static_cast<value_type> ( 3 ) / static_cast<value_type>( 40 );
+ const value_type b32 = static_cast<value_type> ( 9 ) / static_cast<value_type>( 40 );
+
+ const value_type b41 = static_cast<value_type> ( 44 ) / static_cast<value_type> ( 45 );
+ const value_type b42 = static_cast<value_type> ( -56 ) / static_cast<value_type> ( 15 );
+ const value_type b43 = static_cast<value_type> ( 32 ) / static_cast<value_type> ( 9 );
+
+ const value_type b51 = static_cast<value_type> ( 19372 ) / static_cast<value_type>( 6561 );
+ const value_type b52 = static_cast<value_type> ( -25360 ) / static_cast<value_type> ( 2187 );
+ const value_type b53 = static_cast<value_type> ( 64448 ) / static_cast<value_type>( 6561 );
+ const value_type b54 = static_cast<value_type> ( -212 ) / static_cast<value_type>( 729 );
+
+ const value_type b61 = static_cast<value_type> ( 9017 ) / static_cast<value_type>( 3168 );
+ const value_type b62 = static_cast<value_type> ( -355 ) / static_cast<value_type>( 33 );
+ const value_type b63 = static_cast<value_type> ( 46732 ) / static_cast<value_type>( 5247 );
+ const value_type b64 = static_cast<value_type> ( 49 ) / static_cast<value_type>( 176 );
+ const value_type b65 = static_cast<value_type> ( -5103 ) / static_cast<value_type>( 18656 );
+
+ const value_type c1 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 384 );
+ const value_type c3 = static_cast<value_type> ( 500 ) / static_cast<value_type>( 1113 );
+ const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 192 );
+ const value_type c5 = static_cast<value_type> ( -2187 ) / static_cast<value_type>( 6784 );
+ const value_type c6 = static_cast<value_type> ( 11 ) / static_cast<value_type>( 84 );
+
+ typename odeint::unwrap_reference< System >::type &sys = system;
+
+ m_k_x_tmp_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_k_x_tmp_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+
+ //m_x_tmp = x + dt*b21*dxdt
+ stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt_in ,
+ typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) );
+
+ sys( m_x_tmp.m_v , m_k2.m_v , t + dt*a2 );
+ // m_x_tmp = x + dt*b31*dxdt + dt*b32*m_k2
+ stepper_base_type::m_algebra.for_each4( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v ,
+ typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt*b31 , dt*b32 ));
+
+ sys( m_x_tmp.m_v , m_k3.m_v , t + dt*a3 );
+ // m_x_tmp = x + dt * (b41*dxdt + b42*m_k2 + b43*m_k3)
+ stepper_base_type::m_algebra.for_each5( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , m_k3.m_v ,
+ typename operations_type::template scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt*b41 , dt*b42 , dt*b43 ));
+
+ sys( m_x_tmp.m_v, m_k4.m_v , t + dt*a4 );
+ stepper_base_type::m_algebra.for_each6( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , m_k3.m_v , m_k4.m_v ,
+ typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b51 , dt*b52 , dt*b53 , dt*b54 ));
+
+ sys( m_x_tmp.m_v , m_k5.m_v , t + dt*a5 );
+ stepper_base_type::m_algebra.for_each7( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , m_k3.m_v , m_k4.m_v , m_k5.m_v ,
+ typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b61 , dt*b62 , dt*b63 , dt*b64 , dt*b65 ));
+
+ sys( m_x_tmp.m_v , m_k6.m_v , t + dt );
+ stepper_base_type::m_algebra.for_each7( out , in , dxdt_in , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v ,
+ typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*c1 , dt*c3 , dt*c4 , dt*c5 , dt*c6 ));
+
+ // the new derivative
+ sys( out , dxdt_out , t + dt );
+ }
+
+
+
+ /**
+ * \brief This method performs one step. The derivative `dxdt_in` of `in` at the time `t` is passed to the
+ * method. The result is updated out-of-place, hence the input is in `in` and the output in `out`. Furthermore,
+ * the derivative is update out-of-place, hence the input is assumed to be in `dxdt_in` and the output in
+ * `dxdt_out`. `do_step_impl` is used by explicit_error_stepper_fsalbase. An estimation of the error is
+ * calculated.
+ *
+ * \param system The system function to solve, hence the r.h.s. of the ODE. It must fullfil the
+ * Simple System concept.
+ * \param in The state of the ODE which should be solved. in is not modified in this method
+ * \param dxdt_in The derivative of x at t. dxdt_in is not modified by this method
+ * \param t The value of the time, at which the step should be performed.
+ * \param out The result of the step is written in out.
+ * \param dxdt_out The result of the new derivative at time t+dt.
+ * \param dt The step size.
+ * \param xerr An estimation of the error.
+ */
+ template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut , class Err >
+ void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t ,
+ StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr )
+ {
+ const value_type c1 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 384 );
+ const value_type c3 = static_cast<value_type> ( 500 ) / static_cast<value_type>( 1113 );
+ const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 192 );
+ const value_type c5 = static_cast<value_type> ( -2187 ) / static_cast<value_type>( 6784 );
+ const value_type c6 = static_cast<value_type> ( 11 ) / static_cast<value_type>( 84 );
+
+ const value_type dc1 = c1 - static_cast<value_type> ( 5179 ) / static_cast<value_type>( 57600 );
+ const value_type dc3 = c3 - static_cast<value_type> ( 7571 ) / static_cast<value_type>( 16695 );
+ const value_type dc4 = c4 - static_cast<value_type> ( 393 ) / static_cast<value_type>( 640 );
+ const value_type dc5 = c5 - static_cast<value_type> ( -92097 ) / static_cast<value_type>( 339200 );
+ const value_type dc6 = c6 - static_cast<value_type> ( 187 ) / static_cast<value_type>( 2100 );
+ const value_type dc7 = static_cast<value_type>( -1 ) / static_cast<value_type> ( 40 );
+
+ /* ToDo: copy only if &dxdt_in == &dxdt_out ? */
+ if( same_instance( dxdt_in , dxdt_out ) )
+ {
+ m_dxdt_tmp_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_dxdt_tmp_impl<StateIn> , detail::ref( *this ) , detail::_1 ) );
+ boost::numeric::odeint::copy( dxdt_in , m_dxdt_tmp.m_v );
+ do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt );
+ //error estimate
+ stepper_base_type::m_algebra.for_each7( xerr , m_dxdt_tmp.m_v , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , dxdt_out ,
+ typename operations_type::template scale_sum6< time_type , time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 , dt*dc7 ) );
+
+ }
+ else
+ {
+ do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt );
+ //error estimate
+ stepper_base_type::m_algebra.for_each7( xerr , dxdt_in , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , dxdt_out ,
+ typename operations_type::template scale_sum6< time_type , time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 , dt*dc7 ) );
+
+ }
+
+ }
+
+
+ /*
+ * Calculates Dense-Output for Dopri5
+ *
+ * See Hairer, Norsett, Wanner: Solving Ordinary Differential Equations, Nonstiff Problems. I, p.191/192
+ *
+ * y(t+theta) = y(t) + h * sum_i^7 b_i(theta) * k_i
+ *
+ * A = theta^2 * ( 3 - 2 theta )
+ * B = theta^2 * ( theta - 1 )
+ * C = theta^2 * ( theta - 1 )^2
+ * D = theta * ( theta - 1 )^2
+ *
+ * b_1( theta ) = A * b_1 - C * X1( theta ) + D
+ * b_2( theta ) = 0
+ * b_3( theta ) = A * b_3 + C * X3( theta )
+ * b_4( theta ) = A * b_4 - C * X4( theta )
+ * b_5( theta ) = A * b_5 + C * X5( theta )
+ * b_6( theta ) = A * b_6 - C * X6( theta )
+ * b_7( theta ) = B + C * X7( theta )
+ *
+ * An alternative Method is described in:
+ *
+ * www-m2.ma.tum.de/homepages/simeon/numerik3/kap3.ps
+ */
+ /**
+ * \brief This method is used for continous output and it calculates the state `x` at a time `t` from the
+ * knowledge of two states `old_state` and `current_state` at time points `t_old` and `t_new`. It also uses
+ * internal variables to calculate the result. Hence this method must be called after two successful `do_step`
+ * calls.
+ */
+ template< class StateOut , class StateIn1 , class DerivIn1 , class StateIn2 , class DerivIn2 >
+ void calc_state( time_type t , StateOut &x ,
+ const StateIn1 &x_old , const DerivIn1 &deriv_old , time_type t_old ,
+ const StateIn2 & /* x_new */ , const DerivIn2 &deriv_new , time_type t_new ) const
+ {
+ const value_type b1 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 384 );
+ const value_type b3 = static_cast<value_type> ( 500 ) / static_cast<value_type>( 1113 );
+ const value_type b4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 192 );
+ const value_type b5 = static_cast<value_type> ( -2187 ) / static_cast<value_type>( 6784 );
+ const value_type b6 = static_cast<value_type> ( 11 ) / static_cast<value_type>( 84 );
+
+ const time_type dt = ( t_new - t_old );
+ const value_type theta = ( t - t_old ) / dt;
+ const value_type X1 = static_cast< value_type >( 5 ) * ( static_cast< value_type >( 2558722523LL ) - static_cast< value_type >( 31403016 ) * theta ) / static_cast< value_type >( 11282082432LL );
+ const value_type X3 = static_cast< value_type >( 100 ) * ( static_cast< value_type >( 882725551 ) - static_cast< value_type >( 15701508 ) * theta ) / static_cast< value_type >( 32700410799LL );
+ const value_type X4 = static_cast< value_type >( 25 ) * ( static_cast< value_type >( 443332067 ) - static_cast< value_type >( 31403016 ) * theta ) / static_cast< value_type >( 1880347072LL ) ;
+ const value_type X5 = static_cast< value_type >( 32805 ) * ( static_cast< value_type >( 23143187 ) - static_cast< value_type >( 3489224 ) * theta ) / static_cast< value_type >( 199316789632LL );
+ const value_type X6 = static_cast< value_type >( 55 ) * ( static_cast< value_type >( 29972135 ) - static_cast< value_type >( 7076736 ) * theta ) / static_cast< value_type >( 822651844 );
+ const value_type X7 = static_cast< value_type >( 10 ) * ( static_cast< value_type >( 7414447 ) - static_cast< value_type >( 829305 ) * theta ) / static_cast< value_type >( 29380423 );
+
+ const value_type theta_m_1 = theta - static_cast< value_type >( 1 );
+ const value_type theta_sq = theta * theta;
+ const value_type A = theta_sq * ( static_cast< value_type >( 3 ) - static_cast< value_type >( 2 ) * theta );
+ const value_type B = theta_sq * theta_m_1;
+ const value_type C = theta_sq * theta_m_1 * theta_m_1;
+ const value_type D = theta * theta_m_1 * theta_m_1;
+
+ const value_type b1_theta = A * b1 - C * X1 + D;
+ const value_type b3_theta = A * b3 + C * X3;
+ const value_type b4_theta = A * b4 - C * X4;
+ const value_type b5_theta = A * b5 + C * X5;
+ const value_type b6_theta = A * b6 - C * X6;
+ const value_type b7_theta = B + C * X7;
+
+ // const state_type &k1 = *m_old_deriv;
+ // onst state_type &k3 = dopri5().m_k3;
+ // const state_type &k4 = dopri5().m_k4;
+ // const state_type &k5 = dopri5().m_k5;
+ // const state_type &k6 = dopri5().m_k6;
+ // const state_type &k7 = *m_current_deriv;
+
+ stepper_base_type::m_algebra.for_each8( x , x_old , deriv_old , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , deriv_new ,
+ typename operations_type::template scale_sum7< value_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt * b1_theta , dt * b3_theta , dt * b4_theta , dt * b5_theta , dt * b6_theta , dt * b7_theta ) );
+ }
+
+
+
+
+ /**
+ * \brief Adjust the size of all temporaries in the stepper manually.
+ * \param x A state from which the size of the temporaries to be resized is deduced.
+ */
+ template< class StateIn >
+ void adjust_size( const StateIn &x )
+ {
+ resize_k_x_tmp_impl( x );
+ resize_dxdt_tmp_impl( x );
+ stepper_base_type::adjust_size( x );
+ }
+
+
+private:
+
+ template< class StateIn >
+ bool resize_k_x_tmp_impl( const StateIn &x )
+ {
+ bool resized = false;
+ resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable<deriv_type>::type() );
+ resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable<deriv_type>::type() );
+ return resized;
+ }
+
+ template< class StateIn >
+ bool resize_dxdt_tmp_impl( const StateIn &x )
+ {
+ return adjust_size_by_resizeability( m_dxdt_tmp , x , typename is_resizeable<deriv_type>::type() );
+ }
+
+
+
+ wrapped_state_type m_x_tmp;
+ wrapped_deriv_type m_k2 , m_k3 , m_k4 , m_k5 , m_k6 ;
+ wrapped_deriv_type m_dxdt_tmp;
+ resizer_type m_k_x_tmp_resizer;
+ resizer_type m_dxdt_tmp_resizer;
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,359 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/runge_kutta_fehlberg87.hpp
+
+ [begin_description]
+ Implementation of the Runge-Kutta-Fehlberg stepper with the generic stepper.
+ [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_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED
+
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resizer.hpp>
+
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+#ifndef DOXYGEN_SKIP
+template< class Value = double >
+struct rk78_coefficients_a1 : boost::array< Value , 1 >
+{
+ rk78_coefficients_a1( void )
+ {
+ (*this)[0] = static_cast< Value >( 2 )/static_cast< Value >( 27 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a2 : boost::array< Value , 2 >
+{
+ rk78_coefficients_a2( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 36 );
+ (*this)[1] = static_cast< Value >( 1 )/static_cast< Value >( 12 );
+ }
+};
+
+
+template< class Value = double >
+struct rk78_coefficients_a3 : boost::array< Value , 3 >
+{
+ rk78_coefficients_a3( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 24 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 1 )/static_cast< Value >( 8 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a4 : boost::array< Value , 4 >
+{
+ rk78_coefficients_a4( void )
+ {
+ (*this)[0] = static_cast< Value >( 5 )/static_cast< Value >( 12 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( -25 )/static_cast< Value >( 16 );
+ (*this)[3] = static_cast< Value >( 25 )/static_cast< Value >( 16 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a5 : boost::array< Value , 5 >
+{
+ rk78_coefficients_a5( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 20 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 1 )/static_cast< Value >( 4 );
+ (*this)[4] = static_cast< Value >( 1 )/static_cast< Value >( 5 );
+ }
+};
+
+
+template< class Value = double >
+struct rk78_coefficients_a6 : boost::array< Value , 6 >
+{
+ rk78_coefficients_a6( void )
+ {
+ (*this)[0] = static_cast< Value >( -25 )/static_cast< Value >( 108 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 125 )/static_cast< Value >( 108 );
+ (*this)[4] = static_cast< Value >( -65 )/static_cast< Value >( 27 );
+ (*this)[5] = static_cast< Value >( 125 )/static_cast< Value >( 54 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a7 : boost::array< Value , 7 >
+{
+ rk78_coefficients_a7( void )
+ {
+ (*this)[0] = static_cast< Value >( 31 )/static_cast< Value >( 300 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 0 );
+ (*this)[4] = static_cast< Value >( 61 )/static_cast< Value >( 225 );
+ (*this)[5] = static_cast< Value >( -2 )/static_cast< Value >( 9 );
+ (*this)[6] = static_cast< Value >( 13 )/static_cast< Value >( 900 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a8 : boost::array< Value , 8 >
+{
+ rk78_coefficients_a8( void )
+ {
+ (*this)[0] = static_cast< Value >( 2 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( -53 )/static_cast< Value >( 6 );
+ (*this)[4] = static_cast< Value >( 704 )/static_cast< Value >( 45 );
+ (*this)[5] = static_cast< Value >( -107 )/static_cast< Value >( 9 );
+ (*this)[6] = static_cast< Value >( 67 )/static_cast< Value >( 90 );
+ (*this)[7] = static_cast< Value >( 3 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a9 : boost::array< Value , 9 >
+{
+ rk78_coefficients_a9( void )
+ {
+ (*this)[0] = static_cast< Value >( -91 )/static_cast< Value >( 108 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 23 )/static_cast< Value >( 108 );
+ (*this)[4] = static_cast< Value >( -976 )/static_cast< Value >( 135 );
+ (*this)[5] = static_cast< Value >( 311 )/static_cast< Value >( 54 );
+ (*this)[6] = static_cast< Value >( -19 )/static_cast< Value >( 60 );
+ (*this)[7] = static_cast< Value >( 17 )/static_cast< Value >( 6 );
+ (*this)[8] = static_cast< Value >( -1 )/static_cast< Value >( 12 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a10 : boost::array< Value , 10 >
+{
+ rk78_coefficients_a10( void )
+ {
+ (*this)[0] = static_cast< Value >( 2383 )/static_cast< Value >( 4100 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( -341 )/static_cast< Value >( 164 );
+ (*this)[4] = static_cast< Value >( 4496 )/static_cast< Value >( 1025 );
+ (*this)[5] = static_cast< Value >( -301 )/static_cast< Value >( 82 );
+ (*this)[6] = static_cast< Value >( 2133 )/static_cast< Value >( 4100 );
+ (*this)[7] = static_cast< Value >( 45 )/static_cast< Value >( 82 );
+ (*this)[8] = static_cast< Value >( 45 )/static_cast< Value >( 164 );
+ (*this)[9] = static_cast< Value >( 18 )/static_cast< Value >( 41 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a11 : boost::array< Value , 11 >
+{
+ rk78_coefficients_a11( void )
+ {
+ (*this)[0] = static_cast< Value >( 3 )/static_cast< Value >( 205 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 0 );
+ (*this)[4] = static_cast< Value >( 0 );
+ (*this)[5] = static_cast< Value >( -6 )/static_cast< Value >( 41 );
+ (*this)[6] = static_cast< Value >( -3 )/static_cast< Value >( 205 );
+ (*this)[7] = static_cast< Value >( -3 )/static_cast< Value >( 41 );
+ (*this)[8] = static_cast< Value >( 3 )/static_cast< Value >( 41 );
+ (*this)[9] = static_cast< Value >( 6 )/static_cast< Value >( 41 );
+ (*this)[10] = static_cast< Value >( 0 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_a12 : boost::array< Value , 12 >
+{
+ rk78_coefficients_a12( void )
+ {
+ (*this)[0] = static_cast< Value >( -1777 )/static_cast< Value >( 4100 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( -341 )/static_cast< Value >( 164 );
+ (*this)[4] = static_cast< Value >( 4496 )/static_cast< Value >( 1025 );
+ (*this)[5] = static_cast< Value >( -289 )/static_cast< Value >( 82 );
+ (*this)[6] = static_cast< Value >( 2193 )/static_cast< Value >( 4100 );
+ (*this)[7] = static_cast< Value >( 51 )/static_cast< Value >( 82 );
+ (*this)[8] = static_cast< Value >( 33 )/static_cast< Value >( 164 );
+ (*this)[9] = static_cast< Value >( 12 )/static_cast< Value >( 41 );
+ (*this)[10] = static_cast< Value >( 0 );
+ (*this)[11] = static_cast< Value >( 1 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_b : boost::array< Value , 13 >
+{
+ rk78_coefficients_b( void )
+ {
+ (*this)[0] = static_cast< Value >( 0 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 0 );
+ (*this)[4] = static_cast< Value >( 0 );
+ (*this)[5] = static_cast< Value >( 34 )/static_cast<Value>( 105 );
+ (*this)[6] = static_cast< Value >( 9 )/static_cast<Value>( 35 );
+ (*this)[7] = static_cast< Value >( 9 )/static_cast<Value>( 35 );
+ (*this)[8] = static_cast< Value >( 9 )/static_cast<Value>( 280 );
+ (*this)[9] = static_cast< Value >( 9 )/static_cast<Value>( 280 );
+ (*this)[10] = static_cast< Value >( 0 );
+ (*this)[11] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
+ (*this)[12] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
+ }
+};
+
+template< class Value = double >
+struct rk78_coefficients_db : boost::array< Value , 13 >
+{
+ rk78_coefficients_db( void )
+ {
+ (*this)[0] = static_cast< Value >( 0 ) - static_cast< Value >( 41 )/static_cast<Value>( 840 );
+ (*this)[1] = static_cast< Value >( 0 );
+ (*this)[2] = static_cast< Value >( 0 );
+ (*this)[3] = static_cast< Value >( 0 );
+ (*this)[4] = static_cast< Value >( 0 );
+ (*this)[5] = static_cast< Value >( 0 );
+ (*this)[6] = static_cast< Value >( 0 );
+ (*this)[7] = static_cast< Value >( 0 );
+ (*this)[8] = static_cast< Value >( 0 );
+ (*this)[9] = static_cast< Value >( 0 );
+ (*this)[10] = static_cast< Value >( 0 ) - static_cast< Value >( 41 )/static_cast<Value>( 840 );
+ (*this)[11] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
+ (*this)[12] = static_cast< Value >( 41 )/static_cast<Value>( 840 );
+ }
+};
+
+
+template< class Value = double >
+struct rk78_coefficients_c : boost::array< Value , 13 >
+{
+ rk78_coefficients_c( void )
+ {
+ (*this)[0] = static_cast< Value >( 0 );
+ (*this)[1] = static_cast< Value >( 2 )/static_cast< Value >( 27 );
+ (*this)[2] = static_cast< Value >( 1 )/static_cast< Value >( 9 );
+ (*this)[3] = static_cast< Value >( 1 )/static_cast<Value>( 6 );
+ (*this)[4] = static_cast< Value >( 5 )/static_cast<Value>( 12 );
+ (*this)[5] = static_cast< Value >( 1 )/static_cast<Value>( 2 );
+ (*this)[6] = static_cast< Value >( 5 )/static_cast<Value>( 6 );
+ (*this)[7] = static_cast< Value >( 1 )/static_cast<Value>( 6 );
+ (*this)[8] = static_cast< Value >( 2 )/static_cast<Value>( 3 );
+ (*this)[9] = static_cast< Value >( 1 )/static_cast<Value>( 3 );
+ (*this)[10] = static_cast< Value >( 1 );
+ (*this)[11] = static_cast< Value >( 0 );
+ (*this)[12] = static_cast< Value >( 1 );
+ }
+};
+#endif // DOXYGEN_SKIP
+
+
+
+
+
+/**
+ * \class runge_kutta_fehlberg78
+ * \brief The Runge-Kutta Fehlberg 78 method.
+ *
+ * The Runge-Kutta Fehlberg 78 method is a standard method for high-precision applications.
+ * The method is explicit and fullfils the Error Stepper concept. Step size control
+ * is provided but continous output is not available for this method.
+ *
+ * This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring template pattern).
+ * Furthermore, it derivs from explicit_error_generic_rk which is a generic Runge-Kutta algorithm with error estimation.
+ * For more details see explicit_error_stepper_base and explicit_error_generic_rk.
+ *
+ * \tparam State The state type.
+ * \tparam Value The value type.
+ * \tparam Deriv The type representing the time derivative of the state.
+ * \tparam Time The time representing the independent variable - the time.
+ * \tparam Algebra The algebra type.
+ * \tparam Operations The operations type.
+ * \tparam Resizer The resizer policy type.
+ */
+template<
+class State ,
+class Value = double ,
+class Deriv = State ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class runge_kutta_fehlberg78 : public explicit_error_generic_rk< 13 , 8 , 8 , 7 , State , Value , Deriv , Time ,
+Algebra , Operations , Resizer >
+{
+
+public:
+
+ typedef explicit_error_generic_rk< 13 , 8 , 8 , 7 , State , Value , Deriv , Time ,
+ Algebra , Operations , Resizer > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+
+ #ifndef DOXYGEN_SKIP
+ typedef typename stepper_base_type::stepper_type stepper_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ #endif // DOXYGEN_SKIP
+
+ /**
+ * \brief Constructs the runge_kutta_cash_fehlberg78 class. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ runge_kutta_fehlberg78( const algebra_type &algebra = algebra_type() ) : stepper_base_type(
+ boost::fusion::make_vector( rk78_coefficients_a1<Value>() , rk78_coefficients_a2<Value>() , rk78_coefficients_a3<Value>() ,
+ rk78_coefficients_a4<Value>() , rk78_coefficients_a5<Value>() , rk78_coefficients_a6<Value>() ,
+ rk78_coefficients_a7<Value>() , rk78_coefficients_a8<Value>() , rk78_coefficients_a9<Value>() ,
+ rk78_coefficients_a10<Value>() , rk78_coefficients_a11<Value>() , rk78_coefficients_a12<Value>() ) ,
+ rk78_coefficients_b<Value>() , rk78_coefficients_db<Value>() , rk78_coefficients_c<Value>() , algebra )
+ { }
+};
+
+}
+}
+}
+
+#endif //BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/stepper_categories.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/stepper_categories.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,68 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/stepper_categories.hpp
+
+ [begin_description]
+ Definition of all stepper categories.
+ [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_STEPPER_CATEGORIES_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED
+
+#include <boost/type_traits/integral_constant.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+/*
+ * Tags to specify stepper types
+ *
+ * These tags are used by integrate() to choose which integration method is used
+ */
+
+struct stepper_tag {};
+// struct explicit_stepper_tag : stepper_tag {};
+// struct implicit_stepper_tag : stepper_tag {};
+
+
+struct error_stepper_tag : stepper_tag {};
+struct explicit_error_stepper_tag : error_stepper_tag {};
+struct explicit_error_stepper_fsal_tag : error_stepper_tag {};
+
+struct controlled_stepper_tag {};
+struct explicit_controlled_stepper_tag : controlled_stepper_tag {};
+struct explicit_controlled_stepper_fsal_tag : controlled_stepper_tag {};
+
+struct dense_output_stepper_tag {};
+
+
+template< class tag > struct base_tag ;
+template< > struct base_tag< stepper_tag > { typedef stepper_tag type; };
+template< > struct base_tag< error_stepper_tag > { typedef stepper_tag type; };
+template< > struct base_tag< explicit_error_stepper_tag > { typedef stepper_tag type; };
+template< > struct base_tag< explicit_error_stepper_fsal_tag > { typedef stepper_tag type; };
+
+template< > struct base_tag< controlled_stepper_tag > { typedef controlled_stepper_tag type; };
+template< > struct base_tag< explicit_controlled_stepper_tag > { typedef controlled_stepper_tag type; };
+template< > struct base_tag< explicit_controlled_stepper_fsal_tag > { typedef controlled_stepper_tag type; };
+
+template< > struct base_tag< dense_output_stepper_tag > { typedef dense_output_stepper_tag type; };
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/symplectic_euler.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/symplectic_euler.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,125 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/symplectic_euler.hpp
+
+ [begin_description]
+ Implementation of the symplectic Euler for separable Hamiltonian systems.
+ [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_SYMPLECTIC_EULER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
+
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/array.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+#ifndef DOXYGEN_SKIP
+namespace detail {
+namespace symplectic_euler_coef {
+
+template< class Value >
+struct coef_a_type : public boost::array< Value , 1 >
+{
+ coef_a_type( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 );
+ }
+};
+
+template< class Value >
+struct coef_b_type : public boost::array< Value , 1 >
+{
+ coef_b_type( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 );
+ }
+};
+
+} // namespace symplectic_euler_coef
+} // namespace detail
+#endif
+
+
+
+/**
+ * \class symplectic_euler
+ * \brief Implementation of the symplectic Euler method.
+ *
+ * The method is of first order and has one stage. It is described HERE.
+ *
+ * \tparam Order The order of the stepper.
+ * \tparam Coor The type representing the coordinates q.
+ * \tparam Momentum The type representing the coordinates p.
+ * \tparam Value The basic value type. Should be somethink like float, double or a high-precision type.
+ * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt.
+ * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt.
+ * \tparam Time The type representing the time t.
+ * \tparam Algebra The algebra.
+ * \tparam Operations The operations.
+ * \tparam Resizer The resizer policy.
+ */
+template<
+class Coor ,
+class Momentum = Coor ,
+class Value = double ,
+class CoorDeriv = Coor ,
+class MomentumDeriv = Coor ,
+class Time = Value ,
+class Algebra = range_algebra ,
+class Operations = default_operations ,
+class Resizer = initially_resizer
+>
+class symplectic_euler :
+public symplectic_nystroem_stepper_base
+<
+1 , 1 ,
+Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
+>
+{
+public:
+
+ typedef symplectic_nystroem_stepper_base<
+ 1 , 1 , Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > stepper_base_type;
+
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::value_type value_type;
+
+
+ /**
+ * \brief Constructs the symplectic_euler. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ symplectic_euler( const algebra_type &algebra = algebra_type() )
+ : stepper_base_type( detail::symplectic_euler_coef::coef_a_type< value_type >() ,
+ detail::symplectic_euler_coef::coef_b_type< value_type >() ,
+ algebra )
+ { }
+};
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,146 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED
+#define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+#ifndef DOXYGEN_SKIP
+namespace detail {
+namespace symplectic_rkn_sb3a_m4_mclachlan {
+
+ /*
+ exp( a1 t A ) exp( b1 t B )
+ exp( a2 t A ) exp( b2 t B )
+ exp( a3 t A )
+ exp( b2 t B ) exp( a2 t A )
+ exp( b1 t B ) exp( a1 t A )
+ */
+
+
+
+ template< class Value >
+ struct coef_a_type : public boost::array< Value , 5 >
+ {
+ coef_a_type( void )
+ {
+ using std::sqrt;
+
+ Value z = sqrt( static_cast< Value >( 7 ) / static_cast< Value >( 8 ) ) / static_cast< Value >( 3 );
+ (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - z ;
+ (*this)[1] = static_cast< Value >( -1 ) / static_cast< Value >( 3 ) + z ;
+ (*this)[2] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
+ (*this)[3] = (*this)[1];
+ (*this)[4] = (*this)[0];
+ }
+ };
+
+ template< class Value >
+ struct coef_b_type : public boost::array< Value , 5 >
+ {
+ coef_b_type( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 );
+ (*this)[1] = static_cast< Value >( -1 ) / static_cast< Value >( 2 );
+ (*this)[2] = (*this)[1];
+ (*this)[3] = (*this)[0];
+ (*this)[4] = static_cast< Value >( 0 );
+ }
+ };
+
+} // namespace symplectic_rkn_sb3a_m4_mclachlan
+} // namespace detail
+#endif // DOXYGEN_SKIP
+
+
+
+
+/**
+ * \class symplectic_rkn_sb3a_m4_mclachlan
+ * \brief Implementation of the symmetric B3A Runge-Kutta Nystroem method of fifth order.
+ *
+ * The method is of fourth order and has five stages. It is described HERE. This method can be used
+ * with multiprecision types since the coefficients are defined analytically.
+ *
+ * ToDo: add reference to paper.
+ *
+ * \tparam Order The order of the stepper.
+ * \tparam Coor The type representing the coordinates q.
+ * \tparam Momentum The type representing the coordinates p.
+ * \tparam Value The basic value type. Should be somethink like float, double or a high-precision type.
+ * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt.
+ * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt.
+ * \tparam Time The type representing the time t.
+ * \tparam Algebra The algebra.
+ * \tparam Operations The operations.
+ * \tparam Resizer The resizer policy.
+ */
+template<
+ class Coor ,
+ class Momentum = Coor ,
+ class Value = double ,
+ class CoorDeriv = Coor ,
+ class MomentumDeriv = Coor ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class Resizer = initially_resizer
+ >
+class symplectic_rkn_sb3a_m4_mclachlan :
+ public symplectic_nystroem_stepper_base
+<
+ 5 , 4 ,
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
+ >
+{
+public:
+
+ typedef symplectic_nystroem_stepper_base
+ <
+ 5 , 4 ,
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
+ > stepper_base_type;
+
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::value_type value_type;
+
+
+ /**
+ * \brief Constructs the symplectic_rkn_sb3a_m4_mclachlan. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ symplectic_rkn_sb3a_m4_mclachlan( const algebra_type &algebra = algebra_type() )
+ : stepper_base_type(
+ detail::symplectic_rkn_sb3a_m4_mclachlan::coef_a_type< value_type >() ,
+ detail::symplectic_rkn_sb3a_m4_mclachlan::coef_b_type< value_type >() ,
+ algebra )
+ { }
+};
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED

Added: trunk/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,150 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp
+
+ [begin_description]
+ Implementation of the symplectic MacLachlan stepper for separable Hamiltonian system.
+ [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_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
+
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+#include <boost/array.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+#ifndef DOXYGEN_SKIP
+namespace detail {
+namespace symplectic_rkn_sb3a_mclachlan {
+
+ /*
+ exp( a1 t A ) exp( b1 t B )
+ exp( a2 t A ) exp( b2 t B )
+ exp( a3 t A ) exp( b3 t B ) exp( a3 t A )
+ exp( b2 t B ) exp( a2 t A )
+ exp( b1 t B ) exp( a1 t A )
+ */
+
+ template< class Value >
+ struct coef_a_type : public boost::array< Value , 6 >
+ {
+ coef_a_type( void )
+ {
+ (*this)[0] = static_cast< Value >( 0.40518861839525227722 );
+ (*this)[1] = static_cast< Value >( -0.28714404081652408900 );
+ (*this)[2] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - ( (*this)[0] + (*this)[1] );
+ (*this)[3] = (*this)[2];
+ (*this)[4] = (*this)[1];
+ (*this)[5] = (*this)[0];
+
+ }
+ };
+
+ template< class Value >
+ struct coef_b_type : public boost::array< Value , 6 >
+ {
+ coef_b_type( void )
+ {
+ (*this)[0] = static_cast< Value >( -3 ) / static_cast< Value >( 73 );
+ (*this)[1] = static_cast< Value >( 17 ) / static_cast< Value >( 59 );
+ (*this)[2] = static_cast< Value >( 1 ) - static_cast< Value >( 2 ) * ( (*this)[0] + (*this)[1] );
+ (*this)[3] = (*this)[1];
+ (*this)[4] = (*this)[0];
+ (*this)[5] = static_cast< Value >( 0 );
+ }
+ };
+
+} // namespace symplectic_rkn_sb3a_mclachlan
+} // namespace detail
+#endif // DOXYGEN_SKIP
+
+
+
+/**
+ * \class symplectic_rkn_sb3a_mclachlan
+ * \brief Implement of the symetric B3A method of Runge-Kutta-Nystroem method of sixth order.
+ *
+ * The method is of fourth order and has six stages. It is described HERE. This method cannot be used
+ * with multiprecision types since the coefficients are not defined analytically.
+ *
+ * ToDo Add reference to the paper.
+ *
+ * \tparam Order The order of the stepper.
+ * \tparam Coor The type representing the coordinates q.
+ * \tparam Momentum The type representing the coordinates p.
+ * \tparam Value The basic value type. Should be somethink like float, double or a high-precision type.
+ * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt.
+ * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt.
+ * \tparam Time The type representing the time t.
+ * \tparam Algebra The algebra.
+ * \tparam Operations The operations.
+ * \tparam Resizer The resizer policy.
+ */
+template<
+ class Coor ,
+ class Momentum = Coor ,
+ class Value = double ,
+ class CoorDeriv = Coor ,
+ class MomentumDeriv = Coor ,
+ class Time = Value ,
+ class Algebra = range_algebra ,
+ class Operations = default_operations ,
+ class Resizer = initially_resizer
+ >
+class symplectic_rkn_sb3a_mclachlan :
+ public symplectic_nystroem_stepper_base
+<
+ 6 , 4 ,
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
+ >
+{
+public:
+
+ typedef symplectic_nystroem_stepper_base
+ <
+ 6 , 4 ,
+ Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
+ > stepper_base_type;
+
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::value_type value_type;
+
+
+ /**
+ * \brief Constructs the symplectic_rkn_sb3a_mclachlan. This constructor can be used as a default
+ * constructor if the algebra has a default constructor.
+ * \param algebra A copy of algebra is made and stored inside explicit_stepper_base.
+ */
+ symplectic_rkn_sb3a_mclachlan( const algebra_type &algebra = algebra_type() )
+ : stepper_base_type(
+ detail::symplectic_rkn_sb3a_mclachlan::coef_a_type< value_type >() ,
+ detail::symplectic_rkn_sb3a_mclachlan::coef_b_type< value_type >() ,
+ algebra )
+ { }
+};
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/bind.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/bind.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,53 @@
+/*
+ * [begin_description]
+ * Boost bind pull the placeholders, _1, _2, ... into global
+ * namespace. This can conflict with the C++03 TR1 and C++11
+ * std::placeholders. This header provides a workaround for
+ * this problem.
+ * [end_description]
+ *
+ * Copyright 2012 Christoph Koke
+ *
+ * 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_UTIL_BIND_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/config.hpp>
+
+
+#if BOOST_NUMERIC_ODEINT_CXX11
+#include <type_traits>
+#else
+#include <boost/bind.hpp>
+#endif
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+#if BOOST_NUMERIC_ODEINT_CXX11
+
+using ::std::bind;
+using namespace ::std::placeholders;
+
+
+#else
+
+using ::boost::bind;
+using ::_1;
+using ::_2;
+
+#endif
+
+}
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/copy.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/copy.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,75 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/copy.hpp
+
+ [begin_description]
+ Copy abstraction for the usage in the 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_UTIL_COPY_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED
+
+
+#include <boost/range/algorithm/copy.hpp>
+
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/numeric/odeint/util/detail/is_range.hpp>
+
+namespace boost {
+namespace numeric {
+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;
+ }
+
+} // namespace detail
+
+
+/*
+ * Default implementation of the copy operation used the assign operator
+ * gsl_vector must copied differently
+ */
+template< class Container1, class Container2 , class Enabler = void >
+struct copy_impl
+{
+ static void copy( const Container1 &from , Container2 &to )
+ {
+ typedef typename boost::numeric::odeint::detail::is_range< Container1 >::type is_range_type;
+ detail::do_copying( from , to , is_range_type() );
+ }
+};
+
+template< class Container1 , class Container2 >
+void copy( const Container1 &from , Container2 &to )
+{
+ copy_impl< Container1 , Container2 >::copy( from , to );
+}
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/detail/is_range.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/detail/is_range.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,133 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/detail/is_range.hpp
+
+ [begin_description]
+ is_range implementation. Taken from the boost::range library.
+ [end_description]
+
+ Copyright Thorsten Ottosen 2003-2004
+
+
+
+ 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_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED
+
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <cstddef>
+#include <boost/range/config.hpp>
+#include <boost/mpl/has_xxx.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/and.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+
+namespace range_detail
+{
+BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator)
+}
+
+namespace detail
+{
+
+template< typename Range >
+struct is_range : boost::mpl::and_<range_detail::has_iterator<Range>, range_detail::has_const_iterator<Range> >
+{
+};
+
+//////////////////////////////////////////////////////////////////////////
+// pair
+//////////////////////////////////////////////////////////////////////////
+
+template< typename iteratorT >
+struct is_range< std::pair<iteratorT,iteratorT> > : boost::mpl::true_
+{
+};
+
+template< typename iteratorT >
+struct is_range< const std::pair<iteratorT,iteratorT> > : boost::mpl::true_
+{
+};
+
+//////////////////////////////////////////////////////////////////////////
+// array
+//////////////////////////////////////////////////////////////////////////
+
+template< typename elementT, std::size_t sz >
+struct is_range< elementT[sz] > : boost::mpl::true_
+{
+};
+
+template< typename elementT, std::size_t sz >
+struct is_range< const elementT[sz] > : boost::mpl::true_
+{
+};
+
+//////////////////////////////////////////////////////////////////////////
+// string
+//////////////////////////////////////////////////////////////////////////
+
+template<>
+struct is_range< char* > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< wchar_t* > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< const char* > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< const wchar_t* > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< char* const > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< wchar_t* const > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< const char* const > : boost::mpl::true_
+{
+};
+
+template<>
+struct is_range< const wchar_t* const > : boost::mpl::true_
+{
+};
+
+} // namespace detail
+
+} // namespaec odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/detail/less_with_sign.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/detail/less_with_sign.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,53 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/integrate/detail/less_with_sign.hpp
+
+ [begin_description]
+ Helper function to compare times taking into account the sign of dt
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_INTEGRATE_DETAIL_LESS_WITH_SIGN_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_LESS_WITH_SIGN_HPP_INCLUDED
+
+#include <boost/numeric/odeint/util/unit_helper.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+namespace detail {
+
+/**
+ * return t1 < t2 if dt > 0 and t1 > t2 if dt < 0
+ */
+template< typename T1 , typename T2 , typename T3 >
+bool less_with_sign( T1 t1 , T2 t2 , T3 dt )
+{
+ if( get_unit_value(dt) > 0 )
+ return t1 < t2;
+ else
+ return t1 > t2;
+}
+
+/**
+ * return t1 <= t2 if dt > 0 and t1 => t2 if dt < 0
+ */
+template< typename T1 , typename T2 , typename T3>
+bool less_eq_with_sign( T1 t1 , T2 t2 , T3 dt )
+{
+ if( get_unit_value(dt) > 0 )
+ return t1 <= t2;
+ else
+ return t1 >= t2;
+}
+
+} } } }
+
+#endif

Added: trunk/boost/numeric/odeint/util/is_pair.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/is_pair.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,45 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/is_pair.hpp
+
+ [begin_description]
+ Metafunction to determine if a type is a std::pair<>.
+ [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_UTIL_IS_PAIR_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED
+
+
+#include <boost/mpl/bool.hpp>
+#include <utility>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class T >
+struct is_pair : public boost::mpl::false_
+{
+};
+
+template< class T1 , class T2 >
+struct is_pair< std::pair< T1 , T2 > > : public boost::mpl::true_
+{
+};
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/is_resizeable.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/is_resizeable.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,84 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/is_resizeable.hpp
+
+ [begin_description]
+ Metafunction to determine if a state type can resized. For usage in the 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_UTIL_IS_RESIZEABLE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED
+
+
+#include <vector>
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/fusion/include/front.hpp>
+#include <boost/fusion/include/is_sequence.hpp>
+
+#include <boost/mpl/find_if.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/placeholders.hpp>
+// #include <boost/mpl/not.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * by default any type is not resizable
+ */
+template< class Container , class Enabler = void >
+struct is_resizeable
+{
+ //struct type : public boost::false_type { };
+ typedef boost::false_type type;
+ const static bool value = type::value;
+};
+
+/*
+ * specialization for std::vector
+ */
+template< class V, class A >
+struct is_resizeable< std::vector< V , A > >
+{
+ //struct type : public boost::true_type { };
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+
+/*
+ * specialization for fusion sequences
+ */
+template< class FusionSequence >
+struct is_resizeable< FusionSequence , typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type >
+{
+ typedef typename boost::mpl::find_if< FusionSequence , is_resizeable< boost::mpl::_1 > >::type iter;
+ typedef typename boost::mpl::end< FusionSequence >::type last;
+
+ typedef typename boost::mpl::if_< boost::is_same< iter , last > , boost::false_type , boost::true_type >::type type;
+ const static bool value = type::value;
+};
+
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/resize.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/resize.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,107 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/state_wrapper.hpp
+
+ [begin_description]
+ State wrapper for the state type in all stepper. The state wrappers are responsible for contruction,
+ destruction, copying contruction, assignment and resizing.
+ [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_UTIL_RESIZE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED
+
+#include <boost/range.hpp>
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/fusion/include/is_sequence.hpp>
+#include <boost/fusion/include/zip_view.hpp>
+#include <boost/fusion/include/vector.hpp>
+#include <boost/fusion/include/make_fused.hpp>
+#include <boost/fusion/include/for_each.hpp>
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+// resize function
+// standard implementation relies on boost.range and resize member function
+template< class StateOut , class StateIn , class Enabler = void >
+struct resize_impl
+{
+ static void resize( StateOut &x1 , const StateIn &x2 )
+ {
+ x1.resize( boost::size( x2 ) );
+ }
+};
+
+
+// do not overload or specialize this function, specialize resize_impl<> instead
+template< class StateOut , class StateIn >
+void resize( StateOut &x1 , const StateIn &x2 )
+{
+ resize_impl< StateOut , StateIn >::resize( x1 , x2 );
+}
+
+
+namespace detail {
+
+ struct resizer
+ {
+ typedef void result_type;
+
+ template< class StateOut , class StateIn >
+ void operator()( StateOut &x1 , const StateIn &x2 ) const
+ {
+ resize_op( x1 , x2 , typename is_resizeable< StateOut >::type() );
+ }
+
+ template< class StateOut , class StateIn >
+ void resize_op( StateOut &x1 , const StateIn &x2 , boost::true_type ) const
+ {
+ resize( x1 , x2 );
+ }
+
+ template< class StateOut , class StateIn >
+ void resize_op( StateOut &x1 , const StateIn &x2 , boost::false_type ) const
+ {
+ }
+
+ };
+} // nanespace detail
+
+
+/*
+ * specialization for fusion sequences
+ */
+template< class FusionSeq >
+struct resize_impl< FusionSeq , FusionSeq , typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSeq >::type >::type >
+{
+ static void resize( FusionSeq &x1 , const FusionSeq &x2 )
+ {
+ typedef boost::fusion::vector< FusionSeq& , const FusionSeq& > Sequences;
+ Sequences sequences( x1 , x2 );
+ boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( detail::resizer() ) );
+ }
+};
+
+
+
+
+}
+}
+}
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/resizer.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/resizer.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,93 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/resizer.hpp
+
+ [begin_description]
+ Implementation of the resizers.
+ [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_UTIL_RESIZER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/same_size.hpp>
+#include <boost/numeric/odeint/util/resize.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class ResizeWrappedState , class State >
+bool adjust_size_by_resizeability( ResizeWrappedState &x , const State &y , boost::true_type )
+{
+ if ( !same_size( x.m_v , y ) )
+ {
+ resize( x.m_v , y );
+ return true;
+ }
+ else
+ return false;
+}
+
+template< class ResizeWrappedState , class State >
+bool adjust_size_by_resizeability( ResizeWrappedState & /* x */ , const State & /* y */ , boost::false_type )
+{
+ return false;
+}
+
+struct always_resizer
+{
+ template< class State , class ResizeFunction >
+ bool adjust_size( const State &x , ResizeFunction f )
+ {
+ return f( x );
+ }
+};
+
+
+struct initially_resizer
+{
+
+ bool m_initialized;
+
+ initially_resizer() : m_initialized( false )
+ { }
+
+ template< class State , class ResizeFunction >
+ bool adjust_size( const State &x , ResizeFunction f )
+ {
+ if( !m_initialized )
+ {
+ m_initialized = true;
+ return f( x );
+ } else
+ return false;
+ }
+};
+
+
+struct never_resizer
+{
+ template< class State , class ResizeFunction >
+ bool adjust_size( const State &x , ResizeFunction f )
+ {
+ return false;
+ }
+};
+
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/same_instance.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/same_instance.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,56 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/same_instance.hpp
+
+ [begin_description]
+ Basic check if two variables are the same instance
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_UTIL_SAME_INSTANCE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class T1 , class T2 , class Enabler=void >
+struct same_instance_impl
+{
+ static bool same_instance( const T1 &x1 , const T2 &x2 )
+ {
+ return false;
+ }
+};
+
+template< class T >
+struct same_instance_impl< T , T >
+{
+ static bool same_instance( const T &x1 , const T &x2 )
+ {
+ // check pointers
+ return (&x1 == &x2);
+ }
+};
+
+
+template< class T1 , class T2 >
+bool same_instance( const T1 &x1 , const T2 &x2 )
+{
+ return same_instance_impl< T1 , T2 >::same_instance( x1 , x2 );
+}
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: trunk/boost/numeric/odeint/util/same_size.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/same_size.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,105 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/state_wrapper.hpp
+
+ [begin_description]
+ State wrapper for the state type in all stepper. The state wrappers are responsible for contruction,
+ destruction, copying contruction, assignment and resizing.
+ [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_UTIL_SAME_SIZE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_SAME_SIZE_HPP_INCLUDED
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/fusion/include/is_sequence.hpp>
+#include <boost/fusion/include/zip_view.hpp>
+#include <boost/fusion/include/vector.hpp>
+#include <boost/fusion/include/make_fused.hpp>
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/range.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+// same_size function
+// standard implementation relies on boost.range
+template< class State1 , class State2 , class Enabler = void >
+struct same_size_impl
+{
+ static bool same_size( const State1 &x1 , const State2 &x2 )
+ {
+ return ( boost::size( x1 ) == boost::size( x2 ) );
+ }
+};
+
+
+// do not overload or specialize this function, specialize resize_impl<> instead
+template< class State1 , class State2 >
+bool same_size( const State1 &x1 , const State2 &x2 )
+{
+ return same_size_impl< State1 , State2 >::same_size( x1 , x2 );
+}
+
+namespace detail {
+
+struct same_size_fusion
+{
+ typedef bool result_type;
+
+ template< class S1 , class S2 >
+ bool operator()( const S1 &x1 , const S2 &x2 ) const
+ {
+ return same_size_op( x1 , x2 , typename is_resizeable< S1 >::type() );
+ }
+
+ template< class S1 , class S2 >
+ bool same_size_op( const S1 &x1 , const S2 &x2 , boost::true_type ) const
+ {
+ return same_size( x1 , x2 );
+ }
+
+ template< class S1 , class S2 >
+ bool same_size_op( const S1 &x1 , const S2 &x2 , boost::false_type ) const
+ {
+ return true;
+ }
+};
+
+} // namespace detail
+
+
+
+template< class FusionSeq >
+struct same_size_impl< FusionSeq , FusionSeq , typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSeq >::type >::type >
+{
+ static bool same_size( const FusionSeq &x1 , const FusionSeq &x2 )
+ {
+ typedef boost::fusion::vector< const FusionSeq& , const FusionSeq& > Sequences;
+ Sequences sequences( x1 , x2 );
+ return boost::fusion::all( boost::fusion::zip_view< Sequences >( sequences ) ,
+ boost::fusion::make_fused( detail::same_size_fusion() ) );
+ }
+};
+
+
+}
+}
+}
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_SAME_SIZE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/state_wrapper.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/state_wrapper.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,50 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/state_wrapper.hpp
+
+ [begin_description]
+ State wrapper for the state type in all stepper. The state wrappers are responsible for contruction,
+ destruction, copying contruction, assignment and resizing.
+ [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_UTIL_STATE_WRAPPER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED
+
+
+#include <boost/type_traits/integral_constant.hpp>
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/resize.hpp>
+#include <boost/numeric/odeint/util/same_size.hpp>
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+template< class V , class Enabler = void >
+struct state_wrapper
+{
+ typedef state_wrapper< V > state_wrapper_type;
+
+ V m_v;
+};
+
+
+}
+}
+}
+
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/ublas_wrapper.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/ublas_wrapper.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,260 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/ublas_wrapper.hpp
+
+ [begin_description]
+ Resizing for ublas::vector and ublas::matrix
+ [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_UTIL_UBLAS_WRAPPER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED
+
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/lu.hpp>
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+/*
+ * resizeable specialization for boost::numeric::ublas::vector
+ */
+template< class T , class A >
+struct is_resizeable< boost::numeric::ublas::vector< T , A > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+
+/*
+ * resizeable specialization for boost::numeric::ublas::matrix
+ */
+template< class T , class L , class A >
+struct is_resizeable< boost::numeric::ublas::matrix< T , L , A > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+
+/*
+ * resizeable specialization for boost::numeric::ublas::permutation_matrix
+ */
+template< class T , class A >
+struct is_resizeable< boost::numeric::ublas::permutation_matrix< T , A > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+
+// specialization for ublas::matrix
+// same size and resize specialization for matrix-matrix resizing
+template< class T , class L , class A , class T2 , class L2 , class A2 >
+struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T2 , L2 , A2 > >
+{
+ static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &m1 ,
+ const boost::numeric::ublas::matrix< T2 , L2 , A2 > &m2 )
+ {
+ return ( ( m1.size1() == m2.size1() ) && ( m1.size2() == m2.size2() ) );
+ }
+};
+
+template< class T , class L , class A , class T2 , class L2 , class A2 >
+struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T2 , L2 , A2 > >
+{
+ static void resize( boost::numeric::ublas::matrix< T , L , A > &m1 ,
+ const boost::numeric::ublas::matrix< T2 , L2 , A2 > &m2 )
+ {
+ m1.resize( m2.size1() , m2.size2() );
+ }
+};
+
+
+
+// same size and resize specialization for matrix-vector resizing
+template< class T , class L , class A , class T_V , class A_V >
+struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::vector< T_V , A_V > >
+{
+ static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &m ,
+ const boost::numeric::ublas::vector< T_V , A_V > &v )
+ {
+ return ( ( m.size1() == v.size() ) && ( m.size2() == v.size() ) );
+ }
+};
+
+template< class T , class L , class A , class T_V , class A_V >
+struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::vector< T_V , A_V > >
+{
+ static void resize( boost::numeric::ublas::matrix< T , L , A > &m ,
+ const boost::numeric::ublas::vector< T_V , A_V > &v )
+ {
+ m.resize( v.size() , v.size() );
+ }
+};
+
+
+
+// specialization for ublas::permutation_matrix
+// same size and resize specialization for matrix-vector resizing
+template< class T , class A , class T_V , class A_V >
+struct same_size_impl< boost::numeric::ublas::permutation_matrix< T , A > , boost::numeric::ublas::vector< T_V , A_V > >
+{
+ static bool same_size( const boost::numeric::ublas::permutation_matrix< T , A > &m ,
+ const boost::numeric::ublas::vector< T_V , A_V > &v )
+ {
+ return ( m.size() == v.size() ); // && ( m.size2() == v.size() ) );
+ }
+};
+
+template< class T , class A , class T_V , class A_V >
+struct resize_impl< boost::numeric::ublas::vector< T_V , A_V > , boost::numeric::ublas::permutation_matrix< T , A > >
+{
+ static void resize( const boost::numeric::ublas::vector< T_V , A_V > &v,
+ boost::numeric::ublas::permutation_matrix< T , A > &m )
+ {
+ m.resize( v.size() , v.size() );
+ }
+};
+
+
+
+
+
+
+
+template< class T , class A >
+struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > > // with resizing
+{
+ typedef boost::numeric::ublas::permutation_matrix< T , A > state_type;
+ typedef state_wrapper< state_type > state_wrapper_type;
+
+ state_type m_v;
+
+ state_wrapper() : m_v( 1 ) // permutation matrix constructor requires a size, choose 1 as default
+ { }
+
+};
+
+
+
+
+} } }
+
+//// all specializations done, ready to include state_wrapper
+//
+//#include <boost/numeric/odeint/util/state_wrapper.hpp>
+//
+//namespace boost {
+//namespace numeric {
+//namespace odeint {
+//
+///* specialization for permutation matrizes wrapper because we need to change the construction */
+//template< class T , class A >
+//struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > , true > // with resizing
+//{
+// typedef boost::numeric::ublas::permutation_matrix< T , A > state_type;
+// typedef state_wrapper< state_type > state_wrapper_type;
+// //typedef typename V::value_type value_type;
+// typedef boost::true_type is_resizeable;
+//
+// state_type m_v;
+//
+// state_wrapper() : m_v( 1 ) // permutation matrix constructor requires a size, choose 1 as default
+// { }
+//
+// template< class T_V , class A_V >
+// bool same_size( const boost::numeric::ublas::vector< T_V , A_V > &x )
+// {
+// return boost::numeric::odeint::same_size( m_v , x );
+// }
+//
+// template< class T_V , class A_V >
+// bool resize( const boost::numeric::ublas::vector< T_V , A_V > &x )
+// {
+// //standard resizing done like for std::vector
+// if( !same_size( x ) )
+// {
+// boost::numeric::odeint::resize( m_v , x );
+// return true;
+// } else
+// return false;
+// }
+//};
+//
+//}
+//}
+//}
+
+
+/*
+ * preparing ublas::matrix for boost::range, such that ublas::matrix can be used in all steppers with the range algebra
+ */
+
+namespace boost
+{
+template< class T , class L , class A >
+struct range_mutable_iterator< boost::numeric::ublas::matrix< T , L , A > >
+{
+ typedef typename boost::numeric::ublas::matrix< T , L , A >::array_type::iterator type;
+};
+
+template< class T , class L , class A >
+struct range_const_iterator< boost::numeric::ublas::matrix< T , L , A > >
+{
+ typedef typename boost::numeric::ublas::matrix< T , L , A >::array_type::const_iterator type;
+};
+
+} // namespace boost
+
+
+namespace boost { namespace numeric { namespace ublas {
+
+template< class T , class L , class A >
+inline typename matrix< T , L , A >::array_type::iterator
+range_begin( matrix< T , L , A > &x )
+{
+ return x.data().begin();
+}
+
+template< class T , class L , class A >
+inline typename matrix< T , L , A >::array_type::const_iterator
+range_begin( const matrix< T , L , A > &x )
+{
+ return x.data().begin();
+}
+
+template< class T , class L , class A >
+inline typename matrix< T , L , A >::array_type::iterator
+range_end( matrix< T , L , A > &x )
+{
+ return x.data().end();
+}
+
+template< class T , class L , class A >
+inline typename matrix< T , L , A >::array_type::const_iterator
+range_end( const matrix< T , L , A > &x )
+{
+ return x.data().end();
+}
+
+} } } // nampespace boost::numeric::ublas
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/unit_helper.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/unit_helper.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,152 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/unit_helper.hpp
+
+ [begin_description]
+ Get and set the the value of a unit.
+ [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_UTIL_UNIT_HELPER_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED
+
+
+#ifndef __CUDACC__
+#include <boost/units/quantity.hpp>
+#include <boost/units/get_dimension.hpp>
+#include <boost/units/get_system.hpp>
+#endif
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+
+namespace detail {
+
+ template<class T , class Enabler = void >
+ struct get_unit_value_impl
+ {
+ static T value(const T &t)
+ {
+ return t;
+ }
+ typedef T result_type;
+ };
+
+#ifndef __CUDACC__
+ template<class Unit , class T>
+ struct get_unit_value_impl< boost::units::quantity< Unit , T> >
+ {
+ static T value( const boost::units::quantity< Unit , T> &t )
+ {
+ return t.value();
+ }
+ typedef T result_type;
+ };
+#endif
+
+
+
+
+
+ template<class T , class V , class Enabler = void >
+ struct set_unit_value_impl
+ {
+ static void set_value(T &t , const V &v)
+ {
+ t = v;
+ }
+ };
+
+#ifndef __CUDACC__
+ template<class Unit , class T , class V>
+ struct set_unit_value_impl<boost::units::quantity<Unit , T> , V>
+ {
+ static void set_value(boost::units::quantity<Unit , T> &t , const V &v)
+ {
+ t = boost::units::quantity<Unit , T>::from_value(v);
+ }
+ };
+#endif
+
+
+
+} // namespace detail
+
+
+ template<class T>
+ typename detail::get_unit_value_impl<T>::result_type get_unit_value(const T &t)
+ {
+ return detail::get_unit_value_impl<T>::value(t);
+ }
+
+
+ template<class T , class V>
+
+ void set_unit_value(T &t , const V &v)
+ {
+ return detail::set_unit_value_impl<T , V>::set_value(t , v);
+ }
+
+
+
+ template< class T >
+ struct unit_value_type
+ {
+ typedef T type;
+ };
+
+#ifndef __CUDACC__
+ template< class Unit , class Y >
+ struct unit_value_type< boost::units::quantity< Unit , Y > >
+ {
+ typedef Y type;
+ };
+#endif
+
+
+
+
+
+
+
+
+
+
+ template< typename Time >
+ struct inverse_time
+ {
+ typedef Time type;
+ };
+
+#ifndef __CUDACC__
+ template< typename Unit , typename Value >
+ struct inverse_time< boost::units::quantity< Unit , Value > >
+ {
+ typedef boost::units::quantity< Unit , Value > time_type;
+ typedef typename boost::units::get_dimension< time_type >::type dimension;
+ typedef typename boost::units::get_system< time_type >::type system;
+ typedef typename boost::mpl::divides< boost::units::dimensionless_type , dimension >::type inv_dimension;
+ typedef boost::units::unit< inv_dimension , system > inv_unit;
+ typedef boost::units::quantity< inv_unit , Value > type;
+ };
+#endif
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/util/unwrap_reference.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/util/unwrap_reference.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,87 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/util/unwrap_reference.hpp
+
+ [begin_description]
+ unwrap_reference
+ [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_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED
+
+
+#include <boost/numeric/odeint/config.hpp>
+
+
+#if BOOST_NUMERIC_ODEINT_CXX11
+#include <functional>
+#else
+#include <boost/ref.hpp>
+#endif
+
+namespace boost {
+
+#if BOOST_NUMERIC_ODEINT_CXX11
+template<typename T> class reference_wrapper;
+
+template<typename T> class unwrap_reference;
+#endif
+
+namespace numeric {
+namespace odeint {
+
+
+#if BOOST_NUMERIC_ODEINT_CXX11
+
+template<typename T>
+struct unwrap_reference
+{
+ typedef typename std::remove_reference<T>::type type;
+};
+
+template<typename T>
+struct unwrap_reference< std::reference_wrapper<T> >
+{
+ typedef typename std::remove_reference<T>::type type;
+};
+
+template<typename T>
+struct unwrap_reference< boost::reference_wrapper<T> >
+{
+ typedef typename boost::unwrap_reference<T>::type type;
+};
+
+#else
+
+using ::boost::unwrap_reference;
+
+#endif
+
+namespace detail
+{
+
+#if BOOST_NUMERIC_ODEINT_CXX11
+
+using ::std::ref;
+
+#else
+
+using ::boost::ref;
+
+#endif
+}
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED

Added: trunk/boost/numeric/odeint/version.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/numeric/odeint/version.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,55 @@
+/*
+ [auto_generated]
+ boost/numeric/odeint/version.hpp
+
+ [begin_description]
+ Defines the current version of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_VERSION_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED
+
+#include <string>
+#include <sstream>
+
+
+#define ODEINT_MAJOR_VERSION 2
+#define ODEINT_MINOR_VERSION 2
+#define ODEINT_PATCH_LEVEL 0
+#define ODEINT_VERSION ( ODEINT_MAJOR_VERSION * 100000 + ODEINT_MINOR_VERSION * 100 + ODEINT_PATCH_LEVEL )
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+namespace version {
+
+const int major = ODEINT_MAJOR_VERSION ;
+const int minor = ODEINT_MINOR_VERSION ;
+const int patch_level = ODEINT_PATCH_LEVEL ;
+
+}
+
+inline std::string get_version_string( void )
+{
+ std::ostringstream str;
+ str << "v" << version::major << "." << version::minor;
+ if( version::patch_level != 0 ) str << "_" << version::patch_level;
+ return str.str();
+}
+
+
+}
+}
+}
+
+#endif // BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED

Added: trunk/libs/numeric/odeint/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,283 @@
+# (C) Copyright 2009 - 2012 : Karsten Ahnert, 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)
+
+
+import quickbook ;
+import boostbook ;
+import doxygen ;
+import modules ;
+
+project : requirements
+ <include>$(BOOST_ROOT)/tools/auto_index/include
+ ;
+
+if --enable-index in [ modules.peek : ARGV ]
+{
+ ECHO "Building the odeint docs with automatic index generation enabled." ;
+
+ using auto-index ;
+
+ project : requirements
+
+ <auto-index>on
+ <auto-index-verbose>on
+
+ # Choose indexing method (separately for html and pdf):
+ <format>html:<auto-index-internal>on # on (or off) to use internally generated indexes.
+ # <format>html:<xsl:param>generate.index=0 # Don't let the XSL stylesheets generate indexes.
+
+ <format>pdf:<auto-index-internal>off # on (or off) to use internally generated indexes.
+ # <auto-index-type>index # Use <index>...</index> as the XML wrapper.
+
+ <format>pdf:<xsl:param>index.on.type=1 # For the native stylesheets to generate the different indexes.
+ # PDF native index support is probably better for PDFs as then you actually get page numbers.
+
+ <auto-index-script>odeint.idx # Specifies the name of the index script to load.
+ <auto-index-prefix>../../../..
+
+ # Inform Quickbook that there is to be an index(es).
+ <quickbook-define>enable_index
+ ;
+}
+else
+{
+ ECHO "Building the odeint docs with automatic index generation disabled. To get an auto-index, try building with --enable-index." ;
+}
+
+
+
+doxygen reference
+ :
+# [ glob ../../../../boost/numeric/odeint/*.hpp ]
+ [ glob ../../../../boost/numeric/odeint/stepper/*.hpp ]
+ [ glob ../../../../boost/numeric/odeint/stepper/base/*.hpp ]
+# [ glob ../../../../boost/numeric/odeint/stepper/generation/*.hpp ]
+# [ glob ../../../../boost/numeric/odeint/integrate/*.hpp ]
+# [ glob ../../../../boost/numeric/odeint/iterator/*.hpp ]
+# [ glob ../../../../boost/numeric/odeint/algebra/*.hpp ]
+# [ glob ../../../../boost/numeric/odeint/util/*.hpp ]
+# ../../../../boost/numeric/odeint.hpp
+ :
+
+ # Lots of parameters passed to Doxygen. You can see these in the doxygen docs, or the Wizard Expert tab displays them.
+ # If you have successfuly built your Doxygen docs standalone using the Wizard (strongly recommended as it is much quicker).
+ # The values in your project's doxyfile are what to put as the Doxygen parameters passed below.
+ <doxygen:param>WARNINGS=YES
+ <doxygen:param>WARN_LOGFILE=AutoDoxywarnings.log
+ <doxygen:param>WARN_IF_UNDOCUMENTED=NO # Default NO but useful if you aim to Doxygen document *all* members.
+ <doxygen:param>QUIET=NO
+ <doxygen:param>WARN_NO_PARAMDOC=NO # Default no, but YES useful if you aim to document all function parameters.
+ <doxygen:param>DOXYFILE_ENCODING=UTF-8
+ <doxygen:param>PROJECT_NAME="odeint"
+ <doxygen:param>PROJECT_NUMBER=2.2
+ <doxygen:param>TAB_SIZE=2
+ <doxygen:param>SORT_MEMBER_DOCS=NO
+ <doxygen:param>SORT_BRIEF_DOCS=NO
+ <doxygen:param>SORT_MEMBERS_CTORS_1ST=NO
+ <doxygen:param>EXTRACT_PRIVATE=NO
+ <doxygen:param>INLINE_INHERITED_MEMB=YES
+ <doxygen:param>INHERIT_DOCS=YES
+ <doxygen:param>EXTRACT_STATIC=YES
+ <doxygen:param>EXTRACT_ANON_NSPACES=NO
+ <doxygen:param>EXTRACT_LOCAL_CLASSES=YES
+ <doxygen:param>EXTRACT_LOCAL_METHODS=YES
+ <doxygen:param>HIDE_UNDOC_MEMBERS=NO
+ <doxygen:param>HIDE_UNDOC_CLASSES=YES
+ <doxygen:param>HIDE_FRIEND_COMPOUNDS=NO
+ #<doxygen:param>HIDE_INBODY_DOCS=NO
+ <doxygen:param>INTERNAL_DOCS=YES
+ <doxygen:param>CASE_SENSE_NAMES=NO
+ <doxygen:param>HIDE_SCOPE_NAMES=NO
+
+ # Preprocessor settings.
+ # Some ugly examples of predefined macro calls (from Boost.Units library) :(
+ <doxygen:param>"PREDEFINED= \\
+ \"BOOST_UNITS_STATIC_CONSTANT(a,b)=static const b a\" \\
+ \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\
+ \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
+ \"BOOST_UNITS_HAS_TYPEOF=1\" \\
+ \"DOXYGEN_SKIP=1\" "
+ <doxygen:param>ENABLE_PREPROCESSING=YES # Evaluates all C-preprocessor directives found in files.
+ <doxygen:param>MACRO_EXPANSION=YES # Will expand all macro names.
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES # Only predefined macros expanded. See units library for an example.
+ <doxygen:param>SEARCH_INCLUDES=YES # Search #include files found.
+ <doxygen:param>INLINE_INFO=YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] is inserted in the documentation for inline members.
+
+ <doxygen:param>SHOW_INCLUDE_FILES=NO # List of the files that are included by a file in the documentation of that file.
+ <doxygen:param>REPEAT_BRIEF=YES # Prepend the brief description of a member or function before the detailed description
+ <doxygen:param>BRIEF_MEMBER_DESC=YES # Include brief member descriptions after the members that are listed in the file and class
+ <doxygen:param>MULTILINE_CPP_IS_BRIEF=YES # Treat a multi-line C++ special comment block (i.e. a block of //! or /// comments) as a brief description.
+ # May be best to always use \brief and \details to avoid ambiguity?
+ # <doxygen:param>STRIP_FROM_PATH=NO # Most useful to leave default to strip just the directory from which Doxygen is run.
+ # Yes gives the full path, but NO is more useful, only giving enough to be
+ # <doxygen:param>CPP_CLI_SUPPORT=NO # unless, most unusually, you are compiled for a 'managed' CLI application.
+ <doxygen:param>SHOW_USED_FILES=YES # Default YES to show a list files used to generate documention.
+ <doxygen:param>SHOW_DIRECTORIES=YES # Default NO, but useful to show directory heirarchy.
+ <doxygen:param>SHOW_FILES=YES # Default YES is to include a tab for a page of files listed. Useful.
+ <doxygen:param>SHOW_NAMESPACES=YES # Default YES to include tab for list of namespaces. Useful if you have namespacess other than boost::
+ <doxygen:param>FILE_PATTERNS= # Types of files to be used as input. Default includes *.c *.cc *.cxx *.cpp *.c++ *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.py
+ # Might include .qbk?
+
+ <doxygen:param>RECURSIVE=YES # Search recursively down subdirectories.
+ <doxygen:param>EXCLUDE= # Files or directories that should be excluded from INPUT source files.
+ # Headers and footers are actually rather attractive,
+ # <doxygen:param>HTML_HEADER="doxygen/checks_doxygen_header.html" # A sample including a draft stamp and 'Not_Yet_In_Boost' logo.
+ # Take care that if you use this (recommended), you need to ensure that the html
+ # <doxygen:param>HTML_FOOTER="doxygen/checks_doxygen_footer.html" # This is very useful to add copyright, date of revision, versioning etc.
+
+ # A custom stylesheet is also useful, as the default syntax coloring is 'unusual' ;-)
+ <doxygen:param>HTML_STYLESHEET="doxygen/doxygen.css" # Placed in the doxygen directory,
+ # this will change to your choice of C++ syntax coloring when viewing source from Doxygen.
+ # Users can place (or edit) their own personal choice CSS file here.
+
+ # Default is just Reference but you can provide your own title for reference section here.
+ <xsl:param>"boost.doxygen.reftitle=odeint Reference"
+;
+
+
+xml odeint
+ :
+ odeint.qbk
+ :
+;
+
+boostbook standalone
+ :
+ odeint
+ :
+
+ # Path for links to Boost:
+ #<xsl:param>boost.root=\$(local-boost-root) # Link to Boost logo boost.png
+ # Links are relative and trying to make absolute does NOT work.
+ # And remember that all links MUST (unless in quotes) use backslash, not forward that is trip char.
+
+ <xsl:param>boost.root=../../../.. # OK but link to I:/boost_trunk/boost.png
+
+ # Also control links to admonitions, so need to set separately.
+ #<xsl:param>boost.root=../../../../../../../boost_1_47_0 # OK file:///I:/boost_1_48_0/boost.png
+ # Quickbook [@boost:/boost/units/detail/utility.hpp] should make it relative to xsl parameter boost.root.
+
+ # Path for libraries index:
+ <xsl:param>boost.libraries=../../../../../../../boost_1_47_0/libs/libraries.htm
+ # Use the main Boost stylesheet:
+ <xsl:param>html.stylesheet=./boostbook.css # in /doc folder.
+
+ # Use the your own local Boost stylesheet:
+ # <xsl:param>html.stylesheet=../html/boostbook.css
+
+ # Some general style settings:
+ # see http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html
+ <xsl:param>table.footnote.number.format=1 # Identifies the format used for footnote numbers in tables.
+ <xsl:param>footnote.number.format=1 # Identifies the format used for text footnote numbers.
+
+ # Default to not including the Boost logo in the navbar, when one expressly asks to include the navbar.
+ # Boost jamroot now includes
+ # Default to not include a navbar.
+ #<xsl:param>nav.layout=none # No navigation bar (home, prev, next).
+ # defining creates a runtime error: Global parameter nav.layout already defined
+ #<xsl:param>nav.layout=horizontal # to get a horizontal navigation bar (you probably DO want this).
+
+ <xsl:param>boost.image=Boost # options are: none (no logo), Boost (for boost.png), or your own logo like proposed_for_boost.png
+ <xsl:param>boost.image.src=logo.jpg #
+ <xsl:param>boost.image.width=294 # Width of logo in pixels.
+ <xsl:param>boost.image.height=127 # Height of logo in pixels.
+
+
+ # HTML options:
+ # ------------
+ <xsl:param>navig.graphics=1 # Use graphics not text for navigation.
+ <xsl:param>chunk.section.depth=2 # How far down we chunk nested sections, basically all of them.
+ <xsl:param>chunk.first.sections=1 # Don't put the first section on the same page as the TOC.
+ <xsl:param>toc.section.depth=2 # How far down sections get TOCs.
+ <xsl:param>toc.max.depth=2 # Max depth in each TOC.
+ <xsl:param>generate.section.toc.level=3 # How far down we go with TOCs.
+
+ #<format>html:<xsl:param>admon.graphics.extension=".png" # default type for admonitions (important, warning, note ...)
+ #<format>html:<xsl:param>admon.graphics.path=$(nav-images)/ # path to admonition (warning, note...) image (.png) files.
+
+ # <xsl:param name="draft.watermark.image">http://docbook.sourceforge.net/release/images/draft.png>
+ # but use a local copy of draft.png.
+
+ # PDF Options:
+ # -----------
+ # TOC Generation
+ <xsl:param>fop1.extensions=0 # DISable extensions for FOP version 0.90 and later .
+ <format>pdf:<xsl:param>fop.extensions=0 # DISable extensions for FOP version 0.20.5 and earlier.
+ <format>pdf:<xsl:param>xep.extensions=1 # Use XEP extension- PDF bookmarks, document information and better index processing.
+
+ # No indent on body text:
+ <format>pdf:<xsl:param>body.start.indent=0pt #
+ <format>pdf:<xsl:param>paper.type=A4 # Paper type = A4
+ #
http://xml.resource.org/public/rfc/html/rfc2346.html
+ # Making Postscript and PDF International, J Palme, RFC 2346 recommends
+ # If you are using US letter paper format, ensure that both left and right margins are at least 21 mm (0.8 in).
+ # If you are using A4 paper, ensure that both the top and bottom margins are at least 33 mm (1.3 in).
+ # Margins sizes:
+ #<format>pdf:<xsl:param>page.margin.top=1.3in
+ #<format>pdf:<xsl:param>page.margin.inner=0.8in
+ #<format>pdf:<xsl:param>page.margin.bottom=1.3in
+ #<format>pdf:<xsl:param>page.margin.outer=0.8in
+
+ # http://docbook.sourceforge.net/release/xsl/current/doc/index.html
+ # DocBook XSL Stylesheets: Reference Documentation.
+
+ # Yes, we want graphics for admonishments:
+ <xsl:param>admon.graphics=1
+ # Set these one for PDF generation *only*:
+ # In PDF format, default PNG graphics are awful, so better use SVG images (type .svg) instead.
+ <format>pdf:<xsl:param>admon.graphics.extension=".svg" #
+ <format>pdf:<xsl:param>use.role.for.mediaobject=1 # Use print role on next line.
+ <format>pdf:<xsl:param>preferred.mediaobject.role=print # pdf role is to be printed.
+ <format>pdf:<xsl:param>img.src.path=$(images_location)/ # Path of image (.svg) files. (Note trailing /) ?
+ <format>pdf:<xsl:param>admon.graphics.path=$(nav_images)/ # path to admonition (warning, note...) image (.svg) files.
+ <format>pdf:<xsl:param>draft.mode="yes" # Yes if draft watermark wanted!
+ #<format>pdf:<xsl:param>draft.watermark.image="draft.png" # Watermark (local copy).
+ #<format>pdf:<xsl:param>draft.watermark.image=http://docbook.sourceforge.net/release/images/draft.png # Watermark.
+
+ <dependency>reference # Doxygen reference section
+ # <dependency>pdf-install # final pdf
+ # <dependency>png-install # Boost standard icons in both png
+ # <dependency>svg-install # and svg.
+;
+
+
+# To install a copy of 'master' boostbook.css and logo.
+# install html : ../../../doc/html/boostbook.css ;
+# install ../ : ../../../boost.png ;
+
+
+
+# Install (copy) the 'master' copy of boostbook Cascading Style sheet
+# from your current Boost-root to the /doc/html folder.
+# path-constant boost-root : [ modules.peek : BOOST ] ;
+# install css-install : $(boost-root)/doc/src/boostbook.css : <location>html ;
+
+# path-constant boost-root : [ modules.peek : BOOST ] ;
+
+
+# Install (copy) the 'master' copies of all icon images (both PNG and SVG)
+# and the Boost logo from your current Boost-root
+# to the local /doc/html/images folder so that html is complete and standalone.
+# install png-install : [ glob $(boost-root)/doc/src/images/*.png $(boost-root)/boost.png ] : <location>html/images ;
+# install svg-install : [ glob $(boost-root)/doc/src/images/*.svg ] : <location>html/images ;
+
+# install unordered_pdf : standalone/<format>pdf : <location>. ;
+# explicit unordered_pdf ;
+# The explicit rule is there so that it's only installed when the target is explicitly named.
+
+# Effectively copies the file from \bin folder to the \doc folder.
+# install pdf-install : standalone : <location>. <install-type>PDF ;
+# But will not work as expected if doxygen and/or autoindex is used
+# because a modified pdf file is created, so this command below
+# will rename the file to the expected filename, here quick_auto_dox_index.pdf.
+# <location>. means installed in same place as this jamfile, /doc.
+
+install pdf-install : standalone : <install-type>PDF <location>. <name>checks.pdf ;
+
+install callouts : [ glob src/images/callouts/*.png ] : <location>html/images/callouts ;
+
+
+
+
+

Added: trunk/libs/numeric/odeint/doc/acknowledgements.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/acknowledgements.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,37 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Acknowledgments]
+
+
+[/
+
+* Steven Watanabe for managing the Boost review process.
+* All people who participated in the odeint review process on the Boost mailing list.
+* Paul Bristow for helping with the documentation.
+* The Google Summer Of Code (GSOC) program for funding and Andrew Sutton for supervising us during the GSOC and for lots of useful discussions and feedback about many implementation details..
+* Joachim Faulhaber for motivating us to participate in the Boost review process and many detailed comments about the library.
+* All users of odeint. They are the main motivation for our efforts.
+
+
+[h3 Contributers]
+
+* Andreas Angelopoulos implemented the sparse matrix implicit Euler stepper using the MTL4 library.
+* Rajeev Singh implemented the stiff Van der Pol oscillator example.
+* Sylwester Arabas improved the documentation.
+* Denis Demidov provided the adaption to the VexCL and Viennacl libraries.
+* Christoph Koke provided improved binders.
+* Lee Hodgkinson provided the black hole example.
+]
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/concepts.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,26 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section:concepts Concepts]
+[# odeint.concepts]
+
+[include concepts/system.qbk]
+[include concepts/symplectic_system.qbk]
+[include concepts/implicit_system.qbk]
+[include concepts/stepper.qbk]
+[include concepts/error_stepper.qbk]
+[include concepts/controlled_stepper.qbk]
+[include concepts/dense_output_stepper.qbk]
+[include concepts/state_algebra_operations.qbk]
+[include concepts/state_wrapper.qbk]
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/controlled_stepper.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/controlled_stepper.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,74 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Controlled Stepper]
+
+This concept specifies the interface a controlled stepper has to fulfill to be used within __integrate_functions.
+
+[heading Description]
+
+A controlled stepper following this Controlled Stepper concept provides the possibility to perform one step of the solution /x(t)/ of an ODE with step-size /dt/ to obtain /x(t+dt)/ with a given step-size /dt/.
+Depending on an error estimate of the solution the step might be rejected and a smaller step-size is suggested.
+
+[heading Associated types]
+
+* '''<para>'''[*state_type]'''</para>'''
+'''<para>'''`Stepper::state_type`'''</para>'''
+'''<para>'''The type characterizing the state of the ODE, hence ['x].'''</para>'''
+
+* '''<para>'''[*deriv_type]'''</para>'''
+'''<para>'''`Stepper::deriv_type`'''</para>'''
+'''<para>'''The type characterizing the derivative of the ODE, hence ['d x/dt].'''</para>'''
+
+* '''<para>'''[*time_type]'''</para>'''
+'''<para>'''`Stepper::time_type`'''</para>'''
+'''<para>'''The type characterizing the dependent variable of the ODE, hence the time ['t].'''</para>'''
+
+* '''<para>'''[*value_type]'''</para>'''
+'''<para>'''`Stepper::value_type`'''</para>'''
+'''<para>'''The numerical data type which is used within the stepper, something like `float`, `double`, `complex&lt; double &gt;`.'''</para>'''
+
+* '''<para>'''[*stepper_category]'''</para>'''
+'''<para>'''`Stepper::stepper_category`'''</para>'''
+'''<para>'''A tag type characterizing the category of the stepper. This type must be convertible to `controlled_stepper_tag`.'''</para>'''
+
+
+
+[heading Notation]
+
+[variablelist
+ [[`ControlledStepper`] [A type that is a model of Controlled Stepper]]
+ [[`State`] [A type representing the state /x/ of the ODE]]
+ [[`Time`] [A type representing the time /t/ of the ODE]]
+ [[`stepper`] [An object of type `ControlledStepper`]]
+ [[`x`] [Object of type `State`]]
+ [[`t`, `dt`] [Objects of type `Time`]]
+ [[`sys`] [An object defining the ODE, should be a model of __system, __symplectic_system, __simple_symplectic_system or __implicit_system.]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Do step] [``stepper.try_step( sys , x , t , dt )``] [`controlled_step_result`] [Tries one step of step size `dt`. If the step was successful, `success` is returned, the resulting state is written to `x`, the new time is stored in `t` and `dt` now contains a new (possibly larger) step-size for the next step. If the error was too big, `rejected` is returned and the results are neglected - `x` and `t` are unchanged and `dt` now contains a reduced step-size to be used for the next try.] ]
+ [/ [Do step with reference] [`stepper.try_step( boost::ref(sys) , x , t , dt )`] [`void`] [Same as above with `System` as reference] ]
+]
+
+[heading Models]
+
+* `controlled_error_stepper< runge_kutta_cash_karp54 >`
+* `controlled_error_stepper_fsal< runge_kutta_dopri5 >`
+* `controlled_error_stepper< runge_kutta_fehlberg78 >`
+* `rosenbrock4_controller`
+* `bulirsch_stoer`
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/dense_output_stepper.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/dense_output_stepper.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,81 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Dense Output Stepper]
+
+This concept specifies the interface a dense output stepper has to fulfill to be used within __integrate_functions.
+
+[heading Description]
+A dense output stepper following this Dense Output Stepper concept provides the possibility to perform a single step of the solution /x(t)/ of an ODE to obtain /x(t+dt)/.
+The step-size `dt` might be adjusted automatically due to error control.
+Dense output steppers also can interpolate the solution to calculate the state /x(t')/ at any point /t <= t' <= t+dt/.
+
+[heading Associated types]
+
+* '''<para>'''[*state_type]'''</para>'''
+'''<para>'''`Stepper::state_type`'''</para>'''
+'''<para>'''The type characterizing the state of the ODE, hence ['x].'''</para>'''
+
+* '''<para>'''[*deriv_type]'''</para>'''
+'''<para>'''`Stepper::deriv_type`'''</para>'''
+'''<para>'''The type characterizing the derivative of the ODE, hence ['d x/dt].'''</para>'''
+
+* '''<para>'''[*time_type]'''</para>'''
+'''<para>'''`Stepper::time_type`'''</para>'''
+'''<para>'''The type characterizing the dependent variable of the ODE, hence the time ['t].'''</para>'''
+
+* '''<para>'''[*value_type]'''</para>'''
+'''<para>'''`Stepper::value_type`'''</para>'''
+'''<para>'''The numerical data type which is used within the stepper, something like `float`, `double`, `complex&lt; double &gt;`.'''</para>'''
+
+* '''<para>'''[*stepper_category]'''</para>'''
+'''<para>'''`Stepper::stepper_category`'''</para>'''
+'''<para>'''A tag type characterizing the category of the stepper. This type must be convertible to `dense_output_stepper_tag`.'''</para>'''
+
+
+[heading Notation]
+
+[variablelist
+ [[`Stepper`] [A type that is a model of Dense Output Stepper]]
+ [[`State`] [A type representing the state /x/ of the ODE]]
+ [[`stepper`] [An object of type `Stepper`]]
+ [[`x0`, `x`] [Object of type `State`]]
+ [[`t0`, `dt0`, `t`] [Objects of type `Stepper::time_type`]]
+ [[`sys`] [An object defining the ODE, should be a model of __system, __symplectic_system, __simple_symplectic_system or __implicit_system.]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+
+ [[Initialize integration] [`stepper.initialize( x0 , t0 , dt0 )`] [void] [Initializes the stepper with initial values `x0`, `t0` and `dt0`.]]
+
+ [[Do step] [`stepper.do_step( sys )`] [`std::pair< Stepper::time_type , Stepper::time_type >`] [Performs one step using the ODE defined by `sys`. The step-size might be changed internally due to error control. This function returns a pair containing `t` and `t+dt` representing the interval for which interpolation can be performed.] ]
+
+ [/ [Do step with reference] [`stepper.do_step( boost::ref( sys ) )`] [`std::pair< Stepper::time_type , Stepper::time_type >`] [Same as above with `System` as reference] ]
+
+ [[Do interpolation] [`stepper.calc_state( t_inter , x )`] [`void`] [Performs the interpolation to calculate /x(t[sub inter]/) where /t <= t[sub inter] <= t+dt/.]]
+
+ [[Get current time] [`stepper.current_time()`] [`const Stepper::time_type&`] [Returns the current time /t+dt/ of the stepper, that is the end time of the last step and the starting time for the next call of `do_step`]]
+
+ [[Get current state] [`stepper.current_state()`] [`const Stepper::state_type&`] [Returns the current state of the stepper, that is /x(t+dt)/, the state at the time returned by `stepper.current_time()`]]
+]
+
+[heading Models]
+
+* `dense_output_controlled_explicit_fsal< controlled_error_stepper_fsal< runge_kutta_dopri5 >`
+* `bulirsch_stoer_dense_out`
+* `rosenbrock4_dense_output`
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/error_stepper.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/error_stepper.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,100 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Error Stepper]
+
+This concepts specifies the interface an error stepper has to fulfill to be used within a ControlledErrorStepper. An error stepper must always fullfil the stepper concept. This can trivially implemented by
+
+``
+template< class System >
+error_stepper::do_step( System sys , state_type &x , time_type t , time_type dt )
+{
+ state_type xerr;
+ // allocate xerr
+ do_step( sys , x , t , dt , xerr );
+}
+``
+
+[heading Description]
+
+An error stepper following this Error Stepper concept is capable of doing one step of the solution /x(t)/ of an ODE with step-size /dt/ to obtain /x(t+dt)/ and also computing an error estimate ['x[sub err]] of the result.
+Error Steppers can be Runge-Kutta steppers, symplectic steppers as well as implicit steppers.
+Based on the stepper type, the ODE is defined as __system, __symplectic_system, __simple_symplectic_system or __implicit_system.
+
+[heading Refinement of]
+
+* DefaultConstructable
+* CopyConstructable
+* Stepper
+
+[heading Associated types]
+
+* '''<para>'''[*state_type]'''</para>'''
+'''<para>'''`Stepper::state_type`'''</para>'''
+'''<para>'''The type characterizing the state of the ODE, hence ['x].'''</para>'''
+
+* '''<para>'''[*deriv_type]'''</para>'''
+'''<para>'''`Stepper::deriv_type`'''</para>'''
+'''<para>'''The type characterizing the derivative of the ODE, hence ['d x/dt].'''</para>'''
+
+* '''<para>'''[*time_type]'''</para>'''
+'''<para>'''`Stepper::time_type`'''</para>'''
+'''<para>'''The type characterizing the dependent variable of the ODE, hence the time ['t].'''</para>'''
+
+* '''<para>'''[*value_type]'''</para>'''
+'''<para>'''`Stepper::value_type`'''</para>'''
+'''<para>'''The numerical data type which is used within the stepper, something like `float`, `double`, `complex&lt; double &gt;`.'''</para>'''
+
+* '''<para>'''[*order_type]'''</para>'''
+'''<para>'''`Stepper::order_type`'''</para>'''
+'''<para>'''The type characterizing the order of the ODE, typically `unsigned short`.'''</para>'''
+
+* '''<para>'''[*stepper_category]'''</para>'''
+'''<para>'''`Stepper::stepper_category`'''</para>'''
+'''<para>'''A tag type characterizing the category of the stepper. This type must be convertible to `error_stepper_tag`.'''</para>'''
+
+
+[heading Notation]
+
+[variablelist
+ [[`ErrorStepper`] [A type that is a model of Error Stepper]]
+ [[`State`] [A type representing the state /x/ of the ODE]]
+ [[`Error`] [A type representing the error calculated by the stepper, usually same as `State`]]
+ [[`Time`] [A type representing the time /t/ of the ODE]]
+ [[`stepper`] [An object of type `ErrorStepper`]]
+ [[`x`] [Object of type `State`]]
+ [[`xerr`] [Object of type `Error`]]
+ [[`t`, `dt`] [Objects of type `Time`]]
+ [[`sys`] [An object defining the ODE, should be a model of either __system, __symplectic_system, __simple_symplectic_system or __implicit_system.]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Get the stepper order] [`stepper.order()`] [`order_type`] [Returns the order of the stepper for one step without error estimation.]]
+ [[Get the stepper order] [`stepper.stepper_order()`] [`order_type`] [Returns the order of the stepper for one error estimation step which is used for error calculation.]]
+ [[Get the error order] [`stepper.errorr_order()`] [`order_type`] [Returns the order of the error step which is used for error calculation.]]
+ [[Do step] [`stepper.do_step( sys , x , t , dt )`] [`void`] [Performs one step of step size `dt`. The newly obtained state is written in-place to `x`.] ]
+ [[Do step with error estimation] [`stepper.do_step( sys , x , t , dt , xerr )`] [`void`] [Performs one step of step size `dt` with error estimation. The newly obtained state is written in-place to `x` and the estimated error to `xerr`.] ]
+ [/ [Do step with reference] [`stepper.do_step( boost::ref(sys) , x , t , dt , xerr )`] [`void`] [Performs one step of step size `dt`. The newly obtained state is written in-place to `x` and the estimated error to `xerr`.] ]
+]
+
+[heading Models]
+
+* `runge_kutta_cash_karp54`
+* `runge_kutta_dopri5`
+* `runge_kutta_fehlberg78`
+* `rosenbrock4`
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/concepts/implicit_system.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/implicit_system.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,43 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Implicit System]
+
+[heading Description]
+
+This concept describes how to define a ODE that can be solved by an implicit routine.
+Implicit routines need not only the function /f(x,t)/ but also the Jacobian /df/dx = A(x,t)/.
+/A/ is a matrix and implicit routines need to solve the linear problem /Ax = b/.
+In odeint this is implemented with use of __ublas, therefore, the ['state_type] implicit routines is ['ublas::vector] and the matrix is defined as ['ublas::matrix].
+
+[heading Notation]
+
+[variablelist
+ [[`System`] [A type that is a model of `Implicit System`]]
+ [[`Time`] [A type representing the time of the ODE]]
+ [[`sys`] [An object of type `System`]]
+ [[`x`] [Object of type ublas::vector]]
+ [[`dxdt`] [Object of type ublas::vector]]
+ [[`jacobi`] [Object of type ublas::matrix]]
+ [[`t`] [Object of type `Time`]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Calculate ['dx/dt := f(x,t)]] [`sys.first( x , dxdt , t )`] [`void`] [Calculates `f(x,t)`, the result is stored into dxdt] ]
+ [[Calculate ['A := df/dx (x,t)]] [`sys.second( x , jacobi , t )`] [`void`] [Calculates the Jacobian of /f/ at /x/,/t/, the result is stored into `jacobi`] ]
+]
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/state_algebra_operations.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/state_algebra_operations.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,123 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section State Algebra Operations]
+
+[note The following does not apply to implicit steppers like implicit_euler or Rosenbrock 4 as there the `state_type` can not be changed from `ublas::vector` and no algebra/operations are used.]
+
+[heading Description]
+
+The `State`, `Algebra` and `Operations` together define a concept describing how the mathematical vector operations required for the stepper algorithms are performed.
+The typical vector operation done within steppers is
+
+['*y* = __Sigma __alpha[sub i] [*x[sub i]]].
+
+The `State` represents the state variable of an ODE, usually denoted with /x/.
+Algorithmically, the state is often realized as a `vector< double >` or `array< double , N >`, however, the genericity of odeint enables you to basically use anything as a state type.
+The algorithmic counterpart of such mathematical expressions is divided into two parts.
+First, the `Algebra` is used to account for the vector character of the equation.
+In the case of a `vector` as state type this means the `Algebra` is responsible for iteration over all vector elements.
+Second, the `Operations` are used to represent the actual operation applied to each of the vector elements.
+So the `Algebra` iterates over all elements of the `State`s and calls an operation taken from the `Operations` for each element.
+This is where `State`, `Algebra` and `Operations` have to work together to make odeint running.
+Please have a look at the `range_algebra` and `default_operations` to see an example how this is implemented.
+
+In the following we describe how `State`, `Algebra` and `Operations` are used together within the stepper implementations.
+
+[section Operations]
+
+[heading Notation]
+
+[variablelist
+ [[`Operations`] [The operations type]]
+ [/[`Time`] [A type representing the time type of steppers]]
+ [[`Value1`, ... , `ValueN`] [Types representing the value or time type of stepper]]
+ [[`Scale`] [Type of the scale operation]]
+ [[`scale`] [Object of type `Scale`]]
+ [[[^ScaleSum['N]]] [Type that represents a general scale_sum operation, [^/N/] should be replaced by a number from 1 to 14.]]
+ [[[^scale_sum['N]]] [Object of type [^ScaleSum['N]], [^/N/] should be replaced by a number from 1 to 14.]]
+ [[`ScaleSumSwap2`] [Type of the scale sum swap operation]]
+ [[`scale_sum_swap2`] [Object of type `ScaleSumSwap2`]]
+ [[`a1, a2, ...`] [Objects of type `Value1`, `Value2`, ...]]
+ [[`y, x1, x2, ...`] [Objects of `State`'s value type]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Get scale operation] [`Operations::scale< Value >`] [`Scale`] [Get `Scale` from `Operations`]]
+ [[`Scale` constructor] [`Scale< Value >( a )`] [`Scale`] [Constructs a `Scale` object]]
+ [[`Scale` operation] [`scale( x )`] [`void`] [Calculates `x *= a`]]
+ [[Get general `scale_sum` operation] [[^Operations::scale_sum['N]< Value1 , ... , ValueN >]] [[^ScaleSum['N]]] [Get the [^ScaleSum['N]] type from `Operations`, [^/N/] should be replaced by a number from 1 to 14.]]
+ [[`scale_sum` constructor] [[^ScaleSum['N]< Value1 , ... , ValueN >( a1 , ... , aN )]] [[^ScaleSum['N]]] [Constructs a `scale_sum` object given [^/N/] parameter values with [^/N/] between 1 and 14.]]
+ [[`scale_sum` operation] [[^scale_sum['N]( y , x1 , ... , xN )]] [`void`] [Calculates `y = a1*x1 + a2*x2 + ... + aN*xN`. Note that this is an [^/N/+1]-ary function call.]]
+ [[Get scale sum swap operation] [`Operations::scale_sum_swap2< Value1 , Value2 >`] [`ScaleSumSwap2`] [Get scale sum swap from operations]]
+ [[`ScaleSumSwap2` constructor] [`ScaleSumSwap2< Value1 , Value2 >( a1 , a2 )`] [`ScaleSumSwap2`] [Constructor]]
+ [[`ScaleSumSwap2` operation] [`scale_sum_swap2( x1 , x2 , x3 )`] [`void`] [Calculates `tmp = x1`, `x1 = a1*x2 + a2*x3` and `x2 = tmp`.]]
+]
+
+[endsect]
+
+[section Algebra]
+
+[heading Notation]
+
+[variablelist
+ [[`State`] [The state type]]
+ [[`Algebra`] [The algebra type]]
+ [[[^Operation['N]]] [An [^/N/]-ary operation type, [^/N/] should be a number from 1 to 14.]]
+ [[`algebra`] [Object of type `Algebra`]]
+ [[[^operation['N]]] [Object of type [^Operation['N]]]]
+ [[`y, x1, x2, ...`] [Objects of type `State`]]
+]
+
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Vector Operation with arity 2] [`algebra.for_each2( y , x , operation2 )`] [void] [Calls `operation2( y_i , x_i )` for each element `y_i` of `y` and `x_i` of `x`.]]
+ [[Vector Operation with arity 3] [`algebra.for_each3( y , x1 , x2 , operation3 )`] [void] [Calls `operation3( y_i , x1_i , x2_i )` for each element `y_i` of `y` and `x1_i` of `x1` and `x2_i` of `x2`.]]
+ [[Vector Operation with arity [^/N/]] [[^algebra.for_each['N]( y , x1 , ... , xN , operation['N] )]] [void] [Calls [^operation['N]( y_i , x1_i , ... , xN_i )] for each element `y_i` of `y` and `x1_i` of `x1` and so on. [^/N/] should be replaced by a number between 1 and 14.]]
+]
+
+[endsect]
+
+[section Pre-Defined implementations]
+
+As standard configuration odeint uses the `range_algebra` and `default_operations` which suffices most situations.
+However, a few more possibilities exist either to gain better performance or to ensure interoperability with other libraries.
+In the following we list the existing `Algebra`/`Operations` configurations that can be used in the steppers.
+
+[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 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]]
+ [[`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.]]
+]
+
+[endsect]
+
+[section Example expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Vector operation] [`algebra.for_each3( y , x1 , x2 , Operations::scale_sum2< Value1 , Value2 >( a1 , a2 ) )`] [void] [Calculates ['*y* = a1 *x1* + a2 *x2*]]]
+]
+
+[endsect]
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/state_wrapper.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/state_wrapper.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,39 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section State Wrapper]
+
+[heading Description]
+
+The `State Wrapper` concept describes the way odeint creates temporary state objects to store intermediate results within the stepper's `do_step` methods.
+
+[heading Notation]
+
+[variablelist
+ [[`State`] [A type that is the `state_type` of the ODE]]
+ [[`WrappedState`] [A type that is a model of State Wrapper for the state type `State`.]]
+ [[`x`] [Object of type `State`]]
+ [[`w`] [Object of type `WrappedState`]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Get resizeability] [`is_resizeable< State >`] [`boost::false_type` or `boost::true_type`] [Returns `boost::true_type` if the `State` is resizeable, `boost::false_type` otherwise.]]
+ [[Create `WrappedState` type] [`state_wrapper< State >`] [`WrappedState`] [Creates the type for a `WrappedState` for the state type `State`]]
+ [[Constructor] [`WrappedState()`] [`WrappedState`] [Constructs a state wrapper with an empty state]]
+ [[Copy Constructor] [`WrappedState( w )`] [`WrappedState`] [Constructs a state wrapper with a state of the same size as the state in `w`]]
+ [[Get state] [`w.m_v`] [`State`] [Returns the `State` object of this state wrapper.]]
+]
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/stepper.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/stepper.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,92 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Stepper]
+
+This concepts specifies the interface a simple stepper has to fulfill to be used within the __integrate_functions.
+
+[heading Description]
+
+The basic stepper concept.
+A basic stepper following this Stepper concept is able to perform a single step of the solution /x(t)/ of an ODE to obtain /x(t+dt)/ using a given step size /dt/.
+Basic steppers can be Runge-Kutta steppers, symplectic steppers as well as implicit steppers.
+Depending on the actual stepper, the ODE is defined as __system, __symplectic_system, __simple_symplectic_system or __implicit_system.
+Note that all error steppers are also basic steppers.
+
+[heading Refinement of]
+
+* DefaultConstructable
+* CopyConstructable
+
+
+[heading Associated types]
+
+* '''<para>'''[*state_type]'''</para>'''
+'''<para>'''`Stepper::state_type`'''</para>'''
+'''<para>'''The type characterizing the state of the ODE, hence ['x].'''</para>'''
+
+* '''<para>'''[*deriv_type]'''</para>'''
+'''<para>'''`Stepper::deriv_type`'''</para>'''
+'''<para>'''The type characterizing the derivative of the ODE, hence ['d x/dt].'''</para>'''
+
+* '''<para>'''[*time_type]'''</para>'''
+'''<para>'''`Stepper::time_type`'''</para>'''
+'''<para>'''The type characterizing the dependent variable of the ODE, hence the time ['t].'''</para>'''
+
+* '''<para>'''[*value_type]'''</para>'''
+'''<para>'''`Stepper::value_type`'''</para>'''
+'''<para>'''The numerical data type which is used within the stepper, something like `float`, `double`, `complex&lt; double &gt;`.'''</para>'''
+
+* '''<para>'''[*order_type]'''</para>'''
+'''<para>'''`Stepper::order_type`'''</para>'''
+'''<para>'''The type characterizing the order of the ODE, typically `unsigned short`.'''</para>'''
+
+* '''<para>'''[*stepper_category]'''</para>'''
+'''<para>'''`Stepper::stepper_category`'''</para>'''
+'''<para>'''A tag type characterizing the category of the stepper. This type must be convertible to `stepper_tag`.'''</para>'''
+
+
+[heading Notation]
+
+[variablelist
+ [[`Stepper`] [A type that is a model of Stepper]]
+ [[`State`] [A type representing the state /x/ of the ODE]]
+ [[`Time`] [A type representing the time /t/ of the ODE]]
+ [[`stepper`] [An object of type `Stepper`]]
+ [[`x`] [Object of type `State`]]
+ [[`t`, `dt`] [Objects of type `Time`]]
+ [[`sys`] [An object defining the ODE. Depending on the Stepper this might be a model of __system, __symplectic_system, __simple_symplectic_system or __implicit_system ]]
+]
+
+[heading Valid Expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Get the order] [`stepper.order()`] [`order_type`] [Returns the order of the stepper.]]
+ [[Do step] [`stepper.do_step( sys , x , t , dt )`] [`void`] [Performs one step of step size `dt`. The newly obtained state is written in place in `x`.] ]
+
+ [/ [Do step with reference] [`stepper.do_step( boost::ref(sys) , x , t , dt )`] [`void`] [Performs one step of step size `dt`. The newly obtained state is written in place in `x`.] ]
+
+ [/ [Do step out-of-place] [`stepper.do_step( sys , in , t , out , dt )`] [`void`] [Performs one step. The newly obtained state is written to `out`] ]
+]
+
+[heading Models]
+
+* `runge_kutta4`
+* `euler`
+* `runge_kutta_cash_karp54`
+* `runge_kutta_dopri5`
+* `runge_kutta_fehlberg78`
+* `modified_midpoint`
+* `rosenbrock4`
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/concepts/symplectic_system.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/symplectic_system.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,99 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Symplectic System]
+
+[heading Description]
+
+This concept describes how to define a symplectic system written with generalized coordinate `q` and generalized momentum `p`:
+
+[' q'(t) = f(p) ]
+
+[' p'(t) = g(q) ]
+
+Such a situation is typically found for Hamiltonian systems with a separable Hamiltonian:
+
+[' H(p,q) = H[sub kin](p) + V(q) ]
+
+which gives the equations of motion:
+
+[' q'(t) = dH[sub kin] / dp = f(p) ]
+
+[' p'(t) = dV / dq = g(q) ]
+
+
+The algorithmic implementation of this situation is described by a pair of callable objects for /f/ and /g/ with a specific parameter signature.
+Such a system should be implemented as a std::pair of functions or a functors.
+Symplectic systems are used in symplectic steppers like `symplectic_rkn_sb3a_mclachlan`.
+
+[heading Notation]
+
+[variablelist
+ [[`System`] [A type that is a model of SymplecticSystem]]
+ [[`Coor`] [The type of the coordinate ['q]]]
+ [[`Momentum`] [The type of the momentum ['p]]]
+ [[`CoorDeriv`] [The type of the derivative of coordinate ['q']]]
+ [[`MomentumDeriv`] [The type of the derivative of momentum ['p']]]
+ [[`sys`] [An object of the type `System`]]
+ [[`q`] [Object of type Coor]]
+ [[`p`] [Object of type Momentum]]
+ [[`dqdt`] [Object of type CoorDeriv]]
+ [[`dpdt`] [Object of type MomentumDeriv]]
+]
+
+[heading Valid expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Check for pair] [`boost::is_pair< System >::type`] [`boost::mpl::true_`] [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`] ]
+]
+
+[endsect]
+
+
+[section Simple Symplectic System]
+
+[heading Description]
+
+In most Hamiltonian systems the kinetic term is a quadratic term in the momentum ['H[sub kin] = p^2 / 2m] and in many cases it is possible to rescale coordinates and set /m=1/ which leads to a trivial equation of motion:
+
+[' q'(t) = f(p) = p. ]
+
+while for /p'/ we still have the general form
+
+[' p'(t) = g(q) ]
+
+As this case is very frequent we introduced a concept where only the nontrivial equation for /p'/ has to be provided to the symplectic stepper.
+We call this concept ['SimpleSymplecticSystem]
+
+[heading Notation]
+
+[variablelist
+ [[System] [A type that is a model of SimpleSymplecticSystem]]
+ [[Coor] [The type of the coordinate ['q]]]
+ [[MomentumDeriv] [The type of the derivative of momentum ['p']]]
+ [[sys] [An object that models System]]
+ [[q] [Object of type Coor]]
+ [[dpdt] [Object of type MomentumDeriv]]
+]
+
+[heading Valid Expressions]
+
+[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.]]
+ [[Calculate ['dp/dt = g(q)]] [`sys( q , dpdt )`] [`void`] [Calculates ['g(q)], the result is stored into `dpdt`] ]
+]
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/concepts/system.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/concepts/system.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,43 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section System]
+
+[heading Description]
+
+The System concept models the algorithmic implementation of the rhs. of the ODE ['x' = f(x,t)].
+The only requirement for this concept is that it should be callable with a specific parameter syntax (see below).
+A System is typically implemented as a function or a functor.
+Systems fulfilling this concept are required by all Runge-Kutta steppers as well as the Bulirsch-Stoer steppers.
+However, symplectic and implicit steppers work with other system concepts, see __symplectic_system and __implicit_system.
+
+[heading Notation]
+
+[variablelist
+ [[`System`] [A type that is a model of System]]
+ [[`State`] [A type representing the state /x/ of the ODE]]
+ [[`Deriv`] [A type representing the derivative /x'/ of the ODE]]
+ [[`Time`] [A type representing the time]]
+ [[`sys`] [An object of type `System`]]
+ [[`x`] [Object of type `State`]]
+ [[`dxdt`] [Object of type `Deriv`]]
+ [[`t`] [Object of type `Time`]]
+]
+
+[heading Valid expressions]
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Calculate ['dx/dt := f(x,t)]] [`sys( x , dxdt , t )`] [`void`] [Calculates f(x,t), the result is stored into dxdt] ]
+]
+
+[endsect]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/controlled_stepper_table.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/controlled_stepper_table.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,55 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[table Adaptive step size algorithms
+ [ [Stepper] [Tolerance formula] [Norm] [Step size adaption] ]
+ [ [`controlled_runge_kutta`]
+ [
+ ['val = || | err[subl i] | / ( __epsilon[subl abs] + __epsilon[subl rel] * ( a[subl x] | x[subl i] | + a[subl dxdt] | | dxdt[subl i] | )|| ]
+ ]
+ [['||x|| = max( x[subl i] )]]
+ [
+ ['val > 1 : dt[subl new] = dt[subl current] max( 0.9 pow( val , -1 / ( O[subl E] - 1 ) ) , 0.2 )]
+
+ ['val < 0.5 : dt[subl new] = dt[subl current] min( 0.9 pow( val , -1 / O[subl S] ) , 5 )]
+
+ ['else : dt[subl new] = dt[subl current]]
+ ] ]
+ [ [`rosenbrock4_controller`]
+ [
+ ['val = || err[subl i] / ( __epsilon[subl abs] + __epsilon[subl rel] max( | x[subl i] | , | xold[subl i] | ) ) || ]
+ ]
+ [['||x||=(__Sigma[subl i] x[subl i][super 2])[super 1/2]]]
+ [
+ ['fac = max( 1 / 6 , min( 5 , pow( val , 1 / 4 ) / 0.9 ) ]
+
+ ['fac2 = max( 1 / 6 , min( 5 , dt[subl old] / dt[subl current] pow( val[super 2] / val[subl old] , 1 / 4 ) / 0.9 ) ]
+
+ ['val > 1 : dt[subl new] = dt[subl current] / fac ]
+
+ ['val < 1 : dt[subl new] = dt[subl current] / max( fac , fac2 ) ]
+ ]
+ ]
+ [ [bulirsch_stoer] [['tol=1/2]] [-] [['dt[subl new] = dt[subl old][super 1/a]]] ]
+]
+
+[/
+
+safe = 0.9 , fac1 = 5.0 , fac2 = 1.0 / 6.0
+
+value_type fac_pred = ( m_dt_old / dt ) * pow( err * err / m_err_old , 0.25 ) / safe;
+ fac_pred = std::max( fac2 , std::min( fac1 , fac_pred ) );
+ fac = std::max( fac , fac_pred );
+ dt_new = dt / fac;
+
+
+fac = max( fac2 , min( fac1 , pow( err , 0.25 ) / safe ) )
+]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/details.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,30 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section odeint in detail]
+
+[include details_steppers.qbk]
+
+[include details_generation_functions.qbk]
+
+[include details_integrate_functions.qbk]
+
+[include details_iterators.qbk]
+
+[include details_state_types_algebras_operations.qbk]
+
+[include details_boost_ref.qbk]
+
+[include details_boost_range.qbk]
+
+[include details_bind_member_functions.qbk]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_bind_member_functions.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_bind_member_functions.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,36 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Binding member functions]
+
+[import ../examples/bind_member_functions.cpp]
+
+Binding member functions to a function objects suitable for odeint system function is not easy, at least in C++03. The usual way of using __boost_bind does not work because of the forwarding problem. odeint provides two `do_step` method which only differ in the const specifiers of the arguments and __boost_bind binders only provide the specializations up to two argument which is not enough for odeint.
+
+But one can easily implement the according binders themself:
+
+[ode_wrapper]
+
+One can use this binder as follows
+
+[bind_member_function]
+
+[section Binding member functions in C++11]
+
+[import ../examples/bind_member_functions_cpp11.cpp]
+In C++11 one can use `std::bind` and one does not need to implement the bind themself:
+
+[bind_member_function_cpp11]
+
+[endsect]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_boost_range.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_boost_range.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,60 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section Using boost::range]
+
+Most steppers in odeint also accept the state give as a range. A range is
+sequence of values modeled by a range concept. See __boost_range for an
+overview over existing concepts and examples of ranges. This means that the
+`state_type` of the stepper need not necessarily be used to call the `do_step` method.
+
+One use-case for __boost_range in odeint has been shown in __tut_chaotic_system where the state consists of two parts: one for the original system and one for the perturbations. The ranges are used to initialize (solve) only the system part where the perturbation part is not touched, that is a range consisting only of the system part is used. After that the complete state including the perturbations is solved.
+
+Another use case is a system consisting of coupled units where you want to initialize each unit separately with the ODE of the uncoupled unit. An example is a chain of coupled van-der-Pol-oscillators which are initialized uniformly from the uncoupled van-der-Pol-oscillator. Then you can use __boost_range to solve only one individual oscillator in the chain.
+
+In short, you can __boost_range to use one state within two system functions which expect states with different sizes.
+
+An example was given in the __tut_chaotic_system tutorial. Using Boost.Range usually means that your system function needs to adapt to the iterators of Boost.Range. That is, your function is called with a range and you need to get the iterators from that range. This can easily be done. You have to implement your system as a class or a struct and you have to templatize the `operator()`. Then you can use the `range_iterator`-meta function and `boost::begin` and `boost::end` to obtain the iterators of your range:
+
+``
+class sys
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t ) const
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ // fill dxdt
+ }
+};
+``
+
+If your range is a random access-range you can also apply the bracket operator to the iterator to access the elements in the range:
+``
+class sys
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t ) const
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = f1( x[0] , x[1] );
+ dxdt[1] = f2( x[0] , x[1] );
+ }
+};
+``
+
+The following two tables show which steppers and which algebras are compatible with __boost_range.
+[include range_table.qbk]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_boost_ref.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_boost_ref.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,35 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section Using boost::ref]
+
+In odeint all system functions and observers are passed by value. For example, if you call a `do_step` method of a particular stepper or the integration functions, your system and your stepper will be passed by value:
+
+[c++]
+``
+rk4.do_step( sys , x , t , dt ); // pass sys by value
+``
+
+This behavior is suitable for most systems, especially if your system does not contain any data or only a few parameters. However, in some cases you might contain some large amount of data with you system function and passing them by value is not desired since the data would be copied.
+
+In such cases you can easily use `boost::ref` (and its relative `boost::cref`)
+which passes its argument by reference (or constant reference). odeint will
+unpack the arguments and no copying at all of your system object will take place:
+
+``
+rk4.do_step( boost::ref( sys ) , x , t , dt ); // pass sys as references
+``
+
+The same mechanism can be used for the observers in the integrate functions.
+
+[tip If you are using C++11 you can also use `std::ref` and `std::cref`]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_generation_functions.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_generation_functions.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,43 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section Generation functions]
+
+[import ../examples/generation_functions.cpp]
+
+In the __tutorial we have learned how we can use the generation functions `make_controlled` and `make_dense_output` to create controlled and dense output stepper from a simple stepper or an error stepper. The syntax of these two functions is very simple:
+
+[generation_functions_syntax_auto]
+
+The first two parameters are the absolute and the relative error tolerances and the third parameter is the stepper. In C++03 you can infer the type from the `result_of` mechanism:
+
+[generation_functions_syntax_result_of]
+
+To use your own steppers with the `make_controlled` or `make_dense_output` you need to specialize two class templates. Suppose your steppers are called `custom_stepper`, `custom_controller` and `custom_dense_output`. Then, the first class you need to specialize is `boost::numeric::get_controller`, a meta function returning the type of the controller:
+
+[generation_functions_get_controller]
+
+The second one is a factory class `boost::numeric::odeint::controller_factory` which constructs the controller from the tolerances and the stepper. In our dummy implementation this class is
+
+[generation_functions_controller_factory]
+
+This is all to use the `make_controlled` mechanism. Now you can use your controller via
+
+[generation_functions_example_custom_controller]
+
+For the dense_output_stepper everything works similar. Here you have to specialize `boost::numeric::odeint::get_dense_output` and `boost::numeric::odeint::dense_output_factory`. These two classes have the same syntax as their relatives `get_controller` and `controller_factory`.
+
+All controllers and dense-output steppers in odeint can be used with these mechanisms. In the table below you will find, which steppers is constructed from `make_controlled` or `make_dense_output` if applied on a stepper from odeint:
+
+[include make_controlled_table.qbk]
+[include make_dense_output_table.qbk]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_integrate_functions.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_integrate_functions.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,124 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section Integrate functions]
+
+Integrate functions perform the time evolution of a given ODE from some
+starting time ['t[sub 0]] to a given end time ['t[sub 1]] and starting at state ['x[sub 0]] by subsequent calls of a given stepper's `do_step` function.
+Additionally, the user can provide an __observer to analyze the state during time evolution.
+There are five different integrate functions which have different strategies on when to call the observer function during integration.
+All of the integrate functions except `integrate_n_steps` can be called with any stepper following one of the stepper concepts: __stepper , __error_stepper , __controlled_stepper , __dense_output_stepper.
+Depending on the abilities of the stepper, the integrate functions make use of step-size control or dense output.
+
+[heading Equidistant observer calls]
+
+If observer calls at equidistant time intervals /dt/ are needed, the
+`integrate_const` or `integrate_n_steps` function should be used.
+We start with explaining `integrate_const`:
+
+`integrate_const( stepper , system , x0 , t0 , t1 , dt )`
+
+`integrate_const( stepper , system , x0 , t0 , t1 , dt , observer )`
+
+These integrate the ODE given by `system` with subsequent steps from `stepper`.
+Integration start at `t0` and `x0` and ends at some ['t' = t[sub 0] + n dt] with /n/ such that ['t[sub 1] - dt < t' <= t[sub 1]].
+`x0` is changed to the approximative solution ['x(t')] at the end of integration.
+If provided, the `observer` is invoked at times ['t[sub 0]], ['t[sub 0] + dt], ['t[sub 0] + 2dt], ... ,['t'].
+`integrate_const` returns the number of steps performed during the integration.
+Note that if you are using a simple __stepper or __error_stepper and want to make exactly `n` steps you should prefer the `integrate_n_steps` function below.
+
+* If `stepper` is a __stepper or __error_stepper then `dt` is also the step size used for integration and the observer is called just after every step.
+* If `stepper` is a __controlled_stepper then `dt` is the initial step size.
+The actual step size will change due to error control during time evolution.
+However, if an observer is provided the step size will be adjusted such that the algorithm always calculates /x(t)/ at ['t = t[sub 0] + n dt] and calls the observer at that point.
+Note that the use of __controlled_stepper is reasonable here only if `dt` is considerably larger than typical step sizes used by the stepper.
+* If `stepper` is a __dense_output_stepper then `dt` is the initial step size.
+The actual step size will be adjusted during integration due to error control.
+If an observer is provided dense output is used to calculate /x(t)/ at ['t = t[sub 0] + n dt].
+
+[heading Integrate a given number of steps]
+
+This function is very similar to `integrate_const` above. The only difference
+is that it does not take the end time as parameter, but rather the number of
+steps. The integration is then performed until the time `t0+n*dt`.
+
+`integrate_n_steps( stepper , system , x0 , t0 , dt , n )`
+
+`integrate_n_steps( stepper , system , x0 , t0 , dt , n , observer )`
+
+Integrates the ODE given by `system` with subsequent steps from `stepper` starting at ['x[sub 0]] and ['t[sub 0]].
+If provided, `observer` is called after every step and at the beginning with
+`t0`, similar as above.
+The approximate result for ['x( t[sub 0] + n dt )] is stored in `x0`.
+This function returns the end time `t0 + n*dt`.
+
+
+[heading Observer calls at each step]
+
+If the observer should be called at each time step then the `integrate_adaptive` function should be used.
+Note that in the case of __controlled_stepper or __dense_output_stepper this leads to non-equidistant observer calls as the step size changes.
+
+`integrate_adaptive( stepper , system , x0 , t0 , t1 , dt )`
+
+`integrate_adaptive( stepper , system , x0 , t0 , t1 , dt , observer )`
+
+Integrates the ODE given by `system` with subsequent steps from `stepper`.
+Integration start at `t0` and `x0` and ends at ['t[sub 1]].
+`x0` is changed to the approximative solution ['x(t[sub 1])] at the end of integration.
+If provided, the `observer` is called after each step (and before the first step at `t0`).
+`integrate_adaptive` returns the number of steps performed during the integration.
+
+* If `stepper` is a __stepper or __error_stepper then `dt` is the step size used for integration and `integrate_adaptive` behaves like `integrate_const` except that for the last step the step size is reduced to ensure we end exactly at `t1`.
+If provided, the observer is called at each step.
+* If `stepper` is a __controlled_stepper then `dt` is the initial step size.
+The actual step size is changed according to error control of the stepper.
+For the last step, the step size will be reduced to ensure we end exactly at `t1`.
+If provided, the observer is called after each time step (and before the first step at `t0`).
+* If stepper is a __dense_output_stepper then `dt` is the initial step size and `integrate_adaptive` behaves just like for __controlled_stepper above. No dense output is used.
+
+[heading Observer calls at given time points]
+
+If the observer should be called at some user given time points the `integrate_times` function should be used.
+The times for observer calls are provided as a sequence of time values.
+The sequence is either defined via two iterators pointing to begin and end of the sequence or in terms of a __boost_range object.
+
+`integrate_times( stepper , system , x0 , times_start , times_end , dt , observer )`
+
+`integrate_times( stepper , system , x0 , time_range , dt , observer )`
+
+Integrates the ODE given by `system` with subsequent steps from `stepper`.
+Integration starts at `*times_start` and ends exactly at `*(times_end-1)`.
+`x0` contains the approximate solution at the end point of integration.
+This function requires an observer which is invoked at the subsequent times `*times_start++` until `times_start == times_end`.
+If called with a __boost_range `time_range` the function behaves the same with `times_start = boost::begin( time_range )` and `times_end = boost::end( time_range )`.
+`integrate_times` returns the number of steps performed during the integration.
+
+* If `stepper` is a __stepper or __error_stepper `dt` is the step size used for integration.
+However, whenever a time point from the sequence is approached the step size `dt` will be reduced to obtain the state /x(t)/ exactly at the time point.
+* If `stepper` is a __controlled_stepper then `dt` is the initial step size.
+The actual step size is adjusted during integration according to error control.
+However, if a time point from the sequence is approached the step size is reduced to obtain the state /x(t)/ exactly at the time point.
+* If `stepper` is a __dense_output_stepper then `dt` is the initial step size.
+The actual step size is adjusted during integration according to error control.
+Dense output is used to obtain the states /x(t)/ at the time points from the sequence.
+
+[heading Convenience integrate function]
+
+Additionally to the sophisticated integrate function above odeint also provides a simple `integrate` routine which uses a dense output stepper based on `runge_kutta_dopri5` with standard error bounds ['10[super -6]] for the steps.
+
+`integrate( system , x0 , t0 , t1 , dt )`
+
+`integrate( system , x0 , t0 , t1 , dt , observer )`
+
+This function behaves exactly like `integrate_adaptive` above but no stepper has to be provided.
+It also returns the number of steps performed during the integration.
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_iterators.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_iterators.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,106 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Iterators and Ranges]
+
+
+
+odeint supports iterators for iterating through an ordinary differential equation. They offer you an alternative to the integrate functions. Furthermore, many of the standard algorithms in the C++ standard library and Boost.Range can be used with the odeint's iterators.
+
+[import ../examples/const_step_iterator.cpp]
+
+Four iterators are provided. They are all single pass iterators. The first one is a iterator which solves the odeint with constant step size. An example is
+
+[const_step_iterator_accumulate]
+
+In this example all x-values of the solution are accumulated. The iterator itself does not occur directly in this example but it is generated by the factory functions `make_const_step_iterator_begin` and `make_const_step_iterator_end`. odeint also supports Boost.Range, that is you write the above example in a more succinct form with the factory function `make_const_step_range`
+
+[const_step_iterator_accumulate_range]
+
+The second iterator type is also a iterator with const step size. But the value type of this iterator consists here of a pair of the time and the state of the solution of the ODE. An example is
+
+[const_step_time_iterator_accumulate_range]
+
+The factory functions are now `make_const_step_time_iterator_begin`, `make_const_step_time_iterator_end` and `make_const_step_time_range`.
+
+
+[import ../examples/adaptive_iterator.cpp]
+
+The other two iterator types adaptive iterators which are completely analogous to the const step iterators. Examples are
+
+[adaptive_iterator_accumulate_range]
+
+[adaptive_time_iterator_accumulate_range]
+
+
+[section const_step_iterator]
+
+* Definition: `const_step_iterator< Stepper , System >`
+* `value_type` is `Stepper::state_type`
+* Factory functions
+ * `make_const_step_iterator_begin( stepper , system , state , t_start , t_end , dt )`
+ * `make_const_step_iterator_end( stepper , system , state )`
+ * `make_const_step_range( stepper , system , state , t_start , t_end , dt )`
+* This stepper works with all steppers fulfilling the Stepper concept or the DenseOutputStepper concept.
+* This stepper updates the value of `state`. The value of `state` is the current state of the ODE during the iteration.
+
+[endsect]
+
+[section const_step_time_iterator]
+
+* Definition: `const_step_iterator< Stepper , System >`
+* `value_type` is `std::pair< Stepper::state_type& , Stepper::time_type >`
+* Factory functions
+ * `make_const_step_time_iterator_begin( stepper , system , state , t_start , t_end , dt )`
+ * `make_const_step_time_iterator_end( stepper , system , state )`
+ * `make_const_step_time_range( stepper , system , state , t_start , t_end , dt )`
+* This stepper works with all steppers fulfilling the Stepper concept or the DenseOutputStepper concept.
+* This stepper updates the value of `state`. The value of `state` is the current state of the ODE during the iteration.
+
+
+[endsect]
+
+
+[section adaptive_step_iterator]
+
+* Definition: `adaptive_iterator< Stepper , System >`
+* `value_type` is `Stepper::state_type`
+* Factory functions
+ * `make_adaptive_iterator_begin( stepper , system , state , t_start , t_end , dt )`
+ * `make_adaptive_iterator_end( stepper , system , state )`
+ * `make_adaptive_range( stepper , system , state , t_start , t_end , dt )`
+* This stepper works with all steppers fulfilling the ControlledStepper concept or the DenseOutputStepper concept.
+* For steppers fulfilling the ControlledStepper concept `state` is modified according to the current state of the ODE. For DenseOutputStepper the state is not modified due to performance optimizations.
+
+
+[endsect]
+
+[section adaptive_step_time_iterator]
+
+* Definition: `adaptive_iterator< Stepper , System >`
+* `value_type` is `std::pair< Stepper::state_type& , Stepper::time_type >`
+* Factory functions
+ * `make_adaptive_time_iterator_begin( stepper , system , state , t_start , t_end , dt )`
+ * `make_adaptive_time_iterator_end( stepper , system , state )`
+ * `make_adaptive_time_range( stepper , system , state , t_start , t_end , dt )`
+* This stepper works with all steppers fulfilling the ControlledStepper concept or the DenseOutputStepper concept.
+* This stepper updates the value of `state`. The value of `state` is the current state of the ODE during the iteration.
+
+
+[endsect]
+
+
+
+
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_state_types_algebras_operations.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_state_types_algebras_operations.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,473 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section State types, algebras and operations]
+
+In odeint the stepper algorithms are implemented independently of the
+underlying fundamental mathematical operations.
+This is realized by giving the user full control over the state type and the
+mathematical operations for this state type.
+Technically, this is done by introducing three concepts: StateType, Algebra,
+Operations.
+Most of the steppers in odeint expect three class types fulfilling these
+concepts as template parameters.
+Note that these concepts are not fully independent of each other but rather a
+valid combination must be provided in order to make the steppers work.
+In the following we will give some examples on reasonable
+state_type-algebra-operations combinations.
+For the most common state types, like `vector<double>` or `array<double,N>`
+the default values range_algebra and default_operations are perfectly fine and
+odeint can be used as is without worrying about algebra/operations at all.
+
+[important state_type, algebra and operations are not independent, a valid
+combination must be provided to make odeint work properly]
+
+Moreover, as odeint handles the memory required for intermediate temporary
+objects itself, it also needs knowledge about how to create state_type objects
+and maybe how to allocate memory (resizing).
+All in all, the following things have to be taken care of when odeint is used
+with non-standard state types:
+
+* construction/destruction
+* resizing (if possible/required)
+* algebraic operations
+
+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
+work is required, they just work out of the box.
+
+[section Construction/Resizing]
+
+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<T,N>`.
+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<double>`.
+
+The most easy way of getting your own state type to work with odeint is to use
+a fixed size state, base calculations on the range_algebra and provide the
+following functionality:
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Construct State] [`State x()`] [`void`] [Creates an instance of `State`
+ and allocates memory.] ]
+ [[Begin of the sequence] [boost::begin(x)] [Iterator] [Returns an iterator
+ pointing to the begin of the sequence]]
+ [[End of the sequence] [boost::end(x)] [Iterator] [Returns an iterator
+ pointing to the end of the sequence]]
+]
+
+[warning If your state type does not allocate memory by default construction,
+you [*must define it as resizeable] and provide resize functionality (see
+below). Otherwise segmentation faults will occur.]
+
+So fixed sized arrays supported by __boost_range immediately work with odeint.
+For dynamically sized arrays one has to additionally supply the resize
+functionality.
+First, the state has to be tagged as resizeable by specializing the struct
+`is_resizeable` which consists of one typedef and one bool value:
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Resizability] [`is_resizeable<State>::type`]
+ [`boost::true_type` or `boost::false_type`]
+ [Determines resizeability of the state type, returns `boost::true_type` if
+ the state is resizeable.]]
+ [[Resizability] [`is_resizeable<State>::value`]
+ [`bool`]
+ [Same as above, but with `bool` value.]]
+]
+
+Defining `type` to be `true_type` and `value` as `true` tells odeint that your
+state is resizeable.
+By default, odeint now expects the support of `boost::size(x)` and a
+`x.resize( boost::size(y) )` member function for resizing:
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Get size] [`boost::size( x )`]
+ [`size_type`] [Returns the current size of x.]]
+ [[Resize] [`x.resize( boost::size( y ) )`]
+ [`void`] [Resizes x to have the same size as y.]]
+]
+
+[section Using the container interface]
+[import ../examples/my_vector.cpp]
+
+As a first example we take the most simple case and implement our own vector
+`my_vector` which will provide a container interface.
+This makes __boost_range working out-of-box.
+We add a little functionality to our vector which makes it allocate some
+default capacity by construction.
+This is helpful when using resizing as then a resize can be assured to not
+require a new allocation.
+
+[my_vector]
+
+
+The only thing that has to be done other than defining is thus declaring
+my_vector as resizeable:
+
+[my_vector_resizeable]
+
+If we wouldn't specialize the `is_resizeable` template, the code would still
+compile but odeint would not adjust the size of temporary internal instances
+of my_vector and hence try to fill zero-sized vectors resulting in
+segmentation faults!
+The full example can be found in [github_link libs/numeric/odeint/examples/my_vector.cpp my_vector.cpp]
+
+[endsect]
+
+[section std::list]
+
+If your state type does work with __boost_range, but handles resizing
+differently you are required to specialize two implementations used by odeint
+to check a state's size and to resize:
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Check size] [`same_size_impl<State,State>::same_size(x , y)`]
+ [`bool`] [Returns true if the size of x equals the size of y.]]
+ [[Resize] [`resize_impl<State,State>::resize(x , y)`]
+ [`void`] [Resizes x to have the same size as y.]]
+]
+
+As an example we will use a `std::list` as state type in odeint.
+Because `std::list` is not supported by `boost::size` we have to replace the
+same_size and resize implementation to get list to work with odeint.
+The following code shows the required template specializations:
+
+[import ../examples/list_lattice.cpp]
+
+[list_bindings]
+
+With these definitions odeint knows how to resize `std::list`s and so they can
+be used as state types.
+A complete example can be found in [github_link libs/numeric/odeint/examples/list_lattice.cpp list_lattice.cpp].
+
+[endsect]
+
+[endsect]
+
+[section Algebras and Operations]
+
+To provide maximum flexibility odeint is implemented in a highly modularized
+way. This means it is possible to change the underlying mathematical
+operations without touching the integration algorithms.
+The fundamental mathematical operations are those of a vector space, that is
+addition of `state_types` and multiplication of `state_type`s with a scalar
+(`time_type`). In odeint this is realized in two concepts: _Algebra_ and
+_Operations_.
+The standard way how this works is by the range algebra which provides
+functions that apply a specific operation to each of the individual elements
+of a container based on the __boost_range library.
+If your state type is not supported by __boost_range there are several
+possibilities to tell odeint how to do algebraic operations:
+
+* Implement `boost::begin` and `boost::end` for your state type so it works
+with __boost_range.
+* Implement vector-vector addition operator `+` and scalar-vector
+multiplication operator `*` and use the non-standard `vector_space_algebra`.
+* Implement your own algebra that implements the required functions.
+
+[section GSL Vector]
+
+In the following example we will try to use the `gsl_vector` type from __gsl (GNU
+Scientific Library) as state type in odeint.
+We will realize this by implementing a wrapper around the gsl_vector that
+takes care of construction/destruction.
+Also, __boost_range is extended such that it works with `gsl_vector`s as well
+which required also the implementation of a new `gsl_iterator`.
+
+[note odeint already includes all the code presented here, see [github_link
+boost/numeric/odeint/external/gsl/gsl_wrapper.hpp gsl_wrapper.hpp], so `gsl_vector`s
+can be used straight out-of-box.
+The following description is just for educational purpose.]
+
+The GSL is a C library, so `gsl_vector` has neither constructor, nor
+destructor or any `begin` or `end` function, no iterators at all.
+So to make it work with odeint plenty of things have to be implemented.
+Note that all of the work shown here is already included in odeint, so using
+`gsl_vector`s in odeint doesn't require any further adjustments.
+We present it here just as an educational example.
+We start with defining appropriate constructors and destructors.
+This is done by specializing the `state_wrapper` for `gsl_vector`.
+State wrappers are used by the steppers internally to create and manage
+temporary instances of state types:
+
+``
+template<>
+struct state_wrapper< gsl_vector* >
+{
+ typedef double value_type;
+ typedef gsl_vector* state_type;
+ typedef state_wrapper< gsl_vector* > state_wrapper_type;
+
+ state_type m_v;
+
+ state_wrapper( )
+ {
+ m_v = gsl_vector_alloc( 1 );
+ }
+
+ state_wrapper( const state_wrapper_type &x )
+ {
+ resize( m_v , x.m_v );
+ gsl_vector_memcpy( m_v , x.m_v );
+ }
+
+
+ ~state_wrapper()
+ {
+ gsl_vector_free( m_v );
+ }
+
+};
+``
+
+This `state_wrapper` specialization tells odeint how gsl_vectors are created,
+copied and destroyed.
+Next we need resizing, this is required because gsl_vectors are dynamically
+sized objects:
+``
+template<>
+struct is_resizeable< gsl_vector* >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+template <>
+struct same_size_impl< gsl_vector* , gsl_vector* >
+{
+ static bool same_size( const gsl_vector* x , const gsl_vector* y )
+ {
+ return x->size == y->size;
+ }
+};
+
+template <>
+struct resize_impl< gsl_vector* , gsl_vector* >
+{
+ static void resize( gsl_vector* x , const gsl_vector* y )
+ {
+ gsl_vector_free( x );
+ x = gsl_vector_alloc( y->size );
+ }
+};
+``
+
+Up to now, we defined creation/destruction and resizing, but gsl_vectors also
+don't support iterators, so we first implement a gsl iterator:
+
+``
+/*
+ * defines an iterator for gsl_vector
+ */
+class gsl_vector_iterator
+ : public boost::iterator_facade< gsl_vector_iterator , double ,
+ boost::random_access_traversal_tag >
+{
+public :
+
+ gsl_vector_iterator( void ): m_p(0) , m_stride( 0 ) { }
+ explicit gsl_vector_iterator( gsl_vector *p ) : m_p( p->data ) , m_stride( p->stride ) { }
+ friend gsl_vector_iterator end_iterator( gsl_vector * );
+
+private :
+
+ friend class boost::iterator_core_access;
+ friend class const_gsl_vector_iterator;
+
+ void increment( void ) { m_p += m_stride; }
+ void decrement( void ) { m_p -= m_stride; }
+ void advance( ptrdiff_t n ) { m_p += n*m_stride; }
+ bool equal( const gsl_vector_iterator &other ) const { return this->m_p == other.m_p; }
+ bool equal( const const_gsl_vector_iterator &other ) const;
+ double& dereference( void ) const { return *m_p; }
+
+ double *m_p;
+ size_t m_stride;
+};
+``
+A similar class exists for the `const` version of the iterator.
+Then we have a function returning the end iterator (similarly for `const` again):
+``
+gsl_vector_iterator end_iterator( gsl_vector *x )
+{
+ gsl_vector_iterator iter( x );
+ iter.m_p += iter.m_stride * x->size;
+ return iter;
+}
+``
+
+Finally, the bindings for __boost_range are added:
+``
+// template<>
+inline gsl_vector_iterator range_begin( gsl_vector *x )
+{
+ return gsl_vector_iterator( x );
+}
+
+// template<>
+inline gsl_vector_iterator range_end( gsl_vector *x )
+{
+ return end_iterator( x );
+}
+``
+Again with similar definitions for the `const` versions.
+This eventually makes odeint work with gsl vectors as state types.
+The full code for these bindings is found in [github_link
+boost/numeric/odeint/external/gsl/gsl_wrapper.hpp gsl_wrapper.hpp].
+It might look rather complicated but keep in mind that gsl is a pre-compiled C
+library.
+[endsect]
+
+
+[section Vector Space Algebra]
+
+As seen above, the standard way of performing algebraic operations on
+container-like state types in odeint is to iterate through the elements of the
+container and perform the operations element-wise on the underlying value type.
+This is realized by means of the `range_algebra` that uses __boost_range for
+obtaining iterators of the state types.
+However, there are other ways to implement the algebraic operations on
+containers, one of which is defining the addition/multiplication operators for
+the containers directly and then using the `vector_space_algebra`.
+If you use this algebra, the following operators have to be defined for the
+state_type:
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Addition] [`x + y`] [`state_type`] [Calculates the vector sum 'x+y'.]]
+ [[Assign addition] [`x += y`] [`state_type`] [Performs x+y in place.]]
+ [[Scalar multiplication] [`a * x `] [`state_type`] [Performs multiplication of vector x with scalar a.]]
+ [[Assign scalar multiplication] [`x *= a`] [`state_type`] [Performs in-place multiplication of vector x with scalar a.]]
+]
+
+Defining these operators makes your state type work with any basic Runge-Kutta
+stepper.
+However, if you want to use step-size control, some more functionality is
+required.
+Specifically, operations like
+[' max[sub i]( |err[sub i]| / (alpha * |s[sub i]|) )]
+have to be performed.
+['err] and ['s] are state_types, alpha is a scalar.
+As you can see, we need element wise absolute value and division as well as an
+reduce operation to get the maximum value.
+So for controlled steppers the following things have to be implemented:
+
+[table
+ [[Name] [Expression] [Type] [Semantics]]
+ [[Division] [`x / y`] [`state_type`] [Calculates the element-wise division 'x/y']]
+ [[Absolute value] [`abs( x )`] [`state_type`] [Element wise absolute value]]
+ [[Reduce] [`vector_space_reduce_impl< state_type >::reduce( state , operation , init )`] [`value_type`]
+ [Performs the `operation` for subsequently each element of `state` and returns the aggregate value.
+ E.g.
+
+`init = operator( init , state[0] );`
+
+`init = operator( init , state[1] )`
+
+`...`
+ ]]
+]
+
+[endsect]
+
+[section Boost.Ublas]
+As an example for the employment of the `vector_space_algebra` we will adopt
+`ublas::vector` from __ublas to work as a state type in odeint.
+This is particularly easy because `ublas::vector` supports vector-vector
+addition and scalar-vector multiplication described above as well as `boost::size`.
+It also has a resize member function so all that has to be done in this case
+is to declare resizability:
+
+[import ../examples/ublas/lorenz_ublas.cpp]
+
+[ublas_resizeable]
+
+Now ublas::vector can be used as state type for simple Runge-Kutta steppers
+in odeint by specifying the `vector_space_algebra` as algebra in the template
+parameter list of the stepper.
+The following code shows the corresponding definitions:
+
+[ublas_main]
+
+Note again, that we haven't supported the requirements for controlled steppers,
+but only for simple Runge-Kutta methods.
+You can find the full example in [github_link
+libs/numeric/odeint/examples/ublas/lorenz_ublas.cpp lorenz_ublas.cpp].
+
+[endsect]
+
+[section Point type]
+
+[import ../examples/lorenz_point.cpp]
+
+Here we show how to implement the required operators on a state type.
+As example we define a new class `point3D` representing a three-dimensional
+vector with components x,y,z and define addition and scalar multiplication
+operators for it.
+We use __boost_operators to reduce the amount of code to be written.
+The class for the point type looks as follows:
+
+[point3D]
+
+By deriving from __boost_operators classes we don't have to define outer class
+operators like `operator+( point3D , point3D )` because that is taken care of
+by the operators library.
+Note that for simple Runge-Kutta schemes (like `runge_kutta4`) only the `+`
+and `*` operators are required.
+If, however, a controlled stepper is used one also needs to specify the
+division operator `/` because calculation of the error term involves an
+element wise division of the state types.
+Additionally, controlled steppers require an `abs` function calculating the
+element-wise absolute value for the state type:
+
+[point3D_abs_div]
+
+Finally, we have to add a specialization for `reduce` implementing a reduction
+over the state type:
+
+[point3D_reduce]
+
+Again, note that the two last steps were only required if you want to use
+controlled steppers.
+For simple steppers definition of the simple `+=` and `*=` operators are
+sufficient.
+Having defined such a point type, we can easily perform the integration on a Lorenz
+system by using the `vector_space_algebra` again:
+
+[point3D_main]
+
+The whole example can be found in [github_link
+libs/numeric/odeint/examples/lorenz_point.cpp lorenz_point.cpp]
+
+[endsect]
+
+[endsect]
+
+gsl_vector, gsl_matrix, ublas::matrix, blitz::matrix, thrust
+
+[section Adapt your own operations]
+
+to be continued
+
+*thrust
+*gsl_complex
+*min, max, pow
+
+[endsect]
+
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/details_steppers.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/details_steppers.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,420 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+[section Steppers]
+
+[import ../examples/stepper_details.cpp]
+
+Solving ordinary differential equation numerically is usually done iteratively, that is a given state of an ordinary differential equation is iterated forward ['x(t) -> x(t+dt) -> x(t+2dt)]. The steppers in odeint perform one single step. The most general stepper type is described by the __stepper concept. The stepper concepts of odeint are described in detail in section __concepts, here we briefly present the mathematical and numerical details of the steppers. The __stepper has two versions of the `do_step` method, one with an in-place transform of the current state and one with an out-of-place transform:
+
+`do_step( sys , inout , t , dt )`
+
+`do_step( sys , in , t , out , dt )`
+
+The first parameter is always the system function - a function describing the
+ODE. In the first version the second parameter is the step which is here
+updated in-place and the third and the fourth parameters are the time and step
+size (the time step). After a call to `do_step` the state `inout` is updated
+and now represents an approximate solution of the ODE at time ['t+dt]. In the
+second version the second argument is the state of the ODE at time ['t], the
+third argument is t, the fourth argument is the approximate solution at time
+['t+dt] which is filled by `do_step` and the fifth argument is the time step.
+Note that these functions do not change the time `t`.
+
+[* System functions]
+
+Up to now, we have nothing said about the system function. This function
+depends on the stepper. For the explicit Runge-Kutta steppers this function
+can be a simple callable object hence a simple (global) C-function or a
+functor. The parameter syntax is `sys( x , dxdt , t )` and it is assumed that
+it calculates ['dx/dt = f(x,t)].
+The function structure in most cases looks like:
+
+[system_function_structure]
+
+Other types of system functions might represent Hamiltonian systems or systems which also compute the Jacobian needed in implicit steppers. For information which stepper uses which system function see the stepper table below. It might be possible that odeint will introduce new system types in near future. Since the system function is strongly related to the stepper type, such an introduction of a new stepper might result in a new type of system function.
+
+[section Explicit steppers]
+
+A first specialization are the explicit steppers. Explicit means that the new
+state of the ode can be computed explicitly from the current state without
+solving implicit equations. Such steppers have in common that they evaluate the system at time ['t] such that the result of ['f(x,t)] can be passed to the stepper. In odeint, the explicit stepper have two additional methods
+
+`do_step( sys , inout , dxdtin , t , dt )`
+
+`do_step( sys , in , dxdtin , t , out , dt )`
+
+Here, the additional parameter is the value of the function ['f] at state ['x] and time ['t]. An example is the Runge-Kutta stepper of fourth order:
+
+[explicit_stepper_detail_example]
+
+In fact, you do not need to call these two methods. You can always use the
+simpler `do_step( sys , inout , t , dt )`, but sometimes the derivative of the
+state is needed externally to do some external computations or to perform some statistical analysis.
+
+A special class of the explicit steppers are the FSAL (first-same-as-last)
+steppers, where the last evaluation of the system function is also the first
+evaluation of the following step. For such steppers the `do_step` method are
+slightly different:
+
+`do_step( sys , inout , dxdtinout , t , dt )`
+
+`do_step( sys , in , dxdtin , out , dxdtout , t , dt )`
+
+This method takes the derivative at time `t` and also also stores
+the derivative at time ['t+dt]. Calling these functions subsequently iterating
+along the solution one saves one function call by passing the result for dxdt
+into the next function call.
+However, when using FSAL steppers without supplying derivatives:
+
+`do_step( sys , inout , t , dt )`
+
+the stepper internally satisfies the FSAL property which means it remembers
+the last `dxdt` and uses it for the next step.
+An example for a FSAL stepper is the Runge-Kutta-Dopri5 stepper. The FSAL trick is sometimes also referred as the Fehlberg trick. An example how the FSAL steppers can be used is
+
+[fsal_stepper_detail_example]
+
+[caution The FSAL-steppers save the derivative at time ['t+dt] internally if
+they are called via `do_step( sys , in , out , t , dt )`. The first call of
+`do_step` will initialize `dxdt` and for all following calls it is assumed
+that the same system and the same state are used. If you use the FSAL stepper
+within the integrate functions this is taken care of automatically. See the __using_steppers section for more details or look into the table below to see which stepper have an internal state.]
+
+
+[endsect]
+
+[section Symplectic solvers]
+
+As mentioned above symplectic solvers are used for Hamiltonian systems. Symplectic solvers conserve the phase space volume exactly and if the Hamiltonian system is energy conservative they also conserve the energy approximately. A special class of symplectic systems are separable systems which can be written in the form ['dqdt/dt = f1(p)], ['dpdt/dt = f2(q)], where ['(q,p)] are the state of system. The space of ['(q,p)] is sometimes referred as the phase space and ['q] and ['p] are said the be the phase space variables. Symplectic systems in this special form occur widely in nature. For example the complete classical mechanics as written down by Newton, Lagrange and Hamilton can be formulated in this framework. The separability of the system depends on the specific choice of coordinates.
+
+Symplectic systems can be solved by odeint by means of the symplectic_euler stepper and a symplectic Runge-Kutta-Nystrom method of fourth order. These steppers assume that the system is autonomous, hence the time will not explicitly occur. Further they fulfill in principle the default Stepper concept, but they expect the system to be a pair of callable objects. The first entry of this pair calculates ['f1(p)] while the second calculates ['f2(q)]. The syntax is `sys.first(p,dqdt)` and `sys.second(q,dpdt)`, where the first and second part can be again simple C-functions of functors. An example is the harmonic oscillator:
+
+[symplectic_stepper_detail_system_function]
+
+The state of such an ODE consist now also of two parts, the part for q (also called the coordinates) and the part for p (the momenta). The full example for the harmonic oscillator is now:
+
+[symplectic_stepper_detail_example]
+
+If you like to represent the system with one class you can easily bind two public method:
+
+[symplectic_stepper_detail_system_class]
+
+[symplectic_stepper_detail_system_class_example]
+
+Many Hamiltonian system can be written as ['dq/dt=p], ['dp/dt=f(q)] which is computationally much easier than the full separable system. Very often, it is also possible to transform the original equations of motion to bring the system in this simplified form. This kind of system can be used in the symplectic solvers, by simply passing ['f(p)] to the `do_step` method, again ['f(p)] will be represented by a simple C-function or a functor. Here, the above example of the harmonic oscillator can be written as
+
+[simplified_symplectic_stepper_example]
+
+In this example the function `harm_osc_f1` is exactly the same function as in the above examples.
+
+Note, that the state of the ODE must not be constructed explicitly via `pair< vector_type , vector_type > x`. One can also use a combination of `make_pair` and `ref`. Furthermore, a convenience version of `do_step` exists which takes q and p without combining them into a pair:
+
+[symplectic_stepper_detail_ref_usage]
+
+[endsect]
+
+[section Implicit solvers]
+
+[caution This section is not up-to-date.]
+
+For some kind of systems the stability properties of the classical Runge-Kutta are not sufficient, especially if the system is said to be stiff. A stiff system possesses two or more time scales of very different order. Solvers for stiff systems are usually implicit, meaning that they solve equations like ['x(t+dt) = x(t) + dt * f(x(t+1))]. This particular scheme is the implicit Euler method. Implicit methods usually solve the system of equations by a root finding algorithm like the Newton method and therefore need to know the Jacobian of the system ['J[subl ij] = df[subl i] / dx[subl j]].
+
+For implicit solvers the system is again a pair, where the first component computes ['f(x,t)] and the second the Jacobian. The syntax is `sys.first( x , dxdt , t )` and `sys.second( x , J , t )`. For the implicit solver the `state_type` is `ublas::vector` and the Jacobian is represented by `ublas::matrix`.
+
+[important Implicit solvers only work with ublas::vector as state type. At
+the moment, no other state types are supported.]
+
+[endsect]
+
+[section Multistep methods]
+
+Another large class of solvers are multi-step method. They save a small part of the history of the solution and compute the next step with the help of this history. Since multi-step methods know a part of their history they do not need to compute the system function very often, usually it is only computed once. This makes multi-step methods preferable if a call of the system function is expensive. Examples are ODEs defined on networks, where the computation of the interaction is usually where expensive (and might be of order O(N^2)).
+
+Multi-step methods differ from the normal steppers. They save a part of their history and this part has to be explicitly calculated and initialized. In the following example an Adams-Bashforth-stepper with a history of 5 steps is instantiated and initialized;
+
+[multistep_detail_example]
+
+The initialization uses a fourth-order Runge-Kutta stepper and after the call
+of `initialize` the state of `inout` has changed to the current state, such
+that it can be immediately used by passing it to following calls of `do_step`. You can also use you own steppers to initialize the internal state of the Adams-Bashforth-Stepper:
+
+[multistep_detail_own_stepper_initialization]
+
+Many multi-step methods are also explicit steppers, hence the parameter of `do_step` method do not differ from the explicit steppers.
+
+[caution The multi-step methods have some internal variables which depend on
+the explicit solution. Hence after any external changes of your state (e.g. size) or
+system the initialize function has to be called again to adjust the internal
+state of the stepper. If you use the integrate functions this will
+be taken into account. See the __using_steppers section for more details.]
+
+
+[endsect]
+
+[section Controlled steppers]
+
+Many of the above introduced steppers possess the possibility to use adaptive step-size control. Adaptive step size integration works in principle as follows:
+
+# The error of one step is calculated. This is usually done by performing two steps with different orders. The difference between these two steps is then used as a measure for the error. Stepper which can calculate the error are __error_stepper and they form an own class with an separate concept.
+# This error is compared against some predefined error tolerances. Are the tolerance violated the step is reject and the step-size is decreases. Otherwise the step is accepted and possibly the step-size is increased.
+
+The class of controlled steppers has their own concept in odeint - the __controlled_stepper concept. They are usually constructed from the underlying error steppers. An example is the controller for the explicit Runge-Kutta steppers. The Runge-Kutta steppers enter the controller as a template argument. Additionally one can pass the Runge-Kutta stepper to the constructor, but this step is not necessary; the stepper is default-constructed if possible.
+
+Different step size controlling mechanism exist. They all have in common that
+they somehow compare predefined error tolerance against the error and that
+they might reject or accept a step. If a step is rejected the step size is
+usually decreased and the step is made again with the reduced step size. This
+procedure is repeated until the step is accepted. This algorithm is
+implemented in the integration functions.
+
+A classical way to decide whether a step is rejected or accepted is to calculate
+
+['val = || | err[subl i] | / ( __epsilon[subl abs] + __epsilon[subl rel] * ( a[subl x] | x[subl i] | + a[subl dxdt] | | dxdt[subl i] | )|| ]
+
+['__epsilon[subl abs]] and ['__epsilon[subl rel]] are the absolute and the relative error tolerances, and ['|| x ||] is a norm, typically ['||x||=(__Sigma[subl i] x[subl i][super 2])[super 1/2]] or the maximum norm. The step is rejected if ['val] is greater then 1, otherwise it is accepted. For details of the used norms and error tolerance see the table below.
+
+For the `controlled_runge_kutta` stepper the new step size is then calculated via
+
+['val > 1 : dt[subl new] = dt[subl current] max( 0.9 pow( val , -1 / ( O[subl E] - 1 ) ) , 0.2 )]
+
+['val < 0.5 : dt[subl new] = dt[subl current] min( 0.9 pow( val , -1 / O[subl S] ) , 5 )]
+
+['else : dt[subl new] = dt[subl current]]
+
+Here, ['O[subl S]] and ['O[subl E]] are the order of the stepper and the error stepper. These formulas also contain some safety factors, avoiding that the step size is reduced or increased to much. For details of the implementations of the controlled steppers in odeint see the table below.
+
+[include controlled_stepper_table.qbk]
+
+To ease to generation of the controlled stepper, generation functions exist which take the absolute and relative error tolerances and a predefined error stepper and construct from this knowledge an appropriate controlled stepper. The generation functions are explained in detail in __generation_functions.
+
+[endsect]
+
+[section Dense output steppers]
+
+A fourth class of stepper exists which are the so called dense output steppers. Dense-output steppers might take larger steps and interpolate the solution between two consecutive points. This interpolated points have usually the same order as the order of the stepper. Dense-output steppers are often composite stepper which take the underlying method as a template parameter. An example is the `dense_output_runge_kutta` stepper which takes a Runge-Kutta stepper with dense-output facilities as argument. Not all Runge-Kutta steppers provide dense-output calculation; at the moment only the Dormand-Prince 5 stepper provides dense output. An example is
+
+[dense_output_detail_example]
+
+Dense output stepper have their own concept. The main difference to usual
+steppers is that they manage the state and time internally. If you call
+`do_step`, only the ODE is passed as argument. Furthermore `do_step` return
+the last time interval: `t` and `t+dt`, hence you can interpolate the solution between these two times points. Another difference is that they must be initialized with `initialize`, otherwise the internal state of the stepper is default constructed which might produce funny errors or bugs.
+
+The construction of the dense output stepper looks a little bit nasty, since in the case of the `dense_output_runge_kutta` stepper a controlled stepper and an error stepper have to be nested. To simplify the generation of the dense output stepper generation functions exist:
+
+[dense_output_detail_generation1]
+
+This statement is also lengthy; it demonstrates how `make_dense_output` can be used with the `result_of` protocol. The parameters to `make_dense_output` are the absolute error tolerance, the relative error tolerance and the stepper. This explicitly assumes that the underlying stepper is a controlled stepper and that this stepper has an absolute and a relative error tolerance. For details about the generation functions see __generation_functions. The generation functions have been designed for easy use with the integrate functions:
+
+[dense_output_detail_generation2]
+
+[endsect]
+
+[section Using steppers]
+
+This section contains some general information about the usage of the steppers in odeint.
+
+[* Steppers are copied by value]
+
+The stepper in odeint are always copied by values. They are copied for the creation of the controlled steppers or the dense output steppers as well as in the integrate functions.
+
+[* Steppers might have a internal state]
+
+[caution Some of the features described in this section are not yet implemented]
+
+Some steppers require to store some information about the state of the ODE between two steps. Examples are the multi-step methods which store a part of the solution during the evolution of the ODE, or the FSAL steppers which store the last derivative at time ['t+dt], to be used in the next step. In both cases the steppers expect that consecutive calls of `do_step` are from the same solution and the same ODE. In this case it is absolutely necessary that you call `do_step` with the same system function and the same state, see also the examples for the FSAL steppers above.
+
+Stepper with an internal state support two additional methods: `reset` which resets the state and `initialize` which initializes the internal state. The parameters of `initialize` depend on the specific stepper. For example the Adams-Bashforth-Moulton stepper provides two initialize methods: `initialize( system , inout , t , dt )` which initializes the internal states with the help of the Runge-Kutta 4 stepper, and `initialize( stepper , system , inout , t , dt )` which initializes with the help of `stepper`. For the case of the FSAL steppers, `initialize` is `initialize( sys , in , t )` which simply calculates the r.h.s. of the ODE and assigns its value to the internal derivative.
+
+All these steppers have in common, that they initially fill their internal state by themselves. Hence you are not required to call initialize. See how this works for the Adams-Bashforth-Moulton stepper: in the example we instantiate a fourth order Adams-Bashforth-Moulton stepper, meaning that it will store 4 internal derivatives of the solution at times `(t-dt,t-2*dt,t-3*dt,t-4*dt)`.
+
+``
+adams_bashforth_moulton< 4 , state_type > stepper;
+stepper.do_step( sys , x , t , dt ); // make one step with the classical Runge-Kutta stepper and initialize the first internal state
+ // the internal array is now [x(t-dt)]
+
+stepper.do_step( sys , x , t , dt ); // make one step with the classical Runge-Kutta stepper and initialize the second internal state
+ // the internal state array is now [x(t-dt), x(t-2*dt)]
+
+stepper.do_step( sys , x , t , dt ); // make one step with the classical Runge-Kutta stepper and initialize the third internal state
+ // the internal state array is now [x(t-dt), x(t-2*dt), x(t-3*dt)]
+
+stepper.do_step( sys , x , t , dt ); // make one step with the classical Runge-Kutta stepper and initialize the fourth internal state
+ // the internal state array is now [x(t-dt), x(t-2*dt), x(t-3*dt), x(t-4*dt)]
+
+stepper.do_step( sys , x , t , dt ); // make one step with Adam-Bashforth-Moulton, the internal array of states is now rotated
+``
+
+In the stepper table at the bottom of this page one can see which stepper have an internal state and hence provide the `reset` and `initialize` methods.
+
+
+[* Stepper might be resizable]
+
+Nearly all steppers in odeint need to store some intermediate results of the
+type `state_type` or `deriv_type`. To do so odeint need some memory management
+for the internal temporaries. As this memory management is typically related
+to adjusting the size of vector-like types, it is called resizing in
+odeint. So, most steppers in odeint provide an additional template parameter
+which controls the size adjustment of the internal variables - the resizer. In
+detail odeint provides three policy classes (resizers) `always_resizer`,
+`initially_resizer`, and `never_resizer`. Furthermore, all stepper have a
+method `adjust_size` which takes a parameter representing a state type and
+which manually adjusts the size of the internal variables matching the size of
+the given instance. Before performing the actual resizing odeint always checks
+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`,
+no memory allocation is required whatsoever.]
+
+By default the resizing parameter is `initially_resizer`, meaning that the
+first call to `do_step` performs the resizing, hence memory allocation.
+If you have changed the size of your system and your state you have to
+call `adjust_size` by hand in this case. The second resizer is the
+`always_resizer` which tries to resize the internal variables at every call of
+`do_step`. Typical use cases for this kind of resizer are self expanding
+lattices like shown in the tutorial (__resizing_lattice_example) or partial differential equations with an
+adaptive grid. Here, no calls of `adjust_size` are required, the steppers manage
+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.
+
+
+
+[* Which steppers should be used in which situation]
+
+odeint provides a quite large number of different steppers such that the user is left with the question of which stepper fits his needs. Our personal recommendations are:
+
+* `runge_kutta_dopri5` is maybe the best default stepper. It has step size control as well as dense-output functionality. Simple create a dense-output stepper by `make_dense_output( 1.0e-6 , 1.0e-5 , runge_kutta_dopri5< state_type >() )`.
+* `runge_kutta4` is a good stepper for constant step sizes. It is widely used and very well known. If you need to create artificial time series this stepper should be the first choice.
+* 'runge_kutta_fehlberg78' is similar to the 'runge_kutta4' with the advantage that it has higher precision. It can also be used with step size control.
+* `adams_bashforth_moulton` is very well suited for ODEs where the r.h.s. is expensive (in terms of computation time). It will calculate the system function only once during each step.
+
+[endsect]
+
+[section Stepper overview]
+
+[include stepper_table.qbk]
+
+[endsect]
+
+
+[section Custom steppers]
+
+[import ../examples/stochastic_euler.cpp]
+
+Finally, one can also write new steppers which are fully compatible with odeint. They only have to fulfill one or several of the stepper __concepts of odeint.
+
+We will illustrate how to write your own stepper with the example of the stochastic Euler method. This method is suited to solve stochastic differential equations (SDEs). A SDE has the form
+
+['dx/dt = f(x) + g(x) __xi(t)]
+
+where ['__xi] is Gaussian white noise with zero mean and a standard deviation ['__sigma(t)]. ['f(x)] is said to be the deterministic part while [' g(x) __xi] is the noisy part. In case ['g(x)] is independent of ['x] the SDE is said to have additive noise. It is not possible to solve SDE with the classical solvers for ODEs since the noisy part of the SDE has to be scaled differently then the deterministic part with respect to the time step. But there exist many solvers for SDEs. A classical and easy method is the stochastic Euler solver. It works by iterating
+
+['x(t+__Delta t) = x(t) + __Delta t f(x(t)) + __Delta t[super 1/2] g(x) __xi(t)]
+
+where __xi(t) is an independent normal distributed random variable.
+
+Now we will implement this method. We will call the stepper
+`stochastic_euler`. It models the __stepper concept. For simplicity, we fix
+the state type to be an `array< double , N >` The class definition looks like
+
+[stochastic_euler_class_definition]
+
+The types are needed in order to fulfill the stepper concept. As internal state and deriv type we use simple arrays in the stochastic Euler, they are needed for the temporaries. The stepper has the order one which is returned from the `order()` function.
+
+The system functions needs to calculate the deterministic and the stochastic part of our stochastic differential equation. So it might be suitable that the system function is a pair of functions. The first element of the pair computes the deterministic part and the second the stochastic one. Then, the second part also needs to calculate the random numbers in order to simulate the stochastic process. We can now implement the `do_step` method
+
+[stochastic_euler_do_step]
+
+This is all. It is quite simple and the stochastic Euler stepper implement here is quite general. Of course it can be enhanced, for example
+
+* use of operations and algebras as well as the resizing mechanism for maximal flexibility and portability
+* use of `boost::ref` for the system functions
+* use of `boost::range` for the state type in the `do_step` method
+* ...
+
+Now, lets look how we use the new stepper. A nice example is the Ornstein-Uhlenbeck process. It consists of a simple Brownian motion overlapped with an relaxation process. Its SDE reads
+
+['dx/dt = - x + __xi]
+
+where __xi is Gaussian white noise with standard deviation ['__sigma]. Implementing the Ornstein-Uhlenbeck process is quite simple. We need two functions or functors - one for the deterministic and one for the stochastic part:
+
+[stochastic_euler_ornstein_uhlenbeck_def]
+
+In the stochastic part we have used the Mersenne twister for the random number generation and a Gaussian white noise generator `normal_distribution` with standard deviation ['__sigma]. Now, we can use the stochastic Euler stepper with the integrate functions:
+
+[ornstein_uhlenbeck_main]
+
+Note, how we have used the `make_pair` function for the generation of the system function.
+
+[endsect]
+
+[section Custom Runge-Kutta steppers]
+
+[import ../examples/heun.cpp]
+
+odeint provides a C++ template meta-algorithm for constructing arbitrary
+Runge-Kutta schemes [footnote M. Mulansky, K. Ahnert, Template-Metaprogramming
+applied to numerical problems, [@http://arxiv.org/abs/1110.3233 arxiv:1110.3233]]. Some schemes are predefined in odeint, for
+example the classical Runge-Kutta of fourth order, or the
+Runge-Kutta-Cash-Karp 54 and the Runge-Kutta-Fehlberg 78 method.
+You can use this meta algorithm to construct you own solvers. This has the
+advantage that you can make full use of odeint's algebra and operation system.
+
+Consider for example the method of Heun, defined by the following Butcher tableau:
+
+[pre
+c1 = 0
+
+c2 = 1/3, a21 = 1/3
+
+c3 = 2/3, a31 = 0 , a32 = 2/3
+
+ b1 = 1/4, b2 = 0 , b3 = 3/4
+]
+
+Implementing this method is very easy. First you have to define the constants:
+
+[heun_define_coefficients]
+
+While this might look cumbersome, packing all
+parameters into a templatized class which is not immediately evaluated has the
+advantage that you can change the `value_type` of your stepper to any type you
+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 }};
+``
+
+But then you are nailed down to use doubles.
+
+Next, you need to define your stepper, note that the Heun method has 3 stages
+and produces approximations of order 3:
+
+[heun_stepper_definition]
+
+That's it. Now, we have a new stepper method and we can use it, for example with the Lorenz system:
+
+[heun_example]
+
+[endsect]
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/examples_table.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/examples_table.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,125 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[table Examples Overview
+ [[File] [Brief Description]]
+
+ [[[github_link libs/numeric/odeint/examples/adaptive_iterator.cpp adaptive_iterator.cpp]]
+ [The adaptive iterator examples shows the usage of the adaptive iterators and how they can be used with C++11 lambdas.]]
+
+ [[[github_link libs/numeric/odeint/examples/bind_member_functions.cpp bind_member_functions.cpp]]
+ [This examples shows how member functions can be used as system functions in odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/bind_member_functions.cpp bind_member_functions_cpp11.cpp]]
+ [This examples shows how member functions can be used as system functions in odeint with `std::bind` in C++11.]]
+
+ [[[github_link libs/numeric/odeint/examples/bulirsch_stoer.cpp bulirsch_stoer.cpp]]
+ [Shows the usage of the Bulirsch-Stoer method.]]
+
+ [[[github_link libs/numeric/odeint/examples/chaotic_system.cpp chaotic_system.cpp]]
+ [The chaotic system examples integrates the Lorenz system and calculates the Lyapunov exponents.]]
+
+ [[[github_link libs/numeric/odeint/examples/const_step_iterator.cpp const_step_iterator.cpp]]
+ [The adaptive iterator examples shows the usage of the const step iterators and how they can be used with C++11 lambdas.]]
+
+ [[[github_link libs/numeric/odeint/examples/elliptic_functions.cpp elliptic_functions.cpp]]
+ [Example calculating the elliptic functions using Bulirsch-Stoer and Runge-Kutta-Dopri5 Steppers with dense output.]]
+
+ [[[github_link libs/numeric/odeint/examples/fpu.cpp fpu.cpp]]
+ [The Fermi-Pasta-Ulam (FPU) example shows how odeint can be used to integrate lattice systems.]]
+
+ [[[github_link libs/numeric/odeint/examples/generation_functions.cpp generation_functions.cpp]]
+ [Shows skeletal code on how to implemente own factory functions.]]
+
+ [[[github_link libs/numeric/odeint/examples/harmonic_oscillator.cpp harmonic_oscillator.cpp]]
+ [The harmonic oscillator examples gives a brief introduction to odeint and shows the usage of the classical Runge-Kutta-solvers.]]
+
+ [[[github_link libs/numeric/odeint/examples/harmonic_oscillator_units.cpp harmonic_oscillator_units.cpp]]
+ [This examples shows how __boost_units can be used with odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/heun.cpp heun.cpp]]
+ [The Heun example shows how an custom Runge-Kutta stepper can be created with odeint generic Runge-Kutta method.]]
+
+ [[[github_link libs/numeric/odeint/examples/list_lattice.cpp list_lattice.cpp]]
+ [Example of a phase lattice integration using `std::list` as state type.]]
+
+ [[[github_link libs/numeric/odeint/examples/lorenz_point.cpp lorenz_point.cpp]]
+ [Alternative way of integrating lorenz by using a self defined point3d data type as state type.]]
+
+ [[[github_link libs/numeric/odeint/examples/my_vector.cpp my_vector.cpp]]
+ [Simple example showing how to get odeint to work with a self-defined vector type.]]
+
+ [[[github_link libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp phase_oscillator_ensemble.cpp]]
+ [The phase oscillator ensemble example shows how globally coupled oscillators can be analyzed and how statistical measures can be computed during integration.]]
+
+ [[[github_link libs/numeric/odeint/examples/resizing_lattice.cpp resizing_lattice.cpp]]
+ [Shows the strength of odeint's memory management by simulating a Hamiltonian system on an expanding lattice.]]
+
+ [[[github_link libs/numeric/odeint/examples/simple1d.cpp simple1d.cpp]]
+ [Integrating a simple, one-dimensional ODE showing the usage of integrate- and generate-functions.]]
+
+ [[[github_link libs/numeric/odeint/examples/solar_system.cpp solar_system.cpp]]
+ [The solar system example shows the usage of the symplectic solvers.]]
+
+ [[[github_link libs/numeric/odeint/examples/stepper_details.cpp stepper_details.cpp]]
+ [Trivial example showing the usability of the several stepper classes.]]
+
+ [[[github_link libs/numeric/odeint/examples/stiff_system.cpp stiff_system.cpp]]
+ [The stiff system example shows the usage of the stiff solvers using the Jacobian of the system function.]]
+
+ [[[github_link libs/numeric/odeint/examples/stochastic_euler.cpp stochastic_euler.cpp]]
+ [Implementation of a custom stepper - the stochastic euler - for solving stochastic differential equations.]]
+
+ [[[github_link libs/numeric/odeint/examples/stuart_landau.cpp stuart_landau.cpp]]
+ [The Stuart-Landau example shows how odeint can be used with complex state types.]]
+
+ [[[github_link libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp two_dimensional_phase_lattice.cpp]]
+ [The 2D phase oscillator example shows how a two-dimensional lattice works with odeint and how matrix types can be used as state types in odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/van_der_pol_stiff.cpp van_der_pol_stiff.cpp]]
+ [This stiff system example again shows the usage of the stiff solvers by integrating the van der Pol oscillator.]]
+
+ [[[github_link libs/numeric/odeint/examples/gmpxx/lorenz_gmpxx.cpp gmpxx/lorenz_gmpxx.cpp]]
+ [This examples integrates the Lorenz system by means of an arbitrary precision type.]]
+
+ [[[github_link libs/numeric/odeint/examples/mtl/gauss_packet.cpp mtl/gauss_packet.cpp]]
+ [The MTL-Gauss-packet example shows how the MTL can be easily used with odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/mtl/implicit_euler_mtl.cpp mtl/implicit_euler_mtl.cpp]]
+ [This examples shows the usage of the MTL implicit Euler method with a sparse matrix type.]]
+
+ [[[github_link libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu thrust/phase_oscillator_ensemble.cu]]
+ [The Thrust phase oscillator ensemble example shows how globally coupled oscillators can be analyzed with Thrust and CUDA, employing the power of modern graphic devices.]]
+
+ [[[github_link libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu thrust/phase_oscillator_chain.cu]]
+ [The Thrust phase oscillator chain example shows how chains of nearest neighbor coupled oscillators can be integrated with Thrust and odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/thrust/lorenz_parameters.cu thrust/lorenz_parameters.cu]]
+ [The Lorenz parameters examples show how ensembles of ordinary differential equations can be solved by means of Thrust to study
+ the dependence of an ODE on some parameters.]]
+
+ [[[github_link libs/numeric/odeint/examples/thrust/relaxation.cu thrust/relaxation.cu]]
+ [Another examples for the usage of Thrust.]]
+
+ [[[github_link libs/numeric/odeint/examples/ublas/lorenz_ublas.cpp ublas/lorenz_ublas.cpp]]
+ [This example shows how the ublas vector types can be used with odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/vexcl/lorenz_ensemble.cpp vexcl/lorenz_ensemble.cpp]]
+ [This example shows how the VexCL - a framework for OpenCL computation - can be used with odeint.]]
+
+ [[[github_link libs/numeric/odeint/examples/2d_lattice/spreading.cpp 2d_lattice/spreading.cpp]]
+ [This examples shows how a `vector< vector< T > >` can be used a state type for odeint and how a resizing mechanism of this state can be implemented.]]
+
+ [[[github_link libs/numeric/odeint/examples/quadmath/black_hole.cpp quadmath/black_hole.cpp]]
+ [This examples shows how gcc libquadmath can be used with odeint. It provides a high precision floating point type which is adapted to odeint in this example.]]
+
+]

Added: trunk/libs/numeric/odeint/doc/getting_started.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/getting_started.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,143 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Getting started]
+
+[section Overview]
+
+[caution Boost.Numeric.Odeint is not an official boost library!]
+
+odeint is a library for solving initial value problems (IVP) of ordinary
+differential equations. Mathematically, these problems are formulated as
+follows:
+
+['x'(t) = f(x,t)], ['x(0) = x0].
+
+['x] and ['f] can be vectors and the solution is some function ['x(t)] fulfilling both equations above. In the following we will refer to ['x'(t)] also `dxdt` which is also our notation for the derivative in the source code.
+
+Ordinary differential equations occur nearly everywhere in natural sciences. For example, the whole Newtonian mechanics are described by second order differential equations. Be sure, you will find them in every discipline. They also occur if partial differential equations (PDEs) are discretized. Then, a system of coupled ordinary differential occurs, sometimes also referred as lattices ODEs.
+
+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:
+
+* __ublas
+* __thrust, making odeint naturally running on CUDA devices
+* gsl_vector for compatibility with the many numerical function in the GSL
+* __boost_range
+* __boost_fusion (the state type can be a fusion vector)
+* __boost_units
+* __intel_mkl for maximum performance
+* __vexcl for OpenCL
+* __boost_graph (still experimentally)
+
+In odeint, the following algorithms are implemented:
+
+[include stepper_table.qbk]
+
+[endsect]
+
+
+
+[section Usage, Compilation, Headers]
+
+odeint is a header-only library, no linking against pre-compiled code is required. It can be included by
+
+``
+#include <boost/numeric/odeint.hpp>
+``
+
+which includes all headers of the library. All functions and classes from odeint live in the namespace
+
+``
+ using namespace boost::numeric::odeint;
+``
+
+It is also possible to include only parts of the library. This is the recommended way since it saves a lot of compilation time.
+
+* `#include <boost/numeric/odeint/stepper/XYZ.hpp>` - the include path for all steppers, XYZ is a placeholder for a stepper.
+* `#include <boost/numeric/odeint/algebra/XYZ.hpp>` - all algebras.
+* `#include <boost/numeric/odeint/util/XYZ.hpp>` - the utility functions like `is_resizeable`, `same_size`, or `resize`.
+* `#include <boost/numeric/odeint/integrate/XYZ.hpp>` - the integrate routines.
+* `#include <boost/numeric/odeint/iterator/XYZ.hpp>` - the range and iterator functions.
+* `#include <boost/numeric/odeint/external/XYZ.hpp>` - any binders to external libraries.
+
+
+
+[endsect]
+
+[section Short Example]
+
+Imaging, you want to numerically integrate a harmonic oscillator with
+friction. The equations of motion are given by ['x'' = -x + __gamma x'].
+Odeint only deals with first order ODEs that have no higher derivatives than
+x' involved. However, any higher order ODE can be transformed to a system of
+first order ODEs by introducing the new variables ['q=x] and ['p=x'] such that ['w=(q,p)]. To apply numerical integration one first has to design the right hand side of the equation ['w' = f(w) = (p,-q+__gamma p)]:
+
+[import ../examples/harmonic_oscillator.cpp]
+[rhs_function]
+
+Here we chose `vector<double>` as the state type, but others are also
+possible, for example `boost::array<double,2>`. 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
+call them in the form `f(x, dxdt, t)` (there are exceptions for some special routines). So, even if there is no explicit time dependence, one has to define `t` as a function parameter.
+
+Now, we have to define the initial state from which the integration should start:
+
+[state_initialization]
+
+For the integration itself we'll use the `integrate` function, which is a convenient way to get quick results. It is based on the error-controlled `runge_kutta54_cash_karp` stepper (5th order) and uses adaptive step-size.
+
+[integration]
+
+The integrate function expects as parameters the rhs of the ode as defined
+above, the initial state `x`, the start-and end-time of the integration as
+well as the initial time step=size. Note, that `integrate` uses an adaptive step-size during
+the integration steps so the time points will not be equally spaced. The
+integration returns the number of steps that were applied and updates x which
+is set to the approximate solution of the ODE at the end of integration.
+
+It is also possible to represent the ode system as a class. The
+rhs must then be implemented as a functor - a class with an overloaded function call operator:
+
+[rhs_class]
+
+which can be used via
+
+[integration_class]
+
+In order to observe the solution
+during the integration steps all you have to do is
+to provide a reasonable observer. An example is
+
+[integrate_observer]
+
+which stores the intermediate steps in a container.
+Note, the argument structure of the ()-operator: odeint calls the observer
+exactly in this way, providing the current state and time. Now, you only have
+to pass this container to the integration function:
+
+[integrate_observ]
+
+That is all. You can use functional libraries like __boost_lambda or __boost_phoenix to ease the creation of observer functions.
+
+The full cpp file for this example can be found here: [github_link libs/numeric/odeint/examples/harmonic_oscillator.cpp harmonic_oscillator.cpp]
+
+
+
+[endsect]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/html/logo.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/libs/numeric/odeint/doc/html/phase_lattice_2d_0000.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/libs/numeric/odeint/doc/html/phase_lattice_2d_0100.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/libs/numeric/odeint/doc/html/phase_lattice_2d_1000.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/libs/numeric/odeint/doc/html/solar_system.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/libs/numeric/odeint/doc/literature.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/literature.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,53 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Literature]
+
+[*General information about numerical integration of ordinary differential equations:]
+
+[#numerical_recipies]
+[1] Press William H et al., Numerical Recipes 3rd Edition: The Art of Scientific Computing, 3rd ed. (Cambridge University Press, 2007).
+
+[#hairer_solving_odes_1]
+[2] Ernst Hairer, Syvert P. Nørsett, and Gerhard Wanner, Solving Ordinary Differential Equations I: Nonstiff Problems, 2nd ed. (Springer, Berlin, 2009).
+
+[#hairer_solving_odes_2]
+[3] Ernst Hairer and Gerhard Wanner, Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Problems, 2nd ed. (Springer, Berlin, 2010).
+
+
+[*Symplectic integration of numerical integration:]
+
+[#hairer_geometrical_numeric_integration]
+[4] Ernst Hairer, Gerhard Wanner, and Christian Lubich, Geometric Numerical Integration: Structure-Preserving Algorithms for Ordinary Differential Equations, 2nd ed. (Springer-Verlag Gmbh, 2006).
+
+[#leimkuhler_reich_simulating_hamiltonian_dynamics]
+[5] Leimkuhler Benedict and Reich Sebastian, Simulating Hamiltonian Dynamics (Cambridge University Press, 2005).
+
+
+[*Special symplectic methods:]
+
+[#symplectic_yoshida_symplectic_integrators]
+[6] Haruo Yoshida, “Construction of higher order symplectic integrators,” Physics Letters A 150, no. 5 (November 12, 1990): 262-268.
+
+[#symplectic_mylachlan_symmetric_composition_mehtods]
+[7] Robert I. McLachlan, “On the numerical integration of ordinary differential equations by symmetric composition methods,” SIAM J. Sci. Comput. 16, no. 1 (1995): 151-168.
+
+
+[*Special systems:]
+
+[#fpu_scholarpedia]
+[8] [@http://www.scholarpedia.org/article/Fermi-Pasta-Ulam_nonlinear_lattice_oscillations Fermi-Pasta-Ulam nonlinear lattice oscillations]
+
+[#synchronization_pikovsky_rosenblum]
+[9] Arkady Pikovsky, Michael Rosemblum, and Jürgen Kurths, Synchronization: A Universal Concept in Nonlinear Sciences. (Cambridge University Press, 2001).
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/make_controlled_table.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/make_controlled_table.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,20 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[table Generation functions make_controlled( abs_error , rel_error , stepper )
+ [[Stepper] [Result of make_controlled] [Remarks]]
+ [[`runge_kutta_cash_karp54`] [`controlled_runge_kutta< runge_kutta_cash_karp54 , default_error_checker<...> >`] [['a[sub x]=1], ['a[sub dxdt]=1]]]
+ [[`runge_kutta_fehlberg78`] [`controlled_runge_kutta< runge_kutta_fehlberg78 , default_error_checker<...> >`] [['a[sub x]=1], ['a[sub dxdt]=1]]]
+ [[`runge_kutta_dopri5`] [`controlled_runge_kutta< runge_kutta_dopri5 , default_error_checker<...> >`] [['a [sub x]=1], ['a[sub dxdt]=1]]]
+ [[`rosenbrock4`] [`rosenbrock4_controlled< rosenbrock4 >`] [-]]
+]

Added: trunk/libs/numeric/odeint/doc/make_dense_output_table.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/make_dense_output_table.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,19 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[table Generation functions make_dense_output( abs_error , rel_error , stepper )
+ [[Stepper] [Result of make_dense_output] [Remarks]]
+ [[`runge_kutta_dopri5`] [`dense_output_runge_kutta< controlled_runge_kutta< runge_kutta_dopri5 , default_error_checker<...> > >`] [['a [sub x]=1], ['a[sub dxdt]=1]]]
+ [[`rosenbrock4`] [`rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4 > >`] [-]]
+]
+

Added: trunk/libs/numeric/odeint/doc/odeint.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/odeint.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,237 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[library Boost.Numeric.Odeint
+ [quickbook 1.5]
+ [id odeint]
+ [dirname odeint]
+ [authors [Ahnert, Karsten], [Mulansky, Mario]]
+ [copyright 2009-2012 Karsten Ahnert and Mario Mulansky]
+ [category math]
+ [purpose
+ Numerical integration of ordinary differential equations.
+ ]
+ [license
+ 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])
+ ]
+]
+
+[include auto_index_helpers.qbk]
+
+
+
+[def __boost_lambda
+ [@http://www.boost.org/doc/libs/release/doc/html/lambda.html Boost.Lambda]]
+[def __boost_phoenix
+ [@http://www.boost.org/doc/libs/1_46_1/libs/spirit/phoenix/doc/html/index.html Boost.Phoenix]]
+[def __boost_operators
+ [@http://www.boost.org/doc/libs/release/doc/html/operators.html Boost.Operators]]
+[def __boost_ref
+ [@http://www.boost.org/doc/libs/release/doc/html/ref.html Boost.Ref]]
+[def __boost_range
+ [@http://www.boost.org/doc/libs/release/libs/range/index.html Boost.Range]]
+[def __boost_units
+ [@http://www.boost.org/doc/libs/release/libs/units/index.html Boost.Units]]
+[def __boost_fusion
+ [@http://www.boost.org/doc/libs/release/libs/fusion/index.html Boost.Fusion]]
+[def __boost_graph
+ [@http://www.boost.org/doc/libs/1_47_0/libs/graph/doc/table_of_contents.html Boost.Graph]]
+
+[def __thrust
+ [@http://code.google.com/p/thrust/ Thrust]]
+[def __ublas
+ [@http://www.boost.org/doc/libs/release/libs/numeric/ublas/index.html Boost.uBLAS]]
+[def __intel_mkl
+ [@http://software.intel.com/en-us/articles/intel-mkl/ Intel Math Kernel Library]]
+[def __gsl
+ [@http://www.gsl.org GSL]]
+[def __vexcl
+ [@https://github.com/ddemidov/vexcl VexCL]]
+
+[def __concepts
+ [link boost_numeric_odeint.concepts Concepts]]
+[def __system
+ [link boost_numeric_odeint.concepts.system System]]
+[def __symplectic_system
+ [link boost_numeric_odeint.concepts.symplectic_system Symplectic System]]
+[def __simple_symplectic_system
+ [link boost_numeric_odeint.concepts.simple_symplectic_system Simple Symplectic System]]
+[def __implicit_system
+ [link boost_numeric_odeint.concepts.implicit_system Implicit System]]
+[def __stepper
+ [link boost_numeric_odeint.concepts.stepper Stepper]]
+[def __error_stepper
+ [link boost_numeric_odeint.concepts.error_stepper Error Stepper]]
+[def __controlled_stepper
+ [link boost_numeric_odeint.concepts.controlled_stepper Controlled Stepper]]
+[def __dense_output_stepper
+ [link boost_numeric_odeint.concepts.dense_output_stepper Dense Output Stepper]]
+[def __integrate_functions
+ [link boost_numeric_odeint.odeint_in_detail.integrate_functions integrate functions]]
+[def __tutorial
+ [link boost_numeric_odeint.tutorial Tutorial]]
+[def __tut_solar_system
+ [link boost_numeric_odeint.tutorial.solar_system Solar System]]
+[def __tut_chaotic_system
+ [link boost_numeric_odeint.tutorial.chaotic_systems_and_lyapunov_exponents Chaotic System]]
+[def __tut_harmonic_oscillator
+ [link boost_numeric_odeint.tutorial.harmonic_oscillator Harmonic Oscillator]]
+[def __using_steppers
+ [link boost_numeric_odeint.odeint_in_detail.steppers.using_steppers Using steppers]]
+[def __generation_functions
+ [link boost_numeric_odeint.odeint_in_detail.generation_functions Generation functions]]
+[def __adapt_state_types
+ [link boost_numeric_odeint.odeint_in_detail.state_types__algebras_and_operations Adapt your own state types]]
+[def __resizing_lattice_example
+ [link boost_numeric_odeint.tutorial.self_expanding_lattices Self expanding lattices]]
+[def __odeint_stepper_table
+ [link boost_numeric_odeint.odeint_in_detail.steppers.stepper_overview Stepper overview]]
+
+
+
+[def __nr_ref [link numerical_recipies \[1\] ]]
+[def __hairer_1_ref [link hairer_solving_odes_1 \[2\] ]]
+[def __hairer_2_ref [link hairer_solving_odes_2 \[3\] ]]
+[def __hairer_geom_ref [link hairer_geometrical_numeric_integration \[4\] ]]
+[def __leimkuhler_reich_ref [link leimkuhler_reich_simulating_hamiltonian_dynamics \[5\] ]]
+[def __symplectic_integrator_1_ref [link symplectic_yoshida_symplectic_integrators \[6\] ]]
+[def __symplectic_integrator_2_ref [link symplectic_mylachlan_symmetric_composition_mehtods \[7\] ]]
+[def __fpu_scholarpedia_ref [link fpu_scholarpedia \[8\] ]]
+[def __synchronization_pikovsky_ref [link synchronization_pikovsky_rosenblum \[9\] ]]
+
+
+
+
+
+[def __alpha '''&#945;''']
+[def __beta '''&#946;''']
+[def __delta '''&#948;''']
+[def __Delta '''&#916;''']
+[def __lambda '''&#955;'''][/lower case]
+[def __Lambda '''&#923;'''][/upper case]
+[def __gamma '''&#947;''']
+[def __Gamma '''&#915;''']
+[def __sigma '''&#963;''']
+[def __Sigma '''&#931;''']
+[def __Omega '''&#937;''']
+[def __omega '''&#969;''']
+[def __phi '''&#966;''']
+[def __psi '''&ä968;''']
+[def __Phi '''&#934;''']
+[def __Psi '''&#936;''']
+[def __epsilon '''&#949;''']
+[def __eta '''&#951;''']
+[def __theta '''&#952;''']
+[def __Theta '''&#920;''']
+[def __xi '''&#958;''']
+
+[def __space '''&#8203;''']
+
+
+
+[template super[x]'''<superscript>'''[x]'''</superscript>''']
+[template sub[x]'''<subscript>'''[x]'''</subscript>''']
+[template subl[x]'''<subscript>'''__space[x]'''</subscript>''']
+
+[/ [template github_link[url text]'''<ulink url="https://github.com/headmyshoulder/odeint-v2/tree/master/'''[url]'''" target="_blank">'''[text]'''</ulink>''']]
+[template github_link[url text]'''<ulink url="../../../../../'''[url]'''" target="_blank">'''[text]'''</ulink>''']
+
+
+
+
+[include getting_started.qbk]
+
+[include tutorial.qbk]
+
+[include details.qbk]
+
+[include concepts.qbk]
+
+[include literature.qbk]
+
+[include acknowledgements.qbk]
+
+[xinclude reference.xml]
+
+[section:indexes Indexes]
+
+[named_index class_name Class Index]
+[named_index function_name Function Index]
+[/
+[named_index typedef_name Typedef Index]
+[named_index macro_name Macro Index]
+]
+[index]
+
+[endsect]
+
+
+
+
+[/
+# &Alpha; Α &#913; U+0391 Greek capital letter alpha
+# &Beta; Î’ &#914; U+0392 Greek capital letter beta
+# &Gamma; Γ &#915; U+0393 Greek capital letter gamma ISOgrk3
+# &Delta; Δ &#916; U+0394 Greek capital letter delta ISOgrk3
+# &Epsilon; Ε &#917; U+0395 Greek capital letter epsilon
+# &Zeta; Ζ &#918; U+0396 Greek capital letter zeta
+# &Eta; Η &#919; U+0397 Greek capital letter eta
+# &Theta; Θ &#920; U+0398 Greek capital letter theta ISOgrk3
+# &Iota; Ι &#921; U+0399 Greek capital letter iota
+# &Kappa; Κ &#922; U+039A Greek capital letter kappa
+# &Lambda; Λ &#923; U+039B Greek capital letter lambda ISOgrk3
+# &Mu; Μ &#924; U+039C Greek capital letter mu
+# &Nu; Ν &#925; U+039D Greek capital letter nu
+# &Xi; Ξ &#926; U+039E Greek capital letter xi ISOgrk3
+# &Omicron; Ο &#927; U+039F Greek capital letter omicron
+# &Pi; Π &#928; U+03A0 Greek capital letter pi ISOgrk3
+# &Rho; Ρ &#929; U+03A1 Greek capital letter rho
+# &Sigma; Σ &#931; U+03A3 Greek capital letter sigma ISOgrk3
+# &Tau; Τ &#932; U+03A4 Greek capital letter tau
+# &Upsilon; Υ &#933; U+03A5 Greek capital letter upsilon ISOgrk3
+# &Phi; Φ &#934; U+03A6 Greek capital letter phi ISOgrk3
+# &Chi; Χ &#935; U+03A7 Greek capital letter chi
+# &Psi; Ψ &#936; U+03A8 Greek capital letter psi ISOgrk3
+# &Omega; Ω &#937; U+03A9 Greek capital letter omega ISOgrk3
+# &alpha; α &#945; U+03B1 Greek small letter alpha ISOgrk3
+# &beta; β &#946; U+03B2 Greek small letter beta ISOgrk3
+# &gamma; γ &#947; U+03B3 Greek small letter gamma ISOgrk3
+# &delta; δ &#948; U+03B4 Greek small letter delta ISOgrk3
+# &epsilon; ε &#949; U+03B5 Greek small letter epsilon ISOgrk3
+# &zeta; ζ &#950; U+03B6 Greek small letter zeta ISOgrk3
+# &eta; η &#951; U+03B7 Greek small letter eta ISOgrk3
+# &theta; θ &#952; U+03B8 Greek small letter theta ISOgrk3
+# &iota; ι &#953; U+03B9 Greek small letter iota ISOgrk3
+# &kappa; κ &#954; U+03BA Greek small letter kappa ISOgrk3
+# &lambda; λ &#955; U+03BB Greek small letter lambda ISOgrk3
+# &mu; μ &#956; U+03BC Greek small letter mu ISOgrk3
+# &nu; ν &#957; U+03BD Greek small letter nu ISOgrk3
+# &xi; ξ &#958; U+03BE Greek small letter xi ISOgrk3
+# &omicron; ο &#959; U+03BF Greek small letter omicron New
+# &pi; π &#960; U+03C0 Greek small letter pi ISOgrk3
+# &rho; ρ &#961; U+03C1 Greek small letter rho ISOgrk3
+# &sigmaf; Ï‚ &#962; U+03C2 Greek small letter final sigma ISOgrk3
+# &sigma; σ &#963; U+03C3 Greek small letter sigma ISOgrk3
+# &tau; Ï„ &#964; U+03C4 Greek small letter tau ISOgrk3
+# &upsilon; Ï… &#965; U+03C5 Greek small letter upsilon ISOgrk3
+# &phi; φ &#966; U+03C6 Greek small letter phi ISOgrk3
+# &chi; χ &#967; U+03C7 Greek small letter chi ISOgrk3
+# &psi; ψ &#968; U+03C8 Greek small letter psi ISOgrk3
+# &omega; ω &#969; U+03C9 Greek small letter omega ISOgrk3
+# &thetasym; Ï‘ &#977; U+03D1 Greek small letter theta symbol New
+# &upsih; Ï’ &#978; U+03D2 Greek upsilon with hook symbol New
+# &piv; Ï– &#982; U+03D6 Greek pi symbol ISOgrk3
+
+/]

Added: trunk/libs/numeric/odeint/doc/range_table.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/range_table.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,70 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[/
+Steppers supporting __boost_range:
+
+* adams_bashforth_moulton
+* bulirsch_stoer_dense_out
+* bulirsch_stoer
+* controlled_runge_kutta
+* dense_output_runge_kutta
+* euler
+* explicit_error_generic_rk
+* explicit_generic_rk
+* rosenbrock4_controller
+* rosenbrock4_dense_output
+* rosenbrock4
+* runge_kutta4_classic
+* runge_kutta4
+* runge_kutta_cash_karp54_classic
+* runge_kutta_cash_karp54
+* runge_kutta_dopri5
+* runge_kutta_fehlberg78
+* symplectic_euler
+* symplectic_rkn_sb3a_mclachlan
+
+Algebras supporting __boost_range
+
+* range_algebra
+* thrust_algebra
+/]
+
+[table Steppers supporting Boost.Range
+ [[Stepper]]
+ [[adams_bashforth_moulton]]
+ [[bulirsch_stoer_dense_out]]
+ [[bulirsch_stoer]]
+ [[controlled_runge_kutta]]
+ [[dense_output_runge_kutta]]
+ [[euler]]
+ [[explicit_error_generic_rk]]
+ [[explicit_generic_rk]]
+ [[rosenbrock4_controller]]
+ [[rosenbrock4_dense_output]]
+ [[rosenbrock4]]
+ [[runge_kutta4_classic]]
+ [[runge_kutta4]]
+ [[runge_kutta_cash_karp54_classic]]
+ [[runge_kutta_cash_karp54]]
+ [[runge_kutta_dopri5]]
+ [[runge_kutta_fehlberg78]]
+ [[symplectic_euler]]
+ [[symplectic_rkn_sb3a_mclachlan]]
+]
+
+[table Algebras supporting Boost.Range
+ [[algebra]]
+ [[range_algebra]]
+ [[thrust_algebra]]
+]
\ No newline at end of file

Added: trunk/libs/numeric/odeint/doc/stepper_table.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/stepper_table.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,40 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[table Stepper Algorithms
+ [[Algorithm] [Class] [Concept] [System Concept] [Order] [Error Estimation] [Dense Output] [Internal state] [Remarks]]
+ [[Explicit Euler] [`euler`] [__dense_output_stepper] [__system] [1] [No] [Yes] [No] [Very simple, only for demonstrating purpose]]
+ [[Modified Midpoint] [`modified_midpoint`] [__stepper] [__system] [configurable (2)] [No] [No] [No] [Used in Bulirsch-Stoer implementation]]
+ [[Runge-Kutta 4] [`runge_kutta4`] [__stepper] [__system] [4] [No] [No] [No] [The classical Runge-Kutta scheme, good general scheme without error control]]
+ [[Cash-Karp] [`runge_kutta_cash_karp54`] [__error_stepper] [__system] [5] [Yes (4)] [No] [No] [Good general scheme with error estimation, to be used in controlled_error_stepper]]
+ [[Dormand-Prince 5] [`runge_kutta_dopri5`] [__error_stepper] [__system] [5] [Yes (4)] [Yes] [Yes] [Standard method with error control and dense output, to be used in controlled_error_stepper and in dense_output_controlled_explicit_fsal.]]
+ [[Fehlberg 78] [`runge_kutta_fehlberg78`] [__error_stepper] [__system] [8] [Yes (7)] [No] [No] [Good high order method with error estimation, to be used in controlled_error_stepper.]]
+
+ [[Adams Bashforth] [`adams_bashforth`] [__stepper] [__system] [configurable] [No] [No] [Yes] [Multistep method]]
+ [[Adams Moulton] [`adams_moulton`] [__stepper] [__system] [configurable] [No] [No] [Yes] [Multistep method]]
+ [[Adams Bashforth Moulton] [`adams_bashforth_moulton`] [__stepper] [__system] [configurable] [No] [No] [Yes] [Combined multistep method]]
+
+ [[Controlled Runge-Kutta] [`controlled_runge_kutta`] [__controlled_stepper] [__system] [depends] [Yes] [No] [depends] [Error control for __error_stepper. Requires an __error_stepper from above. Order depends on the given ErrorStepper]]
+ [[Dense Output Runge-Kutta] [`dense_output_runge_kutta`] [__dense_output_stepper] [__system] [depends] [No] [Yes] [Yes] [Dense output for __stepper and __error_stepper from above if they provide dense output functionality (like `euler` and `runge_kutta_dopri5`). Order depends on the given stepper.]]
+
+ [[Bulirsch-Stoer] [`bulirsch_stoer`] [__controlled_stepper] [__system] [variable] [Yes] [No] [No] [Stepper with step size and order control. Very good if high precision is required.]]
+ [[Bulirsch-Stoer Dense Output] [`bulirsch_stoer_dense_out`] [__dense_output_stepper] [__system] [variable] [Yes] [Yes] [No] [Stepper with step size and order control as well as dense output. Very good if high precision and dense output is required.]]
+
+ [[Implicit Euler] [`implicit_euler`] [__stepper] [__implicit_system] [1] [No] [No] [No] [Basic implicit routine. Requires the Jacobian. Works only with __ublas vectors as state types.]]
+ [[Rosenbrock 4] [`rosenbrock4`] [__error_stepper] [__implicit_system] [4] [Yes] [Yes] [No] [Good for stiff systems. Works only with __ublas vectors as state types.]]
+ [[Controlled Rosenbrock 4] [`rosenbrock4_controller`] [__controlled_stepper] [__implicit_system] [4] [Yes] [Yes] [No] [Rosenbrock 4 with error control. Works only with __ublas vectors as state types.]]
+ [[Dense Output Rosenbrock 4] [`rosenbrock4_dense_output`] [__dense_output_stepper] [__implicit_system] [4] [Yes] [Yes] [No] [Controlled Rosenbrock 4 with dense output. Works only with __ublas vectors as state types.]]
+
+ [[Symplectic Euler] [`symplectic_euler`] [__stepper] [__symplectic_system __simple_symplectic_system] [1] [No] [No] [No] [Basic symplectic solver for separable Hamiltonian system]]
+ [[Symplectic RKN McLachlan] [`symplectic_rkn_sb3a_mclachlan`] [__stepper] [__symplectic_system __simple_symplectic_system] [4] [No] [No] [No] [Symplectic solver for separable Hamiltonian system with 6 stages and order 4.]]
+ [[Symplectic RKN McLachlan] [`symplectic_rkn_sb3a_m4_mclachlan`] [__stepper] [__symplectic_system __simple_symplectic_system] [4] [No] [No] [No] [Symplectic solver with 5 stages and order 4, can be used with arbitrary precision types.]]
+]

Added: trunk/libs/numeric/odeint/doc/tutorial.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,44 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Tutorial]
+
+
+[include tutorial_harmonic_oscillator.qbk]
+
+[include tutorial_solar_system.qbk]
+
+[include tutorial_chaotic_system.qbk]
+
+[include tutorial_stiff_systems.qbk]
+
+[include tutorial_special_topics.qbk]
+
+[include tutorial_thrust_cuda.qbk]
+
+[include tutorial_vexcl_opencl.qbk]
+
+
+[section All examples]
+
+The following table gives an overview over all examples.
+
+[include examples_table.qbk]
+
+[endsect]
+
+
+
+
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/tutorial_chaotic_system.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_chaotic_system.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,156 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Chaotic systems and Lyapunov exponents]
+
+[import ../examples/chaotic_system.cpp]
+
+In this example we present application of odeint to investigation of the properties of chaotic
+deterministic systems. In mathematical terms chaotic refers to an exponential
+growth of perturbations ['__delta x]. In order to observe this exponential growth one usually solves the equations for the tangential dynamics which is again an ordinary differential equation. These equations are linear but time dependent and can be obtained via
+
+['d __delta x / dt = J(x) __delta x]
+
+where ['J] is the Jacobian of the system under consideration. ['__delta x] can
+also be interpreted as a perturbation of the original system. In principle
+['n] of these perturbations exist, they form a hypercube and evolve in the
+time. The Lyapunov exponents are then defined as logarithmic growth rates of
+the perturbations. If one Lyapunov exponent is larger then zero the nearby
+trajectories diverge exponentially hence they are chaotic. If the largest
+Lyapunov exponent is zero one is usually faced with periodic motion. In the
+case of a largest Lyapunov exponent smaller then zero convergence to a
+fixed point is expected. More information's about Lyapunov exponents and nonlinear
+dynamical systems can be found in many textbooks, see for example: E. Ott "Chaos is
+Dynamical Systems", Cambridge.
+
+To calculate the Lyapunov exponents numerically one usually solves the equations of motion for ['n] perturbations and orthonormalizes them every ['k] steps. The Lyapunov exponent is the average of the logarithm of the stretching factor of each perturbation.
+
+To demonstrate how one can use odeint to determine the Lyapunov exponents we choose the Lorenz system. It is one of the most studied dynamical systems in the nonlinear dynamics community. For the standard parameters it possesses a strange attractor with non-integer dimension. The Lyapunov exponents take values of approximately 0.9, 0 and -12.
+
+The implementation of the Lorenz system is
+
+``
+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;
+
+void lorenz( const lorenz_state_type &x , lorenz_state_type &dxdt , double t )
+{
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+}
+``
+We need also to integrate the set of the perturbations. This is done in parallel to the original system, hence within one system function. Of course, we want to use the above definition of the Lorenz system, hence the definition of the system function including the Lorenz system itself and the perturbation could look like:
+
+``
+const size_t n = 3;
+const size_t num_of_lyap = 3;
+const size_t N = n + n*num_of_lyap;
+
+typedef std::tr1::array< double , N > state_type;
+typedef std::tr1::array< double , num_of_lyap > lyap_type;
+
+void lorenz_with_lyap( const state_type &x , state_type &dxdt , double t )
+{
+ lorenz( x , dxdt , t );
+
+ for( size_t l=0 ; l<num_of_lyap ; ++l )
+ {
+ const double *pert = x.begin() + 3 + l * 3;
+ double *dpert = dxdt.begin() + 3 + l * 3;
+ dpert[0] = - sigma * pert[0] + 10.0 * pert[1];
+ dpert[1] = ( R - x[2] ) * pert[0] - pert[1] - x[0] * pert[2];
+ dpert[2] = x[1] * pert[0] + x[0] * pert[1] - b * pert[2];
+ }
+}
+``
+
+The perturbations are stored linearly in the `state_type` behind the state of the Lorenz system.
+The problem of '''lorenz()''' and '''lorenz_with_lyap()''' having different state types may be solved putting the Lorenz system inside a functor with templatized arguments:
+
+``
+struct lorenz
+{
+ template< class StateIn , class StateOut , class Value >
+ void operator()( const StateIn &x , StateOut &dxdt , Value t )
+ {
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+void lorenz_with_lyap( const state_type &x , state_type &dxdt , double t )
+{
+ lorenz()( x , dxdt , t );
+ ...
+}
+
+``
+This works fine and `lorenz_with_lyap` can be used for example via
+``
+state_type x;
+// initialize x
+explicit_rk4< state_type > rk4;
+integrate_n_steps( rk4 , lorenz_with_lyap , x , 0.0 , 0.01 , 1000 );
+``
+This code snippet performs 1000 steps with constant step size 0.01.
+
+A real world use case for the calculation of the Lyapunov exponents of Lorenz system would always include some transient steps, just to ensure that the current state lies on the attractor, hence it would look like
+
+``
+state_type x;
+// initialize x
+explicit_rk4< state_type > rk4;
+integrate_n_steps( rk4 , lorenz , x , 0.0 , 0.01 , 1000 );
+``
+The problem is now, that `x` is the full state containing also the
+perturbations and `integrate_n_steps` does not know that it should only use 3
+elements. In detail, odeint and its steppers determine the length of the
+system under consideration by determining the length of the state. In the
+classical solvers, e.g. from Numerical Recipes, the problem was solved by
+pointer to the state and an appropriate length, something similar to
+
+``
+void lorenz( double* x , double *dxdt , double t, void* params )
+{
+ ...
+}
+
+int system_length = 3;
+rk4( x , system_length , t , dt , lorenz );
+``
+
+But odeint supports a similar and much more sophisticated concept: __boost_range. To make the steppers and the system ready to work with __boost_range the system has to by changed:
+
+[system_function_without_perturbations]
+
+This is in principle all. Now, we only have to call `integrate_n_steps` with a
+range including only the first 3 components of ['x]:
+
+[integrate_transients_with_range]
+
+Having integrated a sufficient number of transients steps we are now able to calculate the Lyapunov exponents:
+
+# Initialize the perturbations. They are stored linearly behind the state of the Lorenz system. The perturbations are initialized such that [' p [subl ij] = __delta [subl ij]], where ['p [subl ij]] is the ['j]-component of the ['i].-th perturbation and ['__delta [subl ij]] is the Kronecker symbol.
+# Integrate 100 steps of the full system with perturbations
+# Orthonormalize the perturbation using Gram-Schmidt orthonormalization algorithm.
+# Repeat step 2 and 3. Every 10000 steps write the current Lyapunov exponent.
+
+[lyapunov_full_code]
+
+The full code can be found here: [github_link libs/numeric/odeint/examples/chaotic_system.cpp chaotic_system.cpp]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,122 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Harmonic oscillator]
+
+[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.
+
+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:
+
+[rhs_function]
+
+The parameters of the function must follow the example above where `x` is the
+current state, here a two-component vector containing position ['q] and
+momentum ['p] of the oscillator, `dxdt` is the derivative ['x'] and should be
+filled by the function with ['f(x)], and `t` is the current time.
+Note that in this example ['t] is not required to calculate ['f], however
+odeint expects the function signature to have exactly three parameters (there
+are exception, discussed later).
+
+A more sophisticated approach is to implement the system as a class where the rhs function is defined as the ()-operator of the class with the same parameter structure as above:
+
+[rhs_class]
+
+odeint can deal with instances of such classes instead of pure functions which
+allows for cleaner code.
+
+[endsect]
+
+[section Stepper Types]
+
+Numerical integration works iteratively, that means you start at a state ['x(t)] and perform a time-step of length ['dt] to obtain the approximate state ['x(t+dt)]. There exist many different methods to perform such a time-step each of which has a certain order ['q]. If the order of a method is ['q] than it is accurate up to term ['~dt[super q]] that means the error in ['x] made by such a step is ['~dt[super q+1]]. odeint provides several steppers of different orders, see __odeint_stepper_table.
+
+Some of steppers in the table above are special: Some need the Jacobian of the ODE, others are constructed for special ODE-systems like Hamiltonian systems. We will show typical examples and use-cases in this tutorial and which kind of steppers should be applied.
+
+[endsect]
+
+[section Integration with Constant Step Size]
+
+The basic stepper just performs one time-step and doesn't give you any information about the error that was made (except that you know it is of order ['q+1]). Such steppers are used with constant step size that should be chosen small enough to have reasonable small errors. However, you should apply some sort of validity check of your results (like observing conserved quantities) because you have no other control of the error. The following example defines a basic stepper based on the classical Runge-Kutta scheme of 4th order. The declaration of the stepper requires the state type as template parameter. The integration can now be done by using the `integrate_const( Stepper, System, state, start_time, end_time, step_size )` function from odeint:
+
+[define_const_stepper]
+
+This call integrates the system defined by `harmonic_oscillator` using the RK4 method from ['t=0] to ['10] with a step-size ['dt=0.01] and the initial condition given in `x`. The result, ['x(t=10)] is stored in `x` (in-place). Each stepper defines a `do_step` method which can also be used directly. So, you write down the above example as
+
+[integrate_const_loop]
+
+[tip If you have a C++11 enabled compiler you can easily use lambdas to create the system function :
+
+[define_const_stepper_cpp11]
+
+]
+
+[endsect]
+
+[section Integration with Adaptive Step Size]
+
+To improve the numerical results and additionally minimize the computational
+effort, the application of a step size control is advisable. Step size control
+is realized via stepper algorithms that additionally provide an error
+estimation of the applied step. odeint provides a number of such
+*ErrorSteppers* and we will show their usage on the example of
+`explicit_error_rk54_ck` - a 5th order Runge-Kutta method with 4th order
+error estimation and coefficients introduced by Cash and Karp.
+
+[define_adapt_stepper]
+
+Given the error stepper, one still needs an instance that checks the error and adjusts the step size accordingly. In odeint, this is done by *ControlledSteppers*. For the `runge_kutta_cash_karp54` stepper a `controlled_runge_kutta` stepper exists which can be used via
+
+[integrate_adapt]
+
+As above, this integrates the system defined by `harmonic_oscillator`, but now using an adaptive step size method based on the Runge-Kutta Cash-Karp 54 scheme from ['t=0] to ['10] with an initial step size of ['dt=0.01] (will be adjusted) and the initial condition given in x. The result, ['x(t=10)], will also be stored in x (in-place).
+
+In the above example an error stepper is nested in a controlled stepper. This is a nice technique; however one drawback is that one always needs to define both steppers. One could also write the instantiation of the controlled stepper into the call of the integrate function but a complete knowledge of the underlying stepper types is still necessary. Another point is, that the error tolerances for the step size control are not easily included into the controlled stepper. Both issues can be solved by using `make_controlled`:
+
+[integrate_adapt_make_controlled]
+
+`make_controlled` can be used with many of the steppers of odeint. The first
+parameter is the absolute error tolerance ['eps_abs] and the second is the
+relative error tolerance ['eps_rel] which is used during the integration. The template parameter determines from which error stepper a controlled stepper should be instantiated. An alternative syntax of `make_controlled` is
+
+[integrate_adapt_make_controlled_alternative]
+
+For the Runge-Kutta controller the error made during one step is compared with ['eps_abs + eps_rel * ( a[sub x] * |x| + a[sub dxdt] * dt * |dxdt| )]. If the error is smaller than this value the current step is accepted, otherwise it is rejected and the step size is decreased. Note, that the step size is also increased if the error gets too small compared to the rhs of the above relation. The full instantiation of the `controlled_runge_kutta` with all parameters is therefore
+
+[integrate_adapt_full]
+
+When using `make_controlled` the parameter ['a[sub x]] and ['a[sub dxdt]] are used with their standard values of 1.
+
+In the tables below, one can find all steppers which are working with `make_controlled` and `make_dense_output` which is the analog for the dense output steppers.
+
+[include make_controlled_table.qbk]
+
+[include make_dense_output_table.qbk]
+
+When using `make_controlled` or `make_dense_output` one should be aware which exact type is used and how the step size control works.
+
+[endsect]
+
+[section Using iterators]
+
+odeint supports iterators for solving ODEs. That is you instantiate a pair of iterators and instead of using the integrate routines with an appropriate observer you put the iterators in one of the algorithm from the C++ standard library or from Boost.Range. An example is
+
+[harm_iterator_const_step]
+
+[endsect]
+
+The full source file for this example can be found here: [github_link libs/numeric/odeint/examples/harmonic_oscillator.cpp harmonic_oscillator.cpp]
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/tutorial_solar_system.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_solar_system.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,108 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Solar system]
+
+[section Gravitation and energy conservation]
+
+The next example in this tutorial is a simulation of the outer solar system, consisting of the sun, Jupiter, Saturn, Uranus, Neptune and Pluto.
+
+[$solar_system.jpg]
+
+Each planet and of course the sun will be represented by mass points. The interaction force between each object is the gravitational force which can be written as
+
+['F[subl ij] = -__gamma m[subl i] m[subl j] ( q[subl i] - q[subl j] ) / | q[subl i] - q[subl j] | [super 3]]
+
+where [' __gamma] is the gravitational constant, ['m[subl i]] and ['m[subl j]] are the masses and ['q[subl i]] and ['q[subl j]] are the locations of the two objects. The equations of motion are then
+
+['dq[subl i] / dt = p[subl i]]
+
+['dp[subl i] / dt = 1 / m[subl i] __Sigma[subl ji] F[subl ij]]
+
+where ['p[subl i]] is the momenta of object ['i]. The equations of motion can also be derived from the Hamiltonian
+
+['H = __Sigma[subl i] p[subl i][super 2] / ( 2 m[subl i] ) + __Sigma[subl j] V( q[subl i] , q[subl j] )]
+
+with the interaction potential ['V(q[subl i],q[subl j])]. The Hamiltonian equations give the
+equations of motion
+
+['dq[subl i] / dt = dH / dp[subl i]]
+
+['dp[subl i] / dt = -dH / dq[subl i]]
+
+In time independent Hamiltonian system the energy and the phase space volume
+are conserved and special integration methods have to be applied in order to
+ensure these conservation laws. The odeint library provides classes for
+separable Hamiltonian systems, which can be written in the form ['H = __Sigma
+p[subl i][super 2] / (2m[subl i]) + H[subl q](q)], where ['H[subl q](q)] only
+depends on the coordinates. Although this functional form might look a bit
+arbitrary, it covers nearly all classical mechanical systems with inertia and
+without dissipation, or where the equations of motion can be written in the
+form ['dq[subl i] / dt = p[subl i]] / m[subl i] , ['dp[subl i] / dt = f(
+q[subl i] )].
+
+[note A short physical note: While the two-body-problem is known to be
+integrable, that means it can be solved with purely analytic techniques,
+already the three-body-problem is not solvable. This was found in the end of the
+19th century by H. Poincare which led to the whole new subject of
+[@http://en.wikipedia.org/wiki/Chaos_theory Chaos Theory].]
+
+[endsect]
+
+
+[section Define the system function]
+
+To implement this system we define a 3D point type which will represent the space as well as the velocity. Therefore, we use the operators from __boost_operators:
+
+[import ../examples/point_type.hpp]
+[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`
+
+[import ../examples/solar_system.cpp]
+[container_type_definition]
+
+The `container_type` is different from the state type of the ODE. The state type of the ode is simply a `pair< container_type , container_type >` since it needs the information about the coordinates and the momenta.
+
+Next we define the system's equations.
+As we will use a stepper that accounts for the Hamiltonian (energy-preserving)
+character of the system, we have to define the rhs different from the usual
+case where it is just a single function.
+The stepper will make use of the separable character, which means the system
+will be defined by two objects representing ['f(p) = -dH/dq] and ['g(q) = dH/dp]:
+
+[coordinate_function]
+
+[momentum_function]
+
+In general a three body-system is chaotic, hence we can not expect that arbitrary initial conditions of the system will lead to a solution comparable with the solar system dynamics. That is we have to define proper initial conditions, which are taken from the book of Hairer, Wannier, Lubich __hairer_geom_ref.
+
+As mentioned above, we need to use some special integrators in order to
+conserve phase space volume. There is a well known family of such integrators,
+the so-called Runge-Kutta-Nystroem solvers, which we apply here in terms of a
+`symplectic_rkn_sb3a_mclachlan` stepper:
+
+[integration_solar_system]
+
+These integration routine was used to produce the above sketch of the solar system. Note, that there are two particularities in this example. First, the state of the symplectic stepper is not `container_type` but a pair of `container_type`. Hence, we must pass such a pair to the integrate function. Since, we want to pass them as references we can simply pack them into __boost_ref. The second point is the observer, which is called with a state type, hence a pair of `container_type`. The reference wrapper is also passed, but this is not a problem at all:
+
+[streaming_observer]
+
+[tip You can use C++11 lambda to create the observers]
+
+The full example can be found here: [github_link libs/numeric/odeint/examples/solar_system.cpp solar_system.cpp]
+
+[endsect]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/tutorial_special_topics.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_special_topics.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,258 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[/ [section Special topics] /]
+
+[section Complex state types]
+
+[import ../examples/stuart_landau.cpp]
+
+Thus far we have seen several examples defined for real values.
+odeint can handle complex state types, hence ODEs which are defined on complex
+vector spaces, as well. An example is the Stuart-Landau oscillator
+
+['d __Psi / dt = ( 1 + i __eta ) __Psi + ( 1 + i __alpha ) | __Psi |[super 2] __Psi ]
+
+where ['__Psi] and ['i] is a complex variable. The definition of this ODE in C++
+using complex< double > as a state type may look as follows
+
+[stuart_landau_system_function]
+
+One can also use a function instead of a functor to implement it
+
+[stuart_landau_system_function_alternative]
+
+We strongly recommend to use the first ansatz. In this case you have explicit control over the parameters of the system and are not restricted to use global variables to parametrize the oscillator.
+
+When choosing the stepper type one has to account for the "unusual" state type:
+it is a single `complex<double>` opposed to the vector types used in the
+previous examples. This means that no iterations over vector elements have to
+be performed inside the stepper algorithm. You can enforce this by supplying
+additional template arguments to the stepper including the
+`vector_space_algebra`. Details on the usage of algebras can be found in the
+section __adapt_state_types.
+
+[stuart_landau_integration]
+
+The full cpp file for the Stuart-Landau example can be found here [github_link
+libs/numeric/odeint/examples/stuart_landau.cpp stuart_landau.cpp]
+
+[note The fact that we have to configure a different algebra is solely due to
+the fact that we use a non-vector state type and not to the usage of complex
+values. So for, e.g. `vector< complex<double> >`, this would not be required.]
+
+[endsect]
+
+[section Lattice systems]
+
+[import ../examples/fpu.cpp]
+
+
+odeint can also be used to solve ordinary differential equations defined on lattices. A prominent example is the Fermi-Pasta-Ulam system __fpu_scholarpedia_ref. It is a Hamiltonian system of nonlinear coupled harmonic oscillators. The Hamiltonian is
+
+[' H = __Sigma[subl i] p[subl i][super 2]/2 + 1/2 ( q[subl i+1] - q[subl i] )^2 + __beta / 4 ( q[subl i+1] - q[subl i] )^4 ]
+
+Remarkably, the Fermi-Pasta-Ulam system was the first numerical experiment to be implemented on a computer. It was studied at Los Alamos in 1953 on one of the first computers (a MANIAC I) and it triggered a whole new tree of mathematical and physical science.
+
+Like the __tut_solar_system, the FPU is solved again by a symplectic solver, but in this case we can speed up the computation because the ['q] components trivially reduce to ['dq[subl i] / dt = p[subl i]]. odeint is capable of doing this performance improvement. All you have to do is to call the symplectic solver with an state function for the ['p] components. Here is how this function looks like
+
+[fpu_system_function]
+
+You can also use `boost::array< double , N >` for the state type.
+
+Now, you have to define your initial values and perform the integration:
+
+[fpu_integration]
+
+The observer uses a reference to the system object to calculate the local energies:
+
+[fpu_observer]
+
+The full cpp file for this FPU example can be found here [github_link libs/numeric/odeint/examples/fpu.cpp fpu.cpp]
+
+[endsect]
+
+[section Ensembles of oscillators]
+
+[import ../examples/phase_oscillator_ensemble.cpp]
+
+Another important high dimensional system of coupled ordinary differential equations is an ensemble of ['N] all-to-all coupled phase oscillators __synchronization_pikovsky_ref. It is defined as
+
+[' d__phi[subl k] / dt = __omega[subl k] + __epsilon / N __Sigma[subl j] sin( __phi[subl j] - __phi[subl k] )]
+
+The natural frequencies ['__omega[subl i]] of each oscillator follow some distribution and ['__epsilon] is the coupling strength. We choose here a Lorentzian distribution for ['__omega[subl i]]. Interestingly a phase transition can be observed if the coupling strength exceeds a critical value. Above this value synchronization sets in and some of the oscillators oscillate with the same frequency despite their different natural frequencies. The transition is also called Kuramoto transition. Its behavior can be analyzed by employing the mean field of the phase
+
+['Z = K e[super i __Theta] = 1 / N __Sigma[subl k]e[super i __phi[subl k]]]
+
+The definition of the system function is now a bit more complex since we also need to store the individual frequencies of each oscillator.
+
+[phase_oscillator_ensemble_system_function]
+
+Note, that we have used ['Z] to simplify the equations of motion. Next, we create an observer which computes the value of ['Z] and we record ['Z] for different values of ['__epsilon].
+
+[phase_oscillator_ensemble_observer]
+
+Now, we do several integrations for different values of ['__epsilon] and record ['Z]. The result nicely confirms the analytical result of the phase transition, i.e. in our example the standard deviation of the Lorentzian is 1 such that the transition will be observed at ['__epsilon = 2].
+
+[phase_oscillator_ensemble_integration]
+
+The full cpp file for this example can be found here [github_link libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp phase_oscillator_ensemble.cpp]
+
+[endsect]
+
+[section Using boost::units]
+
+[import ../examples/harmonic_oscillator_units.cpp]
+
+odeint also works well with __boost_units - a library for compile time unit
+and dimension analysis. It works by decoding unit information into the types
+of values. For a one-dimensional unit you can just use the Boost.Unit types as
+state type, deriv type and time type and hand the `vector_space_algebra` to
+the stepper definition and everything works just fine:
+
+```
+typedef units::quantity< si::time , double > time_type;
+typedef units::quantity< si::length , double > length_type;
+typedef units::quantity< si::velocity , double > velocity_type;
+
+typedef runge_kutta4< length_type , double , velocity_type , time_type ,
+ vector_space_algebra > stepper_type;
+```
+
+If you want to solve more-dimensional problems the individual entries
+typically have different units. That means that the `state_type` is now
+possibly heterogeneous, meaning that every entry might have a different type.
+To solve this problem, compile-time sequences from __boost_fusion can be used.
+
+To illustrate how odeint works with __boost_units we use the harmonic oscillator as primary example. We start with defining all quantities
+
+[units_define_basic_quantities]
+
+Note, that the `state_type` and the `deriv_type` are now a compile-time fusion
+sequences. `deriv_type` represents ['x'] and is now different from the state
+type as it has different unit definitions. Next, we define the ordinary
+differential equation which is completely equivalent to the example in __tut_harmonic_oscillator:
+
+[units_define_ode]
+
+Next, we instantiate an appropriate stepper. We must explicitly parametrize
+the stepper with the `state_type`, `deriv_type`, `time_type`. Furthermore, the
+iteration over vector elements is now done by the `fusion_algebra` which must
+also be given. For more on the state types / algebras see chapter __adapt_state_types.
+
+[units_define_stepper]
+
+It is quite easy but the compilation time might take very long. Furthermore, the observer is defined a bit different
+
+[units_observer]
+
+[caution Using __boost_units works nicely but compilation can be very time and
+memory consuming. For example the unit test for the usage of __boost_units in odeint take up to 4 GB
+of memory at compilation.]
+
+The full cpp file for this example can be found here [github_link libs/numeric/odeint/examples/harmonic_oscillator_units.cpp harmonic_oscillator_units.cpp].
+
+[endsect]
+
+[section Using matrices as state types]
+
+[import ../examples/two_dimensional_phase_lattice.cpp]
+
+odeint works well with a variety of different state types. It is not restricted to pure vector-wise types, like `vector< double >`, `array< double , N >`, `fusion::vector< double , double >`, etc. but also works with types having a different topology then simple vectors. Here, we show how odeint can be used with matrices as states type, in the next section we will show how can be used to solve ODEs defined on complex networks.
+
+By default, odeint can be used with `ublas::matrix< T >` as state type for matrices. A simple example is a two-dimensional lattice of coupled phase oscillators. Other matrix types like `mtl::dense_matrix` or blitz arrays and matrices can used as well but need some kind of activation in order to work with odeint. This activation is described in following sections,
+
+The definition of the system is
+
+[two_dimensional_phase_lattice_definition]
+
+In principle this is all. Please note, that the above code is far from being optimal. Better performance can be achieved if every interaction is only calculated once and iterators for columns and rows are used. Below are some visualizations of the evolution of this lattice equation.
+
+[$phase_lattice_2d_0000.jpg] [$phase_lattice_2d_0100.jpg] [$phase_lattice_2d_1000.jpg]
+
+The full cpp for this example can be found here [github_link libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp two_dimensional_phase_lattice.cpp].
+
+[endsect]
+
+[/
+[section Partial differential equations]
+To be continued:
+*Wave equation
+*KdV
+*Ginzburg-Landau
+[endsect]
+[section Ordinary differential equations on networks]
+to be continued
+[endsect]
+]
+
+[section Using arbitrary precision floating point types]
+
+[import ../examples/gmpxx/lorenz_gmpxx.cpp]
+
+Besides the classical floating point number like `float`, `double`, `complex< double >` you can also use arbitrary precision types, like the types from [@http://gmplib.org/ gmp] and [@http://www.mpfr.org/ mpfr]. But you have to be careful about instantiating any numbers.
+
+For gmp types you have to set the default precision before any number is instantiated. This can be done by calling `mpf_set_default_prec( precision )` as the first function in your main program. Secondly, you can not use any global constant variables since they will not be set with the default precision you have already set.
+
+Here is a simple example:
+
+[gmpxx_lorenz]
+
+which can be integrated:
+
+[gmpxx_integration]
+
+[caution The full support of arbitrary precision types depends on the functionality they provide. For example, the types from gmp are lacking of functions for calculating the power and arbitrary roots, hence they can not be used with the controlled steppers. In detail, for full support the `min( x , y )`, `max( x , y )`, `pow( x , y )` must be callable.]
+
+The full example can be found at [github_link libs/numeric/odeint/examples/lorenz_gmpxx.cpp lorenz_gmpxx.cpp].
+
+
+[endsect]
+
+[section Self expanding lattices]
+
+[import ../examples/resizing_lattice.cpp]
+
+odeint supports changes of the state size during integration if a state_type
+is used which can be resized, like `std::vector`.
+The adjustment of the state's size has to be done from outside and the stepper
+has to be instantiated with `always_resizer` as the template argument for the
+`resizer_type`.
+In this configuration, the stepper checks for changes in the state size and
+adjust it's internal storage accordingly.
+
+We show this for a Hamiltonian system of nonlinear, disordered oscillators with nonlinear nearest neighbor coupling.
+
+The system function is implemented in terms of a class that also provides functions for calculating the energy.
+Note, that this class stores the random potential internally which is not resized, but rather a start index is kept which should be changed whenever the states' size change.
+
+[resizing_lattice_system_class]
+
+The total size we allow is 1024 and we start with an initial state size of 60.
+
+[resizing_lattice_initialize]
+
+The lattice gets resized whenever the energy distribution comes close to the borders `distr[10] > 1E-150`, `distr[distr.size()-10] > 1E-150`.
+If we increase to the left, `q` and `p` have to be rotated because their resize function always appends at the end.
+Additionally, the start index of the potential changes in this case.
+
+[resizing_lattice_steps_loop]
+
+The `do_resize` function simply calls `vector.resize` of `q` , `p` and `distr`.
+
+[resizing_lattice_resize_function]
+
+The full example can be found in [github_link libs/numeric/odeint/examples/resizing_lattice.cpp resizing_lattice.cpp]
+
+[endsect]
+
+[/ [endsect] /]

Added: trunk/libs/numeric/odeint/doc/tutorial_stiff_systems.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_stiff_systems.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,61 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+
+[section Stiff systems]
+
+[import ../examples/stiff_system.cpp]
+
+An important class of ordinary differential equations are so called stiff
+system which are characterized by two or more time scales of different
+order. Examples of such systems are found in chemical systems where reaction
+rates of individual sub-reaction might differ over large ranges, for example:
+
+['d S[subl 1] / dt = - 101 S[subl 2] - 100 S[subl 1]]
+
+['d S[subl 2] / dt = S[subl 1]]
+
+
+In order to efficiently solve stiff systems numerically the Jacobian
+
+['J = d f[subl i] / d x[subl j]]
+
+is needed. Here is the definition of the above example
+
+[stiff_system_definition]
+
+The state type has to be a `ublas::vector` and the matrix type must by a
+`ublas::matrix` since the stiff integrator only accepts these types.
+However, you might want use non-stiff intgrators on this system, too - we will
+do so later for demonstration. Therefore we want to use the same function also
+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
+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:
+
+[integrate_stiff_system]
+
+During the integration 71 steps have been done. Comparing to a classical Runge-Kutta solver this is a very good result. For example the Dormand-Prince 5 method with step size control and dense output yields 1531 steps.
+
+[integrate_stiff_system_alternative]
+
+Note, that we have used __boost_phoenix, a great functional programming library, to create and compose the observer.
+
+The full example can be found here: [github_link libs/numeric/odeint/examples/stiff_system.cpp stiff_system.cpp]
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/tutorial_thrust_cuda.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_thrust_cuda.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,165 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Using CUDA (or OpenMP, TBB, ...) via Thrust]
+
+Modern graphic cards (graphic processing units - GPUs) can be used to speed up
+the performance of time consuming algorithms by means of massive
+parallelization. They are designed to execute many operations in
+parallel. odeint can utilize the power of GPUs by means of CUDA and __thrust,
+which is a STL-like interface for the native CUDA API.
+
+[important Thrust also supports parallelization using OpenMP and Intel Threading Building Blocks (TBB). You can switch
+between CUDA, OpenMP and TBB parallelizations by a simple compiler
+switch. Hence, this also provides an easy way to get basic OpenMP
+parallelization into odeint. The examples discussed below are focued on GPU parallelization, though. ]
+
+To use odeint with CUDA a few points have to be taken into account. First of all, the problem has to be well chosen. It makes absolutely no sense to try to parallelize the code for a three dimensional system, it is simply too small and not worth the effort. One single function call (kernel execution) on the GPU is slow but you can do the operation on a huge set of data with only one call. We have experienced that the vector size over which is parallelized should be of the order of ['10[super 6]] to make full use of the GPU. Secondly, you have to use __thrust's algorithms and functors when implementing the rhs the ODE. This might be tricky since it involves some kind of functional programming knowledge.
+
+Typical applications for CUDA and odeint are large systems, like lattices or discretizations of PDE, and parameter studies. We introduce now three examples which show how the power of GPUs can be used in combination with odeint.
+
+[important The full power of CUDA is only available for really large systems where the number of coupled ordinary differential equations is of order ['N=10[super 6]] or larger. For smaller systems the CPU is usually much faster. You can also integrate an ensemble of different uncoupled ODEs in parallel as shown in the last example.]
+
+[section Phase oscillator ensemble]
+
+[import ../examples/thrust/phase_oscillator_ensemble.cu]
+
+The first example is the phase oscillator ensemble from the previous
+section:
+
+[' d__phi[subl k] / dt = __omega[subl k] + __epsilon / N __Sigma[subl j] sin( __phi[subl j] - __phi[subl k] ).]
+
+It has a phase transition at ['__epsilon = 2] in the limit of
+infinite numbers of oscillators ['N]. In the case of finite ['N] this
+transition is smeared out but still clearly visible.
+
+__thrust and CUDA are perfectly suited for such kinds of problems where one needs a large number of particles (oscillators). We start by defining the state type which is a `thrust::device_vector`. The content of this vector lives on the GPU. If you are not familiar with this we recommend reading the ['Getting started] section on the __thrust website.
+
+[thrust_phase_ensemble_state_type]
+
+Thrust follows a functional programming approach. If you want to perform a calculation on the GPU you usually have to call a global function like `thrust::for_each`, `thrust::reduce`, ... with an appropriate local functor which performs the basic operation. An example is
+``
+struct add_two
+{
+ template< class T >
+ __host__ __device__
+ void operator()( T &t ) const
+ {
+ t += T( 2 );
+ }
+};
+
+// ...
+
+thrust::for_each( x.begin() , x.end() , add_two() );
+``
+This code generically adds two to every element in the container `x`.
+
+For the purpose of integrating the phase oscillator ensemble we need
+
+* to calculate the system function, hence the r.h.s. of the ODE.
+* this involves computing the mean field of the oscillator example, i.e. the values of ['R] and ['__theta]
+
+The mean field is calculated in a class `mean_field_calculator`
+
+[thrust_phase_ensemble_mean_field_calculator]
+
+Inside this class two member structures `sin_functor` and `cos_functor` are defined. They compute the sine and the cosine of a value and they are used within a transform iterator to calculate the sum of ['sin(__phi[subl k])] and ['cos(__phi[subl k])]. The classifiers `__host__` and `__device__` are CUDA specific and define a function or operator which can be executed on the GPU as well as on the CPU. The line
+
+[thrust_phase_ensemble_sin_sum]
+
+performs the calculation of this sine-sum on the GPU (or on the CPU, depending on your thrust configuration).
+
+The system function is defined via
+
+[thrust_phase_ensemble_sys_function]
+
+This class is used within the `do_step` and `integrate` method. It defines a member structure `sys_functor` for the r.h.s. of each individual oscillator and the `operator()` for the use in the steppers and integrators of odeint. The functor computes first the mean field of ['__phi[subl k]] and secondly calculates the whole r.h.s. of the ODE using this mean field. Note, how nicely `thrust::tuple` and `thrust::zip_iterator` play together.
+
+Now, we are ready to put everything together. All we have to do for making odeint ready for using the GPU is to parametrize the stepper with the appropriate thrust algebra/operations:
+
+[thrust_phase_ensemble_define_rk4]
+
+You can also use a controlled or dense output stepper, e.g.
+
+[thrust_phase_ensemble_define_dopri5]
+
+Then, it is straightforward to integrate the phase ensemble by creating an instance of the rhs class and using an integration function:
+
+[thrust_phase_ensemble_system_instance]
+[thrust_phase_ensemble_integration]
+
+We have to use `boost::ref` here in order to pass the rhs class as reference and not by value. This ensures that the natural frequencies of each oscillator are not copied when calling `integrate_const`. In the full example the performance and results of the Runge-Kutta-4 and the Dopri5 solver are compared.
+
+The full example can be found at [github_link libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu phase_oscillator_example.cu].
+
+[endsect]
+
+[section Large oscillator chains]
+
+[import ../examples/thrust/phase_oscillator_chain.cu]
+
+The next example is a large, one-dimensional chain of nearest-neighbor coupled phase oscillators with the following equations of motion:
+
+['d __phi[subl k] / dt = __omega[subl k] + sin( __phi[subl k+1] - __phi[subl k] ) + sin( __phi[subl k] - __phi[subl k-1])]
+
+In principle we can use all the techniques from the previous phase oscillator ensemble example, but we have to take special care about the coupling of the oscillators. To efficiently implement the coupling you can use a very elegant way employing Thrust's permutation iterator. A permutation iterator behaves like a normal iterator on a vector but it does not iterate along the usual order of the elements.
+It rather iterates along some permutation of the elements defined by some index map. To realize the nearest neighbor coupling we create one permutation iterator which travels one step behind a usual iterator and another permutation iterator which travels one step in front. The full system class is:
+
+[thrust_phase_chain_system]
+
+Note, how easy you can obtain the value for the left and right neighboring oscillator in the system functor using the permutation iterators. But, the call of the `thrust::for_each` function looks relatively complicated. Every term of the r.h.s. of the ODE is resembled by one iterator packed in exactly the same way as it is unpacked in the functor above.
+
+Now we put everything together. We create random initial conditions and decreasing frequencies such that we should get synchronization. We copy the frequencies and the initial conditions onto the device and finally initialize and perform the integration. As result we simply write out the current state, hence the phase of each oscillator.
+
+[thrust_phase_chain_integration]
+
+The full example can be found at [github_link libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu phase_oscillator_chain.cu].
+
+[endsect]
+
+[section Parameter studies]
+
+[import ../examples/thrust/lorenz_parameters.cu]
+
+Another important use case for __thrust and CUDA are parameter studies of relatively small systems. Consider for example the three-dimensional Lorenz system from the chaotic systems example in the previous section which has three parameters. If you want to study the behavior of this system for different parameters you usually have to integrate the system for many parameter values. Using thrust and odeint you can do this integration in parallel, hence you integrate a whole ensemble of Lorenz systems where each individual realization has a different parameter value.
+[/ The Lorenz system is dissipative, such that you can assume that different initial conditions will lead to the same attractor so . For Hamiltonian systems this is not the case. Here it might be interesting to study a range of initial conditions to quantify different regions in the phase space.]
+
+In the following we will show how you can use __thrust to integrate the above mentioned ensemble of Lorenz systems. We will vary only the parameter ['__beta] but it is straightforward to vary other parameters or even two or all three parameters. Furthermore, we will use the largest Lyapunov exponent to quantify the behavior of the system (chaoticity).
+
+We start by defining the range of the parameters we want to study. The state_type is again a `thrust::device_vector< value_type >`.
+
+[thrust_lorenz_parameters_define_beta]
+
+The next thing we have to implement is the Lorenz system without perturbations. Later, a system with perturbations is also implemented in order to calculate the Lyapunov exponent. We will use an ansatz where each device function calculates one particular realization of the Lorenz ensemble
+
+[thrust_lorenz_parameters_define_simple_system]
+
+As `state_type` a `thrust::device_vector` or a __boost_range of a `device_vector` is used. The length of the state is ['3N] where ['N] is the number of systems. The system is encoded into this vector such that all ['x] components come first, then every ['y] components and finally every ['z] components. Implementing the device function is then a simple task, you only have to decompose the tuple originating from the zip iterators.
+
+Besides the system without perturbations we furthermore need to calculate the system including linearized equations governing the time evolution of small perturbations. Using the method from above this is straightforward, with a small difficulty that Thrust's tuples have a maximal arity of 10. But this is only a small problem since we can create a zip iterator packed with zip iterators. So the top level zip iterator contains one zip iterator for the state, one normal iterator for the parameter, and one zip iterator for the derivative. Accessing the elements of this tuple in the system function is then straightforward, you unpack the tuple with `thrust::get<>()`. We will not show the code here, it is to large. It can be found [github_link libs/numeric/odeint/examples/thrust/lorenz_parameters.cu here] and is easy to understand.
+
+Furthermore, we need an observer which determines the norm of the perturbations, normalizes them and averages the logarithm of the norm. The device functor which is used within this observer is defined
+
+[thrust_lorenz_parameters_observer_functor]
+
+Note, that this functor manipulates the state, i.e. the perturbations.
+
+Now we complete the whole code to calculate the Lyapunov exponents. First, we have to define a state vector. This vector contains ['6N] entries, the state ['x,y,z] and its perturbations ['dx,dy,dz]. We initialize them such that ['x=y=z=10], ['dx=1], and ['dy=dz=0]. We define a stepper type, a controlled Runge-Kutta Dormand-Prince 5 stepper. We start with some integration to overcome the transient behavior. For this, we do not involve the perturbation and run the algorithm only on the state ['x,y,z] without any observer. Note, how __boost_range is used for partial integration of the state vector without perturbations (the first half of the whole state). After the transient, the full system with perturbations is integrated and the Lyapunov exponents are calculated and written to `stdout`.
+
+[thrust_lorenz_parameters_integration]
+
+The full example can be found at [github_link libs/numeric/odeint/examples/thrust/lorenz_parameters.cu lorenz_parameters.cu].
+
+[endsect]
+
+[endsect]

Added: trunk/libs/numeric/odeint/doc/tutorial_vexcl_opencl.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/doc/tutorial_vexcl_opencl.qbk 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,46 @@
+[/============================================================================
+ Boost.odeint
+
+ Copyright (c) 2009-2012 Karsten Ahnert
+ Copyright (c) 2009-2012 Mario Mulansky
+
+ Use, modification and distribution is 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)
+=============================================================================/]
+
+
+[section Using OpenCL via VexCL]
+
+[import ../examples/vexcl/lorenz_ensemble.cpp]
+
+In the previous section the usage of odeint in combination with __thrust was shown. In this section we show how one can use OpenCL with odeint. The point of odeint is not to implement its own low-level data structures and algorithms, but to use high level libraries doing this task. Here, we will use the __vexcl framework to use OpenCL. __vexcl is a nice library for general computations and it uses heavily expression templates. With the help of __vexcl it is possible to write very compact and expressive application.
+
+[note vexcl needs C++11 features! So you have to compile with C++11 support enabled.]
+
+To use __vexcl one needs to include one additional header which includes the data-types and algorithms from vexcl and the adaption to odeint. Adaption to odeint means here only to adapt the resizing functionality of __vexcl to odeint.
+
+[vexcl_includes]
+
+To demonstrate the use of __vexcl we integrate an ensemble of Lorenz system. The example is very similar to the parameter study of the Lorenz system in the previous section except that we do not compute the Lyapunov exponents. Again, we vary the parameter R of the Lorenz system an solve a whole ensemble of Lorenz systems in parallel (each with a different parameter R). First, we define the state type and a vector type
+
+[vexcl_state_types ]
+
+The `vector_type` is used to represent the parameter R. The `state_type` is a multi-vector of three sub vectors and is used to represent. The first component of this multi-vector represent all `x` components of the Lorenz system, while the second all `y` components and the third all `z` components. The components of this vector can be obtained via
+
+``
+auto &x = X(0);
+auto &y = X(1);
+auto &z = X(2);
+``
+
+As already mentioned __vexcl supports expression templates and we will use them to implement the system function for the Lorenz ensemble:
+
+[vexcl_system]
+
+It's very easy, isn't it? These three little lines do all the computations for you. There is no need to write your own OpenCL kernels. __vexcl does everything for you. Next we have to write the main application. We initialize the vector of parameters (R) and the initial state. Since __vexcl supports odeint we can already use the `vector_space_algebra` in combination with the `default_operations` for the stepper and we are done:
+
+[vexcl_main]
+
+
+[endsect]

Added: trunk/libs/numeric/odeint/examples/2d_lattice/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/2d_lattice/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,12 @@
+# Copyright 2011 Karsten Ahnert and 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)
+
+project
+ : requirements
+ <include>../../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ ;
+
+exe spreading : spreading.cpp ;
\ No newline at end of file

Added: trunk/libs/numeric/odeint/examples/2d_lattice/lattice2d.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/2d_lattice/lattice2d.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,165 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+/* stronlgy nonlinear hamiltonian lattice in 2d */
+
+#ifndef LATTICE2D_HPP
+#define LATTICE2D_HPP
+
+#include <vector>
+
+#include <boost/math/special_functions/pow.hpp>
+
+using boost::math::pow;
+
+template< int Kappa , int Lambda >
+struct lattice2d {
+
+ const double m_beta;
+ std::vector< std::vector< double > > m_omega;
+
+ lattice2d( const double beta )
+ : m_beta( beta )
+ { }
+
+ template< class StateIn , class StateOut >
+ void operator()( const StateIn &q , StateOut &dpdt )
+ {
+ // q and dpdt are 2d
+ const int N = q.size();
+
+ int i;
+ for( i = 0 ; i < N ; ++i )
+ {
+ const int i_l = (i-1+N) % N;
+ const int i_r = (i+1) % N;
+ for( int j = 0 ; j < N ; ++j )
+ {
+ const int j_l = (j-1+N) % N;
+ const int j_r = (j+1) % N;
+ dpdt[i][j] = - m_omega[i][j] * pow<Kappa-1>( q[i][j] )
+ - m_beta * pow<Lambda-1>( q[i][j] - q[i][j_l] )
+ - m_beta * pow<Lambda-1>( q[i][j] - q[i][j_r] )
+ - m_beta * pow<Lambda-1>( q[i][j] - q[i_l][j] )
+ - m_beta * pow<Lambda-1>( q[i][j] - q[i_r][j] );
+ }
+ }
+ }
+
+ template< class StateIn >
+ double energy( const StateIn &q , const StateIn &p )
+ {
+ // q and dpdt are 2d
+ const int N = q.size();
+ double energy = 0.0;
+ int i;
+ for( i = 0 ; i < N ; ++i )
+ {
+ const int i_l = (i-1+N) % N;
+ const int i_r = (i+1) % N;
+ for( int j = 0 ; j < N ; ++j )
+ {
+ const int j_l = (j-1+N) % N;
+ const int j_r = (j+1) % N;
+ energy += p[i][j]*p[i][j] / 2.0
+ + m_omega[i][j] * pow<Kappa>( q[i][j] ) / Kappa
+ + m_beta * pow<Lambda>( q[i][j] - q[i][j_l] ) / Lambda / 2
+ + m_beta * pow<Lambda>( q[i][j] - q[i][j_r] ) / Lambda / 2
+ + m_beta * pow<Lambda>( q[i][j] - q[i_l][j] ) / Lambda / 2
+ + m_beta * pow<Lambda>( q[i][j] - q[i_r][j] ) / Lambda / 2;
+ }
+ }
+ return energy;
+ }
+
+
+ template< class StateIn , class StateOut >
+ double local_energy( const StateIn &q , const StateIn &p , StateOut &energy )
+ {
+ // q and dpdt are 2d
+ const int N = q.size();
+ double e = 0.0;
+ int i;
+ for( i = 0 ; i < N ; ++i )
+ {
+ const int i_l = (i-1+N) % N;
+ const int i_r = (i+1) % N;
+ for( int j = 0 ; j < N ; ++j )
+ {
+ const int j_l = (j-1+N) % N;
+ const int j_r = (j+1) % N;
+ energy[i][j] = p[i][j]*p[i][j] / 2.0
+ + m_omega[i][j] * pow<Kappa>( q[i][j] ) / Kappa
+ + m_beta * pow<Lambda>( q[i][j] - q[i][j_l] ) / Lambda / 2
+ + m_beta * pow<Lambda>( q[i][j] - q[i][j_r] ) / Lambda / 2
+ + m_beta * pow<Lambda>( q[i][j] - q[i_l][j] ) / Lambda / 2
+ + m_beta * pow<Lambda>( q[i][j] - q[i_r][j] ) / Lambda / 2;
+ e += energy[i][j];
+ }
+ }
+ //rescale
+ e = 1.0/e;
+ for( i = 0 ; i < N ; ++i )
+ for( int j = 0 ; j < N ; ++j )
+ energy[i][j] *= e;
+ return 1.0/e;
+ }
+
+ void load_pot( const char* filename , const double W , const double gap ,
+ const size_t dim )
+ {
+ std::ifstream in( filename , std::ios::in | std::ios::binary );
+ if( !in.is_open() ) {
+ std::cerr << "pot file not found: " << filename << std::endl;
+ exit(0);
+ } else {
+ std::cout << "using pot file: " << filename << std::endl;
+ }
+
+ m_omega.resize( dim );
+ for( int i = 0 ; i < dim ; ++i )
+ {
+ m_omega[i].resize( dim );
+ for( size_t j = 0 ; j < dim ; ++j )
+ {
+ if( !in.good() )
+ {
+ std::cerr << "I/O Error: " << filename << std::endl;
+ exit(0);
+ }
+ double d;
+ in.read( (char*) &d , sizeof(d) );
+ if( (d < 0) || (d > 1.0) )
+ {
+ std::cerr << "ERROR: " << d << std::endl;
+ exit(0);
+ }
+ m_omega[i][j] = W*d + gap;
+ }
+ }
+
+ }
+
+ void generate_pot( const double W , const double gap , const size_t dim )
+ {
+ m_omega.resize( dim );
+ for( size_t i = 0 ; i < dim ; ++i )
+ {
+ m_omega[i].resize( dim );
+ for( size_t j = 0 ; j < dim ; ++j )
+ {
+ m_omega[i][j] = W*static_cast<double>(rand())/RAND_MAX + gap;
+ }
+ }
+ }
+
+};
+
+#endif

Added: trunk/libs/numeric/odeint/examples/2d_lattice/nested_range_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/2d_lattice/nested_range_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,46 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+/* nested range algebra */
+
+#ifndef NESTED_RANGE_ALGEBRA
+#define NESTED_RANGE_ALGEBRA
+
+namespace detail {
+
+ template< class Iterator1 , class Iterator2 , class Iterator3 , class Operation , class Algebra >
+ void for_each3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Operation op , Algebra &algebra )
+{
+ for( ; first1 != last1 ; )
+ algebra.for_each3( *first1++ , *first2++ , *first3++ , op );
+}
+}
+
+
+template< class InnerAlgebra >
+struct nested_range_algebra
+{
+
+ nested_range_algebra()
+ : m_inner_algebra()
+ { }
+
+ template< class S1 , class S2 , class S3 , class Op >
+ void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
+ {
+ detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op , m_inner_algebra );
+ }
+
+
+private:
+ InnerAlgebra m_inner_algebra;
+};
+
+#endif

Added: trunk/libs/numeric/odeint/examples/2d_lattice/spreading.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/2d_lattice/spreading.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,122 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+/*
+ * Example of a 2D simulation of nonlinearly coupled oscillators.
+ * Program just prints final energy which should be close to the initial energy (1.0).
+ * No parallelization is employed here.
+ * Run time on a 2.3GHz Intel Core-i5: about 10 seconds for 100 steps.
+ * Compile simply via bjam or directly:
+ * g++ -O3 -I${BOOST_ROOT} -I../../../../.. spreading.cpp
+ */
+
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <cstdlib>
+#include <sys/time.h>
+
+#include <boost/ref.hpp>
+#include <boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp>
+
+// we use a vector< vector< double > > as state type,
+// for that some functionality has to be added for odeint to work
+#include "nested_range_algebra.hpp"
+#include "vector_vector_resize.hpp"
+
+// defines the rhs of our dynamical equation
+#include "lattice2d.hpp"
+/* dynamical equations (Hamiltonian structure):
+dqdt_{i,j} = p_{i,j}
+dpdt_{i,j} = - omega_{i,j}*q_{i,j} - \beta*[ (q_{i,j} - q_{i,j-1})^3
+ +(q_{i,j} - q_{i,j+1})^3
+ +(q_{i,j} - q_{i-1,j})^3
+ +(q_{i,j} - q_{i+1,j})^3 ]
+*/
+
+
+using namespace std;
+
+static const int MAX_N = 1024;//2048;
+
+static const size_t KAPPA = 2;
+static const size_t LAMBDA = 4;
+static const double W = 1.0;
+static const double gap = 0.0;
+static const size_t steps = 100;
+static const double dt = 0.1;
+
+double initial_e = 1.0;
+double beta = 1.0;
+int realization_index = 0;
+
+//the state type
+typedef vector< vector< double > > state_type;
+
+//the stepper, choose a symplectic one to account for hamiltonian structure
+//use nested_range_algebra for calculations on vector< vector< ... > >
+typedef boost::numeric::odeint::symplectic_rkn_sb3a_mclachlan<
+ state_type , state_type , double , state_type , state_type , double ,
+ nested_range_algebra< boost::numeric::odeint::range_algebra > ,
+ boost::numeric::odeint::default_operations > stepper_type;
+
+double time_diff_in_ms( timeval &t1 , timeval &t2 )
+{ return (t2.tv_sec - t1.tv_sec)*1000.0 + (t2.tv_usec - t1.tv_usec)/1000.0 + 0.5; }
+
+
+int main( int argc, const char* argv[] ) {
+
+ srand( time(NULL) );
+
+ lattice2d< KAPPA , LAMBDA > lattice( beta );
+
+
+ lattice.generate_pot( W , gap , MAX_N );
+
+ state_type q( MAX_N , vector< double >( MAX_N , 0.0 ) );
+
+ state_type p( q );
+
+ state_type energy( q );
+
+ p[MAX_N/2][MAX_N/2] = sqrt( 0.5*initial_e );
+ p[MAX_N/2+1][MAX_N/2] = sqrt( 0.5*initial_e );
+ p[MAX_N/2][MAX_N/2+1] = sqrt( 0.5*initial_e );
+ p[MAX_N/2+1][MAX_N/2+1] = sqrt( 0.5*initial_e );
+
+ cout.precision(10);
+
+ lattice.local_energy( q , p , energy );
+ double e=0.0;
+ for( size_t i=0 ; i<energy.size() ; ++i )
+ for( size_t j=0 ; j<energy[i].size() ; ++j )
+ {
+ e += energy[i][j];
+ }
+
+ cout << "initial energy: " << lattice.energy( q , p ) << endl;
+
+ timeval elapsed_time_start , elapsed_time_end;
+ gettimeofday(&elapsed_time_start , NULL);
+
+ stepper_type stepper;
+
+ for( size_t step=0 ; step<=steps ; ++step )
+ {
+ stepper.do_step( boost::ref( lattice ) ,
+ make_pair( boost::ref( q ) , boost::ref( p ) ) ,
+ 0.0 , 0.1 );
+ }
+
+ gettimeofday(&elapsed_time_end , NULL);
+ double elapsed_time = time_diff_in_ms( elapsed_time_start , elapsed_time_end );
+ cout << steps << " steps in " << elapsed_time/1000 << " s (energy: " << lattice.energy( q , p ) << ")" << endl;
+}

Added: trunk/libs/numeric/odeint/examples/2d_lattice/vector_vector_resize.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/2d_lattice/vector_vector_resize.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,105 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+/* reserved vector */
+
+#ifndef VECTOR_VECTOR_RESIZE_HPP
+#define VECTOR_VECTOR_RESIZE_HPP
+
+#include <vector>
+
+#include <boost/range.hpp>
+
+namespace boost { namespace numeric { namespace odeint {
+
+template<>
+struct is_resizeable< std::vector< std::vector< double > > >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+template<>
+struct same_size_impl< std::vector< std::vector< double > > , std::vector< std::vector< double > > >
+{
+ typedef std::vector< std::vector< double > > state_type;
+
+ static bool same_size( const state_type &x1 ,
+ const state_type &x2 )
+ {
+ bool same = ( boost::size( x1 ) == boost::size( x2 ) );
+ if( !same )
+ return false;
+ typename state_type::const_iterator begin1 = boost::begin( x1 );
+ typename state_type::const_iterator begin2 = boost::begin( x2 );
+ while( begin1 != boost::end( x1 ) )
+ same &= ( boost::size( *begin1++ ) == boost::size( *begin2++ ) );
+ return same;
+ }
+};
+
+template<>
+struct resize_impl< std::vector< std::vector< double > > , std::vector< std::vector< double > > >
+{
+ typedef std::vector< std::vector< double > > state_type;
+
+ static void resize( state_type &x1 , const state_type &x2 )
+ {
+ x1.resize( boost::size( x2 ) );
+ typename state_type::iterator begin1 = boost::begin( x1 );
+ typename state_type::const_iterator begin2 = boost::begin( x2 );
+ while( begin1 != boost::end( x1 ) )
+ (*begin1++).resize( boost::size( *begin2++ ) );
+ }
+};
+
+template<>
+struct state_wrapper< std::vector< std::vector< double > > >
+{
+ typedef std::vector< std::vector< double > > state_type;
+ typedef state_wrapper< state_type > state_wrapper_type;
+ typedef boost::true_type is_resizeable;
+
+ state_type m_v;
+
+ template< class State >
+ bool same_size( const State &x )
+ {
+ bool same = ( boost::size( m_v ) == boost::size( x ) );
+ if( !same )
+ return false;
+ typename state_type::iterator begin1 = boost::begin( m_v );
+ typename State::const_iterator begin2 = boost::begin( x );
+ while( begin1 != boost::end( m_v ) )
+ same &= ( boost::size( *begin1++ ) == boost::size( *begin2++ ) );
+ return same;
+ }
+
+ template< class State >
+ bool resize( const State &x )
+ {
+ if( !same_size( x ) )
+ {
+ m_v.resize( boost::size( x ) );
+ typename state_type::iterator begin1 = boost::begin( m_v );
+ typename State::const_iterator begin2 = boost::begin( x );
+ while( begin1 != boost::end( m_v ) )
+ (*begin1++).resize( boost::size( *begin2++ ) );
+
+ return true;
+ } else
+ return false;
+ }
+
+};
+
+} } }
+
+#endif

Added: trunk/libs/numeric/odeint/examples/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,43 @@
+# Copyright 2009 Karsten Ahnert and 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)
+
+
+project
+ : requirements
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ :
+ ;
+
+
+exe harmonic_oscillator : harmonic_oscillator.cpp ;
+exe solar_system : solar_system.cpp ;
+exe chaotic_system : chaotic_system.cpp ;
+exe stiff_system : stiff_system.cpp ;
+exe fpu : fpu.cpp ;
+exe phase_oscillator_ensemble : phase_oscillator_ensemble.cpp ;
+exe harmonic_oscillator_units : harmonic_oscillator_units.cpp ;
+exe stuart_landau : stuart_landau.cpp ;
+exe two_dimensional_phase_lattice : two_dimensional_phase_lattice.cpp ;
+exe bulirsch_stoer : bulirsch_stoer.cpp ;
+exe elliptic_functions : elliptic_functions.cpp ;
+exe resizing_lattice : resizing_lattice.cpp ;
+exe list_lattice : list_lattice.cpp ;
+exe stepper_details : stepper_details.cpp ;
+exe my_vector : my_vector.cpp ;
+exe lorenz_point : lorenz_point.cpp ;
+exe van_der_pol_stiff : van_der_pol_stiff.cpp ;
+exe simple1d : simple1d.cpp ;
+exe stochastic_euler : stochastic_euler.cpp ;
+exe generation_functions : generation_functions.cpp ;
+exe heun : heun.cpp ;
+exe const_step_iterator : const_step_iterator.cpp : <cxxflags>-std=c++0x ;
+exe adaptive_iterator : adaptive_iterator.cpp : <cxxflags>-std=c++0x ;
+exe bind_member_functions : bind_member_functions.cpp ;
+exe bind_member_functions_cpp11 : bind_member_functions_cpp11.cpp : <cxxflags>-std=c++0x ;
+
+# build-project mtl ;
+# build-project ublas ;
+# build-project gmpxx ;

Added: trunk/libs/numeric/odeint/examples/adaptive_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/adaptive_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,361 @@
+/*
+ * adaptive_iterator.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+
+#include <iostream>
+#include <iterator>
+#include <utility>
+#include <algorithm>
+#include <cassert>
+
+#include <boost/array.hpp>
+
+#include <boost/range/algorithm.hpp>
+#include <boost/range/adaptor/filtered.hpp>
+#include <boost/range/numeric.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/generation.hpp>
+
+#include <boost/numeric/odeint/iterator/adaptive_iterator.hpp>
+#include <boost/numeric/odeint/iterator/adaptive_time_iterator.hpp>
+
+#define tab "\t"
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , double t ) const
+ {
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+#include <typeinfo>
+
+int main( int argc , char **argv )
+{
+ typedef boost::array< double , 3 > state_type;
+
+ /*
+ * Controlled steppers with time iterator
+ */
+
+ // std::for_each
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ std::for_each( make_adaptive_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_time_iterator_end( stepper , lorenz() , x ) ,
+ []( const std::pair< state_type&, double > &x ) {
+ std::cout << x.second << tab << x.first[0] << tab << x.first[1] << tab << x.first[2] << "\n"; } );
+ }
+
+ // std::copy_if
+ {
+ std::vector< pair< state_type , double > > res;
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ std::copy_if( make_adaptive_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_time_iterator_end( stepper , lorenz() , x ) ,
+ std::back_inserter( res ) ,
+ []( const pair< state_type& , double > &x ) {
+ return ( x.first[0] > 0.0 ) ? true : false; } );
+ for( size_t i=0 ; i<res.size() ; ++i )
+ cout << res[i].first[0] << tab << res[i].first[1] << tab << res[i].first[2] << "\n";
+ }
+
+ // std::accumulate
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = std::accumulate( make_adaptive_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_time_iterator_end( stepper , lorenz() , x ) ,
+ 0.0 ,
+ []( double sum , const pair< state_type& , double > &x ) {
+ return sum + x.first[0]; } );
+ cout << res << endl;
+ }
+
+
+ // std::transform
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ std::transform( make_adaptive_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_time_iterator_end( stepper , lorenz() , x ) ,
+ back_inserter( weights ) ,
+ []( const pair< state_type& , double > &x ) {
+ return sqrt( x.first[0] * x.first[0] + x.first[1] * x.first[1] + x.first[2] * x.first[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /*
+ * Boost.Range versions of controlled stepper with time iterator
+ */
+
+
+ // boost::range::for_each
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::for_each( make_adaptive_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const std::pair< state_type& , double > &x ) {
+ std::cout << x.second << tab << x.first[0] << tab << x.first[1] << tab << x.first[2] << "\n"; } );
+ }
+
+
+ // boost::range::copy with filtered adaptor (simulating std::copy_if)
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ std::vector< std::pair< state_type , double > > res;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::copy( make_adaptive_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) |
+ boost::adaptors::filtered( [] ( const pair< state_type& , double > &x ) { return ( x.first[0] > 0.0 ); } ) ,
+ std::back_inserter( res ) );
+ for( size_t i=0 ; i<res.size() ; ++i )
+ cout << res[i].first[0] << tab << res[i].first[1] << tab << res[i].first[2] << "\n";
+ }
+
+ // boost::range::accumulate
+ {
+ //[adaptive_time_iterator_accumulate_range
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = boost::accumulate( make_adaptive_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , 0.0 ,
+ []( double sum , const pair< state_type& , double > &x ) {
+ return sum + x.first[0]; } );
+ cout << res << endl;
+ //]
+ }
+
+
+ // boost::range::transform
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ boost::transform( make_adaptive_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , back_inserter( weights ) ,
+ []( const pair< state_type& , double > &x ) {
+ return sqrt( x.first[0] * x.first[0] + x.first[1] * x.first[1] + x.first[2] * x.first[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+ // boost::range::find with time iterator
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto iter = boost::find_if( make_adaptive_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const std::pair< state_type & , double > &x ) {
+ return ( x.first[0] < 0.0 ); } );
+ cout << iter->second << "\t" << iter->first[0] << "\t" << iter->first[1] << "\t" << iter->first[2] << "\n";
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ // /*
+ // * Boost.Range versions for dense output steppers
+ // */
+
+ // // boost::range::for_each
+ // {
+ // runge_kutta_dopri5< state_type > stepper;
+ // state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ // boost::range::for_each( make_adaptive_range( make_dense_output( 1.0e-6 , 1.0e-6 , stepper ) , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ // []( const state_type &x ) {
+ // std::cout << x[0] << tab << x[1] << tab << x[2] << "\n"; } );
+ // }
+
+
+ // // boost::range::for_each with time iterator
+ // {
+ // runge_kutta_dopri5< state_type > stepper;
+ // state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ // boost::range::for_each( make_adaptive_time_range( make_dense_output( 1.0e-6 , 1.0e-6 , stepper ) , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ // []( const std::pair< state_type& , double > &x ) {
+ // std::cout << x.second << tab << x.first[0] << tab << x.first[1] << tab << x.first[2] << "\n"; } );
+
+ // }
+
+
+
+
+
+ /*
+ * Pure iterators for controlled stepper without time iterator
+ */
+
+ // std::for_each
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ std::for_each( make_adaptive_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_iterator_end( stepper , lorenz() , x ) ,
+ []( const state_type& x ) {
+ std::cout << x[0] << tab << x[1] << tab << x[2] << "\n"; } );
+ }
+
+ // std::copy_if
+ {
+ std::vector< state_type > res;
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ std::copy_if( make_adaptive_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_iterator_end( stepper , lorenz() , x ) ,
+ std::back_inserter( res ) ,
+ []( const state_type& x ) {
+ return ( x[0] > 0.0 ) ? true : false; } );
+ for( size_t i=0 ; i<res.size() ; ++i )
+ cout << res[i][0] << tab << res[i][1] << tab << res[i][2] << "\n";
+ }
+
+ // std::accumulate
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = std::accumulate( make_adaptive_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_iterator_end( stepper , lorenz() , x ) ,
+ 0.0 ,
+ []( double sum , const state_type& x ) {
+ return sum + x[0]; } );
+ cout << res << endl;
+ }
+
+
+ // std::transform
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ std::transform( make_adaptive_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_adaptive_iterator_end( stepper , lorenz() , x ) ,
+ back_inserter( weights ) ,
+ []( const state_type& x ) {
+ return sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+
+
+
+
+
+
+
+
+ /*
+ * Boost.Range versions of controlled stepper WITHOUT time iterator
+ */
+
+
+ // boost::range::for_each
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::for_each( make_adaptive_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const state_type &x ) {
+ std::cout << x[0] << tab << x[1] << tab << x[2] << "\n"; } );
+ }
+
+
+ // boost::range::copy with filtered adaptor (simulating std::copy_if)
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ std::vector< state_type > res;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::copy( make_adaptive_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) |
+ boost::adaptors::filtered( [] ( const state_type& x ) { return ( x[0] > 0.0 ); } ) ,
+ std::back_inserter( res ) );
+ for( size_t i=0 ; i<res.size() ; ++i )
+ cout << res[i][0] << tab << res[i][1] << tab << res[i][2] << "\n";
+ }
+
+ // boost::range::accumulate
+ {
+ //[adaptive_iterator_accumulate_range
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = boost::accumulate( make_adaptive_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , 0.0 ,
+ []( double sum , const state_type& x ) {
+ return sum + x[0]; } );
+ cout << res << endl;
+ //]
+ }
+
+
+ // boost::range::transform
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ boost::transform( make_adaptive_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , back_inserter( weights ) ,
+ []( const state_type& x ) {
+ return sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+ // boost::range::find
+ {
+ auto stepper = make_controlled( 1.0e-6 , 1.0e-6 , runge_kutta_cash_karp54< state_type >() );
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto iter = boost::find_if( make_adaptive_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const state_type &x ) {
+ return ( x[0] < 0.0 ); } );
+ cout << (*iter)[0] << "\t" << (*iter)[1] << "\t" << (*iter)[2] << "\n";
+ }
+
+
+
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/bind_member_functions.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/bind_member_functions.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,126 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/examples/bind_member_functions.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#include <iostream>
+
+#include <boost/numeric/odeint.hpp>
+
+namespace odeint = boost::numeric::odeint;
+
+typedef boost::array< double , 3 > state_type;
+
+//[ ode_wrapper
+template< class Obj , class Mem >
+class ode_wrapper
+{
+ Obj m_obj;
+ Mem m_mem;
+
+public:
+
+ ode_wrapper( Obj obj , Mem mem ) : m_obj( obj ) , m_mem( mem ) { }
+
+ template< class State , class Deriv , class Time >
+ void operator()( const State &x , Deriv &dxdt , Time t )
+ {
+ (m_obj.*m_mem)( x , dxdt , t );
+ }
+};
+
+template< class Obj , class Mem >
+ode_wrapper< Obj , Mem > make_ode_wrapper( Obj obj , Mem mem )
+{
+ return ode_wrapper< Obj , Mem >( obj , mem );
+}
+//]
+
+
+template< class Obj , class Mem >
+class observer_wrapper
+{
+ Obj m_obj;
+ Mem m_mem;
+
+public:
+
+ observer_wrapper( Obj obj , Mem mem ) : m_obj( obj ) , m_mem( mem ) { }
+
+ template< class State , class Time >
+ void operator()( const State &x , Time t )
+ {
+ (m_obj.*m_mem)( x , t );
+ }
+};
+
+template< class Obj , class Mem >
+observer_wrapper< Obj , Mem > make_observer_wrapper( Obj obj , Mem mem )
+{
+ return observer_wrapper< Obj , Mem >( obj , mem );
+}
+
+
+
+//[ bind_member_function
+struct lorenz
+{
+ void ode( const state_type &x , state_type &dxdt , double t ) const
+ {
+ dxdt[0] = 10.0 * ( x[1] - x[0] );
+ dxdt[1] = 28.0 * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -8.0 / 3.0 * x[2] + x[0] * x[1];
+ }
+};
+
+int main( int argc , char *argv[] )
+{
+ using namespace boost::numeric::odeint;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ integrate_const( runge_kutta4< state_type >() , make_ode_wrapper( lorenz() , &lorenz::ode ) ,
+ x , 0.0 , 10.0 , 0.01 );
+ return 0;
+}
+//]
+
+
+/*
+struct lorenz
+{
+ void ode( const state_type &x , state_type &dxdt , double t ) const
+ {
+ dxdt[0] = 10.0 * ( x[1] - x[0] );
+ dxdt[1] = 28.0 * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -8.0 / 3.0 * x[2] + x[0] * x[1];
+ }
+
+ void obs( const state_type &x , double t ) const
+ {
+ std::cout << t << " " << x[0] << " " << x[1] << " " << x[2] << "\n";
+ }
+};
+
+int main( int argc , char *argv[] )
+{
+ using namespace boost::numeric::odeint;
+
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ integrate_const( runge_kutta4< state_type >() ,
+ make_ode_wrapper( lorenz() , &lorenz::ode ) ,
+ x , 0.0 , 10.0 , 0.01 ,
+ make_observer_wrapper( lorenz() , &lorenz::obs ) );
+
+ return 0;
+}
+*/

Added: trunk/libs/numeric/odeint/examples/bind_member_functions_cpp11.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/bind_member_functions_cpp11.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,56 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/examples/bind_member_functions.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#include <iostream>
+#include <array>
+#include <type_traits>
+
+#include <boost/numeric/odeint.hpp>
+
+namespace odeint = boost::numeric::odeint;
+
+
+
+typedef std::array< double , 3 > state_type;
+
+struct lorenz
+{
+ void ode( const state_type &x , state_type &dxdt , double t ) const
+ {
+ const double sigma = 10.0;
+ const double R = 28.0;
+ const double b = 8.0 / 3.0;
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+int main( int argc , char *argv[] )
+{
+ using namespace boost::numeric::odeint;
+ //[ bind_member_function_cpp11
+ namespace pl = std::placeholders;
+
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ integrate_const( runge_kutta4< state_type >() ,
+ std::bind( &lorenz::ode , lorenz() , pl::_1 , pl::_2 , pl::_3 ) ,
+ x , 0.0 , 10.0 , 0.01 );
+ //]
+ return 0;
+}
+

Added: trunk/libs/numeric/odeint/examples/bulirsch_stoer.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/bulirsch_stoer.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,100 @@
+/*
+ * bulirsch_stoer.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+#include <iostream>
+#include <fstream>
+#define _USE_MATH_DEFINES
+#include <cmath>
+
+#include <boost/array.hpp>
+#include <boost/ref.hpp>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+typedef boost::array< double , 1 > state_type;
+
+/*
+ * x' = ( - x*sin t + 2 tan x ) y
+ * with x( pi/6 ) = 2/sqrt(3) the analytic solution is 1/cos t
+ */
+
+void rhs( const state_type &x , state_type &dxdt , const double t )
+{
+ dxdt[0] = ( - x[0] * sin( t ) + 2.0 * tan( t ) ) * x[0];
+}
+
+void rhs2( const state_type &x , state_type &dxdt , const double t )
+{
+ dxdt[0] = sin(t);
+}
+
+
+ofstream out;
+
+void write_out( const state_type &x , const double t )
+{
+ out << t << '\t' << x[0] << endl;
+}
+
+int main()
+{
+ bulirsch_stoer_dense_out< state_type > stepper( 1E-8 , 0.0 , 0.0 , 0.0 );
+ bulirsch_stoer< state_type > stepper2( 1E-8 , 0.0 , 0.0 , 0.0 );
+
+ state_type x = {{ 2.0 / sqrt(3.0) }};
+
+ double t = M_PI/6.0;
+ //double t = 0.0;
+ double dt = 0.01;
+ double t_end = M_PI/2.0 - 0.1;
+ //double t_end = 100.0;
+
+ out.open( "bs.dat" );
+ out.precision(16);
+ integrate_const( stepper , rhs , x , t , t_end , dt , write_out );
+ out.close();
+
+ x[0] = 2.0 / sqrt(3.0);
+
+ out.open( "bs2.dat" );
+ out.precision(16);
+ integrate_adaptive( stepper , rhs , x , t , t_end , dt , write_out );
+ out.close();
+
+ x[0] = 2.0 / sqrt(3.0);
+
+ out.open( "bs3.dat" );
+ out.precision(16);
+ integrate_adaptive( stepper2 , rhs , x , t , t_end , dt , write_out );
+ out.close();
+
+
+ typedef runge_kutta_dopri5< state_type > dopri5_type;
+ typedef controlled_runge_kutta< dopri5_type > controlled_dopri5_type;
+ typedef dense_output_runge_kutta< controlled_dopri5_type > dense_output_dopri5_type;
+
+ dense_output_dopri5_type dopri5( controlled_dopri5_type( default_error_checker< double >( 1E-2 , 0.0 , 0.0 , 0.0 ) ) );
+
+ x[0] = 2.0 / sqrt(3.0);
+
+ out.open( "bs4.dat" );
+ out.precision(16);
+ integrate_adaptive( dopri5 , rhs , x , t , t_end , dt , write_out );
+ out.close();
+
+}

Added: trunk/libs/numeric/odeint/examples/chaotic_system.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/chaotic_system.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,117 @@
+/*
+ * chaotic_system.cpp
+ *
+ * This example demonstrates how one can use odeint to determine the Lyapunov
+ * exponents of a chaotic system namely the well known Lorenz system. Furthermore,
+ * it shows how odeint interacts with boost.range.
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+#include "gram_schmidt.hpp"
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+//[ system_function_without_perturbations
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t ) const
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+//]
+
+
+
+//[ system_function_with_perturbations
+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;
+
+void lorenz_with_lyap( const state_type &x , state_type &dxdt , double t )
+{
+ lorenz()( x , dxdt , t );
+
+ for( size_t l=0 ; l<num_of_lyap ; ++l )
+ {
+ const double *pert = x.begin() + 3 + l * 3;
+ double *dpert = dxdt.begin() + 3 + l * 3;
+ dpert[0] = - sigma * pert[0] + 10.0 * pert[1];
+ dpert[1] = ( R - x[2] ) * pert[0] - pert[1] - x[0] * pert[2];
+ dpert[2] = x[1] * pert[0] + x[0] * pert[1] - b * pert[2];
+ }
+}
+//]
+
+
+
+
+
+int main( int argc , char **argv )
+{
+ state_type x;
+ lyap_type lyap;
+ runge_kutta4< state_type > rk4;
+
+ fill( x.begin() , x.end() , 0.0 );
+ x[0] = 10.0 ; x[1] = 10.0 ; x[2] = 5.0;
+
+ const double dt = 0.01;
+
+ //[ integrate_transients_with_range
+ // perform 10000 transient steps
+ integrate_n_steps( rk4 , lorenz() , std::make_pair( x.begin() , x.begin() + n ) , 0.0 , dt , 10000 );
+ //]
+
+ //[ lyapunov_full_code
+ fill( x.begin()+n , x.end() , 0.0 );
+ for( size_t i=0 ; i<num_of_lyap ; ++i ) x[n+n*i+i] = 1.0;
+ fill( lyap.begin() , lyap.end() , 0.0 );
+
+ double t = 0.0;
+ size_t count = 0;
+ while( true )
+ {
+
+ t = integrate_n_steps( rk4 , lorenz_with_lyap , x , t , dt , 100 );
+ gram_schmidt< num_of_lyap >( x , lyap , n );
+ ++count;
+
+ if( !(count % 100000) )
+ {
+ cout << t;
+ for( size_t i=0 ; i<num_of_lyap ; ++i ) cout << "\t" << lyap[i] / t ;
+ cout << endl;
+ }
+ }
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/const_step_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/const_step_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,294 @@
+/*
+ * const_step_iterator.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <iterator>
+#include <utility>
+#include <algorithm>
+#include <array>
+#include <cassert>
+
+#include <boost/range/algorithm.hpp>
+#include <boost/range/adaptor/filtered.hpp>
+#include <boost/range/numeric.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/generation.hpp>
+#include <boost/numeric/odeint/iterator/const_step_iterator.hpp>
+#include <boost/numeric/odeint/iterator/const_step_time_iterator.hpp>
+
+#define tab "\t"
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , double t ) const
+ {
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+
+
+int main( int argc , char **argv )
+{
+ typedef std::array< double , 3 > state_type;
+
+ // std::for_each
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ std::for_each( make_const_step_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_const_step_time_iterator_end( stepper , lorenz() , x ) ,
+ []( const std::pair< state_type&, double > &x ) {
+ std::cout << x.second << tab << x.first[0] << tab << x.first[1] << tab << x.first[2] << "\n"; } );
+ }
+
+ // std::copy_if
+ {
+ std::vector< state_type > res;
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ std::copy_if( make_const_step_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_const_step_iterator_end( stepper , lorenz() , x ) ,
+ std::back_inserter( res ) ,
+ []( const state_type& x ) {
+ return ( x[0] > 0.0 ) ? true : false; } );
+ for( size_t i=0 ; i<res.size() ; ++i )
+ cout << res[i][0] << tab << res[i][1] << tab << res[i][2] << "\n";
+ }
+
+ // std::accumulate
+ {
+ //[ const_step_iterator_accumulate
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = std::accumulate( make_const_step_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_const_step_iterator_end( stepper , lorenz() , x ) ,
+ 0.0 ,
+ []( double sum , const state_type &x ) {
+ return sum + x[0]; } );
+ cout << res << endl;
+ //]
+ }
+
+
+ // std::transform
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ std::transform( make_const_step_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_const_step_iterator_end( stepper , lorenz() , x ) ,
+ back_inserter( weights ) ,
+ []( const state_type &x ) {
+ return sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+
+ // std::transform with time_iterator
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ std::transform( make_const_step_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ make_const_step_time_iterator_end( stepper , lorenz() , x ) ,
+ back_inserter( weights ) ,
+ []( const std::pair< state_type &, double > &x ) {
+ return sqrt( x.first[0] * x.first[0] + x.first[1] * x.first[1] + x.first[2] * x.first[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+
+
+
+
+
+
+
+
+ // /*
+ // * Boost.Range versions
+ // */
+
+
+ // boost::range::for_each
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::for_each( make_const_step_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const state_type &x ) {
+ std::cout << x[0] << tab << x[1] << tab << x[2] << "\n"; } );
+ }
+
+ // boost::range::for_each with time iterator
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::for_each( make_const_step_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const std::pair< state_type& , double > &x ) {
+ std::cout << x.second << tab << x.first[0] << tab << x.first[1] << tab << x.first[2] << "\n"; } );
+ }
+
+
+ // boost::range::copy with filtered adaptor (simulating std::copy_if)
+ {
+ std::vector< state_type > res;
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::copy( make_const_step_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) |
+ boost::adaptors::filtered( [] ( const state_type &x ) { return ( x[0] > 0.0 ); } ) ,
+ std::back_inserter( res ) );
+ for( size_t i=0 ; i<res.size() ; ++i )
+ cout << res[i][0] << tab << res[i][1] << tab << res[i][2] << "\n";
+ }
+
+ // boost::range::accumulate
+ {
+ //[const_step_iterator_accumulate_range
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = boost::accumulate( make_const_step_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , 0.0 ,
+ []( double sum , const state_type &x ) {
+ return sum + x[0]; } );
+ cout << res << endl;
+ //]
+ }
+
+ // boost::range::accumulate with time iterator
+ {
+ //[const_step_time_iterator_accumulate_range
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ double res = boost::accumulate( make_const_step_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , 0.0 ,
+ []( double sum , const std::pair< state_type &, double > &x ) {
+ return sum + x.first[0]; } );
+ cout << res << endl;
+ //]
+ }
+
+
+ // boost::range::transform
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ vector< double > weights;
+ boost::transform( make_const_step_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , back_inserter( weights ) ,
+ []( const state_type &x ) {
+ return sqrt( x[0] * x[0] + x[1] * x[1] + x[2] * x[2] ); } );
+ for( size_t i=0 ; i<weights.size() ; ++i )
+ cout << weights[i] << "\n";
+ }
+
+
+ // boost::range::find with time iterator
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto iter = boost::find_if( make_const_step_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const std::pair< state_type & , double > &x ) {
+ return ( x.first[0] < 0.0 ); } );
+ cout << iter->second << "\t" << iter->first[0] << "\t" << iter->first[1] << "\t" << iter->first[2] << "\n";
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ /*
+ * Boost.Range versions for dense output steppers
+ */
+
+ // boost::range::for_each
+ {
+ runge_kutta_dopri5< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::for_each( make_const_step_range( make_dense_output( 1.0e-6 , 1.0e-6 , stepper ) , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const state_type &x ) {
+ std::cout << x[0] << tab << x[1] << tab << x[2] << "\n"; } );
+ }
+
+
+ // boost::range::for_each with time iterator
+ {
+ runge_kutta_dopri5< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ boost::range::for_each( make_const_step_time_range( make_dense_output( 1.0e-6 , 1.0e-6 , stepper ) , lorenz() , x , 0.0 , 1.0 , 0.01 ) ,
+ []( const std::pair< state_type& , double > &x ) {
+ std::cout << x.second << tab << x.first[0] << tab << x.first[1] << tab << x.first[2] << "\n"; } );
+
+ }
+
+
+
+
+
+ /*
+ * Pure iterators
+ */
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto first = make_const_step_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 );
+ auto last = make_const_step_iterator_end( stepper , lorenz() , x );
+ while( first != last )
+ {
+ assert( last != first );
+ cout << (*first)[0] << tab << (*first)[1] << tab << (*first)[2] << "\n";
+ ++first;
+ }
+ }
+
+ {
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto first = make_const_step_time_iterator_begin( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 );
+ auto last = make_const_step_time_iterator_end( stepper , lorenz() , x );
+ while( first != last )
+ {
+ assert( last != first );
+ cout << first->second << tab << first->first[0] << tab << first->first[1] << tab << first->first[2] << "\n";
+ ++first;
+ }
+ }
+
+
+
+
+
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/elliptic.py
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/elliptic.py 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,31 @@
+"""
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 Mario Mulansky
+
+ Stochastic euler stepper example and Ornstein-Uhlenbeck process
+
+ 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)
+"""
+
+
+from pylab import *
+from scipy import special
+
+data1 = loadtxt("elliptic1.dat")
+data2 = loadtxt("elliptic2.dat")
+data3 = loadtxt("elliptic3.dat")
+
+sn1,cn1,dn1,phi1 = special.ellipj( data1[:,0] , 0.51 )
+sn2,cn2,dn2,phi2 = special.ellipj( data2[:,0] , 0.51 )
+sn3,cn3,dn3,phi3 = special.ellipj( data3[:,0] , 0.51 )
+
+semilogy( data1[:,0] , abs(data1[:,1]-sn1) )
+semilogy( data2[:,0] , abs(data2[:,1]-sn2) , 'ro' )
+semilogy( data3[:,0] , abs(data3[:,1]-sn3) , '--' )
+
+show()
+
+
+

Added: trunk/libs/numeric/odeint/examples/elliptic_functions.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/elliptic_functions.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,87 @@
+/*
+ * elliptic_functions.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+typedef boost::array< double , 3 > state_type;
+
+/*
+ * x1' = x2*x3
+ * x2' = -x1*x3
+ * x3' = -m*x1*x2
+ */
+
+void rhs( const state_type &x , state_type &dxdt , const double t )
+{
+ static const double m = 0.51;
+
+ dxdt[0] = x[1]*x[2];
+ dxdt[1] = -x[0]*x[2];
+ dxdt[2] = -m*x[0]*x[1];
+}
+
+ofstream out;
+
+void write_out( const state_type &x , const double t )
+{
+ out << t << '\t' << x[0] << '\t' << x[1] << '\t' << x[2] << endl;
+}
+
+int main()
+{
+ bulirsch_stoer_dense_out< state_type > stepper( 1E-9 , 1E-9 , 1.0 , 0.0 );
+
+ state_type x1 = {{ 0.0 , 1.0 , 1.0 }};
+
+ double t = 0.0;
+ double dt = 0.01;
+
+ out.open( "elliptic1.dat" );
+ out.precision(16);
+ integrate_const( stepper , rhs , x1 , t , 100.0 , dt , write_out );
+ out.close();
+
+ state_type x2 = {{ 0.0 , 1.0 , 1.0 }};
+
+ out.open( "elliptic2.dat" );
+ out.precision(16);
+ integrate_adaptive( stepper , rhs , x2 , t , 100.0 , dt , write_out );
+ out.close();
+
+ typedef runge_kutta_dopri5< state_type > dopri5_type;
+ typedef controlled_runge_kutta< dopri5_type > controlled_dopri5_type;
+ typedef dense_output_runge_kutta< controlled_dopri5_type > dense_output_dopri5_type;
+
+ dense_output_dopri5_type dopri5( controlled_dopri5_type( default_error_checker< double >( 1E-9 , 0.0 , 0.0 , 0.0 ) ) );
+
+ state_type x3 = {{ 0.0 , 1.0 , 1.0 }};
+
+ out.open( "elliptic3.dat" );
+ out.precision(16);
+ integrate_adaptive( dopri5 , rhs , x3 , t , 100.0 , dt , write_out );
+ out.close();
+}

Added: trunk/libs/numeric/odeint/examples/fpu.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/fpu.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,168 @@
+/*
+ * fpu.cpp
+ *
+ * This example demonstrates how one can use odeint to solve the Fermi-Pasta-Ulam system.
+
+ * Created on: July 13, 2011
+ *
+ * Copyright 2009 Karsten Ahnert and 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)
+ */
+
+#include <iostream>
+#include <numeric>
+#include <cmath>
+#include <vector>
+
+#include <boost/numeric/odeint.hpp>
+
+#ifndef M_PI //not there on windows
+#define M_PI 3.1415927 //...
+#endif
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//[ fpu_system_function
+typedef vector< double > container_type;
+
+struct fpu
+{
+ const double m_beta;
+
+ fpu( const double beta = 1.0 ) : m_beta( beta ) { }
+
+ // system function defining the ODE
+ void operator()( const container_type &q , container_type &dpdt ) const
+ {
+ size_t n = q.size();
+ double tmp = q[0] - 0.0;
+ double tmp2 = tmp + m_beta * tmp * tmp * tmp;
+ dpdt[0] = -tmp2;
+ for( size_t i=0 ; i<n-1 ; ++i )
+ {
+ tmp = q[i+1] - q[i];
+ tmp2 = tmp + m_beta * tmp * tmp * tmp;
+ dpdt[i] += tmp2;
+ dpdt[i+1] = -tmp2;
+ }
+ tmp = - q[n-1];
+ tmp2 = tmp + m_beta * tmp * tmp * tmp;
+ dpdt[n-1] += tmp2;
+ }
+
+ // calculates the energy of the system
+ double energy( const container_type &q , const container_type &p ) const
+ {
+ // ...
+ //<-
+ double energy = 0.0;
+ size_t n = q.size();
+
+ double tmp = q[0];
+ energy += 0.5 * tmp * tmp + 0.25 * m_beta * tmp * tmp * tmp * tmp;
+ for( size_t i=0 ; i<n-1 ; ++i )
+ {
+ tmp = q[i+1] - q[i];
+ energy += 0.5 * ( p[i] * p[i] + tmp * tmp ) + 0.25 * m_beta * tmp * tmp * tmp * tmp;
+ }
+ energy += 0.5 * p[n-1] * p[n-1];
+ tmp = q[n-1];
+ energy += 0.5 * tmp * tmp + 0.25 * m_beta * tmp * tmp * tmp * tmp;
+
+ return energy;
+ //->
+ }
+
+ // calculates the local energy of the system
+ void local_energy( const container_type &q , const container_type &p , container_type &e ) const
+ {
+ // ...
+ //<-
+ size_t n = q.size();
+ double tmp = q[0];
+ double tmp2 = 0.5 * tmp * tmp + 0.25 * m_beta * tmp * tmp * tmp * tmp;
+ e[0] = tmp2;
+ for( size_t i=0 ; i<n-1 ; ++i )
+ {
+ tmp = q[i+1] - q[i];
+ tmp2 = 0.25 * tmp * tmp + 0.125 * m_beta * tmp * tmp * tmp * tmp;
+ e[i] += 0.5 * p[i] * p[i] + tmp2 ;
+ e[i+1] = tmp2;
+ }
+ tmp = q[n-1];
+ tmp2 = 0.5 * tmp * tmp + 0.25 * m_beta * tmp * tmp * tmp * tmp;
+ e[n-1] += 0.5 * p[n-1] * p[n-1] + tmp2;
+ //->
+ }
+};
+//]
+
+
+
+//[ fpu_observer
+struct streaming_observer
+{
+ std::ostream& m_out;
+ const fpu &m_fpu;
+ size_t m_write_every;
+ size_t m_count;
+
+ streaming_observer( std::ostream &out , const fpu &f , size_t write_every = 100 )
+ : m_out( out ) , m_fpu( f ) , m_write_every( write_every ) , m_count( 0 ) { }
+
+ template< class State >
+ void operator()( const State &x , double t )
+ {
+ if( ( m_count % m_write_every ) == 0 )
+ {
+ container_type &q = x.first;
+ container_type &p = x.second;
+ container_type energy( q.size() );
+ m_fpu.local_energy( q , p , energy );
+ for( size_t i=0 ; i<q.size() ; ++i )
+ {
+ m_out << t << "\t" << i << "\t" << q[i] << "\t" << p[i] << "\t" << energy[i] << "\n";
+ }
+ m_out << "\n";
+ clog << t << "\t" << accumulate( energy.begin() , energy.end() , 0.0 ) << "\n";
+ }
+ ++m_count;
+ }
+};
+//]
+
+
+
+
+
+
+
+
+int main( int argc , char **argv )
+{
+ //[ fpu_integration
+ const size_t n = 64;
+ container_type q( n , 0.0 ) , p( n , 0.0 );
+
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ p[i] = 0.0;
+ q[i] = 32.0 * sin( double( i + 1 ) / double( n + 1 ) * M_PI );
+ }
+
+
+ const double dt = 0.1;
+
+ typedef symplectic_rkn_sb3a_mclachlan< container_type > stepper_type;
+ fpu fpu_instance( 8.0 );
+
+ integrate_const( stepper_type() , fpu_instance ,
+ make_pair( boost::ref( q ) , boost::ref( p ) ) ,
+ 0.0 , 1000.0 , dt , streaming_observer( cout , fpu_instance , 10 ) );
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/generation_functions.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/generation_functions.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,99 @@
+/*
+ libs/numeric/odeint/examples/stochastic_euler.hpp
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ Stochastic euler stepper example and Ornstein-Uhlenbeck process
+
+ 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)
+ */
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+typedef boost::array< double , 1 > state_type;
+
+using namespace boost::numeric::odeint;
+
+
+//[ generation_functions_own_steppers
+class custom_stepper
+{
+public:
+
+ typedef double value_type;
+ // ...
+};
+
+class custom_controller
+{
+ // ...
+};
+
+class custom_dense_output
+{
+ // ...
+};
+//]
+
+
+//[ generation_functions_get_controller
+namespace boost { namespace numeric { namespace odeint {
+
+template<>
+struct get_controller< custom_stepper >
+{
+ typedef custom_controller type;
+};
+
+} } }
+//]
+
+//[ generation_functions_controller_factory
+namespace boost { namespace numeric { namespace odeint {
+
+template<>
+struct controller_factory< custom_stepper , custom_controller >
+{
+ custom_controller operator()( double abs_tol , double rel_tol , const custom_stepper & ) const
+ {
+ return custom_controller();
+ }
+};
+
+} } }
+//]
+
+int main( int argc , char **argv )
+{
+ {
+ typedef runge_kutta_dopri5< state_type > stepper_type;
+
+ /*
+ //[ generation_functions_syntax_auto
+ auto stepper1 = make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() );
+ auto stepper2 = make_dense_output( 1.0e-6 , 1.0e-6 , stepper_type() );
+ //]
+ */
+
+ //[ generation_functions_syntax_result_of
+ boost::numeric::odeint::result_of::make_controlled< stepper_type >::type stepper3 = make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() );
+ boost::numeric::odeint::result_of::make_dense_output< stepper_type >::type stepper4 = make_dense_output( 1.0e-6 , 1.0e-6 , stepper_type() );
+ //]
+ }
+
+ {
+ /*
+ //[ generation_functions_example_custom_controller
+ auto stepper5 = make_controlled( 1.0e-6 , 1.0e-6 , custom_stepper() );
+ //]
+ */
+
+ boost::numeric::odeint::result_of::make_controlled< custom_stepper >::type stepper5 = make_controlled( 1.0e-6 , 1.0e-6 , custom_stepper() );
+ }
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/gmpxx/Jamfile
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/gmpxx/Jamfile 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,19 @@
+# Copyright 2009 Karsten Ahnert and 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)
+
+
+project
+ : requirements
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ ;
+
+lib libgmp : : <name>gmp <link>shared ;
+lib libgmpxx : : <name>gmpxx <link>shared ;
+
+
+
+exe lorenz_gmpxx : lorenz_gmpxx.cpp libgmp libgmpxx ;
+

Added: trunk/libs/numeric/odeint/examples/gmpxx/lorenz_gmpxx.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/gmpxx/lorenz_gmpxx.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,83 @@
+/*
+ * lorenz_gmpxx.cpp
+ *
+ * This example demonstrates how odeint can be used with arbitrary precision types.
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+
+#include <iostream>
+#include <boost/array.hpp>
+
+#include <gmpxx.h>
+
+#include <boost/numeric/odeint.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//[ gmpxx_lorenz
+typedef mpf_class value_type;
+typedef boost::array< value_type , 3 > state_type;
+
+struct lorenz
+{
+ void operator()( const state_type &x , state_type &dxdt , value_type t ) const
+ {
+ const value_type sigma( 10.0 );
+ const value_type R( 28.0 );
+ const value_type b( value_type( 8.0 ) / value_type( 3.0 ) );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+//]
+
+
+
+
+struct streaming_observer
+{
+ std::ostream& m_out;
+
+ streaming_observer( std::ostream &out ) : m_out( out ) { }
+
+ template< class State , class Time >
+ void operator()( const State &x , Time t ) const
+ {
+ m_out << t;
+ for( size_t i=0 ; i<x.size() ; ++i ) m_out << "\t" << x[i] ;
+ m_out << "\n";
+ }
+};
+
+
+
+
+
+
+int main( int argc , char **argv )
+{
+ //[ gmpxx_integration
+ const int precision = 1024;
+ mpf_set_default_prec( precision );
+
+ state_type x = {{ value_type( 10.0 ) , value_type( 10.0 ) , value_type( 10.0 ) }};
+
+ cout.precision( 1000 );
+ integrate_const( runge_kutta4< state_type , value_type >() ,
+ lorenz() , x , value_type( 0.0 ) , value_type( 10.0 ) , value_type( value_type( 1.0 ) / value_type( 10.0 ) ) ,
+ streaming_observer( cout ) );
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/gram_schmidt.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/gram_schmidt.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,88 @@
+/*
+ boost header: numeric/odeint/gram_schmitt.hpp
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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_GRAM_SCHMITT_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_GRAM_SCHMITT_HPP_INCLUDED
+
+#include <iterator>
+#include <algorithm>
+#include <numeric>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template< class Iterator , class T >
+void normalize( Iterator first , Iterator last , T norm )
+{
+ while( first != last ) *first++ /= norm;
+}
+
+template< class Iterator , class T >
+void substract_vector( Iterator first1 , Iterator last1 ,
+ Iterator first2 , T val )
+{
+ while( first1 != last1 ) *first1++ -= val * ( *first2++ );
+}
+
+template< size_t num_of_lyap , class StateType , class LyapType >
+void gram_schmidt( StateType &x , LyapType &lyap , size_t n )
+{
+ if( !num_of_lyap ) return;
+ if( ptrdiff_t( ( num_of_lyap + 1 ) * n ) != std::distance( x.begin() , x.end() ) )
+ throw std::domain_error( "renormalization() : size of state does not match the number of lyapunov exponents." );
+
+ typedef typename StateType::value_type value_type;
+ typedef typename StateType::iterator iterator;
+
+ value_type norm[num_of_lyap];
+ value_type tmp[num_of_lyap];
+ iterator first = x.begin() + n;
+ iterator beg1 = first , end1 = first + n ;
+
+ std::fill( norm , norm+num_of_lyap , 0.0 );
+
+ // normalize first vector
+ norm[0] = sqrt( std::inner_product( beg1 , end1 , beg1 , 0.0 ) );
+ normalize( beg1 , end1 , norm[0] );
+
+ beg1 += n;
+ end1 += n;
+
+ for( size_t j=1 ; j<num_of_lyap ; ++j , beg1+=n , end1+=n )
+ {
+ for( size_t k=0 ; k<j ; ++k )
+ {
+ tmp[k] = std::inner_product( beg1 , end1 , first + k*n , 0.0 );
+ // clog << j << " " << k << " " << tmp[k] << "\n";
+ }
+
+
+
+ for( size_t k=0 ; k<j ; ++k )
+ substract_vector( beg1 , end1 , first + k*n , tmp[k] );
+
+ // nromalize j-th vector
+ norm[j] = sqrt( std::inner_product( beg1 , end1 , beg1 , 0.0 ) );
+ // clog << j << " " << norm[j] << "\n";
+ normalize( beg1 , end1 , norm[j] );
+ }
+
+ for( size_t j=0 ; j<num_of_lyap ; j++ )
+ lyap[j] += log( norm[j] );
+}
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif //BOOST_NUMERIC_ODEINT_GRAM_SCHMITT_HPP_INCLUDED

Added: trunk/libs/numeric/odeint/examples/harmonic_oscillator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/harmonic_oscillator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,203 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <vector>
+
+#include <boost/numeric/odeint.hpp>
+
+
+
+//[ rhs_function
+/* The type of container used to hold the state vector */
+typedef std::vector< double > state_type;
+
+const double gam = 0.15;
+
+/* The rhs of x' = f(x) */
+void harmonic_oscillator( const state_type &x , state_type &dxdt , const double /* t */ )
+{
+ dxdt[0] = x[1];
+ dxdt[1] = -x[0] - gam*x[1];
+}
+//]
+
+
+
+
+
+//[ rhs_class
+/* The rhs of x' = f(x) defined as a class */
+class harm_osc {
+
+ double m_gam;
+
+public:
+ harm_osc( double gam ) : m_gam(gam) { }
+
+ void operator() ( const state_type &x , state_type &dxdt , const double /* t */ )
+ {
+ dxdt[0] = x[1];
+ dxdt[1] = -x[0] - m_gam*x[1];
+ }
+};
+//]
+
+
+
+
+
+//[ integrate_observer
+struct push_back_state_and_time
+{
+ std::vector< state_type >& m_states;
+ std::vector< double >& m_times;
+
+ push_back_state_and_time( std::vector< state_type > &states , std::vector< double > &times )
+ : m_states( states ) , m_times( times ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ m_states.push_back( x );
+ m_times.push_back( t );
+ }
+};
+//]
+
+struct write_state
+{
+ void operator()( const state_type &x ) const
+ {
+ std::cout << x[0] << "\t" << x[1] << "\n";
+ }
+};
+
+
+int main(int /* argc */ , char** /* argv */ )
+{
+ using namespace std;
+ using namespace boost::numeric::odeint;
+
+
+ //[ state_initialization
+ state_type x(2);
+ x[0] = 1.0; // start at x=1.0, p=0.0
+ x[1] = 0.0;
+ //]
+
+
+
+ //[ integration
+ size_t steps = integrate( harmonic_oscillator ,
+ x , 0.0 , 10.0 , 0.1 );
+ //]
+
+
+
+ //[ integration_class
+ harm_osc ho(0.15);
+ steps = integrate( ho ,
+ x , 0.0 , 10.0 , 0.1 );
+ //]
+
+
+
+
+
+ //[ integrate_observ
+ vector<state_type> x_vec;
+ vector<double> times;
+
+ steps = integrate( harmonic_oscillator ,
+ x , 0.0 , 10.0 , 0.1 ,
+ push_back_state_and_time( x_vec , times ) );
+
+ /* output */
+ for( size_t i=0; i<=steps; i++ )
+ {
+ cout << times[i] << '\t' << x_vec[i][0] << '\t' << x_vec[i][1] << '\n';
+ }
+ //]
+
+
+
+
+
+
+
+ //[ define_const_stepper
+ runge_kutta4< state_type > stepper;
+ integrate_const( stepper , harmonic_oscillator , x , 0.0 , 10.0 , 0.01 );
+ //]
+
+
+
+
+ //[ integrate_const_loop
+ const double dt = 0.01;
+ for( double t=0.0 ; t<10.0 ; t+= dt )
+ stepper.do_step( harmonic_oscillator , x , t , dt );
+ //]
+
+
+
+
+ //[ define_adapt_stepper
+ typedef runge_kutta_cash_karp54< state_type > error_stepper_type;
+ //]
+
+
+
+ //[ integrate_adapt
+ typedef controlled_runge_kutta< error_stepper_type > controlled_stepper_type;
+ controlled_stepper_type controlled_stepper;
+ integrate_adaptive( controlled_stepper , harmonic_oscillator , x , 0.0 , 10.0 , 0.01 );
+ //]
+
+ {
+ //[integrate_adapt_full
+ double abs_err = 1.0e-10 , rel_err = 1.0e-6 , a_x = 1.0 , a_dxdt = 1.0;
+ controlled_stepper_type controlled_stepper(
+ default_error_checker< double >( abs_err , rel_err , a_x , a_dxdt ) );
+ integrate_adaptive( controlled_stepper , harmonic_oscillator , x , 0.0 , 10.0 , 0.01 );
+ //]
+ }
+
+
+ //[integrate_adapt_make_controlled
+ integrate_adaptive( make_controlled< error_stepper_type >( 1.0e-10 , 1.0e-6 ) ,
+ harmonic_oscillator , x , 0.0 , 10.0 , 0.01 );
+ //]
+
+
+
+
+ //[integrate_adapt_make_controlled_alternative
+ integrate_adaptive( make_controlled( 1.0e-10 , 1.0e-6 , error_stepper_type() ) ,
+ harmonic_oscillator , x , 0.0 , 10.0 , 0.01 );
+ //]
+
+ #ifdef BOOST_NUMERIC_ODEINT_CXX11
+ //[ define_const_stepper_cpp11
+ runge_kutta4< state_type > stepper;
+ integrate_const( stepper , []( const state_type &x , state_type &dxdt , double t ) {
+ dxdt[0] = x[1]; dxdt[1] = -x[0] - gam*x[1]; }
+ , x , 0.0 , 10.0 , 0.01 );
+ //]
+ #endif
+
+
+ //[harm_iterator_const_step
+ std::for_each( make_adaptive_iterator_begin( controlled_stepper , harmonic_oscillator , x , 0.0 , 10.0 , 0.01 ) ,
+ make_adaptive_iterator_end( controlled_stepper , harmonic_oscillator , x ) ,
+ write_state() );
+ //]
+
+}

Added: trunk/libs/numeric/odeint/examples/harmonic_oscillator_units.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/harmonic_oscillator_units.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,119 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <vector>
+
+
+/* WARNING: Compilation in debug mode might consume enormous memory
+ (e.g. ~2GB on gcc 4.4 )
+*/
+
+// first increase fusion macro variables (now done by odeint itself)
+//#define BOOST_FUSION_INVOKE_MAX_ARITY 15
+//#define BOOST_RESULT_OF_NUM_ARGS 15
+
+//[ units_define_basic_quantities
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
+
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+#include <boost/fusion/container.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+namespace fusion = boost::fusion;
+namespace units = boost::units;
+namespace si = boost::units::si;
+
+typedef units::quantity< si::time , double > time_type;
+typedef units::quantity< si::length , double > length_type;
+typedef units::quantity< si::velocity , double > velocity_type;
+typedef units::quantity< si::acceleration , double > acceleration_type;
+typedef units::quantity< si::frequency , double > frequency_type;
+
+typedef fusion::vector< length_type , velocity_type > state_type;
+typedef fusion::vector< velocity_type , acceleration_type > deriv_type;
+//]
+
+
+
+//[ units_define_ode
+struct oscillator
+{
+ frequency_type m_omega;
+
+ oscillator( const frequency_type &omega = 1.0 * si::hertz ) : m_omega( omega ) { }
+
+ void operator()( const state_type &x , deriv_type &dxdt , time_type t ) const
+ {
+ fusion::at_c< 0 >( dxdt ) = fusion::at_c< 1 >( x );
+ fusion::at_c< 1 >( dxdt ) = - m_omega * m_omega * fusion::at_c< 0 >( x );
+ }
+};
+//]
+
+
+//[ units_observer
+struct streaming_observer
+{
+ std::ostream& m_out;
+
+ streaming_observer( std::ostream &out ) : m_out( out ) { }
+
+ struct write_element
+ {
+ std::ostream &m_out;
+ write_element( std::ostream &out ) : m_out( out ) { };
+
+ template< class T >
+ void operator()( const T &t ) const
+ {
+ m_out << "\t" << t;
+ }
+ };
+
+ template< class State , class Time >
+ void operator()( const State &x , const Time &t ) const
+ {
+ m_out << t;
+ fusion::for_each( x , write_element( m_out ) );
+ m_out << "\n";
+ }
+};
+//]
+
+
+int main( int argc , char**argv )
+{
+// typedef dense_output_runge_kutta
+// <
+// controlled_runge_kutta
+// <
+// runge_kutta_dopri5< state_type , double , deriv_type , time_type , fusion_algebra >
+// >
+// > stepper_type;
+
+ //[ units_define_stepper
+ typedef runge_kutta_dopri5< state_type , double , deriv_type , time_type , fusion_algebra > stepper_type;
+
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second );
+
+ integrate_const( make_dense_output( 1.0e-6 , 1.0e-6 , stepper_type() ) , oscillator( 2.0 * si::hertz ) , x , 0.0 * si::second , 100.0 * si::second , 0.1 * si::second , streaming_observer( cout ) );
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/heun.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/heun.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,170 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/examples/heun.cpp
+
+ [begin_description]
+ Examplary implementation of the method of Heun.
+ [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)
+ */
+
+#include <iostream>
+
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+
+
+
+
+
+namespace fusion = boost::fusion;
+
+//[ heun_define_coefficients
+template< class Value = double >
+struct heun_a1 : boost::array< Value , 1 > {
+ heun_a1( void )
+ {
+ (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 3 );
+ }
+};
+
+template< class Value = double >
+struct heun_a2 : boost::array< Value , 2 >
+{
+ heun_a2( void )
+ {
+ (*this)[0] = static_cast< Value >( 0 );
+ (*this)[1] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
+ }
+};
+
+
+template< class Value = double >
+struct heun_b : boost::array< Value , 3 >
+{
+ heun_b( void )
+ {
+ (*this)[0] = static_cast<Value>( 1 ) / static_cast<Value>( 4 );
+ (*this)[1] = static_cast<Value>( 0 );
+ (*this)[2] = static_cast<Value>( 3 ) / static_cast<Value>( 4 );
+ }
+};
+
+template< class Value = double >
+struct heun_c : boost::array< Value , 3 >
+{
+ heun_c( void )
+ {
+ (*this)[0] = static_cast< Value >( 0 );
+ (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 3 );
+ (*this)[2] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
+ }
+};
+//]
+
+
+//[ heun_stepper_definition
+template<
+ class State ,
+ class Value = double ,
+ class Deriv = State ,
+ class Time = Value ,
+ class Algebra = boost::numeric::odeint::range_algebra ,
+ class Operations = boost::numeric::odeint::default_operations ,
+ class Resizer = boost::numeric::odeint::initially_resizer
+>
+class heun : public
+boost::numeric::odeint::explicit_generic_rk< 3 , 3 , State , Value , Deriv , Time ,
+ Algebra , Operations , Resizer >
+{
+
+public:
+
+ typedef boost::numeric::odeint::explicit_generic_rk< 3 , 3 , State , Value , Deriv , Time ,
+ Algebra , Operations , Resizer > stepper_base_type;
+
+ typedef typename stepper_base_type::state_type state_type;
+ typedef typename stepper_base_type::wrapped_state_type wrapped_state_type;
+ typedef typename stepper_base_type::value_type value_type;
+ typedef typename stepper_base_type::deriv_type deriv_type;
+ typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type;
+ typedef typename stepper_base_type::time_type time_type;
+ typedef typename stepper_base_type::algebra_type algebra_type;
+ typedef typename stepper_base_type::operations_type operations_type;
+ typedef typename stepper_base_type::resizer_type resizer_type;
+ typedef typename stepper_base_type::stepper_type stepper_type;
+
+ heun( const algebra_type &algebra = algebra_type() )
+ : stepper_base_type(
+ fusion::make_vector(
+ heun_a1<Value>() ,
+ heun_a2<Value>() ) ,
+ heun_b<Value>() , heun_c<Value>() , algebra )
+ { }
+};
+//]
+
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t ) const
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+struct streaming_observer
+{
+ std::ostream &m_out;
+ streaming_observer( std::ostream &out ) : m_out( out ) { }
+ template< typename State , typename Value >
+ void operator()( const State &x , Value t ) const
+ {
+ m_out << t;
+ for( size_t i=0 ; i<x.size() ; ++i ) m_out << "\t" << x[i];
+ m_out << "\n";
+ }
+};
+
+
+
+int main( int argc , char **argv )
+{
+ using namespace std;
+ using namespace boost::numeric::odeint;
+
+
+ //[ heun_example
+ typedef boost::array< double , 3 > state_type;
+ heun< state_type > h;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+
+ integrate_const( h , lorenz() , x , 0.0 , 100.0 , 0.01 ,
+ streaming_observer( std::cout ) );
+
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/list_lattice.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/list_lattice.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,78 @@
+/*
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+/* example showing how odeint can be used with std::list */
+
+#include <iostream>
+#include <cmath>
+#include <list>
+
+#include <boost/numeric/odeint.hpp>
+
+//[ list_bindings
+typedef std::list< double > state_type;
+
+namespace boost { namespace numeric { namespace odeint {
+
+template< >
+struct is_resizeable< state_type >
+{ // declare resizeablility
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+template< >
+struct same_size_impl< state_type , state_type >
+{ // define how to check size
+ static bool same_size( const state_type &v1 ,
+ const state_type &v2 )
+ {
+ return v1.size() == v2.size();
+ }
+};
+
+template< >
+struct resize_impl< state_type , state_type >
+{ // define how to resize
+ static void resize( state_type &v1 ,
+ const state_type &v2 )
+ {
+ v1.resize( v2.size() );
+ }
+};
+
+} } }
+//]
+
+void lattice( const state_type &x , state_type &dxdt , const double /* t */ )
+{
+ state_type::const_iterator x_begin = x.begin();
+ state_type::const_iterator x_end = x.end();
+ state_type::iterator dxdt_begin = dxdt.begin();
+
+ x_end--; // stop one before last
+ while( x_begin != x_end )
+ {
+ *(dxdt_begin++) = std::sin( *(x_begin) - *(x_begin++) );
+ }
+ *dxdt_begin = sin( *x_begin - *(x.begin()) ); // periodic boundary
+}
+
+using namespace boost::numeric::odeint;
+
+int main()
+{
+ const int N = 32;
+ state_type x;
+ for( int i=0 ; i<N ; ++i )
+ x.push_back( 1.0*i/N );
+
+ integrate_const( runge_kutta4< state_type >() , lattice , x , 0.0 , 10.0 , 0.1 );
+}

Added: trunk/libs/numeric/odeint/examples/lorenz_point.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/lorenz_point.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ *
+ * Example for the lorenz system with a 3D point type
+*/
+
+#include <iostream>
+#include <cmath>
+
+#include <boost/operators.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+
+//[point3D
+class point3D :
+ boost::additive1< point3D ,
+ boost::additive2< point3D , double ,
+ boost::multiplicative2< point3D , double > > >
+{
+public:
+
+ double x , y , z;
+
+ point3D()
+ : x( 0.0 ) , y( 0.0 ) , z( 0.0 )
+ { }
+
+ point3D( const double val )
+ : x( val ) , y( val ) , z( val )
+ { }
+
+ point3D( const double _x , const double _y , const double _z )
+ : x( _x ) , y( _y ) , z( _z )
+ { }
+
+ point3D& operator+=( const point3D &p )
+ {
+ x += p.x; y += p.y; z += p.z;
+ return *this;
+ }
+
+ point3D& operator*=( const double a )
+ {
+ x *= a; y *= a; z *= a;
+ return *this;
+ }
+
+};
+//]
+
+//[point3D_abs_div
+// only required for steppers with error control
+point3D operator/( const point3D &p1 , const point3D &p2 )
+{
+ return point3D( p1.x/p2.x , p1.y/p2.y , p1.z/p1.z );
+}
+
+point3D abs( const point3D &p )
+{
+ return point3D( std::abs(p.x) , std::abs(p.y) , std::abs(p.z) );
+}
+//]
+
+
+//[point3D_reduce
+namespace boost { namespace numeric { namespace odeint {
+// specialization of vector_space_reduce, only required for steppers with error control
+template<>
+struct vector_space_reduce< point3D >
+{
+ template< class Value , class Op >
+ Value operator() ( const point3D &p , Op op , Value init )
+ {
+ init = op( init , p.x );
+ //std::cout << init << " ";
+ init = op( init , p.y );
+ //std::cout << init << " ";
+ init = op( init , p.z );
+ //std::cout << init << std::endl;
+ return init;
+ }
+};
+} } }
+//]
+
+std::ostream& operator<<( std::ostream &out , const point3D &p )
+{
+ out << p.x << " " << p.y << " " << p.z;
+ return out;
+}
+
+//[point3D_main
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+void lorenz( const point3D &x , point3D &dxdt , const double t )
+{
+ dxdt.x = sigma * ( x.y - x.x );
+ dxdt.y = R * x.x - x.y - x.x * x.z;
+ dxdt.z = -b * x.z + x.x * x.y;
+}
+
+using namespace boost::numeric::odeint;
+
+int main()
+{
+
+ point3D x( 10.0 , 5.0 , 5.0 );
+ // point type defines it's own operators -> use vector_space_algebra !
+ typedef runge_kutta_dopri5< point3D , double , point3D ,
+ double , vector_space_algebra > stepper;
+ int steps = integrate_adaptive( make_controlled<stepper>( 1E-10 , 1E-10 ) , lorenz , x ,
+ 0.0 , 10.0 , 0.1 );
+ std::cout << x << std::endl;
+ std::cout << "steps: " << steps << std::endl;
+}
+//]

Added: trunk/libs/numeric/odeint/examples/mtl/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/mtl/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,16 @@
+# Copyright 2009 Karsten Ahnert and 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)
+
+MTL4_INCLUDE = /home/karsten/boost/MTL-4.0.8862-Linux/usr/include ;
+
+project
+ : requirements
+ <include>../../../../..
+ <include>$(MTL4_INCLUDE)
+ <define>BOOST_ALL_NO_LIB=1
+ ;
+
+exe gauss_packet : gauss_packet.cpp ;
+exe implicit_euler_mtl : implicit_euler_mtl.cpp ;
\ No newline at end of file

Added: trunk/libs/numeric/odeint/examples/mtl/gauss_packet.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/mtl/gauss_packet.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,141 @@
+/*
+ * gauss_packet.cpp
+ *
+ * Schroedinger equation with potential barrier and periodic boundary conditions
+ * Initial Gauss packet moving to the right
+ *
+ * pipe output into gnuplot to see animation
+ *
+ * Implementation of Hamilton operator via MTL library
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <complex>
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/external/mtl4/mtl4_resize.hpp>
+
+#include <boost/numeric/mtl/mtl.hpp>
+
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+typedef mtl::dense_vector< complex< double > > state_type;
+
+struct hamiltonian {
+
+ typedef mtl::compressed2D< complex< double > > matrix_type;
+ matrix_type m_H;
+
+ hamiltonian( const int N ) : m_H( N , N )
+ {
+ // constructor with zero potential
+ m_H = 0.0;
+ initialize_kinetic_term();
+ }
+
+ //template< mtl::compressed2D< double > >
+ hamiltonian( mtl::compressed2D< double > &V ) : m_H( num_rows( V ) , num_cols( V ) )
+ {
+ // use potential V in hamiltonian
+ m_H = complex<double>( 0.0 , -1.0 ) * V;
+ initialize_kinetic_term();
+ }
+
+ void initialize_kinetic_term( )
+ {
+ const int N = num_rows( m_H );
+ mtl::matrix::inserter< matrix_type , mtl::update_plus< complex<double> > > ins( m_H );
+ const double z = 1.0;
+ // fill diagonal and upper and lower diagonal
+ for( int i = 0 ; i<N ; ++i )
+ {
+ ins[ i ][ (i+1) % N ] << complex< double >( 0.0 , -z );
+ ins[ i ][ i ] << complex< double >( 0.0 , z );
+ ins[ (i+1) % N ][ i ] << complex< double >( 0.0 , -z );
+ }
+ }
+
+ void operator()( const state_type &psi , state_type &dpsidt , const double t )
+ {
+ dpsidt = m_H * psi;
+ }
+
+};
+
+struct write_for_gnuplot
+{
+ size_t m_every , m_count;
+
+ write_for_gnuplot( size_t every = 10 )
+ : m_every( every ) , m_count( 0 ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ if( ( m_count % m_every ) == 0 )
+ {
+ //clog << t << endl;
+ cout << "p [0:" << mtl::size(x) << "][0:0.02] '-'" << endl;
+ for( size_t i=0 ; i<mtl::size(x) ; ++i )
+ {
+ cout << i << "\t" << norm(x[i]) << "\n";
+ }
+ cout << "e" << endl;
+ }
+
+ ++m_count;
+ }
+};
+
+static const int N = 1024;
+static const int N0 = 256;
+static const double sigma0 = 20;
+static const double k0 = -1.0;
+
+int main( int argc , char** argv )
+{
+ state_type x( N , 0.0 );
+
+ // initialize gauss packet with nonzero velocity
+ for( int i=0 ; i<N ; ++i )
+ {
+ x[i] = exp( -(i-N0)*(i-N0) / ( 4.0*sigma0*sigma0 ) ) * exp( complex< double >( 0.0 , k0*i ) );
+ //x[i] += 2.0*exp( -(i+N0-N)*(i+N0-N) / ( 4.0*sigma0*sigma0 ) ) * exp( complex< double >( 0.0 , -k0*i ) );
+ }
+ x /= mtl::two_norm( x );
+
+ typedef runge_kutta4< state_type , double , state_type , double , vector_space_algebra > stepper;
+
+ // create potential barrier
+ mtl::compressed2D< double > V( N , N );
+ V = 0.0;
+ {
+ mtl::matrix::inserter< mtl::compressed2D< double > > ins( V );
+ for( int i=0 ; i<N ; ++i )
+ {
+ //ins[i][i] << 1E-4*(i-N/2)*(i-N/2);
+
+ if( i < N/2 )
+ ins[ i ][ i ] << 0.0 ;
+ else
+ ins[ i ][ i ] << 1.0 ;
+
+ }
+ }
+
+ // perform integration, output can be piped to gnuplot
+ integrate_const( stepper() , hamiltonian( V ) , x , 0.0 , 1000.0 , 0.1 , write_for_gnuplot( 10 ) );
+
+ clog << "Norm: " << mtl::two_norm( x ) << endl;
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/mtl/implicit_euler_mtl.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/mtl/implicit_euler_mtl.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,324 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <fstream>
+#include <utility>
+#include "time.h"
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/phoenix/phoenix.hpp>
+#include <boost/numeric/mtl/mtl.hpp>
+
+#include <boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+namespace phoenix = boost::phoenix;
+
+
+
+typedef mtl::dense_vector< double > vec_mtl4;
+typedef mtl::compressed2D< double > mat_mtl4;
+
+typedef boost::numeric::ublas::vector< double > vec_ublas;
+typedef boost::numeric::ublas::matrix< double > mat_ublas;
+
+
+// two systems defined 1 & 2 both are mostly sparse with the number of element variable
+struct system1_mtl4
+{
+
+ void operator()( const vec_mtl4 &x , vec_mtl4 &dxdt , double t )
+ {
+ int size = mtl::size(x);
+
+ dxdt[ 0 ] = -0.06*x[0];
+
+ for (int i =1; i< size ; ++i){
+
+ dxdt[ i ] = 4.2*x[i-1]-2.2*x[i]*x[i];
+ }
+
+ }
+};
+
+struct jacobi1_mtl4
+{
+ void operator()( const vec_mtl4 &x , mat_mtl4 &J , const double &t )
+ {
+ int size = mtl::size(x);
+ mtl::matrix::inserter<mat_mtl4> ins(J);
+
+ ins[0][0]=-0.06;
+
+ for (int i =1; i< size ; ++i)
+ {
+ ins[i][i-1] = + 4.2;
+ ins[i][i] = -4.2*x[i];
+ }
+ }
+};
+
+
+
+struct system1_ublas
+{
+
+ void operator()( const vec_ublas &x , vec_ublas &dxdt , double t )
+ {
+ int size = x.size();
+
+ dxdt[ 0 ] = -0.06*x[0];
+
+ for (int i =1; i< size ; ++i){
+
+ dxdt[ i ] = 4.2*x[i-1]-2.2*x[i]*x[i];
+ }
+
+ }
+};
+
+struct jacobi1_ublas
+{
+ void operator()( const vec_ublas &x , mat_ublas &J , const double &t )
+ {
+ int size = x.size();
+// mtl::matrix::inserter<mat_mtl4> ins(J);
+
+ J(0,0)=-0.06;
+
+ for (int i =1; i< size ; ++i){
+//ins[i][0]=120.0*x[i];
+ J(i,i-1) = + 4.2;
+ J(i,i) = -4.2*x[i];
+
+ }
+ }
+};
+
+struct system2_mtl4
+{
+
+ void operator()( const vec_mtl4 &x , vec_mtl4 &dxdt , double t )
+ {
+ int size = mtl::size(x);
+
+
+ for (int i =0; i< size/5 ; i+=5){
+
+ dxdt[ i ] = -0.5*x[i];
+ dxdt[i+1]= +25*x[i+1]*x[i+2]-740*x[i+3]*x[i+3]+4.2e-2*x[i];
+ dxdt[i+2]= +25*x[i]*x[i]-740*x[i+3]*x[i+3];
+ dxdt[i+3]= -25*x[i+1]*x[i+2]+740*x[i+3]*x[i+3];
+ dxdt[i+4] = 0.250*x[i]*x[i+1]-44.5*x[i+3];
+
+ }
+
+ }
+};
+
+struct jacobi2_mtl4
+{
+ void operator()( const vec_mtl4 &x , mat_mtl4 &J , const double &t )
+ {
+ int size = mtl::size(x);
+ mtl::matrix::inserter<mat_mtl4> ins(J);
+
+ for (int i =0; i< size/5 ; i+=5){
+
+ ins[ i ][i] = -0.5;
+ ins[i+1][i+1]=25*x[i+2];
+ ins[i+1][i+2] = 25*x[i+1];
+ ins[i+1][i+3] = -740*2*x[i+3];
+ ins[i+1][i] =+4.2e-2;
+
+ ins[i+2][i]= 50*x[i];
+ ins[i+2][i+3]= -740*2*x[i+3];
+ ins[i+3][i+1] = -25*x[i+2];
+ ins[i+3][i+2] = -25*x[i+1];
+ ins[i+3][i+3] = +740*2*x[i+3];
+ ins[i+4][i] = 0.25*x[i+1];
+ ins[i+4][i+1] =0.25*x[i];
+ ins[i+4][i+3]=-44.5;
+
+
+
+ }
+ }
+};
+
+
+
+struct system2_ublas
+{
+
+ void operator()( const vec_ublas &x , vec_ublas &dxdt , double t )
+ {
+ int size = x.size();
+ for (int i =0; i< size/5 ; i+=5){
+
+ dxdt[ i ] = -4.2e-2*x[i];
+ dxdt[i+1]= +25*x[i+1]*x[i+2]-740*x[i+3]*x[i+3]+4.2e-2*x[i];
+ dxdt[i+2]= +25*x[i]*x[i]-740*x[i+3]*x[i+3];
+ dxdt[i+3]= -25*x[i+1]*x[i+2]+740*x[i+3]*x[i+3];
+ dxdt[i+4] = 0.250*x[i]*x[i+1]-44.5*x[i+3];
+
+ }
+
+ }
+};
+
+struct jacobi2_ublas
+{
+ void operator()( const vec_ublas &x , mat_ublas &J , const double &t )
+ {
+ int size = x.size();
+
+ for (int i =0; i< size/5 ; i+=5){
+
+ J(i ,i) = -4.2e-2;
+ J(i+1,i+1)=25*x[i+2];
+ J(i+1,i+2) = 25*x[i+1];
+ J(i+1,i+3) = -740*2*x[i+3];
+ J(i+1,i) =+4.2e-2;
+
+ J(i+2,i)= 50*x[i];
+ J(i+2,i+3)= -740*2*x[i+3];
+ J(i+3,i+1) = -25*x[i+2];
+ J(i+3,i+2) = -25*x[i+1];
+ J(i+3,i+3) = +740*2*x[i+3];
+ J(i+4,i) = 0.25*x[i+1];
+ J(i+4,i+1) =0.25*x[i];
+ J(i+4,i+3)=-44.5;
+
+
+
+ }
+
+
+ }
+};
+
+
+
+
+void testRidiculouslyMassiveArray( int size )
+{
+ typedef boost::numeric::odeint::implicit_euler_mtl4 < double > mtl4stepper;
+ typedef boost::numeric::odeint::implicit_euler< double > booststepper;
+
+ vec_mtl4 x(size , 0.0);
+ x[0]=1;
+
+
+ double dt = 0.02;
+ double endtime = 10.0;
+
+ clock_t tstart_mtl4 = clock();
+ size_t num_of_steps_mtl4 = integrate_const(
+ mtl4stepper() ,
+ make_pair( system1_mtl4() , jacobi1_mtl4() ) ,
+ x , 0.0 , endtime , dt );
+ clock_t tend_mtl4 = clock() ;
+
+ clog << x[0] << endl;
+ clog << num_of_steps_mtl4 << " time elapsed: " << (double)(tend_mtl4-tstart_mtl4 )/CLOCKS_PER_SEC << endl;
+
+ vec_ublas x_ublas(size , 0.0);
+ x_ublas[0]=1;
+
+ clock_t tstart_boost = clock();
+ size_t num_of_steps_ublas = integrate_const(
+ booststepper() ,
+ make_pair( system1_ublas() , jacobi1_ublas() ) ,
+ x_ublas , 0.0 , endtime , dt );
+ clock_t tend_boost = clock() ;
+
+ clog << x_ublas[0] << endl;
+ clog << num_of_steps_ublas << " time elapsed: " << (double)(tend_boost-tstart_boost)/CLOCKS_PER_SEC<< endl;
+
+ clog << "dt_ublas/dt_mtl4 = " << (double)( tend_boost-tstart_boost )/( tend_mtl4-tstart_mtl4 ) << endl << endl;
+ return ;
+}
+
+
+
+void testRidiculouslyMassiveArray2( int size )
+{
+ typedef boost::numeric::odeint::implicit_euler_mtl4 < double > mtl4stepper;
+ typedef boost::numeric::odeint::implicit_euler< double > booststepper;
+
+
+ vec_mtl4 x(size , 0.0);
+ x[0]=100;
+
+
+ double dt = 0.01;
+ double endtime = 10.0;
+
+ clock_t tstart_mtl4 = clock();
+ size_t num_of_steps_mtl4 = integrate_const(
+ mtl4stepper() ,
+ make_pair( system1_mtl4() , jacobi1_mtl4() ) ,
+ x , 0.0 , endtime , dt );
+
+
+ clock_t tend_mtl4 = clock() ;
+
+ clog << x[0] << endl;
+ clog << num_of_steps_mtl4 << " time elapsed: " << (double)(tend_mtl4-tstart_mtl4 )/CLOCKS_PER_SEC << endl;
+
+ vec_ublas x_ublas(size , 0.0);
+ x_ublas[0]=100;
+
+ clock_t tstart_boost = clock();
+ size_t num_of_steps_ublas = integrate_const(
+ booststepper() ,
+ make_pair( system1_ublas() , jacobi1_ublas() ) ,
+ x_ublas , 0.0 , endtime , dt );
+
+
+ clock_t tend_boost = clock() ;
+
+ clog << x_ublas[0] << endl;
+ clog << num_of_steps_ublas << " time elapsed: " << (double)(tend_boost-tstart_boost)/CLOCKS_PER_SEC<< endl;
+
+ clog << "dt_ublas/dt_mtl4 = " << (double)( tend_boost-tstart_boost )/( tend_mtl4-tstart_mtl4 ) << endl << endl;
+ return ;
+}
+
+
+
+
+int main( int argc , char **argv )
+{
+ std::vector< size_t > length;
+ length.push_back( 8 );
+ length.push_back( 16 );
+ length.push_back( 32 );
+ length.push_back( 64 );
+ length.push_back( 128 );
+ length.push_back( 256 );
+
+ for( size_t i=0 ; i<length.size() ; ++i )
+ {
+ clog << "Testing with size " << length[i] << endl;
+ testRidiculouslyMassiveArray( length[i] );
+ }
+ clog << endl << endl;
+
+ for( size_t i=0 ; i<length.size() ; ++i )
+ {
+ clog << "Testing with size " << length[i] << endl;
+ testRidiculouslyMassiveArray2( length[i] );
+ }
+}

Added: trunk/libs/numeric/odeint/examples/my_vector.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/my_vector.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ *
+ * Example for self defined vector type.
+ */
+
+#include <vector>
+
+#include <boost/numeric/odeint.hpp>
+
+//[my_vector
+template< int MAX_N >
+class my_vector
+{
+ typedef std::vector< double > vector;
+
+public:
+ typedef vector::iterator iterator;
+ typedef vector::const_iterator const_iterator;
+
+public:
+ my_vector( const size_t N )
+ : m_v( N )
+ {
+ m_v.reserve( MAX_N );
+ }
+
+ my_vector()
+ : m_v()
+ {
+ m_v.reserve( MAX_N );
+ }
+
+// ... [ implement container interface ]
+//]
+ const double & operator[]( const size_t n ) const
+ { return m_v[n]; }
+
+ double & operator[]( const size_t n )
+ { return m_v[n]; }
+
+ iterator begin()
+ { return m_v.begin(); }
+
+ const_iterator begin() const
+ { return m_v.begin(); }
+
+ iterator end()
+ { return m_v.end(); }
+
+ const_iterator end() const
+ { return m_v.end(); }
+
+ size_t size() const
+ { return m_v.size(); }
+
+ void resize( const size_t n )
+ { m_v.resize( n ); }
+
+private:
+ std::vector< double > m_v;
+
+};
+
+//[my_vector_resizeable
+// define my_vector as reizeable
+
+namespace boost { namespace numeric { namespace odeint {
+
+template<size_t N>
+struct is_resizeable< my_vector<N> >
+{
+ typedef boost::true_type type;
+ static const bool value = type::value;
+};
+
+} } }
+//]
+
+
+typedef my_vector<3> state_type;
+
+void lorenz( const state_type &x , state_type &dxdt , const double t )
+{
+ const double sigma( 10.0 );
+ const double R( 28.0 );
+ const double b( 8.0 / 3.0 );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+}
+
+using namespace boost::numeric::odeint;
+
+int main()
+{
+ state_type x(3);
+ x[0] = 5.0 ; x[1] = 10.0 ; x[2] = 10.0;
+
+ // my_vector works with range_algebra as it implements
+ // the required parts of a container interface
+ // no further work is required
+
+ integrate_const( runge_kutta4< state_type >() , lorenz , x , 0.0 , 10.0 , 0.1 );
+}

Added: trunk/libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,150 @@
+/*
+ * phase_oscillator_ensemble.cpp
+ *
+ * Demonstrates the phase transition from an unsynchronized to an synchronized state.
+ *
+ * Copyright 2009-2012 Karsten Ahnert and 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)
+ *
+ */
+
+#include <iostream>
+#include <utility>
+
+#include <boost/numeric/odeint.hpp>
+
+#ifndef M_PI //not there on windows
+#define M_PI 3.141592653589793 //...
+#endif
+
+#include <boost/random.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//[ phase_oscillator_ensemble_system_function
+typedef vector< double > container_type;
+
+
+pair< double , double > calc_mean_field( const container_type &x )
+{
+ size_t n = x.size();
+ double cos_sum = 0.0 , sin_sum = 0.0;
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ cos_sum += cos( x[i] );
+ sin_sum += sin( x[i] );
+ }
+ cos_sum /= double( n );
+ sin_sum /= double( n );
+
+ double K = sqrt( cos_sum * cos_sum + sin_sum * sin_sum );
+ double Theta = atan2( sin_sum , cos_sum );
+
+ return make_pair( K , Theta );
+}
+
+
+struct phase_ensemble
+{
+ container_type m_omega;
+ double m_epsilon;
+
+ phase_ensemble( const size_t n , double g = 1.0 , double epsilon = 1.0 )
+ : m_omega( n , 0.0 ) , m_epsilon( epsilon )
+ {
+ create_frequencies( g );
+ }
+
+ void create_frequencies( double g )
+ {
+ boost::mt19937 rng;
+ boost::cauchy_distribution<> cauchy( 0.0 , g );
+ boost::variate_generator< boost::mt19937&, boost::cauchy_distribution<> > gen( rng , cauchy );
+ generate( m_omega.begin() , m_omega.end() , gen );
+ }
+
+ void set_epsilon( double epsilon ) { m_epsilon = epsilon; }
+
+ double get_epsilon( void ) const { return m_epsilon; }
+
+ void operator()( const container_type &x , container_type &dxdt , double /* t */ ) const
+ {
+ pair< double , double > mean = calc_mean_field( x );
+ for( size_t i=0 ; i<x.size() ; ++i )
+ dxdt[i] = m_omega[i] + m_epsilon * mean.first * sin( mean.second - x[i] );
+ }
+};
+//]
+
+
+
+//[ phase_oscillator_ensemble_observer
+struct statistics_observer
+{
+ double m_K_mean;
+ size_t m_count;
+
+ statistics_observer( void )
+ : m_K_mean( 0.0 ) , m_count( 0 ) { }
+
+ template< class State >
+ void operator()( const State &x , double t )
+ {
+ pair< double , double > mean = calc_mean_field( x );
+ m_K_mean += mean.first;
+ ++m_count;
+ }
+
+ double get_K_mean( void ) const { return ( m_count != 0 ) ? m_K_mean / double( m_count ) : 0.0 ; }
+
+ void reset( void ) { m_K_mean = 0.0; m_count = 0; }
+};
+//]
+
+
+
+
+
+
+
+
+int main( int argc , char **argv )
+{
+ //[ phase_oscillator_ensemble_integration
+ const size_t n = 16384;
+ const double dt = 0.1;
+
+ container_type x( n );
+
+ boost::mt19937 rng;
+ boost::uniform_real<> unif( 0.0 , 2.0 * M_PI );
+ boost::variate_generator< boost::mt19937&, boost::uniform_real<> > gen( rng , unif );
+
+ // gamma = 1, the phase transition occurs at epsilon = 2
+ phase_ensemble ensemble( n , 1.0 );
+ statistics_observer obs;
+
+ for( double epsilon = 0.0 ; epsilon < 5.0 ; epsilon += 0.1 )
+ {
+ ensemble.set_epsilon( epsilon );
+ obs.reset();
+
+ // start with random initial conditions
+ generate( x.begin() , x.end() , gen );
+
+ // calculate some transients steps
+ integrate_const( runge_kutta4< container_type >() , boost::ref( ensemble ) , x , 0.0 , 10.0 , dt );
+
+ // integrate and compute the statistics
+ integrate_const( runge_kutta4< container_type >() , boost::ref( ensemble ) , x , 0.0 , 100.0 , dt , boost::ref( obs ) );
+ cout << epsilon << "\t" << obs.get_K_mean() << endl;
+ }
+
+
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/point_type.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/point_type.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,177 @@
+/* Boost libs/numeric/odeint/examples/point_type.hpp
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 Mario Mulansky
+
+ solar system example for Hamiltonian stepper
+
+ 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 POINT_TYPE_HPP_INCLUDED
+#define POINT_TYPE_HPP_INCLUDED
+
+
+#include <boost/operators.hpp>
+#include <ostream>
+
+
+//[ point_type
+/*the point type */
+template< class T , size_t Dim >
+class point :
+ boost::additive1< point< T , Dim > ,
+ boost::additive2< point< T , Dim > , T ,
+ boost::multiplicative2< point< T , Dim > , T
+ > > >
+ {
+ public:
+
+ const static size_t dim = Dim;
+ typedef T value_type;
+ typedef point< value_type , dim > point_type;
+
+ // ...
+ // constructors
+ //<-
+ point( void )
+ {
+ for( size_t i=0 ; i<dim ; ++i ) m_val[i] = 0.0;
+ }
+
+ point( value_type val )
+ {
+ for( size_t i=0 ; i<dim ; ++i ) m_val[i] = val;
+ }
+
+ point( value_type x , value_type y , value_type z = 0.0 )
+ {
+ if( dim > 0 ) m_val[0] = x;
+ if( dim > 1 ) m_val[1] = y;
+ if( dim > 2 ) m_val[2] = z;
+ }
+ //->
+
+ // ...
+ // operators
+ //<-
+ T operator[]( size_t i ) const { return m_val[i]; }
+ T& operator[]( size_t i ) { return m_val[i]; }
+
+ point_type& operator+=( const point_type& p )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ m_val[i] += p[i];
+ return *this;
+ }
+
+ point_type& operator-=( const point_type& p )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ m_val[i] -= p[i];
+ return *this;
+ }
+
+ point_type& operator+=( const value_type& val )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ m_val[i] += val;
+ return *this;
+ }
+
+ point_type& operator-=( const value_type& val )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ m_val[i] -= val;
+ return *this;
+ }
+
+ point_type& operator*=( const value_type &val )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ m_val[i] *= val;
+ return *this;
+ }
+
+ point_type& operator/=( const value_type &val )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ m_val[i] /= val;
+ return *this;
+ }
+
+ //->
+
+ private:
+
+ T m_val[dim];
+ };
+
+ //...
+ // more operators
+ //]
+
+ //
+ // the - operator
+ //
+ template< class T , size_t Dim >
+ point< T , Dim > operator-( const point< T , Dim > &p )
+ {
+ point< T , Dim > tmp;
+ for( size_t i=0 ; i<Dim ; ++i ) tmp[i] = -p[i];
+ return tmp;
+ }
+
+ //
+ // scalar product
+ //
+ template< class T , size_t Dim >
+ T scalar_prod( const point< T , Dim > &p1 , const point< T , Dim > &p2 )
+ {
+ T tmp = 0.0;
+ for( size_t i=0 ; i<Dim ; ++i ) tmp += p1[i] * p2[i];
+ return tmp;
+ }
+
+
+
+ //
+ // norm
+ //
+ template< class T , size_t Dim >
+ T norm( const point< T , Dim > &p1 )
+ {
+ return scalar_prod( p1 , p1 );
+ }
+
+
+
+
+ //
+ // absolute value
+ //
+ template< class T , size_t Dim >
+ T abs( const point< T , Dim > &p1 )
+ {
+ return sqrt( norm( p1 ) );
+ }
+
+
+
+
+ //
+ // output operator
+ //
+ template< class T , size_t Dim >
+ std::ostream& operator<<( std::ostream &out , const point< T , Dim > &p )
+ {
+ if( Dim > 0 ) out << p[0];
+ for( size_t i=1 ; i<Dim ; ++i ) out << " " << p[i];
+ return out;
+ }
+
+
+
+#endif //POINT_TYPE_HPP_INCLUDED

Added: trunk/libs/numeric/odeint/examples/quadmath/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/quadmath/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,16 @@
+# Copyright 2009 Karsten Ahnert and 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)
+
+
+project
+ : requirements
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ :
+ ;
+
+lib quadmath : : <name>quadmath <link>shared ;
+
+exe black_hole : black_hole.cpp quadmath : <cxxflags>-std=c++0x ;
\ No newline at end of file

Added: trunk/libs/numeric/odeint/examples/quadmath/black_hole.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/quadmath/black_hole.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,151 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/examples/black_hole.cpp
+
+ [begin_description]
+ This example shows how the __float128 from gcc libquadmath can be used with odeint.
+ [end_description]
+
+ Copyright 2012 Lee Hodgkinson
+ Copyright 2012 Karsten Ahnert
+ Copyright 2012 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)
+ */
+
+#include <cstdlib>
+#include <cmath>
+#include <iostream>
+#include <iterator>
+#include <utility>
+#include <algorithm>
+#include <cassert>
+#include <vector>
+#include <complex>
+
+extern "C" {
+#include <quadmath.h>
+}
+
+const __float128 zero =strtoflt128 ("0.0", NULL);
+
+namespace std {
+
+ inline __float128 abs( __float128 x )
+ {
+ return fabsq( x );
+ }
+
+ inline __float128 sqrt( __float128 x )
+ {
+ return sqrtq( x );
+ }
+
+ inline __float128 pow( __float128 x , __float128 y )
+ {
+ return powq( x , y );
+ }
+
+ inline __float128 abs( std::complex< __float128 > x )
+ {
+ return sqrtq( x.real() * x.real() + x.imag() * x.imag() );
+ }
+
+ inline std::complex< __float128 > pow( std::complex< __float128> x , __float128 y )
+ {
+ __float128 r = pow( abs(x) , y );
+ __float128 phi = atanq( x.imag() / x.real() );
+ return std::complex< __float128 >( r * cosq( y * phi ) , r * sinq( y * phi ) );
+ }
+}
+
+inline std::ostream& operator<< (std::ostream& os, const __float128& f) {
+
+ char* y = new char[1000];
+ quadmath_snprintf(y, 1000, "%.30Qg", f) ;
+ os.precision(30);
+ os<<y;
+ delete[] y;
+ return os;
+}
+
+
+#include <boost/array.hpp>
+#include <boost/range/algorithm.hpp>
+#include <boost/range/adaptor/filtered.hpp>
+#include <boost/range/numeric.hpp>
+#include <boost/numeric/odeint.hpp>
+
+
+
+using namespace boost::numeric::odeint;
+using namespace std;
+
+typedef __float128 my_float;
+typedef std::vector< std::complex < my_float > > state_type;
+
+struct radMod
+{
+ my_float m_om;
+ my_float m_l;
+
+ radMod( my_float om , my_float l )
+ : m_om( om ) , m_l( l ) { }
+
+ void operator()( const state_type &x , state_type &dxdt , my_float r ) const
+ {
+
+ dxdt[0] = x[1];
+ dxdt[1] = -(2*(r-1)/(r*(r-2)))*x[1]-((m_om*m_om*r*r/((r-2)*(r-2)))-(m_l*(m_l+1)/(r*(r-2))))*x[0];
+ }
+};
+
+
+
+
+
+
+
+int main( int argc , char **argv )
+{
+
+
+ state_type x(2);
+
+ my_float re0 = strtoflt128( "-0.00008944230755601224204687038354994353820468" , NULL );
+ my_float im0 = strtoflt128( "0.00004472229441850588228136889483397204368247" , NULL );
+ my_float re1 = strtoflt128( "-4.464175354293244250869336196695966076150E-6 " , NULL );
+ my_float im1 = strtoflt128( "-8.950483248390306670770345406051469584488E-6" , NULL );
+
+ x[0] = complex< my_float >( re0 ,im0 );
+ x[1] = complex< my_float >( re1 ,im1 );
+
+ const my_float dt =strtoflt128 ("-0.001", NULL);
+ const my_float start =strtoflt128 ("10000.0", NULL);
+ const my_float end =strtoflt128 ("9990.0", NULL);
+ const my_float omega =strtoflt128 ("2.0", NULL);
+ const my_float ell =strtoflt128 ("1.0", NULL);
+
+
+
+ my_float abs_err = strtoflt128( "1.0E-15" , NULL ) , rel_err = strtoflt128( "1.0E-10" , NULL );
+ my_float a_x = strtoflt128( "1.0" , NULL ) , a_dxdt = strtoflt128( "1.0" , NULL );
+
+ typedef runge_kutta_dopri5< state_type, my_float > dopri5_type;
+ typedef controlled_runge_kutta< dopri5_type > controlled_dopri5_type;
+ typedef dense_output_runge_kutta< controlled_dopri5_type > dense_output_dopri5_type;
+
+ dense_output_dopri5_type dopri5( controlled_dopri5_type( default_error_checker< my_float >( abs_err , rel_err , a_x , a_dxdt ) ) );
+
+ std::for_each( make_adaptive_time_iterator_begin(dopri5 , radMod(omega , ell) , x , start , end , dt) ,
+ make_adaptive_time_iterator_end(dopri5 , radMod(omega , ell) , x ) ,
+ []( const std::pair< state_type&, my_float > &x ) {
+ std::cout << x.second << ", " << x.first[0].real() << "\n"; }
+ );
+
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/resizing_lattice.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/resizing_lattice.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,168 @@
+/*
+ * resizing_lattice.cpp
+ *
+ * Demonstrates the usage of resizing of the state type during integration.
+ * Examplary system is a strongly nonlinear, disordered Hamiltonian lattice
+ * where the spreading of energy is invastigated
+ *
+ * Copyright 2009-2012 Karsten Ahnert and 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)
+ *
+ */
+
+#include <iostream>
+#include <utility>
+
+#include <boost/numeric/odeint.hpp>
+
+#include <boost/ref.hpp>
+#include <boost/random.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//[ resizing_lattice_system_class
+typedef vector< double > coord_type;
+typedef pair< coord_type , coord_type > state_type;
+
+struct compacton_lattice
+{
+ const int m_max_N;
+ const double m_beta;
+ int m_pot_start_index;
+ vector< double > m_pot;
+
+ compacton_lattice( int max_N , double beta , int pot_start_index )
+ : m_max_N( max_N ) , m_beta( beta ) , m_pot_start_index( pot_start_index ) , m_pot( max_N )
+ {
+ srand( time( NULL ) );
+ // fill random potential with iid values from [0,1]
+ boost::mt19937 rng;
+ boost::uniform_real<> unif( 0.0 , 1.0 );
+ boost::variate_generator< boost::mt19937&, boost::uniform_real<> > gen( rng , unif );
+ generate( m_pot.begin() , m_pot.end() , gen );
+ }
+
+ void operator()( const coord_type &q , coord_type &dpdt )
+ {
+ // calculate dpdt = -dH/dq of this hamiltonian system
+ // dp_i/dt = - V_i * q_i^3 - beta*(q_i - q_{i-1})^3 + beta*(q_{i+1} - q_i)^3
+ const int N = q.size();
+ double diff = q[0] - q[N-1];
+ for( int i=0 ; i<N ; ++i )
+ {
+ dpdt[i] = - m_pot[m_pot_start_index+i] * q[i]*q[i]*q[i] -
+ m_beta * diff*diff*diff;
+ diff = q[(i+1) % N] - q[i];
+ dpdt[i] += m_beta * diff*diff*diff;
+ }
+ }
+
+ void energy_distribution( const coord_type &q , const coord_type &p , coord_type &energies )
+ {
+ // computes the energy per lattice site normalized by total energy
+ const size_t N = q.size();
+ double en = 0.0;
+ for( size_t i=0 ; i<N ; i++ )
+ {
+ const double diff = q[(i+1) % N] - q[i];
+ energies[i] = p[i]*p[i]/2.0
+ + m_pot[m_pot_start_index+i]*q[i]*q[i]*q[i]*q[i]/4.0
+ + m_beta/4.0 * diff*diff*diff*diff;
+ en += energies[i];
+ }
+ en = 1.0/en;
+ for( size_t i=0 ; i<N ; i++ )
+ {
+ energies[i] *= en;
+ }
+ }
+
+ double energy( const coord_type &q , const coord_type &p )
+ {
+ // calculates the total energy of the excitation
+ const size_t N = q.size();
+ double en = 0.0;
+ for( size_t i=0 ; i<N ; i++ )
+ {
+ const double diff = q[(i+1) % N] - q[i];
+ en += p[i]*p[i]/2.0
+ + m_pot[m_pot_start_index+i]*q[i]*q[i]*q[i]*q[i] / 4.0
+ + m_beta/4.0 * diff*diff*diff*diff;
+ }
+ return en;
+ }
+
+ void change_pot_start( const int delta )
+ {
+ m_pot_start_index += delta;
+ }
+};
+//]
+
+//[ resizing_lattice_resize_function
+void do_resize( coord_type &q , coord_type &p , coord_type &distr , const int N )
+{
+ q.resize( N );
+ p.resize( N );
+ distr.resize( N );
+}
+//]
+
+const int max_N = 1024;
+const double beta = 1.0;
+
+int main()
+{
+ //[ resizing_lattice_initialize
+ //start with 60 sites
+ const int N_start = 60;
+ coord_type q( N_start , 0.0 );
+ q.reserve( max_N );
+ coord_type p( N_start , 0.0 );
+ p.reserve( max_N );
+ // start with uniform momentum distribution over 20 sites
+ fill( p.begin()+20 , p.end()-20 , 1.0/sqrt(20.0) );
+
+ coord_type distr( N_start , 0.0 );
+ distr.reserve( max_N );
+
+ // create the system
+ compacton_lattice lattice( max_N , beta , (max_N-N_start)/2 );
+
+ //create the stepper, note that we use an always_resizer because state size might change during steps
+ typedef symplectic_rkn_sb3a_mclachlan< coord_type , coord_type , double , coord_type , coord_type , double ,
+ range_algebra , default_operations , always_resizer > hamiltonian_stepper;
+ hamiltonian_stepper stepper;
+ hamiltonian_stepper::state_type state = make_pair( q , p );
+ //]
+
+ //[ resizing_lattice_steps_loop
+ double t = 0.0;
+ const double dt = 0.1;
+ const int steps = 10000;
+ for( int step = 0 ; step < steps ; ++step )
+ {
+ stepper.do_step( boost::ref(lattice) , state , t , dt );
+ lattice.energy_distribution( state.first , state.second , distr );
+ if( distr[10] > 1E-150 )
+ {
+ do_resize( state.first , state.second , distr , state.first.size()+20 );
+ rotate( state.first.begin() , state.first.end()-20 , state.first.end() );
+ rotate( state.second.begin() , state.second.end()-20 , state.second.end() );
+ lattice.change_pot_start( -20 );
+ cout << t << ": resized left to " << distr.size() << ", energy = " << lattice.energy( state.first , state.second ) << endl;
+ }
+ if( distr[distr.size()-10] > 1E-150 )
+ {
+ do_resize( state.first , state.second , distr , state.first.size()+20 );
+ cout << t << ": resized right to " << distr.size() << ", energy = " << lattice.energy( state.first , state.second ) << endl;
+ }
+ t += dt;
+ }
+ //]
+
+ cout << "final lattice size: " << distr.size() << ", final energy: " << lattice.energy( state.first , state.second ) << endl;
+}

Added: trunk/libs/numeric/odeint/examples/simple1d.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/simple1d.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,44 @@
+/* Boost libs/numeric/odeint/examples/simple1d.cpp
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 Mario Mulansky
+
+ example for a simple one-dimensional 1st order ODE
+
+ 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)
+ */
+
+
+#include <iostream>
+#include <boost/numeric/odeint.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+
+/* we solve the simple ODE x' = 3/(2t^2) + x/(2t)
+ * with initial condition x(1) = 0.
+ * Analytic solution is x(t) = sqrt(t) - 1/t
+ */
+
+void rhs( const double x , double &dxdt , const double t )
+{
+ dxdt = 3.0/(2.0*t*t) + x/(2.0*t);
+}
+
+void write_cout( const double &x , const double t )
+{
+ cout << t << '\t' << x << endl;
+}
+
+// state_type = value_type = deriv_type = time_type = double
+typedef runge_kutta_dopri5< double , double , double , double , vector_space_algebra , default_operations , never_resizer > stepper_type;
+
+int main()
+{
+ double x = 0.0; //initial value x(1) = 0
+ // use dopri5 with stepsize control and allowed errors 10^-12, integrate t=1...10
+ integrate_adaptive( make_controlled( 1E-12 , 1E-12 , stepper_type() ) , rhs , x , 1.0 , 10.0 , 0.1 , write_cout );
+}

Added: trunk/libs/numeric/odeint/examples/solar_system.agr
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/solar_system.agr 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,12672 @@
+# Grace project file
+#
+@version 50122
+@page size 792, 612
+@page scroll 5%
+@page inout 5%
+@link page off
+@map font 0 to "Times-Roman", "Times-Roman"
+@map font 1 to "Times-Italic", "Times-Italic"
+@map font 2 to "Times-Bold", "Times-Bold"
+@map font 3 to "Times-BoldItalic", "Times-BoldItalic"
+@map font 4 to "Helvetica", "Helvetica"
+@map font 5 to "Helvetica-Oblique", "Helvetica-Oblique"
+@map font 6 to "Helvetica-Bold", "Helvetica-Bold"
+@map font 7 to "Helvetica-BoldOblique", "Helvetica-BoldOblique"
+@map font 8 to "Courier", "Courier"
+@map font 9 to "Courier-Oblique", "Courier-Oblique"
+@map font 10 to "Courier-Bold", "Courier-Bold"
+@map font 11 to "Courier-BoldOblique", "Courier-BoldOblique"
+@map font 12 to "Symbol", "Symbol"
+@map font 13 to "ZapfDingbats", "ZapfDingbats"
+@map color 0 to (255, 255, 255), "white"
+@map color 1 to (0, 0, 0), "black"
+@map color 2 to (255, 0, 0), "red"
+@map color 3 to (0, 255, 0), "green"
+@map color 4 to (0, 0, 255), "blue"
+@map color 5 to (255, 255, 0), "yellow"
+@map color 6 to (188, 143, 143), "brown"
+@map color 7 to (220, 220, 220), "grey"
+@map color 8 to (148, 0, 211), "violet"
+@map color 9 to (0, 255, 255), "cyan"
+@map color 10 to (255, 0, 255), "magenta"
+@map color 11 to (255, 165, 0), "orange"
+@map color 12 to (114, 33, 188), "indigo"
+@map color 13 to (103, 7, 72), "maroon"
+@map color 14 to (64, 224, 208), "turquoise"
+@map color 15 to (0, 139, 0), "green4"
+@reference date 0
+@date wrap off
+@date wrap year 1950
+@default linewidth 1.0
+@default linestyle 1
+@default color 1
+@default pattern 1
+@default font 0
+@default char size 1.000000
+@default symbol size 1.000000
+@default sformat "%.8g"
+@background color 0
+@page background fill on
+@timestamp off
+@timestamp 0.03, 0.03
+@timestamp color 1
+@timestamp rot 0
+@timestamp font 0
+@timestamp char size 1.000000
+@timestamp def "Fri Mar 18 17:58:35 2011"
+@with line
+@ line on
+@ line loctype view
+@ line 0.248774509804, 0.780637254902, 0.558823529412, 0.444852941176
+@ line linewidth 1.0
+@ line linestyle 1
+@ line color 1
+@ line arrow 0
+@ line arrow type 0
+@ line arrow length 1.000000
+@ line arrow layout 1.000000, 1.000000
+@line def
+@with line
+@ line on
+@ line loctype view
+@ line 0.730392156863, 0.126225490196, 0.621323529412, 0.411764705882
+@ line linewidth 1.0
+@ line linestyle 1
+@ line color 1
+@ line arrow 0
+@ line arrow type 0
+@ line arrow length 1.000000
+@ line arrow layout 1.000000, 1.000000
+@line def
+@with line
+@ line on
+@ line loctype view
+@ line 0.887254901961, 0.121323529412, 0.689950980392, 0.417892156863
+@ line linewidth 1.0
+@ line linestyle 1
+@ line color 1
+@ line arrow 0
+@ line arrow type 0
+@ line arrow length 1.000000
+@ line arrow layout 1.000000, 1.000000
+@line def
+@with line
+@ line on
+@ line loctype view
+@ line 1.07107843137, 0.120098039216, 0.827205882353, 0.447303921569
+@ line linewidth 1.0
+@ line linestyle 1
+@ line color 1
+@ line arrow 0
+@ line arrow type 0
+@ line arrow length 1.000000
+@ line arrow layout 1.000000, 1.000000
+@line def
+@with string
+@ string on
+@ string loctype view
+@ string 0.164215686274, 0.792892156863
+@ string color 1
+@ string rot 0
+@ string font 0
+@ string just 0
+@ string char size 2.000000
+@ string def "Sun"
+@with string
+@ string on
+@ string loctype view
+@ string 0.658088235294, 0.08
+@ string color 1
+@ string rot 0
+@ string font 0
+@ string just 0
+@ string char size 2.000000
+@ string def "Jupiter"
+@with string
+@ string on
+@ string loctype view
+@ string 0.837009803922, 0.08
+@ string color 1
+@ string rot 0
+@ string font 0
+@ string just 0
+@ string char size 2.000000
+@ string def "Saturn"
+@with string
+@ string on
+@ string loctype view
+@ string 1.00980392157, 0.08
+@ string color 1
+@ string rot 0
+@ string font 0
+@ string just 0
+@ string char size 2.000000
+@ string def "Uranus"
+@with string
+@ string on
+@ string loctype view
+@ string 0.735294117647, 0.680147058824
+@ string color 1
+@ string rot 0
+@ string font 0
+@ string just 0
+@ string char size 2.000000
+@ string def "Neptune"
+@with string
+@ string on
+@ string loctype view
+@ string 0.996323529411, 0.780637254902
+@ string color 1
+@ string rot 0
+@ string font 0
+@ string just 0
+@ string char size 2.000000
+@ string def "Pluto"
+@r0 off
+@link r0 to g0
+@r0 type above
+@r0 linestyle 1
+@r0 linewidth 1.0
+@r0 color 1
+@r0 line 0, 0, 0, 0
+@r1 off
+@link r1 to g0
+@r1 type above
+@r1 linestyle 1
+@r1 linewidth 1.0
+@r1 color 1
+@r1 line 0, 0, 0, 0
+@r2 off
+@link r2 to g0
+@r2 type above
+@r2 linestyle 1
+@r2 linewidth 1.0
+@r2 color 1
+@r2 line 0, 0, 0, 0
+@r3 off
+@link r3 to g0
+@r3 type above
+@r3 linestyle 1
+@r3 linewidth 1.0
+@r3 color 1
+@r3 line 0, 0, 0, 0
+@r4 off
+@link r4 to g0
+@r4 type above
+@r4 linestyle 1
+@r4 linewidth 1.0
+@r4 color 1
+@r4 line 0, 0, 0, 0
+@g0 on
+@g0 hidden false
+@g0 type XY
+@g0 stacked false
+@g0 bar hgap 0.000000
+@g0 fixedpoint off
+@g0 fixedpoint type 0
+@g0 fixedpoint xy 0.000000, 0.000000
+@g0 fixedpoint format general general
+@g0 fixedpoint prec 6, 6
+@with g0
+@ world -32, -32, 45, 46
+@ stack world 0, 0, 0, 0
+@ znorm 1
+@ view 0.150000, 0.150000, 1.150000, 0.850000
+@ title ""
+@ title font 0
+@ title size 1.500000
+@ title color 1
+@ subtitle ""
+@ subtitle font 0
+@ subtitle size 1.000000
+@ subtitle color 1
+@ xaxes scale Normal
+@ yaxes scale Normal
+@ xaxes invert off
+@ yaxes invert off
+@ xaxis on
+@ xaxis type zero false
+@ xaxis offset 0.000000 , 0.000000
+@ xaxis bar on
+@ xaxis bar color 1
+@ xaxis bar linestyle 1
+@ xaxis bar linewidth 1.0
+@ xaxis label ""
+@ xaxis label layout para
+@ xaxis label place auto
+@ xaxis label char size 1.000000
+@ xaxis label font 0
+@ xaxis label color 1
+@ xaxis label place normal
+@ xaxis tick off
+@ xaxis tick major 20
+@ xaxis tick minor ticks 1
+@ xaxis tick default 6
+@ xaxis tick place rounded true
+@ xaxis tick in
+@ xaxis tick major size 1.000000
+@ xaxis tick major color 1
+@ xaxis tick major linewidth 1.0
+@ xaxis tick major linestyle 1
+@ xaxis tick major grid off
+@ xaxis tick minor color 1
+@ xaxis tick minor linewidth 1.0
+@ xaxis tick minor linestyle 1
+@ xaxis tick minor grid off
+@ xaxis tick minor size 0.500000
+@ xaxis ticklabel off
+@ xaxis ticklabel format general
+@ xaxis ticklabel prec 5
+@ xaxis ticklabel formula ""
+@ xaxis ticklabel append ""
+@ xaxis ticklabel prepend ""
+@ xaxis ticklabel angle 0
+@ xaxis ticklabel skip 0
+@ xaxis ticklabel stagger 0
+@ xaxis ticklabel place normal
+@ xaxis ticklabel offset auto
+@ xaxis ticklabel offset 0.000000 , 0.010000
+@ xaxis ticklabel start type auto
+@ xaxis ticklabel start 0.000000
+@ xaxis ticklabel stop type auto
+@ xaxis ticklabel stop 0.000000
+@ xaxis ticklabel char size 1.000000
+@ xaxis ticklabel font 0
+@ xaxis ticklabel color 1
+@ xaxis tick place both
+@ xaxis tick spec type none
+@ yaxis on
+@ yaxis type zero false
+@ yaxis offset 0.000000 , 0.000000
+@ yaxis bar on
+@ yaxis bar color 1
+@ yaxis bar linestyle 1
+@ yaxis bar linewidth 1.0
+@ yaxis label ""
+@ yaxis label layout para
+@ yaxis label place auto
+@ yaxis label char size 1.000000
+@ yaxis label font 0
+@ yaxis label color 1
+@ yaxis label place normal
+@ yaxis tick off
+@ yaxis tick major 20
+@ yaxis tick minor ticks 1
+@ yaxis tick default 6
+@ yaxis tick place rounded true
+@ yaxis tick in
+@ yaxis tick major size 1.000000
+@ yaxis tick major color 1
+@ yaxis tick major linewidth 1.0
+@ yaxis tick major linestyle 1
+@ yaxis tick major grid off
+@ yaxis tick minor color 1
+@ yaxis tick minor linewidth 1.0
+@ yaxis tick minor linestyle 1
+@ yaxis tick minor grid off
+@ yaxis tick minor size 0.500000
+@ yaxis ticklabel off
+@ yaxis ticklabel format general
+@ yaxis ticklabel prec 5
+@ yaxis ticklabel formula ""
+@ yaxis ticklabel append ""
+@ yaxis ticklabel prepend ""
+@ yaxis ticklabel angle 0
+@ yaxis ticklabel skip 0
+@ yaxis ticklabel stagger 0
+@ yaxis ticklabel place normal
+@ yaxis ticklabel offset auto
+@ yaxis ticklabel offset 0.000000 , 0.010000
+@ yaxis ticklabel start type auto
+@ yaxis ticklabel start 0.000000
+@ yaxis ticklabel stop type auto
+@ yaxis ticklabel stop 0.000000
+@ yaxis ticklabel char size 1.000000
+@ yaxis ticklabel font 0
+@ yaxis ticklabel color 1
+@ yaxis tick place both
+@ yaxis tick spec type none
+@ altxaxis off
+@ altyaxis off
+@ legend on
+@ legend loctype view
+@ legend 0.85, 0.8
+@ legend box color 1
+@ legend box pattern 1
+@ legend box linewidth 1.0
+@ legend box linestyle 1
+@ legend box fill color 0
+@ legend box fill pattern 1
+@ legend font 0
+@ legend char size 1.000000
+@ legend color 1
+@ legend length 4
+@ legend vgap 1
+@ legend hgap 1
+@ legend invert false
+@ frame type 0
+@ frame linestyle 1
+@ frame linewidth 1.0
+@ frame color 1
+@ frame pattern 1
+@ frame background color 0
+@ frame background pattern 0
+@ s0 hidden false
+@ s0 type xy
+@ s0 symbol 1
+@ s0 symbol size 1.000000
+@ s0 symbol color 1
+@ s0 symbol pattern 1
+@ s0 symbol fill color 1
+@ s0 symbol fill pattern 1
+@ s0 symbol linewidth 1.0
+@ s0 symbol linestyle 1
+@ s0 symbol char 65
+@ s0 symbol char font 0
+@ s0 symbol skip 0
+@ s0 line type 1
+@ s0 line linestyle 1
+@ s0 line linewidth 2.0
+@ s0 line color 1
+@ s0 line pattern 1
+@ s0 baseline type 0
+@ s0 baseline off
+@ s0 dropline off
+@ s0 fill type 0
+@ s0 fill rule 0
+@ s0 fill color 1
+@ s0 fill pattern 1
+@ s0 avalue off
+@ s0 avalue type 2
+@ s0 avalue char size 1.000000
+@ s0 avalue font 0
+@ s0 avalue color 1
+@ s0 avalue rot 0
+@ s0 avalue format general
+@ s0 avalue prec 3
+@ s0 avalue prepend ""
+@ s0 avalue append ""
+@ s0 avalue offset 0.000000 , 0.000000
+@ s0 errorbar on
+@ s0 errorbar place both
+@ s0 errorbar color 1
+@ s0 errorbar pattern 1
+@ s0 errorbar size 1.000000
+@ s0 errorbar linewidth 1.0
+@ s0 errorbar linestyle 1
+@ s0 errorbar riser linewidth 1.0
+@ s0 errorbar riser linestyle 1
+@ s0 errorbar riser clip off
+@ s0 errorbar riser clip length 0.100000
+@ s0 comment "Cols 2:3"
+@ s0 legend ""
+@ s1 hidden false
+@ s1 type xy
+@ s1 symbol 0
+@ s1 symbol size 1.000000
+@ s1 symbol color 1
+@ s1 symbol pattern 1
+@ s1 symbol fill color 1
+@ s1 symbol fill pattern 0
+@ s1 symbol linewidth 1.0
+@ s1 symbol linestyle 1
+@ s1 symbol char 65
+@ s1 symbol char font 0
+@ s1 symbol skip 0
+@ s1 line type 1
+@ s1 line linestyle 1
+@ s1 line linewidth 3.0
+@ s1 line color 1
+@ s1 line pattern 1
+@ s1 baseline type 0
+@ s1 baseline off
+@ s1 dropline off
+@ s1 fill type 0
+@ s1 fill rule 0
+@ s1 fill color 1
+@ s1 fill pattern 1
+@ s1 avalue off
+@ s1 avalue type 2
+@ s1 avalue char size 1.000000
+@ s1 avalue font 0
+@ s1 avalue color 1
+@ s1 avalue rot 0
+@ s1 avalue format general
+@ s1 avalue prec 3
+@ s1 avalue prepend ""
+@ s1 avalue append ""
+@ s1 avalue offset 0.000000 , 0.000000
+@ s1 errorbar on
+@ s1 errorbar place both
+@ s1 errorbar color 1
+@ s1 errorbar pattern 1
+@ s1 errorbar size 1.000000
+@ s1 errorbar linewidth 1.0
+@ s1 errorbar linestyle 1
+@ s1 errorbar riser linewidth 1.0
+@ s1 errorbar riser linestyle 1
+@ s1 errorbar riser clip off
+@ s1 errorbar riser clip length 0.100000
+@ s1 comment "Cols 5:6"
+@ s1 legend ""
+@ s2 hidden false
+@ s2 type xy
+@ s2 symbol 0
+@ s2 symbol size 1.000000
+@ s2 symbol color 1
+@ s2 symbol pattern 1
+@ s2 symbol fill color 1
+@ s2 symbol fill pattern 0
+@ s2 symbol linewidth 1.0
+@ s2 symbol linestyle 1
+@ s2 symbol char 65
+@ s2 symbol char font 0
+@ s2 symbol skip 0
+@ s2 line type 1
+@ s2 line linestyle 1
+@ s2 line linewidth 3.0
+@ s2 line color 1
+@ s2 line pattern 1
+@ s2 baseline type 0
+@ s2 baseline off
+@ s2 dropline off
+@ s2 fill type 0
+@ s2 fill rule 0
+@ s2 fill color 1
+@ s2 fill pattern 1
+@ s2 avalue off
+@ s2 avalue type 2
+@ s2 avalue char size 1.000000
+@ s2 avalue font 0
+@ s2 avalue color 1
+@ s2 avalue rot 0
+@ s2 avalue format general
+@ s2 avalue prec 3
+@ s2 avalue prepend ""
+@ s2 avalue append ""
+@ s2 avalue offset 0.000000 , 0.000000
+@ s2 errorbar on
+@ s2 errorbar place both
+@ s2 errorbar color 1
+@ s2 errorbar pattern 1
+@ s2 errorbar size 1.000000
+@ s2 errorbar linewidth 1.0
+@ s2 errorbar linestyle 1
+@ s2 errorbar riser linewidth 1.0
+@ s2 errorbar riser linestyle 1
+@ s2 errorbar riser clip off
+@ s2 errorbar riser clip length 0.100000
+@ s2 comment "Cols 8:9"
+@ s2 legend ""
+@ s3 hidden false
+@ s3 type xy
+@ s3 symbol 0
+@ s3 symbol size 1.000000
+@ s3 symbol color 1
+@ s3 symbol pattern 1
+@ s3 symbol fill color 1
+@ s3 symbol fill pattern 0
+@ s3 symbol linewidth 1.0
+@ s3 symbol linestyle 1
+@ s3 symbol char 65
+@ s3 symbol char font 0
+@ s3 symbol skip 0
+@ s3 line type 1
+@ s3 line linestyle 1
+@ s3 line linewidth 3.0
+@ s3 line color 1
+@ s3 line pattern 1
+@ s3 baseline type 0
+@ s3 baseline off
+@ s3 dropline off
+@ s3 fill type 0
+@ s3 fill rule 0
+@ s3 fill color 1
+@ s3 fill pattern 1
+@ s3 avalue off
+@ s3 avalue type 2
+@ s3 avalue char size 1.000000
+@ s3 avalue font 0
+@ s3 avalue color 1
+@ s3 avalue rot 0
+@ s3 avalue format general
+@ s3 avalue prec 3
+@ s3 avalue prepend ""
+@ s3 avalue append ""
+@ s3 avalue offset 0.000000 , 0.000000
+@ s3 errorbar on
+@ s3 errorbar place both
+@ s3 errorbar color 1
+@ s3 errorbar pattern 1
+@ s3 errorbar size 1.000000
+@ s3 errorbar linewidth 1.0
+@ s3 errorbar linestyle 1
+@ s3 errorbar riser linewidth 1.0
+@ s3 errorbar riser linestyle 1
+@ s3 errorbar riser clip off
+@ s3 errorbar riser clip length 0.100000
+@ s3 comment "Cols 11:12"
+@ s3 legend ""
+@ s4 hidden false
+@ s4 type xy
+@ s4 symbol 0
+@ s4 symbol size 1.000000
+@ s4 symbol color 1
+@ s4 symbol pattern 1
+@ s4 symbol fill color 1
+@ s4 symbol fill pattern 0
+@ s4 symbol linewidth 1.0
+@ s4 symbol linestyle 1
+@ s4 symbol char 65
+@ s4 symbol char font 0
+@ s4 symbol skip 0
+@ s4 line type 1
+@ s4 line linestyle 1
+@ s4 line linewidth 3.0
+@ s4 line color 1
+@ s4 line pattern 1
+@ s4 baseline type 0
+@ s4 baseline off
+@ s4 dropline off
+@ s4 fill type 0
+@ s4 fill rule 0
+@ s4 fill color 1
+@ s4 fill pattern 1
+@ s4 avalue off
+@ s4 avalue type 2
+@ s4 avalue char size 1.000000
+@ s4 avalue font 0
+@ s4 avalue color 1
+@ s4 avalue rot 0
+@ s4 avalue format general
+@ s4 avalue prec 3
+@ s4 avalue prepend ""
+@ s4 avalue append ""
+@ s4 avalue offset 0.000000 , 0.000000
+@ s4 errorbar on
+@ s4 errorbar place both
+@ s4 errorbar color 1
+@ s4 errorbar pattern 1
+@ s4 errorbar size 1.000000
+@ s4 errorbar linewidth 1.0
+@ s4 errorbar linestyle 1
+@ s4 errorbar riser linewidth 1.0
+@ s4 errorbar riser linestyle 1
+@ s4 errorbar riser clip off
+@ s4 errorbar riser clip length 0.100000
+@ s4 comment "Cols 14:15"
+@ s4 legend ""
+@ s5 hidden false
+@ s5 type xy
+@ s5 symbol 0
+@ s5 symbol size 1.000000
+@ s5 symbol color 1
+@ s5 symbol pattern 1
+@ s5 symbol fill color 1
+@ s5 symbol fill pattern 0
+@ s5 symbol linewidth 1.0
+@ s5 symbol linestyle 1
+@ s5 symbol char 65
+@ s5 symbol char font 0
+@ s5 symbol skip 0
+@ s5 line type 1
+@ s5 line linestyle 1
+@ s5 line linewidth 3.0
+@ s5 line color 1
+@ s5 line pattern 1
+@ s5 baseline type 0
+@ s5 baseline off
+@ s5 dropline off
+@ s5 fill type 0
+@ s5 fill rule 0
+@ s5 fill color 1
+@ s5 fill pattern 1
+@ s5 avalue off
+@ s5 avalue type 2
+@ s5 avalue char size 1.000000
+@ s5 avalue font 0
+@ s5 avalue color 1
+@ s5 avalue rot 0
+@ s5 avalue format general
+@ s5 avalue prec 3
+@ s5 avalue prepend ""
+@ s5 avalue append ""
+@ s5 avalue offset 0.000000 , 0.000000
+@ s5 errorbar on
+@ s5 errorbar place both
+@ s5 errorbar color 1
+@ s5 errorbar pattern 1
+@ s5 errorbar size 1.000000
+@ s5 errorbar linewidth 1.0
+@ s5 errorbar linestyle 1
+@ s5 errorbar riser linewidth 1.0
+@ s5 errorbar riser linestyle 1
+@ s5 errorbar riser clip off
+@ s5 errorbar riser clip length 0.100000
+@ s5 comment "Cols 17:18"
+@ s5 legend ""
+@target G0.S0
+@type xy
+-0.00020471 0.00655014
+-0.000847612 0.00675668
+-0.0015342 0.00688468
+-0.00225308 0.00692804
+-0.00299183 0.00688197
+-0.00373705 0.00674311
+-0.00447459 0.00650976
+-0.0051897 0.00618199
+-0.00586735 0.00576186
+-0.00649249 0.0052535
+-0.00705043 0.00466325
+-0.00752731 0.00399965
+-0.00791047 0.00327339
+-0.00818899 0.00249719
+-0.00835413 0.00168553
+-0.00839971 0.000854306
+-0.00832249 2.03576e-05
+-0.00812233 -0.000799035
+-0.00780235 -0.00158674
+-0.0073688 -0.00232635
+-0.00683085 -0.00300275
+-0.00620026 -0.00360259
+-0.00549091 -0.00411465
+-0.00471829 -0.00453016
+-0.00389894 -0.00484288
+-0.00304988 -0.0050492
+-0.00218816 -0.00514798
+-0.00133037 -0.00514046
+-0.000492311 -0.00503003
+0.000311334 -0.00482194
+0.00106719 -0.00452309
+0.00176336 -0.00414174
+0.0023895 -0.00368725
+0.00293689 -0.00316983
+0.00339843 -0.00260038
+0.00376866 -0.00199025
+0.00404372 -0.00135108
+0.00422132 -0.000694668
+0.00430073 -3.28003e-05
+0.0042827 0.000622837
+0.00416947 0.0012608
+0.00396473 0.00186999
+0.00367358 0.00243978
+0.00330251 0.00296015
+0.00285936 0.00342178
+0.00235329 0.00381622
+0.00179469 0.00413606
+0.00119514 0.00437506
+0.000567293 0.00452836
+-7.53049e-05 0.00459264
+-0.00071836 0.00456633
+-0.0013471 0.00444974
+-0.00194656 0.00424528
+-0.00250195 0.00395751
+-0.00299907 0.0035932
+-0.00342472 0.00316136
+-0.00376725 0.00267308
+-0.00401694 0.0021413
+-0.00416652 0.00158056
+-0.00421147 0.0010065
+-0.00415031 0.000435375
+-0.00398471 -0.000116498
+-0.00371947 -0.000633337
+-0.00336234 -0.00110046
+-0.00292371 -0.00150477
+-0.00241619 -0.00183519
+-0.00185406 -0.00208297
+-0.0012528 -0.0022418
+-0.000628469 -0.00230793
+2.74829e-06 -0.00228011
+0.000625026 -0.0021594
+0.00122327 -0.00194905
+0.00178344 -0.00165417
+0.00229275 -0.00128155
+0.00273988 -0.000839337
+0.00311505 -0.000336807
+0.00341009 0.000215892
+0.00361845 0.00080795
+0.00373522 0.0014281
+0.00375709 0.00206477
+0.00368232 0.00270628
+0.00351072 0.00334094
+0.00324358 0.0039572
+0.00288369 0.00454375
+0.00243523 0.00508965
+0.00190382 0.00558444
+0.00129643 0.00601825
+0.00062136 0.00638196
+-0.000111784 0.00666728
+-0.000892163 0.00686694
+-0.00170777 0.00697486
+-0.00254553 0.00698629
+-0.00339145 0.00689801
+-0.00423075 0.00670851
+-0.00504817 0.00641817
+-0.00582817 0.00602941
+-0.00655533 0.00554683
+-0.00721472 0.00497726
+-0.00779234 0.00432976
+-0.00827562 0.00361555
+-0.00865384 0.00284781
+-0.00891864 0.0020414
+-0.00906434 0.00121243
+-0.00908827 0.000377804
+-0.00899094 -0.000445331
+-0.00877603 -0.00124019
+-0.00845028 -0.0019909
+-0.00802318 -0.00268303
+-0.00750665 -0.00330403
+-0.00691449 -0.00384357
+-0.00626188 -0.00429373
+-0.00556482 -0.00464914
+-0.00483963 -0.0049069
+-0.00410248 -0.00506653
+-0.00336896 -0.00512977
+-0.00265377 -0.00510033
+-0.00197047 -0.0049837
+-0.00133124 -0.00478682
+-0.000746836 -0.00451784
+-0.000226441 -0.00418594
+0.000222331 -0.00380099
+0.000593451 -0.00337346
+0.000882467 -0.00291418
+0.00108647 -0.00243419
+0.00120406 -0.00194459
+0.00123533 -0.00145645
+0.00118179 -0.00098063
+0.0010464 -0.000527727
+0.000833454 -0.000107918
+0.000548629 0.000269138
+0.000198908 0.000594425
+-0.000207449 0.0008597
+-0.000660949 0.00105764
+-0.00115094 0.001182
+-0.00166568 0.00122777
+-0.00219249 0.00119135
+-0.00271789 0.00107074
+-0.00322782 0.000865725
+-0.00370789 0.000578006
+-0.00414371 0.00021135
+-0.00452123 -0.00022832
+-0.00482722 -0.000732913
+-0.00504967 -0.00129222
+-0.00517828 -0.00189406
+-0.00520489 -0.00252456
+-0.00512392 -0.00316849
+-0.00493266 -0.00380972
+-0.00463146 -0.00443178
+-0.00422385 -0.00501838
+-0.00371639 -0.00555403
+-0.00311849 -0.00602454
+-0.00244202 -0.00641751
+-0.00170088 -0.0067227
+-0.000910464 -0.00693225
+-8.71233e-05 -0.00704087
+0.000752367 -0.00704578
+0.0015913 -0.00694671
+0.00241347 -0.00674568
+0.00320354 -0.0064468
+0.00394729 -0.00605603
+0.00463189 -0.00558093
+0.00524599 -0.00503036
+0.00577986 -0.00441424
+0.0062254 -0.00374334
+0.00657619 -0.00302901
+0.00682745 -0.00228306
+0.00697604 -0.00151752
+0.00702042 -0.000744533
+0.00696063 2.38198e-05
+0.00679821 0.000775615
+0.0065362 0.00149923
+0.00617912 0.00218344
+0.00573286 0.00281756
+0.00520472 0.00339157
+0.00460335 0.00389621
+0.00393865 0.00432316
+0.00322179 0.00466517
+0.00246503 0.00491623
+0.00168168 0.00507174
+0.000885924 0.0051287
+9.26032e-05 0.00508585
+-0.00068299 0.00494387
+-0.00142543 0.00470552
+-0.00211951 0.00437571
+-0.00275065 0.00396159
+-0.00330531 0.0034725
+-0.00377151 0.00291985
+-0.00413922 0.00231694
+-0.00440087 0.00167859
+-0.00455163 0.00102077
+-0.0045897 0.000360038
+-0.00451645 -0.000286939
+-0.00433636 -0.000904027
+-0.00405687 -0.00147615
+-0.00368811 -0.00198982
+-0.00324241 -0.00243351
+-0.00273386 -0.002798
+-0.00217774 -0.00307652
+-0.00159 -0.00326484
+-0.000986717 -0.00336123
+-0.000383681 -0.0033663
+0.000204034 -0.00328282
+0.000762373 -0.00311552
+0.00127853 -0.00287073
+0.00174114 -0.00255624
+0.00214038 -0.00218094
+0.00246801 -0.0017546
+0.00271744 -0.0012877
+0.0028837 -0.000791139
+0.00296344 -0.000276135
+0.00295485 0.000245977
+0.0028577 0.000763873
+0.00267322 0.00126637
+0.0024041 0.00174256
+0.00205447 0.00218189
+0.00162983 0.00257432
+0.00113701 0.00291042
+0.000584157 0.00318149
+-1.93094e-05 0.0033797
+-0.000662788 0.00349826
+-0.00133455 0.00353151
+-0.00202184 0.00347518
+-0.00271103 0.00332649
+-0.00338777 0.00308434
+-0.00403724 0.00274953
+-0.00464442 0.00232482
+-0.00519441 0.00181515
+-0.00567283 0.00122762
+-0.00606627 0.00057154
+-0.00636272 -0.000141662
+-0.00655203 -0.000898636
+-0.00662641 -0.00168438
+-0.00658076 -0.00248265
+-0.00641299 -0.00327642
+-0.00612418 -0.00404845
+-0.00571862 -0.00478184
+-0.00520367 -0.00546063
+-0.00458951 -0.00607034
+-0.00388877 -0.00659837
+-0.00311599 -0.00703441
+-0.00228713 -0.00737062
+-0.001419 -0.00760176
+-0.00052874 -0.00772514
+0.000366691 -0.00774057
+0.0012509 -0.00765013
+0.00210843 -0.00745797
+0.00292501 -0.00717004
+0.00368775 -0.00679382
+0.00438529 -0.00633807
+0.00500783 -0.00581257
+0.00554725 -0.00522787
+0.00599704 -0.00459514
+0.00635231 -0.00392594
+0.00660981 -0.00323204
+0.00676782 -0.00252534
+0.00682617 -0.00181768
+0.00678621 -0.00112073
+0.00665073 -0.000445896
+0.00642398 0.000195823
+0.00611161 0.000793944
+0.00572065 0.00133863
+0.00525948 0.00182081
+0.00473775 0.00223236
+0.00416635 0.00256621
+0.00355733 0.00281658
+0.00292371 0.00297911
+0.00227941 0.00305104
+0.00163898 0.00303144
+0.00101735 0.00292134
+0.000429522 0.00272388
+-0.000109804 0.00244439
+-0.000586673 0.00209045
+-0.000988327 0.0016718
+-0.00130368 0.00120023
+-0.00152379 0.00068929
+-0.00164224 0.000153959
+-0.00165553 -0.000389828
+-0.00156321 -0.000925707
+-0.00136803 -0.00143747
+-0.00107581 -0.00190963
+-0.000695242 -0.00232799
+-0.000237499 -0.00268011
+0.00028419 -0.00295566
+0.000855081 -0.00314671
+0.00145946 -0.00324785
+0.00208119 -0.00325617
+0.00270419 -0.00317124
+0.00331286 -0.0029949
+0.00389246 -0.00273106
+0.0044294 -0.00238543
+0.0049114 -0.0019653
+0.00532771 -0.00147922
+0.00566911 -0.000936778
+0.00592803 -0.000348364
+0.00609852 0.000275049
+0.00617624 0.000922089
+0.00615847 0.00158115
+0.00604404 0.00224056
+0.00583329 0.00288869
+0.00552807 0.00351407
+0.00513166 0.00410555
+0.00464878 0.00465236
+0.00408553 0.00514429
+0.00344935 0.00557172
+0.00274903 0.00592584
+0.00199462 0.00619874
+0.00119736 0.00638358
+0.000369664 0.00647474
+-0.000475063 0.00646803
+-0.00132253 0.00636083
+-0.00215777 0.0061523
+-0.00296539 0.00584355
+-0.00372986 0.00543777
+-0.00443589 0.00494038
+-0.00506882 0.004359
+-0.00561513 0.00370351
+-0.00606283 0.00298586
+-0.00640199 0.00221989
+-0.00662518 0.00142098
+-0.00672776 0.000605622
+-0.00670819 -0.000209112
+-0.00656811 -0.0010061
+-0.00631234 -0.0017688
+-0.00594864 -0.00248175
+-0.00548747 -0.00313111
+-0.00494148 -0.00370507
+-0.00432505 -0.0041941
+-0.00365376 -0.00459117
+-0.00294383 -0.00489176
+-0.0022116 -0.00509385
+-0.00147312 -0.00519776
+-0.000743747 -0.00520592
+-3.78368e-05 -0.00512273
+0.00063148 -0.00495418
+0.00125246 -0.0047077
+0.00181488 -0.00439181
+0.00231004 -0.00401597
+0.00273085 -0.0035903
+0.00307179 -0.00312541
+0.00332892 -0.00263223
+0.00349981 -0.00212187
+0.00358356 -0.00160544
+0.0035807 -0.00109397
+0.00349323 -0.000598283
+0.00332451 -0.000128855
+0.0030793 0.000304265
+0.00276369 0.00069159
+0.00238509 0.00102432
+0.00195215 0.00129447
+0.00147476 0.00149502
+0.000963934 0.00162009
+0.000431728 0.00166509
+-0.000108887 0.0016269
+-0.000644214 0.00150408
+-0.00116005 0.00129698
+-0.00164196 0.00100797
+-0.00207563 0.00064151
+-0.00244724 0.000204212
+-0.00274392 -0.000295131
+-0.00295417 -0.000845654
+-0.00306839 -0.00143461
+-0.00307925 -0.00204764
+-0.00298211 -0.0026692
+-0.0027753 -0.00328305
+-0.00246023 -0.00387273
+-0.00204148 -0.00442224
+-0.0015266 -0.00491653
+-0.000925861 -0.00534202
+-0.000251852 -0.00568708
+0.000481 -0.00594234
+0.00125696 -0.00610085
+0.00205954 -0.00615824
+0.002872 -0.00611266
+0.00367784 -0.00596467
+0.00446119 -0.00571708
+0.00520716 -0.00537468
+0.00590206 -0.00494403
+0.00653364 -0.00443317
+0.0070912 -0.00385134
+0.00756562 -0.00320879
+0.00794947 -0.0025165
+0.00823697 -0.00178597
+0.00842398 -0.00102908
+0.00850797 -0.000257903
+0.00848803 0.000515464
+0.00836476 0.001279
+0.00814029 0.00202091
+0.00781823 0.00272972
+0.00740361 0.00339442
+0.00690288 0.00400457
+0.00632386 0.00455043
+0.00567567 0.00502309
+0.00496873 0.00541463
+0.00421462 0.00571825
+0.00342605 0.00592846
+0.00261666 0.00604125
+0.00180095 0.00605425
+0.000993963 0.00596692
+0.000211106 0.00578071
+-0.000532214 0.00549919
+-0.00122095 0.00512811
+-0.00184082 0.00467545
+-0.0023788 0.00415136
+-0.00282353 0.00356799
+-0.00316584 0.00293927
+-0.00339909 0.00228051
+-0.00351951 0.00160799
+-0.00352642 0.000938407
+-0.00342232 0.00028833
+-0.00321277 -0.000326398
+-0.00290622 -0.000891183
+-0.00251361 -0.00139316
+-0.00204795 -0.00182158
+-0.00152382 -0.00216802
+-0.000956798 -0.0024266
+-0.000362918 -0.00259395
+0.000241787 -0.00266913
+0.000841748 -0.00265351
+0.00142221 -0.00255054
+0.00196954 -0.00236551
+0.0024714 -0.00210525
+0.00291694 -0.00177791
+0.00329689 -0.0013927
+0.00360357 -0.000959609
+0.00383093 -0.000489253
+0.00397456 7.36633e-06
+0.00403161 0.000519013
+0.00400083 0.00103437
+0.00388247 0.00154219
+0.00367824 0.00203139
+0.00339133 0.0024912
+0.00302631 0.00291128
+0.00258913 0.0032818
+0.00208706 0.00359361
+0.00152867 0.00383833
+0.000923769 0.00400851
+0.000283327 0.00409775
+-0.000380585 0.00410091
+-0.00105493 0.00401425
+-0.00172584 0.00383558
+-0.00237883 0.0035645
+-0.00299902 0.0032025
+-0.00357145 0.00275314
+-0.00408143 0.00222212
+-0.00451494 0.00161737
+-0.00485908 0.000948966
+-0.00510253 0.000229046
+-0.00523601 -0.000528417
+-0.00525274 -0.00130795
+-0.00514871 -0.00209298
+-0.00492305 -0.00286637
+-0.00457804 -0.00361097
+-0.00411915 -0.0043102
+-0.00355485 -0.00494861
+-0.00289628 -0.00551238
+-0.00215687 -0.00598974
+-0.00135176 -0.0063713
+-0.000497319 -0.00665017
+0.000389423 -0.00682207
+0.0012913 -0.00688529
+0.00219149 -0.00684051
+0.00307384 -0.00669064
+0.00392329 -0.00644056
+0.00472599 -0.00609685
+0.00546959 -0.00566755
+0.00614326 -0.00516188
+0.00673779 -0.00458998
+0.00724564 -0.00396272
+0.0076609 -0.00329148
+0.00797927 -0.00258799
+0.00819807 -0.00186413
+0.00831617 -0.00113186
+0.00833398 -0.000403032
+0.0082534 0.000310724
+0.00807778 0.000998088
+0.00781192 0.00164819
+0.007462 0.00225073
+0.00703558 0.00279608
+0.00654156 0.00327549
+0.00599008 0.00368114
+0.0053925 0.0040064
+0.00476127 0.00424594
+0.00410982 0.00439594
+0.00345235 0.00445428
+0.00280362 0.00442068
+0.00217868 0.00429692
+0.00159252 0.0040869
+0.00105966 0.00379675
+0.000593729 0.00343484
+0.000206991 0.00301167
+-9.01348e-05 0.00253969
+-0.000289523 0.00203302
+-0.000385725 0.00150707
+-0.000376267 0.000978004
+-0.000261813 0.000462218
+-4.61849e-05 -2.42425e-05
+0.000263767 -0.000466267
+0.000658442 -0.000850202
+0.00112589 -0.0011643
+0.0016523 -0.00139903
+0.00222253 -0.00154732
+0.00282066 -0.00160463
+0.00343052 -0.00156894
+0.00403616 -0.00144062
+0.00462228 -0.00122224
+0.00517449 -0.000918388
+0.00567968 -0.000535338
+0.00612609 -8.08355e-05
+0.00650351 0.000436183
+0.00680331 0.00100583
+0.00701851 0.00161752
+0.00714373 0.00226012
+0.00717522 0.00292218
+0.00711082 0.00359207
+0.00694989 0.00425815
+0.00669333 0.00490883
+0.0063435 0.0055328
+0.00590418 0.00611903
+0.00538059 0.00665696
+0.00477931 0.0071366
+0.00410825 0.00754863
+0.00337664 0.00788455
+0.00259495 0.00813684
+0.00177485 0.0082991
+0.000929099 0.0083662
+7.14174e-05 0.00833452
+-0.000783652 0.00820206
+-0.00162097 0.00796868
+-0.00242508 0.00763621
+-0.0031805 0.00720865
+-0.00387212 0.00669219
+-0.00448566 0.0060953
+-0.00500808 0.00542862
+-0.0054281 0.00470482
+-0.00573664 0.00393836
+-0.00592723 0.00314508
+-0.00599634 0.00234177
+-0.00594358 0.00154561
+-0.00577177 0.000773615
+-0.00548682 4.20286e-05
+-0.00509756 -0.000634203
+-0.0046153 -0.0012419
+-0.00405343 -0.00177003
+-0.00342686 -0.00220993
+-0.0027515 -0.00255546
+-0.00204372 -0.002803
+-0.00131986 -0.00295139
+-0.000595792 -0.00300173
+0.0001134 -0.00295719
+0.000793733 -0.00282277
+0.00143251 -0.00260503
+0.00201848 -0.00231181
+0.00254191 -0.00195203
+0.00299463 -0.0015354
+0.00337006 -0.00107226
+0.00366322 -0.000573387
+0.00387063 -4.98061e-05
+0.00399039 0.000487333
+0.00402205 0.00102689
+0.00396663 0.00155788
+0.00382656 0.00206953
+0.00360566 0.00255147
+0.00330914 0.00299379
+0.0029435 0.00338716
+0.00251657 0.00372301
+0.00203742 0.00399361
+0.00151631 0.00419227
+0.000964635 0.00431347
+0.000394771 0.00435305
+-0.000180037 0.0043084
+-0.000745883 0.00417861
+-0.00128844 0.00396467
+-0.00179326 0.00366961
+-0.00224614 0.00329856
+-0.00263351 0.00285886
+-0.00294291 0.00235999
+-0.00316343 0.00181345
+-0.00328619 0.00123254
+-0.00330473 0.000632022
+-0.00321539 2.77156e-05
+-0.00301755 -0.000564045
+-0.00271372 -0.00112696
+-0.00230949 -0.00164532
+-0.00181337 -0.0021046
+-0.00123645 -0.00249193
+-0.000591989 -0.00279646
+0.000105129 -0.0030097
+0.000838903 -0.00312568
+0.00159276 -0.00314093
+0.00235007 -0.00305452
+0.00309459 -0.00286784
+0.00381083 -0.00258445
+0.00448437 -0.00220982
+0.00510212 -0.00175105
+0.00565241 -0.00121665
+0.00612518 -0.000616233
+0.00651199 3.96856e-05
+0.00680604 0.000739932
+0.00700221 0.00147286
+0.00709699 0.00222654
+0.00708849 0.0029889
+0.00697638 0.00374787
+0.00676186 0.00449153
+0.00644763 0.00520821
+0.00603785 0.00588661
+0.0055381 0.00651593
+0.00495536 0.007086
+0.00429795 0.00758738
+0.0035755 0.00801151
+0.00279889 0.00835089
+0.00198015 0.00859918
+0.00113238 0.00875143
+0.000269591 0.00880422
+-0.000593479 0.00875586
+-0.00144158 0.00860654
+-0.00225923 0.00835849
+-0.00303108 0.00801608
+-0.00374229 0.00758593
+-0.00437895 0.00707683
+-0.00492858 0.00649972
+-0.00538053 0.00586746
+-0.00572651 0.00519457
+-0.00596085 0.0044968
+-0.00608091 0.00379066
+-0.00608713 0.00309292
+-0.00598314 0.00241995
+-0.00577556 0.00178725
+-0.00547378 0.00120885
+-0.00508955 0.000696908
+-0.00463649 0.000261391
+-0.00412957 -9.01733e-05
+-0.0035846 -0.000352771
+-0.00301766 -0.000523893
+-0.00244463 -0.000603429
+-0.00188084 -0.000593487
+-0.00134065 -0.000498166
+-0.000837246 -0.000323302
+-0.000382446 -7.62015e-05
+1.34511e-05 0.000234621
+0.000341729 0.00059969
+0.000595289 0.0010088
+0.000768656 0.00145121
+0.000857967 0.00191585
+0.000860935 0.00239147
+0.00077682 0.0028668
+0.000606385 0.00333065
+0.000351857 0.00377207
+1.68928e-05 0.00418046
+-0.000393461 0.00454566
+-0.000872803 0.0048581
+-0.00141341 0.00510891
+-0.0020063 0.00529004
+-0.00264126 0.00539441
+-0.00330694 0.00541609
+-0.00399094 0.00535042
+-0.00467992 0.00519422
+-0.00535982 0.00494594
+-0.006016 0.00460586
+-0.00663356 0.00417621
+-0.00719762 0.00366132
+-0.00769374 0.00306772
+-0.00810828 0.0024041
+-0.00842893 0.00168131
+-0.00864509 0.000912188
+-0.00874839 0.000111275
+-0.00873307 -0.000705518
+-0.00859629 -0.00152138
+-0.00833835 -0.00231913
+-0.00796275 -0.00308179
+-0.00747612 -0.00379315
+-0.00688795 -0.00443836
+-0.00621032 -0.00500433
+-0.00545734 -0.00548018
+-0.00464469 -0.00585744
+-0.00378905 -0.00613023
+-0.00290757 -0.00629524
+-0.00201735 -0.0063517
+-0.00113502 -0.00630117
+-0.000276361 -0.00614734
+0.000543972 -0.00589582
+0.00131267 -0.00555378
+0.00201794 -0.00512977
+0.00264954 -0.00463342
+0.00319891 -0.00407522
+0.00365911 -0.0034663
+0.00402485 -0.00281822
+0.00429249 -0.00214282
+0.00445994 -0.00145209
+0.00452668 -0.000757982
+0.00449372 -7.23101e-05
+0.00436354 0.00059336
+0.00414008 0.00122784
+0.00382869 0.00182043
+0.00343613 0.00236104
+0.00297049 0.00284035
+0.00244119 0.0032499
+0.00185888 0.0035823
+0.00123539 0.00383136
+0.000583595 0.00399228
+-8.27271e-05 0.00406183
+-0.000749079 0.00403857
+-0.0014005 0.00392293
+-0.00202187 0.00371747
+-0.00259827 0.00342692
+-0.00311538 0.00305823
+-0.00355996 0.00262058
+-0.00392031 0.00212522
+-0.00418673 0.00158531
+-0.00435196 0.00101549
+-0.00441156 0.000431554
+-0.00436414 -0.000150138
+-0.00421145 -0.000713197
+-0.00395841 -0.0012418
+-0.00361288 -0.00172126
+-0.00318531 -0.0021385
+-0.0026884 -0.0024825
+-0.00213646 -0.00274456
+-0.00154499 -0.00291845
+-0.000930025 -0.00300052
+-0.000307715 -0.00298956
+0.000306186 -0.00288675
+0.000896679 -0.00269536
+0.00144983 -0.00242058
+0.00195298 -0.0020692
+0.00239494 -0.00164941
+0.00276608 -0.00117045
+0.00305835 -0.000642454
+0.00326536 -7.61943e-05
+0.00338233 0.000517116
+0.00340609 0.00112599
+0.00333502 0.00173881
+0.00316905 0.002344
+0.00290959 0.0029301
+0.00255953 0.00348593
+0.00212315 0.00400066
+0.00160616 0.00446398
+0.00101561 0.00486615
+0.000359859 0.0051982
+-0.000351414 0.005452
+-0.00110732 0.00562046
+-0.00189583 0.00569765
+-0.00270382 0.005679
+-0.00351729 0.0055615
+-0.00432148 0.00534383
+-0.00510113 0.00502657
+-0.00584075 0.00461236
+-0.00652499 0.00410601
+-0.00713899 0.00351457
+-0.00766889 0.00284733
+-0.00810225 0.00211574
+-0.00842857 0.00133317
+-0.00863968 0.000514676
+-0.00873017 -0.000323451
+-0.00869768 -0.00116417
+-0.00854301 -0.00199025
+-0.00827016 -0.00278485
+-0.00788619 -0.00353208
+-0.00740094 -0.00421756
+-0.00682659 -0.0048288
+-0.00617721 -0.00535559
+-0.00546821 -0.00579015
+-0.00471578 -0.00612723
+-0.00393641 -0.00636411
+-0.00314638 -0.00650046
+-0.00236139 -0.00653815
+-0.00159621 -0.00648104
+-0.000864441 -0.00633473
+-0.000178338 -0.00610627
+0.000451323 -0.00580392
+0.00101531 -0.00543692
+0.00150597 -0.00501524
+0.00191723 -0.00454941
+0.00224459 -0.00405033
+0.00248508 -0.00352909
+0.00263726 -0.00299689
+0.00270114 -0.00246484
+0.0026782 -0.00194391
+0.0025713 -0.00144475
+0.0023847 -0.000977635
+0.00212403 -0.000552323
+0.00179621 -0.000177928
+0.00140946 0.000137204
+0.000973252 0.000385644
+0.000498219 0.000561036
+-3.91598e-06 0.000658268
+-0.000520468 0.000673646
+-0.00103795 0.000605082
+-0.00154229 0.000452269
+-0.00201907 0.000216841
+-0.00245391 -9.74899e-05
+-0.00283275 -0.000484853
+-0.00314237 -0.000937196
+-0.00337079 -0.00144435
+-0.00350776 -0.00199417
+-0.00354519 -0.00257284
+-0.00347759 -0.00316519
+-0.00330234 -0.0037552
+-0.00301992 -0.00432651
+-0.00263394 -0.004863
+-0.00215106 -0.00534936
+-0.00158075 -0.00577164
+-0.000934892 -0.00611769
+-0.000227375 -0.00637753
+0.000526482 -0.00654359
+0.00131045 -0.00661083
+0.00210791 -0.00657674
+0.00290237 -0.00644127
+0.00367787 -0.00620664
+0.00441932 -0.00587715
+0.00511282 -0.00545888
+0.0057458 -0.0049595
+0.00630724 -0.00438791
+0.00678768 -0.0037541
+0.00717933 -0.00306881
+0.00747603 -0.00234341
+0.00767328 -0.00158963
+0.00776819 -0.000819462
+0.00775946 -4.49676e-05
+0.00764734 0.000721848
+0.0074336 0.00146916
+0.00712147 0.00218544
+0.00671566 0.00285957
+0.00622226 0.003481
+0.00564874 0.0040398
+0.00500392 0.00452685
+0.00429789 0.00493398
+0.00354198 0.00525409
+0.00274861 0.00548135
+0.00193126 0.00561135
+0.00110423 0.0056413
+0.000282503 0.00557017
+-0.000518552 0.00539891
+-0.00128345 0.00513053
+-0.00199696 0.00477025
+-0.00264452 0.0043255
+-0.00321269 0.0038059
+-0.00368959 0.00322316
+-0.00406541 0.00259079
+-0.00433276 0.00192386
+-0.00448708 0.00123847
+-0.00452685 0.000551326
+-0.00445371 -0.000120873
+-0.00427242 -0.000761984
+-0.00399068 -0.00135699
+-0.00361879 -0.00189247
+-0.00316926 -0.00235704
+-0.0026563 -0.0027416
+-0.00209526 -0.00303952
+-0.00150208 -0.00324671
+-0.000892858 -0.00336154
+-0.000283313 -0.00338473
+0.000311548 -0.00331911
+0.000877747 -0.00316945
+0.00140257 -0.00294212
+0.00187475 -0.00264488
+0.00228452 -0.0022866
+0.00262374 -0.00187703
+0.00288589 -0.00142656
+0.00306606 -0.000946067
+0.00316092 -0.000446673
+0.00316874 6.03597e-05
+0.00308929 0.000563789
+0.00292383 0.00105252
+0.00267508 0.00151572
+0.00234717 0.00194295
+0.0019456 0.00232425
+0.00147721 0.0026503
+0.000950161 0.00291249
+0.000373841 0.00310313
+-0.000241152 0.00321553
+-0.000883112 0.00324419
+-0.00153932 0.00318497
+-0.0021962 0.00303525
+-0.00283948 0.00279413
+-0.00345444 0.00246255
+-0.00402618 0.0020435
+-0.00453999 0.00154209
+-0.00498172 0.000965631
+-0.00533819 0.000323597
+-0.00559772 -0.000372434
+-0.00575054 -0.00110899
+-0.00578923 -0.00187101
+-0.00570912 -0.00264222
+-0.00550857 -0.00340566
+-0.0051891 -0.0041442
+-0.00475541 -0.00484113
+-0.00421526 -0.00548073
+-0.0035792 -0.00604881
+-0.00286011 -0.00653312
+-0.00207278 -0.00692371
+-0.00123334 -0.00721312
+-0.000358713 -0.00739649
+0.000533906 -0.00747153
+0.00142754 -0.0074384
+0.00230584 -0.00729955
+0.0031534 -0.00705948
+0.00395608 -0.00672447
+0.00470111 -0.0063023
+0.00537729 -0.00580201
+0.00597502 -0.00523365
+0.00648638 -0.00460801
+0.00690507 -0.00393647
+0.00722647 -0.00323077
+0.00744754 -0.00250288
+0.00756684 -0.00176482
+0.00758447 -0.00102856
+0.00750203 -0.000305872
+0.0073226 0.000391772
+0.00705071 0.00105332
+0.00669228 0.00166825
+0.00625463 0.00222674
+0.00574638 0.00271972
+0.00517749 0.0031391
+0.00455909 0.0034779
+0.00390347 0.0037304
+0.00322392 0.00389236
+0.00253455 0.00396116
+0.00185012 0.00393603
+0.00118574 0.00381817
+0.000556566 0.0036109
+-2.25989e-05 0.00331979
+-0.00053772 0.0029526
+-0.000976001 0.00251932
+-0.00132636 0.00203193
+-0.0015799 0.0015042
+-0.0017303 0.000951274
+-0.00177416 0.000389245
+-0.00171118 -0.000165416
+-0.00154427 -0.000696424
+-0.0012794 -0.00118827
+-0.000925402 -0.00162677
+-0.000493592 -0.00199953
+2.70698e-06 -0.00229631
+0.00054869 -0.00250928
+0.00112862 -0.00263312
+0.00172636 -0.00266507
+0.00232589 -0.0026048
+0.0029117 -0.00245426
+0.00346915 -0.00221742
+0.00398477 -0.00190009
+0.00444647 -0.00150957
+0.0048436 -0.00105445
+0.00516715 -0.00054431
+0.00540969 1.04888e-05
+0.00556544 0.000599016
+0.00563022 0.00120996
+0.00560147 0.00183181
+0.00547814 0.00245297
+0.00526072 0.00306192
+0.00495119 0.00364732
+0.00455293 0.00419815
+0.00407078 0.00470378
+0.00351093 0.00515414
+0.00288091 0.00553977
+0.00218957 0.00585203
+0.00144703 0.00608319
+0.00066459 0.00622658
+-0.000145305 0.00627678
+-0.000969217 0.0062298
+-0.00179285 0.00608323
+-0.00260124 0.00583646
+-0.00337901 0.00549082
+-0.0041107 0.00504975
+-0.00478109 0.0045189
+-0.00537564 0.00390614
+-0.00588094 0.00322161
+-0.00628523 0.00247751
+-0.00657879 0.00168789
+-0.00675444 0.000868354
+-0.00680788 3.556e-05
+-0.0067379 -0.000793274
+-0.00654651 -0.00160095
+-0.0062389 -0.00237087
+-0.00582321 -0.00308762
+-0.00531024 -0.00373743
+-0.00471298 -0.0043086
+-0.0040461 -0.00479177
+-0.00332542 -0.00518008
+-0.00256735 -0.00546922
+-0.0017884 -0.00565736
+-0.00100472 -0.005745
+-0.000231751 -0.0057348
+0.000516103 -0.00563129
+0.00122568 -0.00544064
+0.00188521 -0.00517039
+0.00248446 -0.0048292
+0.00301472 -0.00442662
+0.0034689 -0.00397287
+0.00384146 -0.00347863
+0.00412843 -0.00295493
+0.00432738 -0.00241293
+0.00443736 -0.00186384
+0.00445888 -0.00131875
+0.00439391 -0.000788557
+0.00424578 -0.000283835
+0.00401923 0.000185282
+0.00372032 0.000609217
+0.00335645 0.000979069
+0.00293627 0.00128676
+0.00246966 0.00152518
+0.00196767 0.00168834
+0.00144237 0.00177158
+0.000906782 0.00177171
+0.000374634 0.00168719
+-0.00013982 0.00151837
+-0.00062211 0.00126755
+-0.00105788 0.000939192
+-0.00143331 0.000539902
+-0.0017355 7.84798e-05
+-0.00195302 -0.000434197
+-0.0020763 -0.000985369
+-0.00209811 -0.00156069
+-0.00201392 -0.00214465
+-0.0018222 -0.00272105
+-0.00152451 -0.00327355
+-0.00112557 -0.00378628
+-0.000633055 -0.00424437
+-5.73322e-05 -0.0046345
+0.000588956 -0.00494528
+0.00129138 -0.00516761
+0.00203427 -0.00529484
+0.00280123 -0.00532288
+0.0035757 -0.00525016
+0.00434138 -0.00507746
+0.00508265 -0.00480782
+0.00578489 -0.0044462
+0.00643473 -0.00399929
+0.00702022 -0.00347522
+0.00753095 -0.00288331
+0.00795815 -0.00223382
+0.00829466 -0.0015377
+0.00853498 -0.000806448
+0.00867526 -5.18715e-05
+0.00871324 0.000714043
+0.00864821 0.00147928
+0.00848102 0.00223194
+0.008214 0.00296032
+0.00785095 0.00365309
+0.0073971 0.00429935
+0.00685906 0.00488881
+0.00624483 0.00541186
+0.00556369 0.00585975
+0.00482621 0.0062247
+0.00404415 0.0065001
+0.00323034 0.00668065
+0.00239859 0.00676255
+0.00156349 0.00674365
+0.000740216 0.00662369
+-5.5763e-05 0.00640438
+-0.000809002 0.0060896
+-0.00150446 0.00568539
+-0.00212791 0.00520008
+-0.00266645 0.0046441
+-0.0031089 0.00402993
+-0.00344631 0.00337174
+-0.00367231 0.00268508
+-0.00378345 0.00198639
+-0.00377942 0.0012925
+-0.00366304 0.000619996
+-0.00344021 -1.52936e-05
+-0.00311969 -0.000598859
+-0.00271266 -0.00111797
+-0.00223237 -0.00156203
+-0.00169352 -0.00192282
+-0.00111177 -0.00219464
+-0.000503202 -0.0023743
+0.000116174 -0.00246104
+0.000730839 -0.00245636
+0.00132612 -0.00236383
+0.00188848 -0.00218879
+0.00240569 -0.00193814
+0.00286702 -0.00162005
+0.00326329 -0.00124371
+0.00358691 -0.00081909
+0.00383194 -0.000356757
+0.00399402 0.000132346
+0.00407039 0.000637052
+0.00405982 0.00114613
+0.00396259 0.00164839
+0.00378047 0.00213286
+0.00351664 0.00258887
+0.00317569 0.00300614
+0.00276357 0.00337496
+0.00228756 0.00368628
+0.0017562 0.00393181
+0.0011793 0.00410421
+0.000567808 0.00419723
+-6.62365e-05 0.00420583
+-0.000709837 0.00412643
+-0.00134919 0.00395699
+-0.00196988 0.00369729
+-0.00255714 0.00334899
+-0.00309616 0.00291585
+-0.00357243 0.00240377
+-0.00397216 0.00182085
+-0.00428275 0.00117735
+-0.0044932 0.000485559
+-0.00459463 -0.000240438
+-0.00458068 -0.000985106
+-0.00444783 -0.00173189
+-0.00419567 -0.00246373
+-0.00382696 -0.00316362
+-0.00334763 -0.00381522
+-0.00276658 -0.00440338
+-0.00209531 -0.00491463
+-0.00134753 -0.00533763
+-0.000538614 -0.0056634
+0.000314911 -0.00588551
+0.00119595 -0.00600015
+0.00208732 -0.00600603
+0.00297223 -0.00590426
+0.00383465 -0.00569816
+0.00465963 -0.00539299
+0.00543352 -0.00499568
+0.00614415 -0.00451458
+0.00678095 -0.00395922
+0.00733495 -0.00333998
+0.00779888 -0.00266797
+0.00816711 -0.00195478
+0.00843565 -0.00121229
+0.0086021 -0.000452557
+0.00866565 0.000312372
+0.00862701 0.00107055
+0.00848839 0.00181028
+0.00825344 0.00252019
+0.00792727 0.00318941
+0.00751637 0.00380764
+0.0070286 0.00436529
+0.00647312 0.00485364
+0.00586037 0.00526499
+0.00520198 0.00559278
+0.00451065 0.00583183
+0.00380004 0.00597845
+0.00308458 0.00603069
+0.00237923 0.00598849
+0.00169919 0.00585382
+0.00105958 0.00563082
+0.000475013 0.00532588
+-4.08309e-05 0.0049476
+-0.000475693 0.00450673
+-0.000819203 0.00401598
+-0.00106333 0.00348968
+-0.00120277 0.00294342
+-0.00123522 0.00239352
+-0.00116153 0.00185648
+-0.000985758 0.0013484
+-0.000714944 0.000884384
+-0.000358885 0.000478036
+7.03095e-05 0.000141013
+0.000558702 -0.000117295
+0.00109108 -0.000289966
+0.00165149 -0.000372625
+0.0022238 -0.000363414
+0.00279212 -0.000262861
+0.00334123 -7.36936e-05
+0.00385693 0.000199403
+0.00432623 0.000550047
+0.00473758 0.000970433
+0.00508096 0.00145159
+0.00534795 0.00198362
+0.00553176 0.00255596
+0.00562722 0.00315752
+0.00563077 0.00377691
+0.00554042 0.00440261
+0.00535573 0.00502305
+0.00507775 0.00562679
+0.00470898 0.00620263
+0.00425336 0.0067397
+0.00371623 0.0072276
+0.00310427 0.00765649
+0.00242551 0.00801724
+0.00168927 0.00830154
+0.000906097 0.00850206
+8.77161e-05 0.0086126
+-0.000753064 0.00862827
+-0.00160248 0.00854566
+-0.00244598 0.00836301
+-0.00326843 0.00808044
+-0.00405441 0.00770005
+-0.00478849 0.00722609
+-0.00545567 0.00666504
+-0.00604179 0.00602566
+-0.006534 0.00531885
+-0.00692123 0.00455756
+-0.00719468 0.00375649
+-0.00734821 0.00293171
+-0.00737866 0.00210018
+-0.00728602 0.00127922
+-0.00707353 0.000485882
+-0.00674755 -0.000263568
+-0.00631731 -0.000954252
+-0.00579451 -0.00157311
+-0.0051929 -0.00210929
+-0.00452769 -0.00255433
+-0.00381504 -0.00290233
+-0.00307151 -0.00314994
+-0.00231357 -0.00329622
+-0.00155719 -0.00334254
+-0.000817509 -0.0032923
+-0.000108525 -0.0031507
+0.000557074 -0.00292449
+0.00116805 -0.00262168
+0.0017147 -0.00225132
+0.00218889 -0.00182325
+0.00258408 -0.00134793
+0.0028953 -0.000836208
+0.00311913 -0.000299215
+0.00325367 0.000251823
+0.00329848 0.000805695
+0.00325461 0.00135132
+0.0031245 0.00187788
+0.00291199 0.0023749
+0.0026223 0.0028324
+0.00226196 0.00324097
+0.00183883 0.00359196
+0.00136202 0.00387757
+0.00084185 0.00409103
+0.000289754 0.00422675
+-0.000281812 0.00428052
+-0.000859532 0.0042497
+-0.00142942 0.00413335
+-0.00197709 0.00393246
+-0.00248801 0.00365006
+-0.00294793 0.00329135
+-0.00334328 0.00286371
+-0.00366158 0.00237667
+-0.00389197 0.00184181
+-0.00402564 0.00127248
+-0.00405627 0.000683498
+-0.00398035 9.06782e-05
+-0.00379743 -0.000489676
+-0.00351021 -0.00104134
+-0.00312448 -0.00154876
+-0.00264891 -0.00199759
+-0.00209474 -0.00237518
+-0.00147528 -0.00267098
+-0.00080545 -0.00287681
+-0.00010121 -0.00298696
+0.000620981 -0.00299832
+0.00134465 -0.00291022
+0.00205379 -0.00272431
+0.00273315 -0.00244439
+0.00336864 -0.00207609
+0.00394745 -0.00162666
+0.00445827 -0.00110471
+0.00489136 -0.000519899
+0.00523861 0.000117241
+0.00549354 0.000795557
+0.00565134 0.00150345
+0.00570878 0.00222907
+0.00566425 0.00296044
+0.00551767 0.00368561
+0.00527047 0.00439277
+0.00492558 0.0050704
+0.00448735 0.00570735
+0.00396155 0.00629298
+0.00335535 0.00681726
+0.00267723 0.00727092
+0.001937 0.00764559
+0.00114568 0.00793394
+0.000315454 0.00812986
+-0.00054043 0.00822859
+-0.00140783 0.00822697
+-0.0022719 0.00812356
+-0.00311728 0.00791885
+-0.00392845 0.00761536
+-0.00469005 0.00721783
+-0.00538725 0.00673317
+-0.00600626 0.00617057
+-0.00653472 0.00554129
+-0.00696224 0.00485852
+-0.00728076 0.00413706
+-0.007485 0.0033929
+-0.00757267 0.00264274
+-0.00754462 0.00190343
+-0.00740488 0.0011914
+-0.00716047 0.000522057
+-0.00682112 -9.06587e-05
+-0.00639889 -0.000634758
+-0.00590762 -0.00110049
+-0.00536248 -0.00148057
+-0.00477934 -0.0017702
+-0.00417432 -0.00196712
+-0.00356329 -0.00207141
+-0.0029615 -0.00208536
+-0.00238322 -0.00201321
+-0.00184151 -0.00186089
+-0.00134805 -0.00163579
+-0.000913007 -0.00134644
+-0.000544958 -0.00100233
+-0.000250882 -0.000613633
+-3.6141e-05 -0.000191038
+9.54964e-05 0.000254446
+0.000141826 0.000711648
+0.000102173 0.00116938
+-2.26495e-05 0.00161655
+-0.000230374 0.00204232
+-0.00051732 0.00243619
+-0.000878423 0.00278811
+-0.00130728 0.00308861
+-0.00179616 0.00332894
+-0.00233609 0.00350118
+-0.00291687 0.00359837
+-0.00352719 0.00361472
+-0.00415466 0.00354572
+-0.00478601 0.00338834
+-0.00540722 0.00314122
+-0.00600377 0.0028048
+-0.00656086 0.00238153
+-0.00706378 0.00187595
+-0.00749828 0.00129478
+-0.00785101 0.000646931
+-0.00810993 -5.65498e-05
+-0.00826485 -0.000802682
+-0.00830782 -0.0015768
+-0.00823355 -0.00236294
+-0.00803971 -0.00314431
+-0.00772712 -0.00390383
+-0.0072998 -0.0046247
+-0.00676486 -0.00529098
+-0.00613228 -0.00588817
+-0.00541446 -0.00640358
+-0.00462585 -0.00682679
+-0.00378234 -0.00714983
+-0.00290074 -0.00736731
+-0.00199824 -0.00747643
+-0.00109192 -0.00747689
+-0.000198311 -0.00737071
+0.000666941 -0.00716202
+0.00148938 -0.00685681
+0.00225594 -0.0064626
+0.00295506 -0.00598828
+0.00357682 -0.00544374
+0.00411294 -0.00483972
+0.00455681 -0.00418754
+0.00490347 -0.00349896
+0.00514959 -0.00278594
+0.00529343 -0.00206058
+0.0053348 -0.0013349
+0.00527505 -0.000620779
+0.00511697 7.02093e-05
+0.00486483 0.000726877
+0.0045243 0.00133856
+0.00410243 0.00189523
+0.00360762 0.00238762
+0.00304956 0.00280741
+0.00243919 0.0031473
+0.00178858 0.00340128
+0.00111084 0.00356471
+0.000419972 0.00363457
+-0.000269337 0.00360962
+-0.000941971 0.00349056
+-0.00158268 0.00328019
+-0.00217647 0.00298351
+-0.00270897 0.00260777
+-0.00316698 0.00216243
+-0.00353883 0.00165904
+-0.00381498 0.00111098
+-0.00398833 0.000533167
+-0.00405466 -5.84376e-05
+-0.00401282 -0.000647325
+-0.00386487 -0.00121703
+-0.003616 -0.0017517
+-0.00327433 -0.00223669
+-0.00285058 -0.00265903
+-0.00235764 -0.00300785
+-0.00180999 -0.00327461
+-0.00122322 -0.00345333
+-0.000613421 -0.00354054
+3.28964e-06 -0.00353527
+0.000611222 -0.0034389
+0.00119549 -0.00325489
+0.00174231 -0.00298857
+0.00223922 -0.00264687
+0.00267522 -0.00223805
+0.00304088 -0.00177143
+0.0033284 -0.00125716
+0.0035316 -0.000705993
+0.00364591 -0.000129116
+0.00366837 0.000462045
+0.00359757 0.00105597
+0.00343362 0.00164116
+0.00317812 0.0022063
+0.0028341 0.00274034
+0.00240601 0.00323261
+0.00189966 0.00367296
+0.00132224 0.00405184
+0.000682217 0.00436044
+-1.06478e-05 0.00459086
+-0.000745393 0.00473619
+-0.00150992 0.00479076
+-0.00229108 0.00475022
+-0.00307483 0.00461179
+-0.00384644 0.00437443
+-0.00459066 0.00403899
+-0.00529206 0.00360838
+-0.00593538 0.00308771
+-0.00650591 0.00248433
+-0.00698996 0.00180781
+-0.00737532 0.00106989
+-0.00765177 0.00028423
+-0.00781149 -0.000533889
+-0.00784946 -0.00136797
+-0.00776373 -0.00220082
+-0.00755558 -0.00301512
+-0.00722949 -0.00379399
+-0.00679302 -0.00452163
+-0.00625644 -0.00518376
+-0.00563237 -0.00576811
+-0.00493526 -0.00626468
+-0.00418084 -0.00666599
+-0.00338554 -0.00696712
+-0.00256605 -0.00716565
+-0.00173875 -0.00726158
+-0.00091943 -0.0072571
+-0.000122869 -0.00715635
+0.000637337 -0.00696518
+0.00134898 -0.0066909
+0.00200134 -0.00634196
+0.00258526 -0.0059278
+0.00309316 -0.00545854
+0.00351905 -0.00494486
+0.0038585 -0.00439776
+0.00410863 -0.00382847
+0.00426805 -0.00324828
+0.00433686 -0.00266839
+0.00431658 -0.00209985
+0.00421015 -0.00155343
+0.0040219 -0.00103946
+0.00375751 -0.00056778
+0.00342399 -0.000147592
+0.00302963 0.000212691
+0.002584 0.000505574
+0.00209782 0.000724644
+0.00158291 0.000864745
+0.00105207 0.000922156
+0.000518898 0.000894778
+-2.43285e-06 0.000782316
+-0.00049742 0.000586438
+-0.000951575 0.000310912
+-0.00135081 -3.8314e-05
+-0.00168186 -0.000453093
+-0.00193276 -0.000923151
+-0.00209333 -0.00143625
+-0.00215558 -0.00197848
+-0.00211417 -0.00253461
+-0.00196668 -0.00308859
+-0.0017138 -0.00362411
+-0.00135937 -0.00412511
+-0.000910274 -0.00457646
+-0.000376169 -0.00496441
+0.000230894 -0.00527706
+0.000896945 -0.00550476
+0.00160663 -0.00564026
+0.00234377 -0.00567886
+0.00309187 -0.00561839
+0.00383461 -0.00545912
+0.00455627 -0.00520356
+0.00524205 -0.00485623
+0.00587837 -0.00442345
+0.00645302 -0.003913
+0.00695532 -0.00333392
+0.00737619 -0.00269623
+0.00770819 -0.0020107
+0.00794551 -0.00128868
+0.00808399 -0.000541855
+0.00812105 0.000217879
+0.0080557 0.000978563
+0.00788846 0.00172832
+0.00762137 0.00245546
+0.00725789 0.00314861
+0.00680294 0.00379682
+0.00626284 0.00438971
+0.00564524 0.00491753
+0.00495916 0.00537135
+0.00421486 0.0057432
+0.00342381 0.0060262
+0.00259863 0.00621473
+0.00175292 0.00630465
+0.000901122 0.0062934
+5.83161e-05 0.00618029
+-0.000760034 0.00596654
+-0.0015384 0.00565554
+-0.00226156 0.00525284
+-0.00291501 0.00476625
+-0.00348543 0.00420577
+-0.00396113 0.00358345
+-0.00433255 0.00291318
+-0.00459264 0.00221027
+-0.00473723 0.0014911
+-0.00476521 0.000772521
+-0.00467868 7.13155e-05
+-0.00448283 -0.000596375
+-0.00418579 -0.00121561
+-0.00379825 -0.00177314
+-0.00333303 -0.00225778
+-0.00280457 -0.00266069
+-0.0022284 -0.00297552
+-0.00162056 -0.00319846
+-0.000997145 -0.00332814
+-0.00037384 -0.00336551
+0.000234438 -0.00331365
+0.000813845 -0.00317745
+0.00135182 -0.00296343
+0.00183725 -0.00267943
+0.00226057 -0.00233436
+0.00261378 -0.00193799
+0.00289052 -0.00150069
+0.00308602 -0.00103327
+0.0031971 -0.000546798
+0.00322212 -5.24534e-05
+0.00316094 0.000438622
+0.00301491 0.000915438
+0.00278679 0.00136728
+0.00248077 0.00178382
+0.00210237 0.00215522
+0.00165847 0.00247229
+0.00115722 0.00272656
+0.000608027 0.00291046
+2.14703e-05 0.00301745
+-0.000590759 0.00304219
+-0.00121598 0.00298069
+-0.00184065 0.00283051
+-0.00245057 0.00259092
+-0.00303111 0.0022631
+-0.00356752 0.00185024
+-0.00404525 0.00135766
+-0.00445035 0.000792888
+-0.00476994 0.000165633
+-0.00499267 -0.000512338
+-0.00510917 -0.0012274
+-0.00511248 -0.00196437
+-0.00499844 -0.00270695
+-0.00476593 -0.0034382
+-0.00441701 -0.00414113
+-0.00395695 -0.00479925
+-0.003394 -0.00539714
+-0.00273914 -0.00592101
+-0.00200563 -0.00635907
+-0.00120855 -0.00670185
+-0.000364205 -0.00694246
+0.000510382 -0.00707654
+0.00139802 -0.00710237
+0.00228181 -0.0070206
+0.00314555 -0.00683417
+0.00397406 -0.00654801
+0.00475342 -0.00616879
+0.00547117 -0.00570464
+0.00611644 -0.00516493
+0.00667997 -0.00455993
+0.00715418 -0.00390069
+0.00753317 -0.00319875
+0.00781265 -0.00246599
+0.00798999 -0.00171449
+0.0080641 -0.000956326
+0.00803546 -0.000203513
+0.00790604 0.000532173
+0.00767925 0.00123928
+0.00735997 0.00190681
+0.00695446 0.00252434
+0.00647034 0.00308211
+0.00591656 0.00357121
+0.00530334 0.0039837
+0.00464211 0.00431277
+0.00394539 0.0045529
+0.00322669 0.00470008
+0.00250034 0.00475195
+0.00178126 0.00470798
+0.0010847 0.00456969
+0.000425889 0.00434069
+-0.000180315 0.00402686
+-0.00071989 0.0036363
+-0.00118011 0.0031793
+-0.00155001 0.00266817
+-0.00182088 0.00211692
+-0.00198664 0.00154097
+-0.00204417 0.000956581
+-0.00199349 0.000380355
+-0.00183783 -0.000171364
+-0.0015835 -0.000683078
+-0.00123965 -0.00114068
+-0.00081787 -0.00153191
+-0.000331701 -0.00184672
+0.00020388 -0.00207751
+0.000773036 -0.00221922
+0.0013596 -0.00226933
+0.00194758 -0.00222776
+0.00252154 -0.00209669
+0.00306701 -0.00188031
+0.00357067 -0.0015846
+0.00402064 -0.00121699
+0.00440651 -0.000786164
+0.0047195 -0.000301772
+0.00495243 0.000225803
+0.00509977 0.000785641
+0.00515759 0.00136648
+0.00512355 0.00195686
+0.00499683 0.0025453
+0.00477812 0.00312039
+0.0044696 0.00367094
+0.00407485 0.00418607
+0.00359884 0.00465534
+0.00304791 0.00506886
+0.00242974 0.00541738
+0.00175328 0.00569248
+0.00102874 0.00588665
+0.000267515 0.00599346
+-0.000517909 0.00600777
+-0.00131406 0.00592583
+-0.00210662 0.00574553
+-0.00288065 0.00546655
+-0.00362084 0.00509054
+-0.00431179 0.00462123
+-0.00493843 0.00406461
+-0.00548638 0.00342889
+-0.00594249 0.00272449
+-0.00629525 0.00196392
+-0.00653531 0.00116155
+-0.00665588 0.000333178
+-0.0066531 -0.000504323
+-0.00652625 -0.00133361
+-0.00627787 -0.00213742
+-0.00591366 -0.00289918
+-0.00544232 -0.00360356
+-0.00487511 -0.00423699
+-0.00422548 -0.00478799
+-0.00350849 -0.0052475
+-0.00274027 -0.005609
+-0.00193747 -0.00586854
+-0.00111679 -0.00602466
+-0.000294484 -0.00607823
+0.000513966 -0.00603223
+0.00129415 -0.00589152
+0.00203295 -0.00566258
+0.00271867 -0.00535319
+0.00334115 -0.00497226
+0.00389181 -0.00452953
+0.00436366 -0.0040354
+0.00475127 -0.0035007
+0.00505079 -0.00293659
+0.00525989 -0.00235435
+0.00537774 -0.00176529
+0.00540496 -0.00118059
+0.0053436 -0.000611242
+0.00519712 -6.78851e-05
+0.00497035 0.000439276
+0.00466946 0.000900598
+0.00430194 0.00130713
+0.00387658 0.00165074
+0.00340337 0.00192429
+0.00289346 0.00212178
+0.00235908 0.00223852
+0.00181335 0.00227135
+0.00127012 0.00221877
+0.000743763 0.00208117
+0.000248841 0.00186096
+-0.000200224 0.00156267
+-0.000589559 0.00119307
+-0.000906289 0.000761075
+-0.00113901 0.000277715
+-0.00127827 -0.000244117
+-0.00131698 -0.000789963
+-0.00125083 -0.00134423
+-0.00107852 -0.00189068
+-0.000801881 -0.00241302
+-0.000425905 -0.00289547
+4.14664e-05 -0.00332332
+0.000589638 -0.00368349
+0.00120579 -0.00396487
+0.00187537 -0.00415869
+0.00258267 -0.00425866
+0.00331135 -0.00426105
+0.00404494 -0.00416464
+0.00476733 -0.00397057
+0.00546315 -0.00368214
+0.00611806 -0.0033046
+0.00671902 -0.00284483
+0.00725444 -0.00231112
+0.00771427 -0.0017129
+0.0080901 -0.00106049
+0.00837515 -0.000364866
+0.00856428 0.000362506
+0.00865396 0.00110987
+0.00864226 0.00186533
+0.00852878 0.00261698
+0.00831465 0.00335304
+0.00800246 0.00406199
+0.00759626 0.00473263
+0.00710148 0.00535427
+0.00652497 0.00591678
+0.00587489 0.00641075
+0.00516072 0.00682765
+0.00439319 0.00715991
+0.00358421 0.00740115
+0.00274676 0.00754631
+0.00189478 0.00759186
+0.00104297 0.00753596
+0.000206579 0.00737862
+-0.000598861 0.00712192
+-0.0013579 0.00677005
+-0.00205553 0.00632948
+-0.00267764 0.00580887
+-0.00321148 0.00521905
+-0.00364612 0.00457286
+-0.00397292 0.0038848
+-0.00418589 0.00317069
+-0.00428204 0.0024472
+-0.00426149 0.00173126
+-0.00412758 0.00103953
+-0.00388669 0.000387774
+-0.00354801 -0.000209617
+-0.00312315 -0.000740122
+-0.00262566 -0.00119341
+-0.00207051 -0.00156157
+-0.00147352 -0.00183921
+-0.000850848 -0.00202347
+-0.000218514 -0.0021139
+0.000408021 -0.00211228
+0.0010142 -0.0020224
+0.00158661 -0.00184982
+0.00211323 -0.00160159
+0.0025835 -0.00128598
+0.00298842 -0.000912232
+0.00332062 -0.000490365
+0.00357431 -3.0925e-05
+0.0037453 0.000455177
+0.00383098 0.000956832
+0.00383025 0.00146288
+0.00374351 0.00196224
+0.00357261 0.00244403
+0.0033208 0.00289767
+0.00299274 0.00331304
+0.00259442 0.00368053
+0.00213314 0.0039912
+0.00161749 0.00423693
+0.00105725 0.0044105
+0.000463394 0.00450579
+-0.000152071 0.00451794
+-0.000776174 0.00444352
+-0.00139516 0.00428068
+-0.00199469 0.00402937
+-0.0025601 0.00369148
+-0.00307672 0.00327095
+-0.00353021 0.00277392
+-0.00390704 0.0022087
+-0.00419488 0.00158575
+-0.0043831 0.000917548
+-0.00446325 0.000218305
+-0.00442943 -0.000496361
+-0.00427864 -0.00120989
+-0.00401101 -0.00190529
+-0.00362985 -0.00256574
+-0.00314164 -0.00317515
+-0.00255574 -0.00371874
+-0.0018841 -0.00418349
+-0.00114075 -0.00455853
+-0.000341311 -0.00483545
+0.000497549 -0.00500839
+0.00135869 -0.00507409
+0.002225 -0.00503185
+0.0030798 -0.00488328
+0.00390729 -0.00463221
+0.00469279 -0.00428433
+0.00542295 -0.00384696
+0.00608596 -0.00332881
+0.00667161 -0.00273967
+0.00717135 -0.00209019
+0.0075783 -0.00139168
+0.00788724 -0.000655871
+0.0080946 0.000105237
+0.0081984 0.000879521
+0.00819823 0.00165489
+0.0080952 0.0024194
+0.00789191 0.00316137
+0.0075924 0.00386951
+0.00720213 0.00453303
+0.00672795 0.00514174
+0.00617803 0.00568622
+0.00556188 0.0061579
+0.00489021 0.00654928
+0.00417493 0.00685403
+0.00342899 0.0070672
+0.00266627 0.00718539
+0.00190137 0.00720692
+0.0011494 0.00713205
+0.00042569 0.00696308
+-0.000254603 0.0067045
+-0.000876855 0.00636302
+-0.00142744 0.0059476
+-0.00189422 0.00546934
+-0.00226699 0.00494124
+-0.00253796 0.00437792
+-0.00270211 0.0037952
+-0.00275745 0.00320956
+-0.00270522 0.00263761
+-0.00254979 0.00209547
+-0.00229859 0.0015982
+-0.00196172 0.0011593
+-0.00155158 0.000790248
+-0.00108233 0.000500207
+-0.00056933 0.000295844
+-2.86149e-05 0.000181259
+0.000523656 0.000158036
+0.00107165 0.000225377
+0.00160028 0.000380311
+0.00209547 0.000617937
+0.00254446 0.000931697
+0.00293592 0.00131364
+0.00326008 0.00175471
+0.00350878 0.00224494
+0.00367551 0.00277373
+0.00375537 0.00333004
+0.00374506 0.00390252
+0.00364284 0.00447971
+0.00344852 0.00505017
+0.00316337 0.00560259
+0.00279011 0.00612592
+0.00233288 0.00660948
+0.00179718 0.00704304
+0.00118987 0.00741699
+0.000519105 0.00772242
+-0.000205672 0.00795128
+-0.000973812 0.00809649
+-0.00177351 0.00815212
+-0.00259191 0.00811357
+-0.00341522 0.00797772
+-0.0042289 0.00774316
+-0.00501784 0.00741029
+-0.0057667 0.00698157
+-0.00646018 0.0064616
+-0.00708345 0.0058572
+-0.00762255 0.00517745
+-0.00806491 0.00443361
+-0.00839982 0.00363892
+-0.00861885 0.00280836
+-0.0087163 0.00195821
+-0.00868952 0.00110561
+-0.00853903 0.000267982
+-0.00826863 -0.000537593
+-0.00788522 -0.00129492
+-0.00739856 -0.00198927
+-0.00682088 -0.00260779
+-0.00616635 -0.0031399
+-0.00545057 -0.00357751
+-0.00469 -0.00391507
+-0.00390142 -0.00414962
+-0.00310147 -0.00428064
+-0.0023062 -0.00430986
+-0.00153077 -0.00424106
+-0.000789143 -0.00407979
+-9.3948e-05 -0.0038331
+0.000543677 -0.00350928
+0.00111415 -0.00311763
+0.00160948 -0.0026682
+0.00202326 -0.00217164
+0.00235067 -0.00163896
+0.00258844 -0.00108142
+0.00273482 -0.000510378
+0.00278953 6.28611e-05
+0.00275374 0.000627129
+0.00263005 0.00117152
+0.00242245 0.00168552
+0.00213629 0.00215906
+0.00177825 0.00258273
+0.00135634 0.00294782
+0.000879801 0.00324653
+0.000359112 0.00347207
+-0.000194143 0.00361888
+-0.000767365 0.00368279
+-0.0013471 0.0036612
+-0.00191923 0.00355327
+-0.00246924 0.00336008
+-0.00298254 0.0030848
+-0.0034448 0.00273276
+-0.00384243 0.00231152
+-0.00416297 0.00183079
+-0.00439565 0.00130231
+-0.0045318 0.000739597
+-0.00456527 0.000157595
+-0.00449279 -0.000427789
+-0.0043142 -0.00100022
+-0.00403248 -0.00154351
+-0.00365372 -0.0020422
+-0.00318687 -0.00248213
+-0.0026434 -0.0028509
+-0.00203681 -0.00313824
+-0.00138214 -0.00333631
+-0.000695371 -0.00343979
+7.07559e-06 -0.00344589
+0.000708855 -0.00335432
+0.00139413 -0.00316707
+0.00204794 -0.00288821
+0.00265645 -0.00252363
+0.00320721 -0.00208078
+0.00368926 -0.00156842
+0.00409323 -0.000996296
+0.00441138 -0.000375001
+0.00463761 0.000284308
+0.00476746 0.000970071
+0.00479805 0.0016705
+0.00472808 0.00237371
+0.0045578 0.0030679
+0.00428892 0.00374139
+0.00392463 0.00438284
+0.00346952 0.00498128
+0.0029296 0.00552627
+0.00231223 0.00600798
+0.00162608 0.00641738
+0.000881139 0.00674632
+8.8584e-05 0.00698771
+-0.00073925 0.0071357
+-0.001589 0.00718582
+-0.00244641 0.00713519
+-0.00329653 0.00698269
+-0.00412398 0.00672913
+-0.0049132 0.00637742
+-0.00564885 0.00593263
+-0.0063162 0.00540211
+-0.00690158 0.00479539
+-0.00739288 0.00412415
+-0.00777997 0.00340193
+-0.00805517 0.00264384
+-0.00821361 0.00186615
+-0.00825346 0.00108574
+-0.00817611 0.000319558
+-0.00798608 -0.000415947
+-0.00769089 -0.00110543
+-0.00730075 -0.00173511
+-0.0068281 -0.00229324
+-0.00628712 -0.00277036
+-0.00569322 -0.00315948
+-0.00506244 -0.00345617
+-0.00441097 -0.00365849
+-0.00375468 -0.00376683
+-0.00310875 -0.00378377
+-0.00248734 -0.00371379
+-0.00190337 -0.00356303
+-0.00136832 -0.00333901
+-0.000892187 -0.00305039
+-0.000483348 -0.00270671
+-0.000148592 -0.00231817
+0.000106895 -0.00189544
+0.00027951 -0.00144951
+0.000367195 -0.000991486
+0.000369402 -0.000532467
+0.000287052 -8.34435e-05
+0.000122501 0.000344845
+-0.0001205 0.000742011
+-0.000436834 0.00109814
+-0.000820055 0.00140389
+-0.00126242 0.00165065
+-0.00175495 0.00183063
+-0.00228744 0.00193704
+-0.00284859 0.00196421
+-0.00342606 0.00190781
+-0.00400663 0.00176499
+-0.00457635 0.00153456
+-0.00512078 0.00121716
+-0.00562527 0.000815445
+-0.00607529 0.000334156
+-0.00645678 -0.000219767
+-0.00675667 -0.000837204
+-0.00696326 -0.00150693
+-0.00706674 -0.00221581
+-0.0070596 -0.00294907
+-0.00693705 -0.00369069
+-0.00669731 -0.00442392
+-0.00634174 -0.00513179
+-0.00587492 -0.00579771
+-0.00530449 -0.00640608
+-0.00464087 -0.00694276
+-0.0038969 -0.00739556
+-0.0030873 -0.00775457
+-0.0022282 -0.0080124
+-0.00133649 -0.00816425
+-0.000429373 -0.00820789
+0.000476158 -0.00814358
+0.00136374 -0.00797388
+0.00221798 -0.0077034
+0.00302472 -0.00733853
+0.00377122 -0.00688722
+0.0044463 -0.00635863
+0.00504044 -0.00576297
+0.00554576 -0.00511117
+0.00595608 -0.00441476
+0.00626684 -0.00368559
+0.00647516 -0.00293576
+0.00657971 -0.00217738
+0.00658071 -0.00142251
+0.0064799 -0.000682991
+0.00628048 2.96505e-05
+0.00598708 0.000704315
+0.00560572 0.00133045
+0.00514382 0.00189818
+0.00461007 0.00239841
+0.00401449 0.002823
+0.00336826 0.00316491
+0.00268373 0.00341833
+0.00197421 0.00357893
+0.00125391 0.00364396
+0.000537641 0.0036125
+&
+@target G0.S1
+@type xy
+-3.50257 -3.81043
+-2.90668 -4.18559
+-2.25582 -4.48139
+-1.56171 -4.69102
+-0.837195 -4.80894
+-0.0961435 -4.83116
+0.646737 -4.75536
+1.37611 -4.58111
+2.07627 -4.31002
+2.73149 -3.94588
+3.3264 -3.49479
+3.8464 -2.96512
+4.27818 -2.36754
+4.61018 -1.71479
+4.83307 -1.02151
+4.9402 -0.303765
+4.92793 0.421323
+4.79585 1.13619
+4.54689 1.82342
+4.18724 2.46633
+3.72613 3.04957
+3.17543 3.5596
+2.54922 3.98513
+1.86322 4.31735
+1.1342 4.55011
+0.37942 4.67995
+-0.383861 4.706
+-1.13889 4.6298
+-1.86978 4.45512
+-2.56181 4.18765
+-3.20166 3.83474
+-3.77756 3.40513
+-4.27939 2.90866
+-4.69869 2.35605
+-5.02877 1.75864
+-5.26457 1.12822
+-5.40275 0.476853
+-5.44159 -0.183307
+-5.38095 -0.840131
+-5.22228 -1.48166
+-4.96853 -2.09621
+-4.62413 -2.67251
+-4.19499 -3.19982
+-3.6884 -3.66803
+-3.11307 -4.06785
+-2.47902 -4.39089
+-1.79755 -4.62986
+-1.08115 -4.77876
+-0.343376 -4.83299
+0.401279 -4.78963
+1.13762 -4.64757
+1.84996 -4.40771
+2.52248 -4.0731
+3.13958 -3.64907
+3.68628 -3.14329
+4.14875 -2.56573
+4.51476 -1.92855
+4.77417 -1.24586
+4.91943 -0.533385
+4.94591 0.19197
+4.85218 0.912673
+4.64016 1.61115
+4.31505 2.2704
+3.8852 2.87459
+3.36172 3.40958
+2.75807 3.86333
+2.08951 4.22628
+1.37253 4.49145
+0.624287 4.65455
+-0.137937 4.71391
+-0.897211 4.67035
+-1.63736 4.52695
+-2.34329 4.2888
+-3.00124 3.96274
+-3.59893 3.55708
+-4.12571 3.0813
+-4.5726 2.54584
+-4.93233 1.96184
+-5.19929 1.34096
+-5.36961 0.695171
+-5.44099 0.0365955
+-5.4128 -0.622618
+-5.28595 -1.27044
+-5.06288 -1.89509
+-4.74754 -2.48515
+-4.34533 -3.02966
+-3.86311 -3.5183
+-3.30911 -3.94148
+-2.69295 -4.29048
+-2.02551 -4.55762
+-1.31892 -4.73646
+-0.586419 -4.8219
+0.157763 -4.81047
+0.898612 -4.70045
+1.62056 -4.49206
+2.30776 -4.18768
+2.94449 -3.79191
+3.51551 -3.31169
+4.00658 -2.75628
+4.4049 -2.13716
+4.69965 -1.46786
+4.88242 -0.763634
+4.94764 -0.0410522
+4.89285 0.68252
+4.71891 1.38949
+4.42999 2.06265
+4.03344 2.68577
+3.5395 3.24414
+2.96089 3.72505
+2.31231 4.11812
+1.60985 4.41552
+0.870478 4.6121
+0.111443 4.70532
+-0.650195 4.69519
+-1.398 4.58403
+-2.1165 4.37627
+-2.79147 4.07819
+-3.41013 3.6976
+-3.96127 3.2436
+-4.43531 2.72634
+-4.8244 2.15674
+-5.12237 1.5463
+-5.32474 0.906922
+-5.42868 0.250714
+-5.43299 -0.41015
+-5.33808 -1.06357
+-5.14588 -1.69763
+-4.85986 -2.30076
+-4.48497 -2.86182
+-4.0276 -3.37025
+-3.49556 -3.81618
+-2.89805 -4.19059
+-2.24558 -4.48544
+-1.5499 -4.69387
+-0.823937 -4.81033
+-0.0816164 -4.83084
+0.66227 -4.75307
+1.3923 -4.57665
+2.09271 -4.30324
+2.7477 -3.93672
+3.34187 -3.48328
+3.86062 -2.95141
+4.29065 -2.35188
+4.62048 -1.69756
+4.84088 -1.00317
+4.94531 -0.284855
+4.93026 0.44024
+4.7955 1.15456
+4.54408 1.84071
+4.1823 2.4821
+3.71946 3.06347
+3.1675 3.57139
+2.54049 3.99467
+1.85412 4.32462
+1.1251 4.55516
+0.370666 4.68289
+-0.392018 4.70695
+-1.14625 4.62893
+-1.87619 4.45257
+-2.56715 4.18357
+-3.20584 3.82925
+-3.78048 3.39833
+-4.28097 2.90066
+-4.69884 2.34693
+-5.02737 1.74851
+-5.26153 1.11721
+-5.39796 0.465087
+-5.43495 -0.195648
+-5.3724 -0.852842
+-5.21177 -1.4945
+-4.95607 -2.10891
+-4.60979 -2.68479
+-4.17887 -3.21137
+-3.67071 -3.67858
+-3.09406 -4.07712
+-2.45901 -4.39867
+-1.7769 -4.63598
+-1.06026 -4.78311
+-0.322676 -4.83558
+0.421378 -4.79052
+1.15672 -4.64692
+1.86774 -4.40575
+2.53867 -4.07013
+3.154 -3.64543
+3.69887 -3.13936
+4.15954 -2.56185
+4.52387 -1.92505
+4.78183 -1.243
+4.9259 -0.531355
+4.95148 0.193071
+4.85714 0.91283
+4.64475 1.61043
+4.31947 2.26891
+3.88956 2.87249
+3.36606 3.40701
+2.76235 3.86043
+2.09364 4.22314
+1.37639 4.48809
+0.62774 4.65095
+-0.135001 4.70998
+-0.894868 4.66596
+-1.63563 4.52192
+-2.34214 4.28296
+-3.00056 3.95591
+-3.59856 3.54911
+-4.12544 3.07208
+-4.57217 2.53531
+-4.93146 1.95001
+-5.19773 1.32789
+-5.36708 0.68099
+-5.43729 0.0214915
+-5.40775 -0.63841
+-5.27943 -1.28665
+-5.05485 -1.91142
+-4.73803 -2.5013
+-4.33447 -3.04535
+-3.85107 -3.53326
+-3.29614 -3.9555
+-2.67934 -4.3034
+-2.0116 -4.56936
+-1.30505 -4.74699
+-0.572933 -4.8313
+0.170568 -4.81887
+0.910488 -4.70804
+1.63133 -4.4991
+2.31733 -4.19441
+2.95287 -3.7986
+3.52279 -3.31857
+4.01292 -2.76352
+4.41052 -2.14487
+4.70477 -1.47608
+4.88727 -0.772312
+4.9524 -0.0500763
+4.89764 0.673311
+4.72378 1.38028
+4.43489 2.05361
+4.03827 2.67704
+3.54411 3.23581
+2.96512 3.71715
+2.31599 4.1106
+1.61288 4.4083
+0.872791 4.60504
+0.113047 4.69826
+-0.649228 4.68797
+-1.39754 4.57652
+-2.11638 4.36838
+-2.79149 4.06986
+-3.41007 3.68883
+-3.96093 3.23444
+-4.43453 2.71689
+-4.82303 2.14713
+-5.12031 1.53669
+-5.32193 0.897475
+-5.42513 0.241609
+-5.42874 -0.418748
+-5.33322 -1.07151
+-5.14052 -1.7048
+-4.85414 -2.30707
+-4.47904 -2.86723
+-4.02163 -3.37473
+-3.4897 -3.81975
+-2.89243 -4.1933
+-2.2403 -4.48736
+-1.54504 -4.69509
+-0.819544 -4.81095
+-0.0777013 -4.83093
+0.665723 -4.75272
+1.39533 -4.57589
+2.09537 -4.30211
+2.75003 -3.9352
+3.3439 -3.48132
+3.86235 -2.94896
+4.29205 -2.34887
+4.62146 -1.69392
+4.84131 -0.998838
+4.94503 -0.279819
+4.92909 0.445951
+4.79323 1.16085
+4.54054 1.84745
+4.17734 2.48907
+3.71302 3.07043
+3.15955 3.57807
+2.5311 4.0008
+1.84344 4.32995
+1.11336 4.55947
+0.358121 4.68602
+-0.405051 4.70883
+-1.15945 4.62953
+-1.88924 4.45195
+-2.57977 4.18184
+-3.21778 3.82659
+-3.79156 3.39496
+-4.29105 2.8968
+-4.70785 2.34284
+-5.03531 1.74443
+-5.26842 1.11334
+-5.40389 0.461639
+-5.44001 -0.198534
+-5.37671 -0.855058
+-5.21544 -1.49598
+-4.95919 -2.10963
+-4.61243 -2.68474
+-4.18109 -3.21058
+-3.6725 -3.67706
+-3.0954 -4.07489
+-2.45985 -4.3957
+-1.77718 -4.63224
+-1.05994 -4.77852
+-0.321719 -4.82999
+0.422962 -4.78378
+1.15886 -4.63883
+1.87028 -4.39611
+2.54139 -4.05876
+3.15657 -3.63219
+3.70088 -3.12418
+4.16054 -2.54477
+4.52337 -1.9062
+4.77936 -1.22266
+4.92105 -0.509907
+4.94393 0.21513
+4.8467 0.934932
+4.63141 1.63197
+4.30336 2.28929
+3.87098 2.89116
+3.34544 3.42352
+2.74023 3.87443
+2.07061 4.23442
+1.35305 4.49659
+0.604693 4.65672
+-0.157227 4.71319
+-0.915822 4.66687
+-1.65496 4.52086
+-2.35958 4.28027
+-3.01596 3.95197
+-3.61185 3.54425
+-4.13663 3.06662
+-4.58133 2.52953
+-4.93869 1.94413
+-5.20314 1.32208
+-5.37081 0.675377
+-5.43944 0.0161671
+-5.40842 -0.643386
+-5.2787 -1.29124
+-5.05275 -1.91559
+-4.73457 -2.505
+-4.32963 -3.04853
+-3.84483 -3.53584
+-3.28847 -3.95735
+-2.67022 -4.30437
+-2.00105 -4.56926
+-1.29312 -4.74561
+-0.559725 -4.82839
+0.184865 -4.81419
+0.925616 -4.70135
+1.64695 -4.4902
+2.33304 -4.18317
+2.96819 -3.78495
+3.53721 -3.30255
+4.02593 -2.74527
+4.42162 -2.12467
+4.71353 -1.4543
+4.89336 -0.749442
+4.9556 -0.026655
+4.8979 0.696699
+4.72117 1.40305
+4.42966 2.07522
+4.03076 2.69701
+3.53476 3.25378
+2.95441 3.73285
+2.30443 4.1239
+1.60095 4.41914
+0.860912 4.61346
+0.101588 4.70438
+-0.659971 4.69194
+-1.40733 4.5785
+-2.12504 4.36855
+-2.79889 4.06837
+-3.4161 3.68584
+-3.96549 3.23009
+-4.43752 2.7113
+-4.82437 2.14041
+-5.11989 1.52898
+-5.31965 0.888906
+-5.42089 0.232338
+-5.42245 -0.428533
+-5.3248 -1.08159
+-5.12995 -1.71493
+-4.84142 -2.31697
+-4.46424 -2.87659
+-4.00488 -3.38324
+-3.4712 -3.82712
+-2.87245 -4.19923
+-2.21918 -4.49161
+-1.52318 -4.69747
+-0.797372 -4.81135
+-0.0556868 -4.82932
+0.687114 -4.74916
+1.41566 -4.57054
+2.11422 -4.29519
+2.7671 -3.92705
+3.35896 -3.47231
+3.87528 -2.93948
+4.30284 -2.33934
+4.63022 -1.68471
+4.84823 -0.990285
+4.95038 -0.272172
+4.93318 0.452527
+4.79637 1.16629
+4.54302 1.85175
+4.17942 2.49231
+3.71486 3.07273
+3.16126 3.57957
+2.53271 4.00163
+1.84491 4.33019
+1.11463 4.55919
+0.359103 4.68521
+-0.404434 4.70743
+-1.15925 4.62745
+-1.88946 4.44906
+-2.58036 4.17798
+-3.21864 3.82162
+-3.79252 3.38876
+-4.29191 2.88928
+-4.70837 2.33395
+-5.03521 1.73418
+-5.26745 1.10182
+-5.40178 0.448969
+-5.43655 -0.212156
+-5.37171 -0.869389
+-5.20879 -1.51074
+-4.95084 -2.1245
+-4.60241 -2.69942
+-4.16949 -3.22476
+-3.65952 -3.69045
+-3.08128 -4.08725
+-2.44491 -4.40685
+-1.76177 -4.64206
+-1.04443 -4.78696
+-0.306474 -4.83711
+0.437592 -4.78969
+1.17258 -4.64372
+1.88286 -4.40022
+2.55267 -4.06237
+3.16652 -3.63559
+3.70953 -3.12762
+4.16801 -2.54848
+4.52986 -1.91034
+4.78508 -1.2273
+4.92621 -0.515073
+4.94873 0.209506
+4.8513 0.928964
+4.63586 1.6258
+4.30768 2.28307
+3.87509 2.88501
+3.34925 3.41751
+2.7436 3.86861
+2.07342 4.22875
+1.35522 4.49099
+0.606174 4.65109
+-0.156411 4.7074
+-0.91559 4.66079
+-1.65518 4.51438
+-2.36008 4.27333
+-3.01654 3.94453
+-3.61231 3.53633
+-4.13676 3.05829
+-4.58097 2.5209
+-4.93771 1.93533
+-5.20145 1.31329
+-5.36836 0.666766
+-5.43625 0.00791248
+-5.40453 -0.651117
+-5.2742 -1.2983
+-5.04776 -1.92186
+-4.72925 -2.5104
+-4.32413 -3.053
+-3.83931 -3.53937
+-3.28309 -3.95997
+-2.66511 -4.30612
+-1.99631 -4.57023
+-1.28883 -4.74587
+-0.555933 -4.82805
+0.188151 -4.81333
+0.928413 -4.70004
+1.64929 -4.48848
+2.33498 -4.18107
+2.96976 -3.78245
+3.53845 -3.29961
+4.02681 -2.74183
+4.4221 -2.12066
+4.71352 -1.44965
+4.89272 -0.744103
+4.95415 -0.0206277
+4.89544 0.703366
+4.7175 1.41025
+4.4246 2.08278
+4.02418 2.70471
+3.5266 3.26135
+2.94467 3.74001
+2.29321 4.13035
+1.58841 4.42464
+0.847314 4.61778
+0.0872213 4.70737
+-0.674772 4.69351
+-1.42223 4.57866
+-2.13969 4.36736
+-2.81299 4.06598
+-3.4294 3.68243
+-3.97779 3.2259
+-4.44869 2.70658
+-4.83433 2.13545
+-5.12865 1.52402
+-5.32725 0.884211
+-5.42742 0.228113
+-5.42805 -0.432116
+-5.3296 -1.0844
+-5.13409 -1.71689
+-4.84504 -2.31803
+-4.46744 -2.87675
+-4.00772 -3.38252
+-3.47372 -3.82554
+-2.87466 -4.19681
+-2.22105 -4.48837
+-1.52466 -4.69338
+-0.798418 -4.80634
+-0.0562642 -4.82328
+0.687002 -4.74194
+1.41595 -4.56197
+2.1148 -4.28509
+2.76773 -3.91522
+3.35934 -3.45862
+3.87502 -2.92386
+4.30151 -2.32181
+4.62732 -1.66541
+4.8433 -0.969471
+4.943 -0.250236
+4.92302 0.475089
+4.78325 1.1889
+4.52689 1.87379
+4.16042 2.51317
+3.69329 3.09183
+3.13755 3.59644
+2.50741 4.01589
+1.81864 4.34162
+1.08802 4.5677
+0.33279 4.69084
+-0.429888 4.71035
+-1.18335 4.62792
+-1.91181 4.4474
+-2.60067 4.17458
+-3.23672 3.81687
+-3.80828 3.38303
+-4.30532 2.88293
+-4.71949 2.3273
+-5.04415 1.7275
+-5.27433 1.09531
+-5.40675 0.442812
+-5.43974 -0.217839
+-5.37325 -0.874507
+-5.20879 -1.51522
+-4.94937 -2.12831
+-4.59952 -2.70249
+-4.16522 -3.22703
+-3.65387 -3.69184
+-3.07426 -4.08765
+-2.43654 -4.40611
+-1.75209 -4.64001
+-1.03351 -4.78341
+-0.294458 -4.83182
+0.450508 -4.78244
+1.18612 -4.6343
+1.89668 -4.38845
+2.56634 -4.04811
+3.17955 -3.61881
+3.72142 -3.10837
+4.17822 -2.52693
+4.53788 -1.88678
+4.79047 -1.20214
+4.92863 -0.488801
+4.94797 0.236305
+4.84728 0.955672
+4.62869 1.6518
+4.2976 2.30778
+3.86249 2.90792
+3.33458 3.43822
+2.72741 3.88683
+2.05627 4.2443
+1.33764 4.50382
+0.588659 4.66123
+-0.173437 4.71496
+-0.93177 4.66593
+-1.67023 4.5173
+-2.37378 4.27422
+-3.02871 3.94358
+-3.62281 3.53374
+-4.14549 3.05423
+-4.58782 2.51553
+-4.94257 1.92883
+-5.20423 1.3058
+-5.36896 0.658474
+-5.43457 -0.000993882
+-5.40049 -0.660421
+-5.26773 -1.30775
+-5.03885 -1.93119
+-4.71792 -2.5193
+-4.31046 -3.06116
+-3.82345 -3.54645
+-3.26526 -3.96563
+-2.64562 -4.31006
+-1.97553 -4.57218
+-1.26721 -4.74562
+-0.533959 -4.82546
+0.209954 -4.80835
+0.94951 -4.69274
+1.66917 -4.47902
+2.35316 -4.16969
+2.98585 -3.76951
+3.55215 -3.28553
+4.03794 -2.72707
+4.4306 -2.10569
+4.71946 -1.43493
+4.89627 -0.730055
+4.95559 -0.00758691
+4.89509 0.71515
+4.71572 1.42062
+4.42173 2.09168
+4.02053 2.71216
+3.52242 3.26742
+2.94015 3.74481
+2.28845 4.134
+1.58347 4.42723
+0.842195 4.61939
+0.0819105 4.70801
+-0.680296 4.69317
+-1.42796 4.57727
+-2.14562 4.36483
+-2.81902 4.06221
+-3.43542 3.67732
+-3.98363 3.21936
+-4.45413 2.69856
+-4.83912 2.12593
+-5.13253 1.51305
+-5.32996 0.871892
+-5.4287 0.214606
+-5.42768 -0.446593
+-5.32741 -1.09958
+-5.12995 -1.73246
+-4.83891 -2.33367
+-4.45936 -2.8921
+-3.9978 -3.39725
+-3.46216 -3.83932
+-2.86173 -4.20938
+-2.20709 -4.4995
+-1.51005 -4.70292
+-0.783582 -4.81422
+-0.0416246 -4.82953
+0.701039 -4.74667
+1.42902 -4.56536
+2.12659 -4.28739
+2.77805 -3.91674
+3.36805 -3.45968
+3.8821 -2.92477
+4.30702 -2.32285
+4.63142 -1.66682
+4.84618 -0.971408
+4.94486 -0.252786
+4.92408 0.47191
+4.78367 1.18513
+4.5268 1.86951
+4.15986 2.50848
+3.69227 3.0868
+3.13603 3.59113
+2.50532 4.01032
+1.81592 4.33576
+1.08463 4.56147
+0.328739 4.68417
+-0.434542 4.70313
+-1.18849 4.62006
+-1.91729 4.43883
+-2.60628 4.16526
+-3.24225 3.8068
+-3.81352 3.37227
+-4.31007 2.87158
+-4.72357 2.31549
+-5.04742 1.71539
+-5.27671 1.08311
+-5.40819 0.430717
+-5.44026 -0.229627
+-5.37291 -0.885799
+-5.20769 -1.52585
+-4.94764 -2.13814
+-4.59733 -2.71142
+-4.16275 -3.23499
+-3.65129 -3.69881
+-3.07175 -4.09364
+-2.43424 -4.41118
+-1.75015 -4.64422
+-1.03201 -4.78684
+-0.293464 -4.83457
+0.450966 -4.7846
+1.18604 -4.63594
+1.89608 -4.38963
+2.56525 -4.04886
+3.178 -3.61911
+3.7194 -3.1082
+4.1757 -2.52624
+4.5348 -1.88552
+4.78671 -1.20026
+4.92405 -0.486297
+4.94237 0.23941
+4.84047 0.959295
+4.62047 1.65579
+4.28781 2.31193
+3.85101 2.91197
+3.32138 3.44188
+2.71254 3.88977
+2.03985 4.24622
+1.3199 4.50445
+0.569887 4.66034
+-0.192892 4.71241
+-0.95153 4.66164
+-1.68991 4.51127
+-2.393 4.26655
+-3.04714 3.93444
+-3.64017 3.52335
+-4.16154 3.04286
+-4.60242 2.50348
+-4.95565 1.9164
+-5.21578 1.29331
+-5.37903 0.646189
+-5.44327 -0.0128151
+-5.40797 -0.671569
+-5.27416 -1.31806
+-5.0444 -1.94055
+-4.72275 -2.52764
+-4.31472 -3.06844
+-3.82726 -3.55269
+-3.2687 -3.97084
+-2.64872 -4.31428
+-1.9783 -4.5754
+-1.26964 -4.74784
+-0.536025 -4.82662
+0.208265 -4.80838
+0.948183 -4.6915
+1.66813 -4.47635
+2.35229 -4.16543
+2.98492 -3.76349
+3.55085 -3.27761
+4.0359 -2.71721
+4.42737 -2.09391
+4.71456 -1.42139
+4.88923 -0.715022
+4.94599 0.00853012
+4.88261 0.731835
+4.70017 1.43728
+4.40308 2.10766
+3.99894 2.72682
+3.49819 3.28017
+2.91374 3.75514
+2.26045 4.14152
+1.55452 4.43168
+0.812985 4.62067
+0.0531051 4.70617
+-0.708075 4.68836
+-1.45417 4.56977
+-2.16981 4.355
+-2.84086 4.05044
+-3.45467 3.66403
+-4.00016 3.20499
+-4.4679 2.6835
+-4.85018 2.11055
+-5.14096 1.49769
+-5.33589 0.856802
+-5.4323 0.200014
+-5.4291 -0.460513
+-5.32681 -1.1127
+-5.12749 -1.74467
+-4.83469 -2.34488
+-4.45348 -2.90224
+-3.99034 -3.40625
+-3.45318 -3.84708
+-2.85128 -4.21579
+-2.19524 -4.50441
+-1.49689 -4.70617
+-0.769215 -4.81563
+-0.0262265 -4.82889
+0.717234 -4.74376
+1.44571 -4.56
+2.14339 -4.27941
+2.79451 -3.90605
+3.38366 -3.44625
+3.89632 -2.90869
+4.3193 -2.30433
+4.64123 -1.64617
+4.85307 -0.949083
+4.94849 -0.229332
+4.92422 0.495869
+4.78028 1.20893
+4.51999 1.89248
+4.14991 2.52999
+3.67959 3.10632
+3.12116 3.60821
+2.48885 4.02464
+1.79847 4.34713
+1.06682 4.56984
+0.31113 4.68956
+-0.451446 4.70566
+-1.20427 4.61991
+-1.93159 4.43624
+-2.61884 4.16045
+-3.25285 3.80002
+-3.82198 3.36376
+-4.31626 2.86156
+-4.72739 2.30418
+-5.04875 1.703
+-5.27546 1.06986
+-5.40427 0.41682
+-5.43359 -0.243932
+-5.36342 -0.900254
+-5.19533 -1.54018
+-4.93243 -2.15202
+-4.5793 -2.72452
+-4.14201 -3.24696
+-3.62802 -3.70929
+-3.04622 -4.10227
+-2.40679 -4.41762
+-1.72119 -4.64818
+-1.00205 -4.78809
+-0.263061 -4.83295
+0.481216 -4.78006
+1.21553 -4.62853
+1.9242 -4.37951
+2.59145 -4.03632
+3.20179 -3.60454
+3.74041 -3.09207
+4.19369 -2.50907
+4.54964 -1.86787
+4.79843 -1.18268
+4.9328 -0.469289
+4.94843 0.255402
+4.84418 0.973922
+4.62223 1.66881
+4.28802 2.3232
+3.85006 2.92143
+3.31961 3.44955
+2.71022 3.89574
+2.0372 4.25058
+1.31707 4.50729
+0.566972 4.66175
+-0.195823 4.71244
+-0.954423 4.66031
+-1.6927 4.50858
+-2.39562 4.26245
+-3.04947 3.92889
+-3.64206 3.51631
+-4.16282 3.0343
+-4.60286 2.49339
+-4.955 1.90482
+-5.21378 1.28033
+-5.37543 0.631953
+-5.43782 -0.0281061
+-5.40046 -0.687661
+-5.26443 -1.33466
+-5.03236 -1.9573
+-4.70836 -2.54417
+-4.29805 -3.08438
+-3.80844 -3.56766
+-3.24796 -3.98449
+-2.62637 -4.32628
+-1.95472 -4.58552
+-1.24527 -4.75589
+-0.51134 -4.83252
+0.232771 -4.81213
+0.972027 -4.6932
+1.69087 -4.47619
+2.37353 -4.16369
+3.00438 -3.7605
+3.56833 -3.27375
+4.0513 -2.71284
+4.4407 -2.0894
+4.72592 -1.41705
+4.89878 -0.711099
+4.95395 0.0118568
+4.88918 0.734459
+4.70556 1.43915
+4.40746 2.10879
+4.00241 2.72724
+3.50082 3.2799
+2.91558 3.7542
+2.2615 4.1399
+1.5548 4.42934
+0.812515 4.61756
+0.05196 4.70221
+-0.709783 4.68348
+-1.45628 4.5639
+-2.17212 4.34811
+-2.84315 4.04254
+-3.4567 3.65517
+-4.00168 3.19526
+-4.46871 2.67306
+-4.85008 2.09958
+-5.13981 1.48639
+-5.33362 0.845419
+-5.42886 0.188791
+-5.42453 -0.471337
+-5.32118 -1.1229
+-5.12092 -1.75404
+-4.82735 -2.35326
+-4.44556 -2.90951
+-3.98205 -3.41231
+-3.44474 -3.85191
+-2.84289 -4.21938
+-2.18709 -4.50681
+-1.48914 -4.70744
+-0.762014 -4.81586
+-0.0196643 -4.82818
+0.723094 -4.74222
+1.45083 -4.55771
+2.14777 -4.27644
+2.79813 -3.90244
+3.38653 -3.44203
+3.89841 -2.90387
+4.32057 -2.29887
+4.64158 -1.64006
+4.85238 -0.942316
+4.94659 -0.221934
+4.92093 0.503825
+4.77539 1.21731
+4.51332 1.9011
+4.14132 2.5386
+3.669 3.1146
+3.10856 3.61583
+2.47433 4.03126
+1.78222 4.35242
+1.04911 4.5735
+0.2923 4.69137
+-0.470991 4.70547
+-1.2241 4.61766
+-1.95126 4.43194
+-2.63794 4.15423
+-3.27099 3.79207
+-3.83885 3.35433
+-4.33161 2.85097
+-4.74103 2.29277
+-5.06061 1.69113
+-5.28552 1.05787
+-5.41259 0.405048
+-5.44029 -0.255188
+-5.36867 -0.910739
+-5.19933 -1.54968
+-4.93539 -2.16039
+-4.58144 -2.73166
+-4.14351 -3.25282
+-3.62907 -3.71384
+-3.04694 -4.10553
+-2.40728 -4.41961
+-1.7215 -4.64892
+-1.00222 -4.78757
+-0.263099 -4.83117
+0.48129 -4.77694
+1.21567 -4.62398
+1.92433 -4.3734
+2.59142 -4.02851
+3.20138 -3.59489
+3.73931 -3.08048
+4.19151 -2.4955
+4.54595 -1.85239
+4.79275 -1.16546
+4.92468 -0.450634
+4.93745 0.275062
+4.83003 0.994042
+4.60474 1.68876
+4.26719 2.34231
+3.82605 2.93903
+3.29277 3.46502
+2.68104 3.90854
+2.0063 4.2603
+1.28513 4.51367
+0.53473 4.66467
+-0.227654 4.71194
+-0.985172 4.65656
+-1.72178 4.50186
+-2.42252 4.25314
+-3.07382 3.91741
+-3.66358 3.50312
+-4.18134 3.01986
+-4.61832 2.47816
+-4.96741 1.88921
+-5.22324 1.26472
+-5.38206 0.616681
+-5.4418 -0.0427728
+-5.40197 -0.701496
+-5.26366 -1.34748
+-5.02949 -1.96896
+-4.70356 -2.55456
+-4.29145 -3.09339
+-3.80018 -3.57518
+-3.23816 -3.99042
+-2.61514 -4.33052
+-1.94219 -4.58792
+-1.23155 -4.7563
+-0.496618 -4.83076
+0.248285 -4.80802
+0.988059 -4.68656
+1.70708 -4.46686
+2.38951 -4.15154
+3.01964 -3.74548
+3.58234 -3.25587
+4.0635 -2.69223
+4.45053 -2.06631
+4.73285 -1.39185
+4.90236 -0.684293
+4.95383 0.0396776
+4.88518 0.762621
+4.69764 1.46694
+4.39577 2.1355
+3.98727 2.7522
+3.4827 3.30254
+2.89506 3.77404
+2.23924 4.15661
+1.5315 4.44273
+0.78886 4.62755
+0.028592 4.70884
+-0.732289 4.6869
+-1.47744 4.56432
+-2.19152 4.34578
+-2.86046 4.03774
+-3.47166 3.6482
+-4.01411 3.18639
+-4.47843 2.66257
+-4.85698 2.08775
+-5.14379 1.47347
+-5.33457 0.831686
+-5.42671 0.174506
+-5.4192 -0.485892
+-5.31263 -1.13742
+-5.10913 -1.76822
+-4.81235 -2.36674
+-4.42741 -2.92192
+-3.96089 -3.42327
+-3.42078 -3.86102
+-2.81644 -4.22626
+-2.15854 -4.5111
+-1.45897 -4.70882
+-0.73077 -4.81408
+0.0120178 -4.82308
+0.75454 -4.73373
+1.48134 -4.5459
+2.17667 -4.2615
+2.82477 -3.88469
+3.41035 -3.4219
+3.91897 -2.88188
+4.33754 -2.27564
+4.65482 -1.61623
+4.86187 -0.918537
+4.95249 -0.198815
+4.92352 0.525743
+4.77505 1.23758
+4.51051 1.91939
+4.13652 2.55468
+3.66267 3.12838
+3.10115 3.62726
+2.46622 4.0404
+1.77372 4.35935
+1.04047 4.57833
+0.283719 4.69421
+-0.479359 4.70641
+-1.23212 4.61676
+-1.95882 4.42925
+-2.64491 4.14977
+-3.27722 3.78586
+-3.84417 3.34639
+-4.3358 2.84133
+-4.74388 2.28148
+-5.06187 1.6783
+-5.28494 1.04363
+-5.40992 0.389586
+-5.4353 -0.271625
+-5.36117 -0.927855
+-5.18918 -1.56713
+-4.9225 -2.1778
+-4.56582 -2.74862
+-4.12524 -3.2689
+-3.60831 -3.72864
+-3.02396 -4.11865
+-2.38243 -4.43071
+-1.69522 -4.65771
+-0.975007 -4.79385
+-0.235493 -4.83482
+0.508723 -4.77796
+1.24237 -4.62247
+1.94976 -4.36957
+2.61512 -4.02265
+3.22296 -3.58738
+3.7585 -3.07174
+4.20815 -2.486
+4.55999 -1.84254
+4.80426 -1.15569
+4.93379 -0.441292
+4.94438 0.283701
+4.83502 1.00178
+4.60803 1.69545
+4.26898 2.34789
+3.82656 2.94345
+3.29214 3.46827
+2.67939 3.91059
+2.00373 4.26113
+1.28175 4.51324
+0.530646 4.66293
+-0.232301 4.70884
+-0.990211 4.65206
+-1.727 4.49593
+-2.42768 4.2458
+-3.07866 3.90872
+-3.66783 3.49318
+-4.18475 3.00882
+-4.62064 2.46622
+-4.96847 1.87662
+-5.22288 1.25174
+-5.38021 0.60359
+-5.43844 -0.0556748
+-5.39714 -0.713923
+-5.25746 -1.35916
+-5.02207 -1.97966
+-4.69512 -2.56407
+-4.28222 -3.10156
+-3.79041 -3.5819
+-3.22811 -3.99564
+-2.60506 -4.33422
+-1.93231 -4.59013
+-1.22209 -4.75709
+-0.487755 -4.83024
+0.25641 -4.80628
+0.99534 -4.68372
+1.71344 -4.46304
+2.39491 -4.14682
+3.02404 -3.73994
+3.58571 -3.24955
+4.06579 -2.68518
+4.45167 -2.05854
+4.73274 -1.38338
+4.90086 -0.675158
+4.95076 0.0494025
+4.88036 0.772816
+4.69089 1.47743
+4.38691 2.14604
+3.9762 2.76249
+3.46938 3.31223
+2.87952 3.78277
+2.22163 4.164
+1.51205 4.44844
+0.767902 4.63127
+0.00653287 4.71036
+-0.754991 4.68606
+-1.5003 4.56108
+-2.21404 4.34019
+-2.88219 4.02994
+-3.49218 3.63842
+-4.03305 3.17493
+-4.49553 2.64979
+-4.87204 2.07403
+-5.15671 1.45923
+-5.34534 0.817311
+-5.4354 0.160386
+-5.42595 -0.49941
+-5.31763 -1.15004
+-5.11262 -1.77967
+-4.81458 -2.37685
+-4.42865 -2.93055
+-3.96139 -3.43034
+-3.42078 -3.86649
+-2.81612 -4.23013
+-2.15805 -4.5134
+-1.45844 -4.70958
+-0.730277 -4.81332
+0.0124139 -4.82079
+0.754783 -4.7299
+1.48136 -4.54045
+2.17636 -4.25434
+2.82397 -3.87572
+3.40883 -3.41102
+3.91642 -2.86903
+4.33359 -2.26081
+4.64903 -1.59953
+4.85379 -0.900147
+4.94167 -0.179072
+4.90957 0.546384
+4.7577 1.25855
+4.4896 1.94004
+4.11206 2.57432
+3.63487 3.14631
+3.07037 3.64286
+2.433 4.0531
+1.73871 4.36875
+1.00439 4.58414
+0.247343 4.69632
+-0.515277 4.70486
+-1.26687 4.61172
+-1.99176 4.42102
+-2.6755 4.13875
+-3.30504 3.7725
+-3.86891 3.33117
+-4.35728 2.82477
+-4.762 2.26408
+-5.07663 1.66051
+-5.29642 1.02589
+-5.41827 0.372277
+-5.4407 -0.288178
+-5.36383 -0.943378
+-5.18931 -1.5814
+-4.92034 -2.19063
+-4.56157 -2.75985
+-4.1191 -3.27841
+-3.60048 -3.73632
+-3.0146 -4.12438
+-2.37171 -4.43437
+-1.68332 -4.65918
+-0.962115 -4.793
+-0.221829 -4.83149
+0.522894 -4.772
+1.25673 -4.61372
+1.96394 -4.35792
+2.62867 -4.00801
+3.23538 -3.56975
+3.76924 -3.05119
+4.21664 -2.4627
+4.56567 -1.8168
+4.80661 -1.12793
+4.93237 -0.412052
+4.93887 0.313776
+4.82526 1.03197
+4.59402 1.72502
+4.25092 2.37608
+3.80481 2.96959
+3.26722 3.49174
+2.65193 3.93093
+1.97446 4.278
+1.25141 4.52644
+0.499983 4.6724
+-0.262585 4.71464
+-1.01948 4.65436
+-1.75471 4.49497
+-2.45338 4.24186
+-3.10197 3.90213
+-3.68847 3.48425
+-4.20249 2.9979
+-4.63532 2.45363
+-4.97995 1.86268
+-5.23106 1.23675
+-5.385 0.587864
+-5.43977 -0.0718277
+-5.39496 -0.730182
+-5.25174 -1.37519
+-5.01282 -1.9951
+-4.68239 -2.57855
+-4.26612 -3.11467
+-3.7711 -3.59324
+-3.20584 -4.0048
+-2.58017 -4.34078
+-1.90524 -4.59372
+-1.19337 -4.75739
+-0.458 -4.82698
+0.286508 -4.7993
+1.02504 -4.67297
+1.74198 -4.44859
+2.42151 -4.12891
+3.04801 -3.7189
+3.60641 -3.22589
+4.08272 -2.65949
+4.46447 -2.03151
+4.74121 -1.35575
+4.905 -0.64766
+4.95073 0.0760591
+4.87646 0.797996
+4.68356 1.5006
+4.37667 2.16679
+3.96359 2.78054
+3.45498 3.32741
+2.86386 3.79503
+2.20518 4.17337
+1.49523 4.45501
+0.751059 4.63517
+-0.0100563 4.71171
+-0.771098 4.685
+-1.51573 4.55773
+-2.22862 4.33465
+-2.89575 4.0223
+-3.50454 3.62874
+-4.04403 3.16331
+-4.50491 2.6363
+-4.8796 2.05878
+-5.1622 1.44237
+-5.34853 0.799036
+-5.43604 0.140924
+-5.42384 -0.519772
+-5.31259 -1.17096
+-5.10453 -1.80079
+-4.80339 -2.39773
+-4.41438 -2.95076
+-3.94415 -3.44942
+-3.40078 -3.884
+-2.79367 -4.24566
+-2.13354 -4.52656
+-1.43235 -4.72006
+-0.703177 -4.8209
+0.0399239 -4.82535
+0.782067 -4.73143
+1.50779 -4.53906
+2.20131 -4.25026
+2.84692 -3.86927
+3.42932 -3.40264
+3.93411 -2.8592
+4.34826 -2.25006
+4.66061 -1.58837
+4.86231 -0.889094
+4.94727 -0.168562
+4.91248 0.555978
+4.75818 1.26694
+4.48795 1.94701
+4.10857 2.57972
+3.6298 3.15004
+3.06397 3.64487
+2.42547 4.05335
+1.73025 4.36719
+0.995189 4.58075
+0.237585 4.69106
+-0.525384 4.69771
+-1.2771 4.60267
+-2.00186 4.41009
+-2.68518 4.126
+-3.31402 3.75804
+-3.87691 3.31516
+-4.36401 2.8074
+-4.76723 2.24561
+-5.08017 1.64123
+-5.29813 1.00612
+-5.41807 0.352355
+-5.43858 -0.307914
+-5.35985 -0.962596
+-5.1836 -1.59979
+-4.91308 -2.20791
+-4.55298 -2.77579
+-4.10946 -3.29282
+-3.59007 -3.74907
+-3.00374 -4.13539
+-2.3607 -4.44362
+-1.67243 -4.66669
+-0.951614 -4.79885
+-0.211944 -4.83577
+0.531976 -4.77484
+1.26486 -4.61527
+1.97101 -4.35829
+2.6346 -4.00735
+3.2401 -3.56815
+3.77271 -3.04875
+4.21879 -2.45948
+4.56642 -1.81287
+4.80585 -1.12335
+4.92997 -0.406898
+4.93467 0.319387
+4.81909 1.03788
+4.58572 1.731
+4.24036 2.38187
+3.7919 2.97485
+3.25197 3.4961
+2.63443 3.934
+1.95489 4.2794
+1.23006 4.52582
+0.477243 4.66946
+-0.286266 4.70916
+-1.0436 4.64621
+-1.77873 4.48413
+-2.47678 4.22841
+-3.12425 3.88623
+-3.70918 3.46618
+-4.22126 2.97799
+-4.65184 2.43227
+-4.99402 1.8403
+-5.24258 1.21381
+-5.39396 0.564812
+-5.44624 -0.0945691
+-5.3991 -0.75222
+-5.25378 -1.39618
+-5.01301 -2.01475
+-4.68104 -2.59664
+-4.26353 -3.13104
+-3.76759 -3.60779
+-3.20169 -4.01746
+-2.57563 -4.35156
+-1.90052 -4.60265
+-1.18865 -4.76449
+-0.453396 -4.8323
+0.290886 -4.80287
+1.0291 -4.67478
+1.74562 -4.44863
+2.42461 -4.12711
+3.05039 -3.71521
+3.60785 -3.22024
+4.08291 -2.65186
+4.46305 -2.02192
+4.73777 -1.34433
+4.8991 -0.634632
+4.94196 0.0903405
+4.86446 0.813057
+4.66807 1.51586
+4.35758 2.18158
+3.94096 2.79417
+3.42903 3.33919
+2.835 3.80431
+2.17397 4.17962
+1.46235 4.45781
+0.717257 4.63425
+-0.0439849 4.70697
+-0.804368 4.67649
+-1.5476 4.54565
+-2.25844 4.3193
+-2.92295 4.0041
+-3.52868 3.60817
+-4.06478 3.14089
+-4.52206 2.61258
+-4.89306 2.0343
+-5.17197 1.41762
+-5.35469 0.774495
+-5.43875 0.117011
+-5.42329 -0.54269
+-5.30903 -1.19257
+-5.0982 -1.82083
+-4.79455 -2.41599
+-4.4033 -2.96706
+-3.93108 -3.46362
+-3.38594 -3.89597
+-2.7773 -4.25528
+-2.11587 -4.53373
+-1.41359 -4.72467
+-0.683564 -4.82283
+0.0601208 -4.82446
+0.802546 -4.7276
+1.5282 -4.53219
+2.22125 -4.24026
+2.86593 -3.85611
+3.44688 -3.38634
+3.94967 -2.83989
+4.36126 -2.22796
+4.67048 -1.56383
+4.86855 -0.862568
+4.94948 -0.140638
+4.91036 0.584624
+4.75161 1.29557
+4.47697 1.97484
+4.09342 2.606
+3.61089 3.17408
+3.04186 3.66606
+2.40084 4.07123
+1.70385 4.38142
+0.967826 4.59116
+0.210039 4.6976
+-0.552369 4.70047
+-1.30285 4.60186
+-2.02579 4.40598
+-2.70682 4.11891
+-3.33296 3.74833
+-3.89284 3.3032
+-4.37672 2.79356
+-4.77654 2.23026
+-5.08595 1.62472
+-5.30028 0.988796
+-5.41653 0.334556
+-5.43331 -0.325846
+-5.35082 -0.980312
+-5.17083 -1.61693
+-4.89658 -2.22409
+-4.53284 -2.79063
+-4.08582 -3.30589
+-3.56313 -3.75995
+-2.97378 -4.14367
+-2.3281 -4.44888
+-1.63767 -4.66855
+-0.915258 -4.79697
+-0.174662 -4.82991
+0.569443 -4.76484
+1.30172 -4.60109
+2.00643 -4.34004
+2.66777 -3.98528
+3.27026 -3.54266
+3.79918 -3.02038
+4.24102 -2.4289
+4.58404 -1.78083
+4.81865 -1.09066
+4.93794 -0.374378
+4.93799 0.350959
+4.8181 1.0678
+4.58091 1.75867
+4.2323 2.40682
+3.78122 2.99677
+3.2393 3.51479
+2.62039 3.94939
+1.94004 4.29152
+1.2149 4.53476
+0.462171 4.67538
+-0.300895 4.71223
+-1.0575 4.64659
+-1.79166 4.48199
+-2.48853 4.2239
+-3.13463 3.8795
+-3.71799 3.45736
+-4.2283 2.9672
+-4.65691 2.41967
+-4.9969 1.82603
+-5.24304 1.19807
+-5.39178 0.547822
+-5.44121 -0.112536
+-5.39104 -0.770845
+-5.24253 -1.4151
+-4.99849 -2.03357
+-4.66322 -2.61491
+-4.24247 -3.1483
+-3.74343 -3.62356
+-3.17467 -4.03129
+-2.5461 -4.36301
+-1.86892 -4.61132
+-1.15551 -4.77008
+-0.419328 -4.83457
+0.325222 -4.80169
+1.06301 -4.67017
+1.77841 -4.4407
+2.45562 -4.11613
+3.07901 -3.70154
+3.63358 -3.20437
+4.10537 -2.63433
+4.48199 -2.00334
+4.7531 -1.32529
+4.91083 -0.615718
+4.95025 0.10861
+4.86957 0.830233
+4.6703 1.53158
+4.35727 2.19558
+3.93847 2.80624
+3.42469 3.34921
+2.82912 3.8122
+2.16685 4.18532
+1.45424 4.46128
+0.708421 4.63548
+-0.0533021 4.70594
+-0.813911 4.67321
+-1.5571 4.54013
+-2.26761 4.3116
+-2.93149 3.99432
+-3.53629 3.59646
+-4.07115 3.12745
+-4.52693 2.59764
+-4.89617 2.01816
+-5.17314 1.40063
+-5.35378 0.756999
+-5.4357 0.0993932
+-5.41811 -0.56005
+-5.3018 -1.20931
+-5.08907 -1.83659
+-4.78374 -2.43047
+-4.39107 -2.97999
+-3.91773 -3.4748
+-3.37182 -3.90526
+-2.76275 -4.26258
+-2.10123 -4.53902
+-1.3992 -4.72798
+-0.669732 -4.82424
+0.0731315 -4.82411
+0.814512 -4.72562
+1.53894 -4.52875
+2.23064 -4.23554
+2.87385 -3.85027
+3.45327 -3.37952
+3.95447 -2.83222
+4.36441 -2.21955
+4.67191 -1.55478
+4.86816 -0.852975
+4.94716 -0.130617
+4.90597 0.594929
+4.745 1.30597
+4.46802 1.9851
+4.08203 2.61582
+3.59701 3.18312
+3.02552 3.67394
+2.38217 4.07756
+1.68308 4.38582
+0.945271 4.59328
+0.186112 4.69715
+-0.577186 4.69725
+-1.32802 4.59574
+-2.05077 4.39696
+-2.73105 4.10709
+-3.35594 3.7339
+-3.91409 3.28645
+-4.39585 2.77485
+-4.79324 2.21001
+-5.10001 1.60339
+-5.3116 0.966869
+-5.4251 0.31251
+-5.43922 -0.34755
+-5.35424 -1.00125
+-5.17198 -1.63673
+-4.89579 -2.24243
+-4.53043 -2.80726
+-4.08214 -3.32064
+-3.55854 -3.77269
+-2.96861 -4.15435
+-2.32265 -4.4575
+-1.63221 -4.67515
+-0.91 -4.8016
+-0.169777 -4.83264
+0.57382 -4.76573
+1.30547 -4.60017
+2.00944 -4.33734
+2.66992 -3.98079
+3.27139 -3.53635
+3.79906 -3.01223
+4.23939 -2.41892
+4.58054 -1.76908
+4.81293 -1.07727
+4.9296 -0.359588
+4.92665 0.366787
+4.80344 1.08419
+4.56272 1.77505
+4.2105 2.42254
+3.7559 3.01113
+3.21071 3.52713
+2.58897 3.95908
+1.90635 4.29804
+1.17963 4.53772
+0.426095 4.67453
+-0.336985 4.70747
+-1.09281 4.638
+-1.82546 4.46976
+-2.52015 4.20837
+-3.16349 3.86109
+-3.74366 3.43656
+-4.25044 2.94457
+-4.67531 2.39574
+-5.01147 1.80138
+-5.25377 1.17321
+-5.39877 0.523253
+-5.44462 -0.13637
+-5.39109 -0.793555
+-5.23947 -1.43635
+-4.99261 -2.05308
+-4.6548 -2.63245
+-4.2318 -3.16368
+-3.7308 -3.63663
+-3.16036 -4.04192
+-2.53038 -4.3711
+-1.85205 -4.61677
+-1.13775 -4.77278
+-0.40095 -4.83444
+0.343922 -4.79864
+1.0817 -4.6641
+1.79673 -4.43155
+2.47315 -4.10384
+3.09529 -3.68614
+3.6481 -3.18592
+4.1176 -2.61299
+4.49137 -1.97938
+4.75911 -1.29909
+4.91302 -0.587767
+4.94823 0.137705
+4.8631 0.859782
+4.65931 1.56084
+4.34186 2.22377
+3.9189 2.83263
+3.40141 3.37311
+2.80273 3.83304
+2.13805 4.20265
+1.42382 4.4748
+0.677191 4.64503
+-0.0845414 4.71153
+-0.844402 4.67495
+-1.58616 4.53824
+-2.29464 4.3064
+-2.956 3.98616
+-3.55787 3.58574
+-4.08951 3.11455
+-4.54183 2.58298
+-4.90745 2.00211
+-5.18068 1.38357
+-5.35752 0.739303
+-5.43558 0.0814138
+-5.41412 -0.577957
+-5.29393 -1.22678
+-5.07735 -1.85326
+-4.76822 -2.44596
+-4.37185 -2.99389
+-3.89499 -3.4867
+-3.34576 -3.91473
+-2.73369 -4.26921
+-2.06957 -4.54238
+-1.36544 -4.72771
+-0.634462 -4.82001
+0.109212 -4.81567
+0.850627 -4.71285
+1.57426 -4.51161
+2.2643 -4.21417
+2.90501 -3.82495
+3.48113 -3.35069
+3.97833 -2.80047
+4.3837 -2.18559
+4.68625 -1.51943
+4.87737 -0.817106
+4.95123 -0.0950973
+4.90512 0.629264
+4.73962 1.33837
+4.45864 2.01493
+4.06928 2.64259
+3.58159 3.20649
+3.00814 3.69371
+2.36351 4.09366
+1.66375 4.3983
+0.925822 4.60226
+0.167014 4.70283
+-0.595545 4.69982
+-1.34532 4.59543
+-2.06675 4.39398
+-2.74548 4.10164
+-3.36862 3.72617
+-3.92483 3.27662
+-4.40446 2.76309
+-4.79953 2.1965
+-5.10378 1.58834
+-5.31265 0.950484
+-5.42323 0.295047
+-5.43424 -0.365798
+-5.346 -1.01995
+-5.16037 -1.6555
+-4.88072 -2.26086
+-4.51193 -2.82489
+-4.06028 -3.33701
+-3.53349 -3.78732
+-2.94065 -4.16676
+-2.29214 -4.46725
+-1.59963 -4.68185
+-0.875919 -4.80493
+-0.134834 -4.83238
+0.608921 -4.76176
+1.34 -4.59251
+2.04266 -4.32613
+2.70112 -3.9663
+3.29993 -3.51901
+3.82442 -2.99255
+4.26115 -2.3975
+4.59845 -1.74657
+4.82687 -1.05434
+4.93962 -0.336881
+4.93291 0.38869
+4.80624 1.10478
+4.56239 1.79393
+4.20745 2.43939
+3.75053 3.02573
+3.20342 3.53933
+2.58013 3.9688
+1.89632 4.30522
+1.16872 4.54234
+0.414614 4.67659
+-0.348746 4.70699
+-1.10457 4.635
+-1.83691 4.46431
+-2.53099 4.20055
+-3.17343 3.85103
+-3.75238 3.42445
+-4.25765 2.93063
+-4.68075 2.38025
+-5.0149 1.78467
+-5.25502 1.15564
+-5.39772 0.505216
+-5.44122 -0.154467
+-5.38537 -0.811304
+-5.23154 -1.45336
+-4.98264 -2.06897
+-4.64304 -2.6469
+-4.21855 -3.17641
+-3.7164 -3.64742
+-3.14518 -4.05062
+-2.51481 -4.37762
+-1.83647 -4.62109
+-1.12254 -4.77495
+-0.386445 -4.83456
+0.357422 -4.79685
+1.09395 -4.66059
+1.80753 -4.42651
+2.48235 -4.09749
+3.1028 -3.67867
+3.65384 -3.17751
+4.12152 -2.60381
+4.49344 -1.96956
+4.75927 -1.28875
+4.9112 -0.577033
+4.94436 0.148707
+4.85707 0.8709
+4.65099 1.57188
+4.33115 2.2345
+3.90574 2.84275
+3.38577 3.38229
+2.78467 3.8409
+2.1177 4.20882
+1.40143 4.47891
+0.653091 4.64675
+-0.109929 4.71057
+-0.870589 4.67112
+-1.61261 4.53145
+-2.32079 4.29665
+-2.9813 3.97355
+-3.5818 3.57048
+-4.1116 3.09694
+-4.56169 2.56339
+-4.92477 1.98099
+-5.19526 1.36139
+-5.36924 0.71656
+-5.44446 0.0586038
+-5.42024 -0.600356
+-5.29748 -1.24833
+-5.0786 -1.87356
+-4.76749 -2.46469
+-4.36951 -3.01079
+-3.89141 -3.50158
+-3.34136 -3.92748
+-2.72882 -4.27977
+-2.06458 -4.55078
+-1.36064 -4.73399
+-0.630091 -4.82426
+0.112952 -4.81799
+0.853583 -4.71333
+1.57631 -4.51034
+2.26533 -4.2112
+2.90491 -3.82032
+3.47975 -3.34441
+3.9755 -2.79256
+4.37918 -2.17608
+4.67976 -1.50838
+4.86857 -0.804671
+4.93978 -0.0815086
+4.89069 0.643663
+4.72195 1.35313
+4.43755 2.0295
+4.04472 2.65636
+3.55367 3.21881
+2.97712 3.70395
+2.32982 4.10124
+1.62795 4.40273
+0.888595 4.60317
+0.129101 4.69999
+-0.633369 4.69316
+-1.38229 4.58503
+-2.10214 4.38004
+-2.77865 4.0845
+-3.39902 3.70624
+-3.95203 3.25441
+-4.42812 2.73914
+-4.81946 2.17136
+-5.1199 1.56256
+-5.32495 0.924605
+-5.43182 0.269564
+-5.4393 -0.390436
+-5.34776 -1.04334
+-5.15909 -1.67731
+-4.87671 -2.28081
+-4.50549 -2.84275
+-4.05174 -3.35259
+-3.52315 -3.80047
+-2.92882 -4.17737
+-2.27911 -4.47524
+-1.58569 -4.68713
+-0.861342 -4.80743
+-0.119915 -4.83204
+0.623878 -4.75851
+1.35466 -4.58631
+2.05666 -4.31695
+2.71406 -3.95413
+3.31137 -3.5039
+3.83386 -2.97461
+4.2681 -2.37692
+4.60241 -1.72364
+4.82735 -1.02946
+4.93621 -0.310553
+4.9253 0.415861
+4.79423 1.13212
+4.54595 1.8207
+4.18672 2.46486
+3.72581 3.04918
+3.17519 3.56013
+2.54899 3.98641
+1.86298 4.31924
+1.13397 4.55251
+0.379246 4.68279
+-0.383944 4.70924
+-1.13885 4.63347
+-1.86962 4.45924
+-2.56155 4.19227
+-3.20135 3.83991
+-3.77728 3.4109
+-4.27925 2.91506
+-4.69883 2.36307
+-5.02931 1.76627
+-5.26567 1.13641
+-5.40454 0.485515
+-5.44421 -0.174284
+-5.38451 -0.830885
+-5.22685 -1.47235
+-4.97417 -2.08701
+-4.63086 -2.66362
+-4.20278 -3.19142
+-3.69721 -3.66031
+-3.12281 -4.06099
+-2.48957 -4.38505
+-1.80877 -4.62519
+-1.09287 -4.77537
+-0.355423 -4.83097
+0.3891 -4.78904
+1.1255 -4.64843
+1.83811 -4.41001
+2.5111 -4.0768
+3.12886 -3.65409
+3.67642 -3.14953
+4.13992 -2.57304
+4.50711 -1.93676
+4.76784 -1.25476
+4.91451 -0.542753
+4.94244 0.182371
+4.85016 0.90309
+4.63955 1.60182
+4.31575 2.26156
+3.88706 2.86643
+3.36456 3.40226
+2.76168 3.85699
+2.09366 4.22098
+1.37699 4.48721
+0.628834 4.65136
+-0.133516 4.7117
+-0.8931 4.66903
+-1.63371 4.5264
+-2.34023 4.28888
+-2.99885 3.96331
+-3.59728 3.55799
+-4.12483 3.08242
+-4.57251 2.54704
+-4.93301 1.963
+-5.20074 1.34198
+-5.3718 0.695959
+-5.44393 0.0370746
+-5.41646 -0.622517
+-5.29031 -1.27078
+-5.06795 -1.89594
+-4.75332 -2.48657
+-4.35184 -3.03174
+-3.87034 -3.52112
+-3.31706 -3.94514
+-2.7016 -4.29509
+-2.03482 -4.56331
+-1.32882 -4.74335
+-0.596809 -4.83014
+0.147041 -4.82017
+0.887756 -4.7117
+1.60981 -4.50494
+2.29741 -4.20219
+2.93484 -3.808
+3.50689 -3.32924
+3.9993 -2.77507
+4.39923 -2.15692
+4.69581 -1.48825
+4.88053 -0.784269
+4.94771 -0.061516
+4.8948 0.662629
+4.72255 1.37053
+4.43504 2.04492
+4.03954 2.66948
+3.54628 3.22939
+2.96796 3.71185
+2.3193 4.10639
+1.61648 4.4051
+0.876509 4.60277
+0.116734 4.69684
+-0.645706 4.68732
+-1.3943 4.57654
+-2.11352 4.36901
+-2.7891 4.07103
+-3.40824 3.69049
+-3.95974 3.23657
+-4.43405 2.71946
+-4.82335 2.15014
+-5.12153 1.54013
+-5.32418 0.901353
+-5.42854 0.245892
+-5.43348 -0.414109
+-5.33945 -1.0666
+-5.14842 -1.69974
+-4.86387 -2.30203
+-4.49074 -2.86242
+-4.0354 -3.37043
+-3.50561 -3.81626
+-2.91045 -4.19095
+-2.26035 -4.48653
+-1.56694 -4.69612
+-0.842997 -4.81419
+-0.102336 -4.83668
+0.640376 -4.76121
+1.36982 -4.58727
+&
+@target G0.S2
+@type xy
+9.07533 -3.03929
+9.22824 -2.55085
+9.35109 -2.0541
+9.44322 -1.55058
+9.50404 -1.04192
+9.53307 -0.529761
+9.52991 -0.0158071
+9.49428 0.498206
+9.426 1.01051
+9.32499 1.51931
+9.19131 2.02279
+9.02513 2.51911
+8.82673 3.00643
+8.59654 3.48291
+8.33511 3.94673
+8.04311 4.39605
+7.72136 4.82908
+7.37081 5.24407
+6.99254 5.6393
+6.58775 6.01312
+6.15778 6.36392
+5.7041 6.69019
+5.22828 6.99051
+4.73204 7.26354
+4.21719 7.50809
+3.68567 7.72303
+3.1395 7.9074
+2.5808 8.06033
+2.01176 8.18112
+1.43463 8.26919
+0.851705 8.3241
+0.265326 8.34559
+-0.322148 8.33353
+-0.908351 8.28794
+-1.49092 8.20902
+-2.06752 8.09712
+-2.63583 7.95273
+-3.1936 7.77649
+-3.73863 7.56921
+-4.26878 7.3318
+-4.78201 7.06532
+-5.27638 6.77097
+-5.75002 6.45004
+-6.20122 6.10392
+-6.62836 5.73413
+-7.02994 5.34224
+-7.40461 4.9299
+-7.75114 4.49883
+-8.06846 4.05082
+-8.35559 3.58766
+-8.61175 3.11121
+-8.83625 2.62333
+-9.02856 2.12589
+-9.18828 1.62079
+-9.31514 1.1099
+-9.40899 0.595087
+-9.46983 0.0781871
+-9.49774 -0.43898
+-9.49295 -0.954633
+-9.45579 -1.46703
+-9.38668 -1.97446
+-9.28615 -2.47529
+-9.15483 -2.9679
+-8.99342 -3.45077
+-8.80273 -3.92239
+-8.58361 -4.38135
+-8.33702 -4.82629
+-8.06396 -5.25592
+-7.7655 -5.66899
+-7.44277 -6.06434
+-7.09695 -6.44089
+-6.72927 -6.7976
+-6.341 -7.13352
+-5.93345 -7.44775
+-5.50797 -7.73948
+-5.06593 -8.00795
+-4.60876 -8.25249
+-4.13786 -8.47248
+-3.65472 -8.66737
+-3.16079 -8.83669
+-2.65757 -8.98002
+-2.14657 -9.09704
+-1.6293 -9.18746
+-1.10729 -9.25107
+-0.582058 -9.28774
+-0.0551514 -9.29738
+0.471898 -9.27999
+0.997555 -9.23563
+1.52029 -9.16442
+2.03857 -9.06653
+2.55088 -8.94223
+3.0557 -8.79183
+3.55155 -8.6157
+4.03695 -8.41428
+4.51042 -8.1881
+4.97054 -7.93771
+5.41589 -7.66375
+5.84509 -7.36695
+6.25678 -7.04807
+6.64964 -6.70795
+7.02238 -6.34752
+7.37375 -5.96775
+7.70254 -5.56968
+8.00759 -5.15443
+8.28777 -4.72316
+8.54201 -4.2771
+8.76932 -3.81756
+8.96876 -3.34587
+9.13943 -2.86347
+9.28055 -2.3718
+9.39139 -1.87241
+9.4713 -1.36686
+9.51973 -0.856774
+9.53623 -0.343826
+9.52043 0.170274
+9.47207 0.683781
+9.39101 1.19491
+9.27722 1.70187
+9.13077 2.20282
+8.95187 2.69593
+8.74086 3.17936
+8.4982 3.65126
+8.22448 4.1098
+7.92042 4.55318
+7.58691 4.97961
+7.22492 5.38734
+6.8356 5.77469
+6.42022 6.14
+5.98017 6.48172
+5.51699 6.79836
+5.03232 7.08852
+4.52792 7.35089
+4.00567 7.58429
+3.46756 7.78764
+2.91563 7.96
+2.35206 8.10055
+1.77904 8.20863
+1.19887 8.28371
+0.613849 8.32542
+0.0263445 8.33354
+-0.56128 8.30802
+-1.14665 8.24894
+-1.72741 8.15656
+-2.30122 8.03131
+-2.86579 7.87373
+-3.41887 7.68455
+-3.95829 7.46461
+-4.48195 7.21491
+-4.98783 6.93657
+-5.47404 6.63082
+-5.93875 6.29903
+-6.38029 5.94263
+-6.79709 5.56318
+-7.18772 5.16229
+-7.55088 4.74166
+-7.88539 4.30304
+-8.19023 3.84822
+-8.46451 3.37904
+-8.70748 2.89737
+-8.91852 2.40508
+-9.09716 1.90407
+-9.24304 1.39623
+-9.35597 0.883422
+-9.43583 0.367523
+-9.48267 -0.149633
+-9.49662 -0.666238
+-9.47794 -1.18052
+-9.427 -1.69076
+-9.34425 -2.19528
+-9.23027 -2.69245
+-9.0857 -3.18071
+-8.9113 -3.65854
+-8.70791 -4.12449
+-8.47642 -4.57718
+-8.21782 -5.01527
+-7.93317 -5.43749
+-7.62355 -5.84265
+-7.29012 -6.22961
+-6.93411 -6.59729
+-6.55675 -6.9447
+-6.15935 -7.2709
+-5.74322 -7.57503
+-5.30975 -7.85629
+-4.86032 -8.11396
+-4.39636 -8.34737
+-3.91931 -8.55595
+-3.43064 -8.73916
+-2.93184 -8.89656
+-2.42441 -9.02775
+-1.90986 -9.13244
+-1.38973 -9.21035
+-0.86553 -9.26132
+-0.338811 -9.28522
+0.188891 -9.28202
+0.716033 -9.25172
+1.24108 -9.19442
+1.76249 -9.11025
+2.27874 -8.99945
+2.78831 -8.8623
+3.28969 -8.69914
+3.78139 -8.51039
+4.26193 -8.29654
+4.72985 -8.05812
+5.18371 -7.79577
+5.62211 -7.51016
+6.04365 -7.20204
+6.44697 -6.87222
+6.83077 -6.52158
+7.19376 -6.15108
+7.53469 -5.76171
+7.85237 -5.35457
+8.14565 -4.93078
+8.41344 -4.49156
+8.6547 -4.03818
+8.86845 -3.57196
+9.05378 -3.09429
+9.20987 -2.60662
+9.33594 -2.11046
+9.43132 -1.60735
+9.49542 -1.09891
+9.52773 -0.586796
+9.52786 -0.072696
+9.4955 0.441652
+9.43047 0.954478
+9.33267 1.46399
+9.20215 1.96836
+9.03906 2.46575
+8.84368 2.95433
+8.61643 3.43225
+8.35783 3.89767
+8.06857 4.34877
+7.74945 4.78375
+7.40141 5.20085
+7.02553 5.59835
+6.62302 5.97457
+6.1952 6.32792
+5.74355 6.65686
+5.26965 6.95996
+4.77519 7.23585
+4.26199 7.4833
+3.73195 7.70118
+3.18709 7.88851
+2.6295 8.04441
+2.06137 8.16817
+1.48494 8.2592
+0.902497 8.31708
+0.316389 8.34151
+-0.271028 8.33237
+-0.857386 8.28969
+-1.44032 8.21364
+-2.01748 8.10455
+-2.58657 7.96293
+-3.1453 7.78939
+-3.69147 7.58472
+-4.22296 7.34985
+-4.73769 7.08582
+-5.23373 6.79382
+-5.7092 6.47511
+-6.16237 6.13112
+-6.59161 5.76331
+-6.99543 5.37328
+-7.37244 4.96267
+-7.72143 4.53319
+-8.04129 4.08662
+-8.33106 3.62476
+-8.58991 3.14946
+-8.81718 2.66257
+-9.01231 2.16599
+-9.17488 1.66158
+-9.30463 1.15124
+-9.4014 0.636813
+-9.46515 0.120154
+-9.49599 -0.396921
+-9.49413 -0.91263
+-9.45987 -1.42522
+-9.39364 -1.933
+-9.29596 -2.43432
+-9.16745 -2.92756
+-9.0088 -3.41118
+-8.82081 -3.8837
+-8.60434 -4.34368
+-8.36032 -4.78976
+-8.08976 -5.22065
+-7.79371 -5.6351
+-7.4733 -6.03195
+-7.12971 -6.4101
+-6.76415 -6.76852
+-6.37789 -7.10623
+-5.97224 -7.42236
+-5.54853 -7.71607
+-5.10815 -7.98661
+-4.6525 -8.23329
+-4.183 -8.45549
+-3.7011 -8.65266
+-3.20828 -8.82431
+-2.70603 -8.97004
+-2.19584 -9.08949
+-1.67923 -9.18238
+-1.15772 -9.2485
+-0.632843 -9.2877
+-0.106122 -9.2999
+0.420906 -9.28509
+0.946705 -9.2433
+1.46975 -9.17467
+1.9885 -9.07937
+2.50146 -8.95764
+3.0071 -8.8098
+3.50393 -8.63622
+3.99048 -8.43734
+4.46526 -8.21366
+4.92684 -7.96575
+5.37379 -7.69424
+5.80473 -7.39983
+6.21828 -7.08328
+6.61311 -6.74542
+6.98795 -6.38714
+7.34153 -6.00942
+7.67264 -5.61328
+7.98012 -5.19983
+8.26285 -4.77022
+8.51976 -4.32569
+8.74984 -3.86753
+8.95215 -3.39707
+9.1258 -2.91574
+9.26998 -2.42498
+9.38396 -1.92633
+9.46708 -1.42135
+9.5188 -0.91165
+9.53862 -0.398907
+9.52619 0.115175
+9.48124 0.628854
+9.40359 1.14035
+9.29321 1.64787
+9.15017 2.14958
+8.97466 2.64365
+8.76699 3.12823
+8.52761 3.60148
+8.25711 4.06157
+7.9562 4.50668
+7.62573 4.93504
+7.26667 5.34488
+6.88016 5.7345
+6.46744 6.10227
+6.02991 6.4466
+5.56907 6.766
+5.08656 7.05906
+4.58414 7.32447
+4.06367 7.56102
+3.52711 7.76762
+2.97653 7.94333
+2.41406 8.0873
+1.84192 8.19887
+1.26238 8.27748
+0.67776 8.32274
+0.0903996 8.33443
+-0.497328 8.31247
+-1.08305 8.25693
+-1.66441 8.16806
+-2.23906 8.04626
+-2.80471 7.89206
+-3.3591 7.70616
+-3.90006 7.48942
+-4.42546 7.24279
+-4.93331 6.9674
+-5.42166 6.66446
+-5.88871 6.33531
+-6.33275 5.9814
+-6.75222 5.60426
+-7.14565 5.2055
+-7.51174 4.78682
+-7.8493 4.34994
+-8.15729 3.89667
+-8.43481 3.42884
+-8.68109 2.94832
+-8.89551 2.45697
+-9.07757 1.95669
+-9.22692 1.44937
+-9.34333 0.93689
+-9.42671 0.421113
+-9.47707 -0.0961171
+-9.49456 -0.612989
+-9.47942 -1.12773
+-9.432 -1.63859
+-9.35278 -2.1439
+-9.24229 -2.64201
+-9.10119 -3.13134
+-8.9302 -3.61037
+-8.73014 -4.07764
+-8.50189 -4.53175
+-8.24642 -4.97137
+-7.96477 -5.39524
+-7.65803 -5.80216
+-7.32736 -6.19098
+-6.97395 -6.56065
+-6.59906 -6.91015
+-6.20398 -7.23854
+-5.79004 -7.54497
+-5.3586 -7.82864
+-4.91105 -8.0888
+-4.44881 -8.3248
+-3.97333 -8.53603
+-3.48607 -8.72199
+-2.98851 -8.88219
+-2.48216 -9.01627
+-1.96852 -9.12388
+-1.44912 -9.20477
+-0.925479 -9.25876
+-0.399142 -9.28572
+0.128356 -9.28559
+0.655477 -9.25839
+1.18068 -9.20419
+1.70244 -9.12313
+2.21921 -9.01542
+2.7295 -8.88134
+3.23177 -8.72124
+3.72455 -8.5355
+4.20636 -8.32462
+4.67572 -8.08912
+5.1312 -7.82962
+5.5714 -7.54679
+5.99491 -7.24136
+6.40038 -6.91414
+6.78649 -6.56601
+7.15195 -6.19789
+7.49551 -5.81079
+7.81597 -5.40577
+8.11217 -4.98398
+8.38301 -4.5466
+8.62745 -4.0949
+8.84451 -3.63019
+9.03325 -3.15386
+9.19284 -2.66734
+9.32251 -2.17214
+9.42156 -1.66979
+9.48939 -1.16191
+9.52548 -0.650138
+9.52942 -0.136165
+9.50089 0.378277
+9.43969 0.891421
+9.34571 1.40147
+9.21898 1.90661
+9.05963 2.40501
+8.86793 2.89482
+8.64428 3.37419
+8.38919 3.84129
+8.10332 4.29428
+7.78746 4.73137
+7.44255 5.15079
+7.06964 5.5508
+6.66993 5.92975
+6.24474 6.286
+5.79554 6.61804
+5.3239 6.92439
+4.83152 7.20369
+4.3202 7.45469
+3.79187 7.67623
+3.24851 7.86729
+2.69221 8.02697
+2.12514 8.15452
+1.54952 8.24935
+0.967643 8.311
+0.381828 8.33917
+-0.205568 8.33373
+-0.792177 8.29468
+-1.37563 8.22221
+-1.95358 8.11662
+-2.5237 7.9784
+-3.08372 7.80817
+-3.63142 7.6067
+-4.16466 7.37489
+-4.68137 7.1138
+-5.17957 6.82457
+-5.6574 6.50849
+-6.1131 6.16695
+-6.54503 5.80144
+-6.95167 5.41352
+-7.33164 5.00483
+-7.68369 4.57709
+-8.00671 4.13207
+-8.29972 3.67157
+-8.56189 3.19743
+-8.79252 2.71153
+-8.99105 2.21574
+-9.15705 1.71194
+-9.29024 1.20201
+-9.39045 0.687826
+-9.45764 0.171232
+-9.49189 -0.345952
+-9.49341 -0.861936
+-9.4625 -1.37497
+-9.39958 -1.88335
+-9.30515 -2.38541
+-9.17983 -2.87955
+-9.0243 -3.36421
+-8.83936 -3.8379
+-8.62586 -4.2992
+-8.38472 -4.74672
+-8.11694 -5.17917
+-7.82358 -5.5953
+-7.50577 -5.99395
+-7.16465 -6.374
+-6.80147 -6.73442
+-6.41746 -7.07424
+-6.01394 -7.39257
+-5.59225 -7.68856
+-5.15375 -7.96147
+-4.69984 -8.2106
+-4.23196 -8.43532
+-3.75153 -8.63508
+-3.26004 -8.80939
+-2.75896 -8.95783
+-2.24979 -9.08005
+-1.73404 -9.17576
+-1.21324 -9.24473
+-0.688896 -9.28682
+-0.162546 -9.30194
+0.36428 -9.29007
+0.890053 -9.25125
+1.41325 -9.18559
+1.93233 -9.09326
+2.4458 -8.9745
+2.95215 -8.82962
+3.44987 -8.65898
+3.93749 -8.46303
+4.41355 -8.24225
+4.87659 -7.99721
+5.32519 -7.72854
+5.75796 -7.43692
+6.17353 -7.12312
+6.57054 -6.78794
+6.94771 -6.43227
+7.30377 -6.05706
+7.63751 -5.66333
+7.94775 -5.25215
+8.23337 -4.82467
+8.49331 -4.38212
+8.72656 -3.92576
+8.93216 -3.45693
+9.10923 -2.97704
+9.25695 -2.48754
+9.37458 -1.98993
+9.46146 -1.48578
+9.51701 -0.976705
+9.54074 -0.464357
+9.53229 0.0495622
+9.49135 0.563314
+9.41775 1.07513
+9.31143 1.58321
+9.17245 2.08572
+9.00096 2.58085
+8.79729 3.06674
+8.56184 3.54154
+8.29519 4.00344
+7.99803 4.45059
+7.67118 4.88123
+7.31562 5.29357
+6.93243 5.68593
+6.52287 6.05664
+6.0883 6.40411
+5.63021 6.72684
+5.15023 7.0234
+4.65009 7.29246
+4.13165 7.53281
+3.59687 7.74333
+3.04778 7.92306
+2.48652 8.07115
+1.9153 8.18689
+1.33639 8.26972
+0.75209 8.31924
+0.164758 8.33518
+-0.42324 8.31745
+-1.00953 8.26612
+-1.59174 8.18139
+-2.16754 8.06365
+-2.7346 7.91343
+-3.29068 7.7314
+-3.83358 7.51839
+-4.36117 7.27535
+-4.87143 7.00339
+-5.36242 6.70371
+-5.83231 6.37763
+-6.27938 6.02661
+-6.70205 5.65214
+-7.09883 5.25585
+-7.46841 4.8394
+-7.80958 4.40455
+-8.12129 3.95307
+-8.40261 3.48681
+-8.65276 3.00761
+-8.87111 2.51736
+-9.05715 2.01795
+-9.2105 1.51126
+-9.33093 0.999189
+-9.41833 0.483592
+-9.47271 -0.0336828
+-9.4942 -0.550818
+-9.48304 -1.06603
+-9.43958 -1.57759
+-9.36427 -2.08378
+-9.25767 -2.58298
+-9.12041 -3.07357
+-8.95322 -3.55404
+-8.7569 -4.0229
+-8.53232 -4.47875
+-8.28043 -4.92024
+-8.00226 -5.34609
+-7.69887 -5.7551
+-7.37142 -6.14613
+-7.02108 -6.51811
+-6.64911 -6.87004
+-6.25679 -7.20097
+-5.84545 -7.51005
+-5.41643 -7.79646
+-4.97114 -8.05948
+-4.51099 -8.29843
+-4.03742 -8.51272
+-3.55189 -8.70181
+-3.05588 -8.86523
+-2.55088 -9.0026
+-2.03841 -9.11357
+-1.51998 -9.1979
+-0.997115 -9.25536
+-0.47135 -9.28585
+0.0557809 -9.28929
+0.582741 -9.26568
+1.108 -9.21509
+1.63001 -9.13765
+2.14727 -9.03357
+2.65824 -8.90311
+3.16143 -8.7466
+3.65533 -8.56443
+4.13847 -8.35707
+4.6094 -8.12505
+5.06666 -7.86896
+5.50884 -7.58946
+5.93455 -7.28729
+6.34244 -6.96322
+6.73116 -6.61813
+7.09944 -6.25294
+7.44602 -5.86863
+7.76968 -5.46626
+8.06927 -5.04696
+8.34368 -4.6119
+8.59185 -4.16234
+8.81279 -3.69958
+9.00557 -3.225
+9.16933 -2.74002
+9.30329 -2.24612
+9.40673 -1.74486
+9.47905 -1.23781
+9.51972 -0.726617
+9.52828 -0.212968
+9.50443 0.301415
+9.44792 0.814771
+9.35864 1.32531
+9.2366 1.83122
+9.0819 2.33066
+8.89479 2.8218
+8.67565 3.30278
+8.42497 3.77176
+8.14339 4.22692
+7.83168 4.66644
+7.49074 5.08855
+7.12163 5.49152
+6.7255 5.87366
+6.30368 6.23335
+5.85761 6.56904
+5.38885 6.87926
+4.89908 7.16264
+4.39011 7.4179
+3.86384 7.64387
+3.32228 7.83951
+2.7675 8.00389
+2.20167 8.13624
+1.62702 8.23591
+1.04581 8.30241
+0.460366 8.33542
+-0.126975 8.33476
+-0.713853 8.30043
+-1.2979 8.23258
+-1.87678 8.13151
+-2.44815 7.99769
+-3.00974 7.83172
+-3.55931 7.63435
+-4.09471 7.40649
+-4.61386 7.14915
+-5.11477 6.86348
+-5.59555 6.55077
+-6.05442 6.21237
+-6.48973 5.84976
+-6.89993 5.46451
+-7.28364 5.05826
+-7.63956 4.6327
+-7.96658 4.18961
+-8.26369 3.73078
+-8.53005 3.25806
+-8.76492 2.77332
+-8.96775 2.27844
+-9.13807 1.77531
+-9.27559 1.2658
+-9.38012 0.751795
+-9.45162 0.235146
+-9.49014 -0.282319
+-9.49588 -0.798804
+-9.46913 -1.31255
+-9.41029 -1.82185
+-9.31987 -2.32502
+-9.19845 -2.82046
+-9.04674 -3.30661
+-8.8655 -3.78196
+-8.65558 -4.24507
+-8.4179 -4.69456
+-8.15346 -5.12913
+-7.8633 -5.54752
+-7.54854 -5.94855
+-7.21035 -6.33112
+-6.84993 -6.69417
+-6.46854 -7.03674
+-6.06749 -7.35791
+-5.64809 -7.65685
+-5.21173 -7.93279
+-4.7598 -8.18503
+-4.29371 -8.41295
+-3.81491 -8.61597
+-3.32487 -8.79361
+-2.82507 -8.94544
+-2.317 -9.07109
+-1.80216 -9.17028
+-1.28208 -9.24278
+-0.758273 -9.28843
+-0.232265 -9.30713
+0.294417 -9.29886
+0.820243 -9.26366
+1.34369 -9.20161
+1.86324 -9.1129
+2.37737 -8.99776
+2.88459 -8.85647
+3.3834 -8.68941
+3.87232 -8.497
+4.34989 -8.27972
+4.81467 -8.03814
+5.26524 -7.77288
+5.70019 -7.48462
+6.11815 -7.17411
+6.51779 -6.84215
+6.89778 -6.48963
+7.25687 -6.11748
+7.59383 -5.7267
+7.90747 -5.31837
+8.19666 -4.8936
+8.46033 -4.45359
+8.69746 -3.9996
+8.90711 -3.53295
+9.08837 -3.05503
+9.24043 -2.56727
+9.36254 -2.07118
+9.45403 -1.56831
+9.51432 -1.06025
+9.54291 -0.548656
+9.53939 -0.0352165
+9.50347 0.47834
+9.43496 0.99025
+9.33377 1.49872
+9.19993 2.00195
+9.03359 2.49809
+8.83504 2.9853
+8.60467 3.46176
+8.34303 3.92561
+8.05077 4.37505
+7.72871 4.80827
+7.37778 5.22352
+6.99906 5.61907
+6.59377 5.99327
+6.16323 6.3445
+5.70893 6.67125
+5.23246 6.97208
+4.73554 7.24564
+4.22001 7.4907
+3.68779 7.70612
+3.14092 7.8909
+2.58152 8.04418
+2.01178 8.16523
+1.43396 8.25344
+0.850357 8.3084
+0.263325 8.32981
+-0.324772 8.31755
+-0.911559 8.27166
+-1.49466 8.19231
+-2.07174 8.07987
+-2.64046 7.93483
+-3.19856 7.75784
+-3.74383 7.54971
+-4.27414 7.31137
+-4.78743 7.0439
+-5.28175 6.74848
+-5.75524 6.42643
+-6.20617 6.07916
+-6.63292 5.70818
+-7.034 5.31509
+-7.40806 4.90156
+-7.75387 4.46931
+-8.07035 4.02015
+-8.35655 3.55588
+-8.61168 3.07838
+-8.83506 2.58951
+-9.02618 2.09117
+-9.18463 1.58526
+-9.31016 1.07366
+-9.40265 0.55824
+-9.46208 0.0408572
+-9.48857 -0.476667
+-9.48236 -0.992543
+-9.44377 -1.50502
+-9.37326 -2.0124
+-9.27136 -2.51303
+-9.1387 -3.00529
+-8.976 -3.48766
+-8.78407 -3.95863
+-8.56378 -4.41679
+-8.31606 -4.86078
+-8.04194 -5.28929
+-7.74247 -5.70112
+-7.41878 -6.0951
+-7.07204 -6.47015
+-6.70349 -6.82525
+-6.3144 -7.15947
+-5.90609 -7.47194
+-5.4799 -7.76185
+-5.03722 -8.02846
+-4.57947 -8.2711
+-4.10809 -8.48917
+-3.62453 -8.68213
+-3.13026 -8.84951
+-2.6268 -8.99091
+-2.11562 -9.10598
+-1.59826 -9.19447
+-1.07624 -9.25615
+-0.551086 -9.2909
+-0.0243262 -9.29864
+0.502502 -9.27937
+1.02787 -9.23313
+1.55024 -9.16007
+2.0681 -9.06036
+2.57993 -8.93425
+3.08422 -8.78208
+3.57949 -8.60423
+4.06424 -8.40114
+4.53704 -8.17333
+4.99642 -7.92139
+5.44099 -7.64597
+5.86934 -7.34777
+6.28011 -7.02758
+6.67198 -6.68624
+7.04364 -6.32466
+7.39385 -5.94382
+7.72138 -5.54476
+8.02507 -5.12858
+8.30381 -4.69646
+8.55652 -4.24962
+8.78221 -3.78936
+8.97993 -3.31704
+9.14881 -2.83407
+9.28806 -2.34191
+9.39696 -1.8421
+9.47486 -1.33622
+9.52122 -0.825879
+9.53559 -0.312765
+9.51761 0.201412
+9.46704 0.714902
+9.38372 1.22592
+9.26763 1.73266
+9.11887 2.2333
+8.93766 2.72599
+8.72433 3.20889
+8.47935 3.68015
+8.20334 4.13793
+7.89703 4.58044
+7.5613 5.00588
+7.19717 5.41251
+6.80578 5.79863
+6.38841 6.16262
+5.94649 6.50289
+5.48154 6.81797
+4.99525 7.10647
+4.48938 7.36708
+3.96583 7.59862
+3.42659 7.80002
+2.87374 7.97033
+2.30943 8.10876
+1.7359 8.21462
+1.15541 8.28739
+0.570299 8.3267
+-0.0170975 8.33233
+-0.60442 8.30423
+-1.18931 8.24251
+-1.76942 8.14744
+-2.34242 8.01945
+-2.90603 7.85913
+-3.45801 7.66721
+-3.99618 7.44457
+-4.51846 7.1922
+-5.02282 6.91126
+-5.50737 6.60299
+-5.97029 6.26875
+-6.40991 5.91001
+-6.82467 5.52831
+-7.21313 5.12529
+-7.574 4.70265
+-7.90611 4.26215
+-8.20845 3.80558
+-8.48013 3.3348
+-8.72042 2.85167
+-8.9287 2.35807
+-9.10452 1.85589
+-9.24755 1.34703
+-9.35757 0.83337
+-9.43453 0.316763
+-9.47847 -0.200949
+-9.48956 -0.717961
+-9.46807 -1.23251
+-9.41441 -1.74286
+-9.32904 -2.24734
+-9.21258 -2.74433
+-9.06568 -3.23224
+-8.88911 -3.70958
+-8.68371 -4.17489
+-8.4504 -4.62677
+-8.19016 -5.06391
+-7.90403 -5.48505
+-7.59313 -5.889
+-7.2586 -6.27463
+-6.90167 -6.64089
+-6.52357 -6.9868
+-6.12561 -7.31144
+-5.70912 -7.61397
+-5.27545 -7.89361
+-4.826 -8.14966
+-4.36219 -8.38146
+-3.88546 -8.58847
+-3.39727 -8.77016
+-2.8991 -8.92611
+-2.39243 -9.05595
+-1.87878 -9.15938
+-1.35965 -9.23616
+-0.836568 -9.28613
+-0.311048 -9.30919
+0.215381 -9.30529
+0.741195 -9.27447
+1.26487 -9.21681
+1.78489 -9.13249
+2.29975 -9.02171
+2.80794 -8.88477
+3.30797 -8.72202
+3.79837 -8.53388
+4.27768 -8.32082
+4.74446 -8.0834
+5.19728 -7.82222
+5.63475 -7.53796
+6.05549 -7.23135
+6.45817 -6.90321
+6.84148 -6.55438
+7.20413 -6.18582
+7.54491 -5.79849
+7.86261 -5.39347
+8.15609 -4.97187
+8.42426 -4.53485
+8.6661 -4.08366
+8.88063 -3.61961
+9.06696 -3.14404
+9.22425 -2.65839
+9.35175 -2.16413
+9.44878 -1.6628
+9.51475 -1.15598
+9.54914 -0.645309
+9.55155 -0.132466
+9.52165 0.380833
+9.45923 0.892836
+9.36418 1.40176
+9.23651 1.9058
+9.07635 2.40313
+8.88395 2.89192
+8.65968 3.37032
+8.40406 3.83651
+8.11771 4.28866
+7.80142 4.72498
+7.45609 5.14369
+7.08277 5.54307
+6.68263 5.92145
+6.25699 6.2772
+5.80729 6.6088
+5.3351 6.91478
+4.84212 7.19377
+4.33013 7.44452
+3.80107 7.66586
+3.25694 7.85678
+2.69984 8.01637
+2.13194 8.14387
+1.55549 8.23866
+0.972788 8.30027
+0.386171 8.32838
+-0.201999 8.32283
+-0.789345 8.28361
+-1.37349 8.21089
+-1.95208 8.10498
+-2.52279 7.96634
+-3.08333 7.7956
+-3.63148 7.59353
+-4.16508 7.36103
+-4.68205 7.09914
+-5.18043 6.80905
+-5.65834 6.49204
+-6.114 6.14949
+-6.54578 5.78291
+-6.95215 5.39387
+-7.33173 4.98403
+-7.68327 4.55511
+-8.00565 4.1089
+-8.2979 3.6472
+-8.55919 3.17189
+-8.78882 2.68483
+-8.98623 2.18792
+-9.15102 1.68306
+-9.28289 1.17213
+-9.3817 0.657028
+-9.4474 0.139597
+-9.48011 -0.378324
+-9.48002 -0.894938
+-9.44746 -1.40848
+-9.38285 -1.91725
+-9.28672 -2.41956
+-9.15969 -2.91382
+-9.00247 -3.39845
+-8.81586 -3.87196
+-8.60071 -4.33292
+-8.35796 -4.77995
+-8.08863 -5.21174
+-7.79377 -5.62705
+-7.47451 -6.0247
+-7.13202 -6.4036
+-6.7675 -6.7627
+-6.38223 -7.10106
+-5.9775 -7.41777
+-5.55466 -7.71204
+-5.11508 -7.9831
+-4.66016 -8.23029
+-4.19135 -8.45299
+-3.71009 -8.65067
+-3.21787 -8.82285
+-2.71616 -8.96911
+-2.20648 -9.08912
+-1.69034 -9.18259
+-1.16926 -9.24932
+-0.644768 -9.28914
+-0.118395 -9.30199
+0.408328 -9.28785
+0.93387 -9.24676
+1.4567 -9.17884
+1.97531 -9.08427
+2.48817 -8.96329
+2.99378 -8.81621
+3.49065 -8.6434
+3.97731 -8.44531
+4.45229 -8.22244
+4.91416 -7.97535
+5.36149 -7.70469
+5.7929 -7.41115
+6.20702 -7.09549
+6.60252 -6.75856
+6.97809 -6.40123
+7.33249 -6.02448
+7.66448 -5.62933
+7.97291 -5.21687
+8.25663 -4.78824
+8.51459 -4.34468
+8.74577 -3.88745
+8.94921 -3.41789
+9.12404 -2.9374
+9.26944 -2.44743
+9.38468 -1.94949
+9.4691 -1.44515
+9.52213 -0.936016
+9.54331 -0.423744
+9.53225 0.0899632
+9.48868 0.60337
+9.41243 1.1147
+9.30346 1.62217
+9.16182 2.12394
+8.98769 2.61819
+8.7814 3.10308
+8.54337 3.57675
+8.27418 4.03739
+7.97453 4.48317
+7.64527 4.9123
+7.28737 5.32304
+6.90195 5.71367
+6.49026 6.08255
+6.05367 6.4281
+5.5937 6.74881
+5.11197 7.04325
+4.61024 7.31012
+4.09038 7.54821
+3.55435 7.7564
+3.0042 7.93374
+2.44209 8.07938
+1.87022 8.19262
+1.29088 8.27291
+0.706379 8.31984
+0.119072 8.33315
+-0.468672 8.31275
+-1.05448 8.25868
+-1.636 8.17118
+-2.2109 8.05061
+-2.77688 7.89751
+-3.3317 7.71259
+-3.87318 7.49667
+-4.3992 7.25075
+-4.90774 6.97592
+-5.39687 6.67342
+-5.86476 6.3446
+-6.30969 5.99089
+-6.73008 5.61384
+-7.12445 5.21506
+-7.49148 4.79625
+-7.82998 4.35915
+-8.13888 3.90556
+-8.41727 3.43733
+-8.66438 2.95631
+-8.87956 2.4644
+-9.06233 1.9635
+-9.21232 1.4555
+-9.32931 0.942284
+-9.41318 0.425733
+-9.46398 -0.0923083
+-9.48183 -0.61002
+-9.467 -1.12562
+-9.41986 -1.63737
+-9.34088 -2.14358
+-9.23062 -2.6426
+-9.08975 -3.13285
+-8.91902 -3.6128
+-8.71926 -4.08097
+-8.49137 -4.53598
+-8.23632 -4.97647
+-7.95516 -5.40117
+-7.64898 -5.80889
+-7.31893 -6.19847
+-6.96622 -6.56886
+-6.59211 -6.91906
+-6.19787 -7.24813
+-5.78483 -7.55523
+-5.35436 -7.83955
+-4.90784 -8.10039
+-4.4467 -8.3371
+-3.97236 -8.54908
+-3.4863 -8.73584
+-2.98998 -8.89692
+-2.4849 -9.03195
+-1.97256 -9.14061
+-1.45447 -9.22267
+-0.932143 -9.27795
+-0.407106 -9.30633
+0.119119 -9.30776
+0.645008 -9.28228
+1.16904 -9.22995
+1.6897 -9.15094
+2.20548 -9.04545
+2.71488 -8.91375
+3.21641 -8.7562
+3.70859 -8.5732
+4.18998 -8.36522
+4.65912 -8.13279
+5.11459 -7.87652
+5.55501 -7.59705
+5.979 -7.29513
+6.38522 -6.97155
+6.77236 -6.62714
+7.13915 -6.26284
+7.48435 -5.87963
+7.80676 -5.47854
+8.10524 -5.06069
+8.37869 -4.62723
+8.62606 -4.17939
+8.84637 -3.71846
+9.03869 -3.24577
+9.20219 -2.76272
+9.33608 -2.27077
+9.43968 -1.77143
+9.51238 -1.26625
+9.55365 -0.756871
+9.56307 -0.244937
+9.54029 0.267847
+9.48509 0.779744
+9.39733 1.28898
+9.277 1.79377
+9.1242 2.29229
+8.93914 2.78271
+8.72217 3.26321
+8.47376 3.73195
+8.19452 4.18711
+7.88518 4.6269
+7.54661 5.04953
+7.17982 5.45328
+6.78595 5.83645
+6.36628 6.19742
+5.92221 6.53464
+5.45527 6.84661
+4.96712 7.13196
+4.45954 7.38939
+3.9344 7.61772
+3.3937 7.81588
+2.83949 7.98295
+2.27395 8.11812
+1.69929 8.22072
+1.1178 8.29026
+0.531808 8.32637
+-0.0563274 8.32884
+-0.644231 8.29763
+-1.22953 8.23286
+-1.80985 8.13479
+-2.38286 8.00386
+-2.94625 7.84064
+-3.49779 7.64586
+-4.0353 7.4204
+-4.55667 7.16527
+-5.0599 6.88161
+-5.54309 6.57068
+-6.00443 6.23384
+-6.44224 5.87257
+-6.85498 5.48843
+-7.24121 5.08306
+-7.59965 4.65817
+-7.92915 4.21553
+-8.22869 3.75696
+-8.49741 3.28431
+-8.73458 2.79945
+-8.9396 2.30428
+-9.11203 1.80071
+-9.25155 1.29063
+-9.35798 0.775926
+-9.43125 0.258472
+-9.47144 -0.25989
+-9.47873 -0.777348
+-9.45342 -1.29213
+-9.39592 -1.80251
+-9.30672 -2.30679
+-9.18644 -2.80337
+-9.03577 -3.29065
+-8.85549 -3.76713
+-8.64646 -4.23136
+-8.4096 -4.68195
+-8.14592 -5.11756
+-7.85647 -5.53695
+-7.54238 -5.93893
+-7.20481 -6.32237
+-6.84497 -6.68623
+-6.46412 -7.02951
+-6.06356 -7.35131
+-5.64463 -7.6508
+-5.20868 -7.92721
+-4.7571 -8.17984
+-4.29133 -8.40809
+-3.81281 -8.61138
+-3.32301 -8.78925
+-2.82342 -8.94128
+-2.31553 -9.0671
+-1.80086 -9.16645
+-1.28093 -9.2391
+-0.757271 -9.28488
+-0.231404 -9.30372
+0.295136 -9.29558
+0.820822 -9.2605
+1.34413 -9.19859
+1.86353 -9.11001
+2.37752 -8.995
+2.88459 -8.85385
+3.38325 -8.68693
+3.87203 -8.49465
+4.34947 -8.27752
+4.81412 -8.03608
+5.26457 -7.77096
+5.69943 -7.48284
+6.11733 -7.17248
+6.51692 -6.84067
+6.89693 -6.48831
+7.25607 -6.11634
+7.59312 -5.72577
+7.90691 -5.31766
+8.1963 -4.89315
+8.46021 -4.45344
+8.69763 -3.99979
+8.90758 -3.53351
+9.08917 -3.05599
+9.24158 -2.56866
+9.36405 -2.07301
+9.45591 -1.57058
+9.51657 -1.06297
+9.54553 -0.551819
+9.54241 -0.0388096
+9.50688 0.474335
+9.43877 0.985858
+9.33797 1.49397
+9.20454 1.99687
+9.03861 2.49273
+8.84046 2.97971
+8.61049 3.45597
+8.34924 3.91969
+8.05737 4.36904
+7.73569 4.80223
+7.38512 5.2175
+7.00674 5.61314
+6.60176 5.98748
+6.17152 6.33892
+5.71749 6.66593
+5.24126 6.96708
+4.74456 7.24101
+4.2292 7.48648
+3.69713 7.70237
+3.15039 7.88766
+2.59108 8.04148
+2.02141 8.1631
+1.44363 8.25192
+0.860063 8.30749
+0.273049 8.32952
+-0.315037 8.31787
+-0.901813 8.27255
+-1.4849 8.19375
+-2.06196 8.08179
+-2.63065 7.93714
+-3.18873 7.76046
+-3.73398 7.55251
+-4.26428 7.31425
+-4.77758 7.04672
+-5.27193 6.75115
+-5.74548 6.42883
+-6.19648 6.08119
+-6.6233 5.70976
+-7.02446 5.31613
+-7.39858 4.90198
+-7.74443 4.46905
+-8.06091 4.01913
+-8.34706 3.55407
+-8.60208 3.07571
+-8.82528 2.58597
+-9.01614 2.08672
+-9.17426 1.57988
+-9.29936 1.06735
+-9.39132 0.551004
+-9.45013 0.0327077
+-9.4759 -0.485707
+-9.46887 -1.00244
+-9.42937 -1.51574
+-9.35786 -2.0239
+-9.25488 -2.52524
+-9.12108 -3.01818
+-8.95718 -3.50115
+-8.764 -3.97268
+-8.54242 -4.43133
+-8.29342 -4.87575
+-8.01802 -5.30464
+-7.71731 -5.71679
+-7.39244 -6.11103
+-7.0446 -6.48628
+-6.67503 -6.84153
+-6.28502 -7.17583
+-5.8759 -7.48831
+-5.44903 -7.77815
+-5.00578 -8.04463
+-4.54758 -8.28708
+-4.07587 -8.50491
+-3.5921 -8.69759
+-3.09775 -8.86466
+-2.59431 -9.00572
+-2.08328 -9.12047
+-1.56618 -9.20864
+-1.04452 -9.27005
+-0.519827 -9.30456
+0.00637733 -9.31212
+0.532568 -9.29275
+1.05722 -9.24651
+1.57883 -9.17354
+2.09587 -9.07404
+2.60684 -8.94828
+3.11027 -8.79659
+3.60467 -8.61937
+4.08858 -8.41706
+4.56056 -8.19021
+5.01919 -7.93939
+5.46307 -7.66525
+5.89084 -7.36851
+6.30115 -7.04995
+6.69268 -6.7104
+7.06417 -6.35078
+7.41437 -5.97205
+7.74209 -5.57523
+8.04617 -5.16143
+8.32552 -4.7318
+8.57907 -4.28754
+8.80583 -3.82993
+9.00487 -3.3603
+9.17532 -2.88003
+9.31639 -2.39056
+9.42736 -1.89338
+9.50759 -1.39002
+9.55655 -0.882084
+9.5738 -0.371204
+9.55896 0.140936
+9.5118 0.652617
+9.43217 1.16208
+9.32001 1.66756
+9.17541 2.16723
+8.99854 2.6593
+8.78974 3.14192
+8.54943 3.61328
+8.27818 4.07156
+7.97669 4.51496
+7.64579 4.9417
+7.28645 5.35005
+6.89977 5.7383
+6.48698 6.10483
+6.04945 6.44805
+5.58867 6.76648
+5.10626 7.05868
+4.60395 7.32335
+4.0836 7.55928
+3.54714 7.76538
+2.99662 7.94066
+2.43418 8.08429
+1.86201 8.19557
+1.28238 8.27394
+0.697598 8.319
+0.110014 8.3305
+-0.478004 8.30834
+-1.06408 8.25259
+-1.64585 8.16348
+-2.22096 8.04138
+-2.7871 7.88682
+-3.34201 7.7005
+-3.8835 7.48324
+-4.40943 7.23601
+-4.91778 6.95991
+-5.40659 6.65617
+-5.87405 6.32612
+-6.31843 5.97121
+-6.73814 5.59297
+-7.13171 5.19302
+-7.49782 4.77305
+-7.83526 4.33483
+-8.14298 3.88015
+-8.42008 3.41085
+-8.66577 2.92882
+-8.87943 2.43595
+-9.06056 1.93413
+-9.20881 1.42528
+-9.32396 0.911296
+-9.40591 0.394049
+-9.4547 -0.124602
+-9.47047 -0.64283
+-9.45351 -1.15885
+-9.40418 -1.67091
+-9.32296 -2.17731
+-9.21045 -2.67642
+-9.0673 -3.16662
+-8.89429 -3.6464
+-8.69226 -4.11427
+-8.46212 -4.56884
+-8.20485 -5.00876
+-7.92152 -5.43274
+-7.61323 -5.83959
+-7.28114 -6.22816
+-6.92648 -6.59738
+-6.55048 -6.94626
+-6.15446 -7.27386
+-5.73974 -7.57932
+-5.30769 -7.86185
+-4.8597 -8.12073
+-4.39717 -8.35532
+-3.92156 -8.56506
+-3.43432 -8.74943
+-2.93694 -8.90801
+-2.4309 -9.04043
+-1.91772 -9.14641
+-1.39892 -9.22571
+-0.876023 -9.27817
+-0.35056 -9.30368
+0.175937 -9.30222
+0.70194 -9.27381
+1.22592 -9.21854
+1.74636 -9.13656
+2.26174 -9.02811
+2.77056 -8.89347
+3.27133 -8.73298
+3.76257 -8.54705
+4.24282 -8.33617
+4.71064 -8.10088
+5.16461 -7.84179
+5.60333 -7.55955
+6.02544 -7.25492
+6.42959 -6.92868
+6.81449 -6.5817
+7.17886 -6.21491
+7.52148 -5.8293
+7.84116 -5.42591
+8.13676 -5.00588
+8.40719 -4.57037
+8.65142 -4.12062
+8.86848 -3.65794
+9.05745 -3.18368
+9.2175 -2.69926
+9.34787 -2.20615
+9.44785 -1.70588
+9.51684 -1.20001
+9.55433 -0.690172
+9.55988 -0.17803
+9.53318 0.334713
+9.474 0.846314
+9.38221 1.355
+9.25783 1.85899
+9.10096 2.35645
+8.91185 2.84556
+8.69085 3.3245
+8.43845 3.79143
+8.15529 4.24454
+7.84211 4.68203
+7.49981 5.10213
+7.12941 5.50313
+6.73208 5.88334
+6.30911 6.24115
+5.86193 6.57501
+5.39208 6.88345
+4.90125 7.1651
+4.39121 7.41869
+3.86388 7.64304
+3.32125 7.83711
+2.76541 8
+2.19853 8.1309
+1.62285 8.22919
+1.04065 8.29438
+0.454289 8.32612
+-0.13388 8.32423
+-0.721473 8.28868
+-1.30611 8.21959
+-1.88541 8.11726
+-2.45705 7.98212
+-3.01872 7.81475
+-3.56819 7.61589
+-4.1033 7.38642
+-4.62195 7.12734
+-5.12217 6.83981
+-5.60207 6.5251
+-6.05987 6.1846
+-6.49393 5.81978
+-6.90271 5.43224
+-7.2848 5.02364
+-7.63892 4.59569
+-7.96394 4.15019
+-8.25886 3.68896
+-8.52282 3.21387
+-8.75511 2.7268
+-8.95514 2.22967
+-9.12247 1.72437
+-9.2568 1.21283
+-9.35795 0.696927
+-9.42589 0.178541
+-9.46069 -0.340478
+-9.46255 -0.858315
+-9.43178 -1.3732
+-9.3688 -1.88339
+-9.27414 -2.38721
+-9.14841 -2.88303
+-8.99232 -3.36929
+-8.80667 -3.84446
+-8.59234 -4.30711
+-8.35027 -4.75585
+-8.08147 -5.18937
+-7.78703 -5.60642
+-7.46808 -6.00582
+-7.12582 -6.38647
+-6.76148 -6.74732
+-6.37634 -7.08742
+-5.97172 -7.40587
+-5.54898 -7.70185
+-5.1095 -7.9746
+-4.65471 -8.22344
+-4.18602 -8.44776
+-3.70492 -8.64702
+-3.21287 -8.82073
+-2.71136 -8.96851
+-2.2019 -9.09001
+-1.686 -9.18495
+-1.16518 -9.25315
+-0.640968 -9.29445
+-0.114887 -9.3088
+0.411535 -9.29619
+0.936776 -9.25667
+1.45932 -9.19037
+1.97765 -9.09749
+2.49026 -8.97827
+2.99567 -8.83304
+3.49239 -8.66218
+3.97897 -8.46613
+4.45395 -8.2454
+4.91593 -8.00058
+5.36349 -7.73229
+5.79527 -7.44124
+6.20992 -7.12819
+6.60612 -6.79397
+6.98259 -6.43947
+7.3381 -6.06564
+7.67145 -5.6735
+7.98147 -5.26412
+8.26705 -4.83865
+8.52715 -4.39828
+8.76075 -3.94427
+8.96692 -3.47794
+9.14476 -3.00065
+9.29348 -2.51384
+9.41234 -2.01897
+9.50067 -1.51757
+9.55791 -1.01122
+9.58357 -0.501524
+9.57729 0.0098532
+9.53877 0.521216
+9.46786 1.03083
+9.36447 1.53693
+9.22866 2.03773
+9.06059 2.53143
+8.86054 3.01621
+8.62891 3.49025
+8.36624 3.95174
+8.07318 4.39888
+7.75052 4.82989
+7.3992 5.24304
+7.02027 5.63662
+6.61491 6.00897
+6.18446 6.35851
+5.73036 6.68372
+5.25419 6.98316
+4.75763 7.25549
+4.24251 7.49948
+3.71072 7.71398
+3.16429 7.89799
+2.60531 8.05064
+2.03596 8.17117
+1.45847 8.25898
+0.87514 8.31363
+0.288305 8.3348
+-0.299676 8.32237
+-0.886433 8.27634
+-1.46959 8.19687
+-2.04681 8.08431
+-2.61575 7.93914
+-3.17415 7.76199
+-3.71978 7.55364
+-4.25049 7.31502
+-4.76423 7.04719
+-5.259 6.75133
+-5.73296 6.42874
+-6.18433 6.08083
+-6.61149 5.70911
+-7.01293 5.31518
+-7.38726 4.90071
+-7.73326 4.46742
+-8.04981 4.01713
+-8.33596 3.55165
+-8.59089 3.07286
+-8.81392 2.58266
+-9.00452 2.08294
+-9.16228 1.57562
+-9.28694 1.06259
+-9.37838 0.545751
+-9.43658 0.0269674
+-9.46165 -0.491921
+-9.45385 -1.00911
+-9.4135 -1.52283
+-9.34107 -2.03138
+-9.23711 -2.53307
+-9.10227 -3.0263
+-8.93728 -3.50951
+-8.74297 -3.98121
+-8.52025 -4.43997
+-8.27007 -4.88442
+-7.99349 -5.31327
+-7.69159 -5.72528
+-7.36554 -6.1193
+-7.01655 -6.49424
+-6.64586 -6.84907
+-6.25477 -7.18284
+-5.84462 -7.49468
+-5.41676 -7.78377
+-4.97259 -8.04938
+-4.51353 -8.29084
+-4.04101 -8.50754
+-3.55651 -8.69897
+-3.06148 -8.86466
+-2.55742 -9.00424
+-2.04584 -9.11739
+-1.52825 -9.20387
+-1.00617 -9.26351
+-0.481127 -9.2962
+0.0453362 -9.30188
+0.571693 -9.28058
+1.09642 -9.23237
+1.61798 -9.15742
+2.13487 -9.05591
+2.64557 -8.92813
+3.1486 -8.77442
+3.64247 -8.59517
+4.12572 -8.39085
+4.59691 -8.16198
+5.0546 -7.90917
+5.49741 -7.63306
+5.92396 -7.33438
+6.3329 -7.01391
+6.72293 -6.67249
+7.09278 -6.31105
+7.44119 -5.93054
+7.76699 -5.53202
+8.06903 -5.11658
+8.34621 -4.68538
+8.59749 -4.23964
+8.82188 -3.78064
+9.01846 -3.30973
+9.18637 -2.82831
+9.32484 -2.33781
+9.43316 -1.83976
+9.51069 -1.33571
+9.55691 -0.827256
+9.57135 -0.316052
+9.55368 0.196216
+9.50364 0.707821
+9.42109 1.21701
+9.30598 1.72199
+9.15842 2.22098
+8.97859 2.71214
+8.76682 3.19367
+8.52356 3.66373
+8.2494 4.12051
+7.94505 4.56223
+7.61136 4.9871
+7.24931 5.3934
+6.86001 5.77944
+6.44472 6.14359
+6.00482 6.48428
+5.5418 6.80003
+5.05731 7.08944
+4.55309 7.35119
+4.031 7.58411
+3.493 7.78709
+2.94115 7.95919
+2.37759 8.09959
+1.80452 8.20759
+1.22422 8.28266
+0.639013 8.32441
+0.051245 8.3326
+-0.536707 8.30716
+-1.12246 8.24817
+-1.70365 8.15586
+-2.27792 8.03062
+-2.84295 7.87301
+-3.3965 7.6837
+-3.93634 7.46353
+-4.46037 7.21347
+-4.96656 6.93462
+-5.45297 6.62819
+-5.91778 6.29552
+-6.35931 5.93806
+-6.77598 5.55734
+-7.16634 5.155
+-7.52908 4.73275
+-7.86303 4.29233
+-8.16714 3.83559
+-8.44051 3.36437
+-8.68237 2.88055
+-8.89211 2.38605
+-9.06925 1.88278
+-9.21342 1.37264
+-9.32441 0.857548
+-9.40214 0.339388
+-9.44665 -0.179977
+-9.4581 -0.698716
+-9.43676 -1.21503
+-9.38302 -1.72718
+-9.29738 -2.23345
+-9.18042 -2.73219
+-9.03283 -3.2218
+-8.85538 -3.70076
+-8.64892 -4.16759
+-8.41439 -4.62089
+-8.15279 -5.0593
+-7.86517 -5.48156
+-7.55267 -5.88647
+-7.21647 -6.27289
+-6.85779 -6.63977
+-6.47791 -6.98611
+-6.07815 -7.31099
+-5.65986 -7.61358
+-5.22442 -7.89309
+-4.77325 -8.14882
+-4.30778 -8.38014
+-3.82948 -8.58649
+-3.33983 -8.76737
+-2.84031 -8.92236
+-2.33244 -9.05111
+-1.81773 -9.15332
+-1.29771 -9.22879
+-0.773901 -9.27736
+-0.247838 -9.29894
+0.278949 -9.29352
+0.804931 -9.26115
+1.32859 -9.20192
+1.8484 -9.11603
+2.36286 -9.00372
+2.87047 -8.86528
+3.36975 -8.7011
+3.85924 -8.5116
+4.33748 -8.29728
+4.80304 -8.05871
+5.25453 -7.7965
+5.69057 -7.51136
+6.1098 -7.20402
+6.5109 -6.87531
+6.8926 -6.5261
+7.25364 -6.15733
+7.59282 -5.77001
+7.90897 -5.36519
+8.20098 -4.944
+8.46779 -4.50763
+8.70838 -4.05732
+8.92181 -3.59437
+9.10719 -3.12014
+9.26369 -2.63603
+9.39057 -2.14353
+9.48716 -1.64413
+9.55285 -1.1394
+9.58715 -0.630943
+9.58964 -0.120401
+9.56001 0.390545
+9.49807 0.900186
+9.4037 1.40678
+9.27694 1.90855
+9.11791 2.40372
+8.92686 2.89047
+8.70418 3.36702
+8.45035 3.83154
+8.16601 4.28225
+7.8519 4.71737
+7.50891 5.13516
+7.13805 5.53391
+6.74048 5.91195
+6.31746 6.2677
+5.87042 6.5996
+5.40087 6.90622
+4.91048 7.18618
+4.401 7.43821
+3.87431 7.66114
+3.33239 7.85395
+2.77729 8.0157
+2.21116 8.1456
+1.63622 8.24303
+1.05473 8.30746
+0.46902 8.33855
+-0.118575 8.33611
+-0.705688 8.3001
+-1.28995 8.23062
+-1.86901 8.12797
+-2.44054 7.99256
+-3.00224 7.82499
+-3.55187 7.62598
+-4.08727 7.3964
+-4.60635 7.13728
+-5.10708 6.84975
+-5.58758 6.53508
+-6.04604 6.19462
+-6.48079 5.82987
+-6.89027 5.44239
+-7.27307 5.03381
+-7.62788 4.60587
+-7.95356 4.16033
+-8.24911 3.69902
+-8.51365 3.2238
+-8.74645 2.73655
+-8.94694 2.23918
+-9.11466 1.7336
+-9.24931 1.22172
+-9.35071 0.705441
+-9.41881 0.18664
+-9.45368 -0.332827
+-9.45553 -0.85114
+-9.42467 -1.36652
+-9.36151 -1.87721
+-9.26659 -2.38155
+-9.14052 -2.87789
+-8.98402 -3.36464
+-8.79788 -3.8403
+-8.583 -4.30341
+-8.34032 -4.75258
+-8.07087 -5.18649
+-7.77573 -5.60388
+-7.45605 -6.00357
+-7.11303 -6.38445
+-6.74792 -6.74548
+-6.362 -7.08568
+-5.95661 -7.40415
+-5.53311 -7.70007
+-5.09289 -7.97267
+-4.63739 -8.22127
+-4.16803 -8.44524
+-3.68629 -8.64404
+-3.19365 -8.81719
+-2.69159 -8.96428
+-2.18163 -9.08497
+-1.66526 -9.179
+-1.14402 -9.24617
+-0.619425 -9.28636
+-0.0930099 -9.29951
+0.433694 -9.28562
+0.959157 -9.24478
+1.48185 -9.1771
+2.00026 -9.0828
+2.51287 -8.96213
+3.01818 -8.81543
+3.51472 -8.64307
+4.001 -8.44552
+4.47559 -8.22328
+4.93706 -7.97694
+5.38399 -7.70715
+5.81502 -7.4146
+6.22879 -7.10007
+6.624 -6.76439
+6.99935 -6.40846
+7.35361 -6.03323
+7.68558 -5.63974
+7.9941 -5.22905
+8.27807 -4.80232
+8.53643 -4.36075
+8.7682 -3.90561
+8.97242 -3.43822
+9.14825 -2.95995
+9.29487 -2.47225
+9.41157 -1.9766
+9.4977 -1.47454
+9.55271 -0.967658
+9.57612 -0.457581
+9.56755 0.0540176
+9.52674 0.565428
+9.45351 1.07491
+9.34779 1.5807
+9.20964 2.081
+9.03923 2.574
+8.83684 3.0579
+8.60288 3.53089
+8.33791 3.99114
+8.04258 4.43687
+7.71771 4.8663
+7.36424 5.27771
+6.98323 5.66939
+6.57589 6.0397
+6.14355 6.38707
+5.68768 6.70997
+5.20986 7.007
+4.71179 7.27682
+4.1953 7.5182
+3.6623 7.73002
+3.11482 7.91129
+2.55495 8.06113
+1.9849 8.17883
+1.40689 8.2638
+0.823228 8.31559
+0.236255 8.33392
+-0.351667 8.31866
+-0.938165 8.26984
+-1.52087 8.18764
+-2.09742 8.07241
+-2.66549 7.92464
+-3.22281 7.74497
+-3.76716 7.5342
+-4.29638 7.29325
+-4.8084 7.02319
+-5.30126 6.72519
+-5.77308 6.40055
+-6.22212 6.05068
+-6.64674 5.67707
+-7.04545 5.28131
+-7.4169 4.86507
+-7.75986 4.4301
+-8.07326 3.97818
+-8.35613 3.51117
+-8.60769 3.03093
+-8.82727 2.53938
+-9.01433 2.03843
+-9.16849 1.52999
+-9.28948 1.01598
+-9.37719 0.498292
+-9.43159 -0.0211906
+-9.45283 -0.540622
+-9.44113 -1.05819
+-9.39686 -1.57212
+-9.32046 -2.08069
+-9.21251 -2.58223
+-9.07365 -3.07511
+-8.90463 -3.55778
+&
+@target G0.S3
+@type xy
+8.30994 -16.2836
+8.66186 -16.1431
+9.01042 -15.9963
+9.35548 -15.8433
+9.69693 -15.6842
+10.0346 -15.5191
+10.3685 -15.3479
+10.6983 -15.1709
+11.0241 -14.9881
+11.3456 -14.7995
+11.6628 -14.6053
+11.9756 -14.4055
+12.2838 -14.2002
+12.5873 -13.9896
+12.8861 -13.7736
+13.18 -13.5524
+13.4689 -13.3262
+13.7528 -13.0949
+14.0315 -12.8586
+14.3049 -12.6176
+14.573 -12.3718
+14.8356 -12.1214
+15.0926 -11.8664
+15.344 -11.6071
+15.5897 -11.3434
+15.8296 -11.0755
+16.0636 -10.8034
+16.2917 -10.5274
+16.5137 -10.2474
+16.7296 -9.96372
+16.9393 -9.6763
+17.1428 -9.38532
+17.3399 -9.09087
+17.5306 -8.79307
+17.7149 -8.49203
+17.8927 -8.18787
+18.0639 -7.88069
+18.2284 -7.57063
+18.3863 -7.25778
+18.5374 -6.94228
+18.6817 -6.62423
+18.8192 -6.30375
+18.9498 -5.98097
+19.0734 -5.65599
+19.1901 -5.32895
+19.2997 -4.99997
+19.4024 -4.66915
+19.4979 -4.33663
+19.5863 -4.00253
+19.6675 -3.66696
+19.7416 -3.33006
+19.8085 -2.99195
+19.8681 -2.65274
+19.9205 -2.31257
+19.9656 -1.97155
+20.0035 -1.62981
+20.034 -1.28748
+20.0572 -0.944683
+20.0731 -0.601539
+20.0816 -0.258176
+20.0828 0.085282
+20.0767 0.428709
+20.0632 0.77198
+20.0423 1.11497
+20.0142 1.45755
+19.9787 1.7996
+19.9358 2.14099
+19.8857 2.48159
+19.8282 2.82128
+19.7635 3.15994
+19.6915 3.49744
+19.6122 3.83365
+19.5258 4.16844
+19.4321 4.5017
+19.3312 4.83329
+19.2232 5.1631
+19.1081 5.491
+18.9859 5.81686
+18.8567 6.14057
+18.7204 6.46199
+18.5772 6.78101
+18.4271 7.0975
+18.2701 7.41135
+18.1063 7.72243
+17.9357 8.03062
+17.7583 8.3358
+17.5743 8.63785
+17.3837 8.93665
+17.1866 9.23209
+16.983 9.52404
+16.7729 9.8124
+16.5565 10.097
+16.3338 10.3779
+16.1049 10.6547
+15.8699 10.9275
+15.6288 11.1962
+15.3818 11.4606
+15.1288 11.7205
+14.87 11.976
+14.6056 12.2269
+14.3355 12.473
+14.0598 12.7144
+13.7787 12.9508
+13.4923 13.1822
+13.2006 13.4084
+12.9037 13.6295
+12.6019 13.8452
+12.295 14.0554
+11.9834 14.2602
+11.667 14.4593
+11.346 14.6527
+11.0206 14.8403
+10.6907 15.0221
+10.3566 15.1978
+10.0184 15.3675
+9.67612 15.531
+9.32999 15.6884
+8.98012 15.8394
+8.62662 15.984
+8.26964 16.1222
+7.9093 16.2538
+7.54575 16.3788
+7.17913 16.4971
+6.80957 16.6087
+6.43722 16.7135
+6.06223 16.8114
+5.68473 16.9024
+5.30489 16.9864
+4.92286 17.0633
+4.53877 17.1332
+4.15279 17.1959
+3.76508 17.2514
+3.37579 17.2996
+2.98508 17.3406
+2.59311 17.3743
+2.20004 17.4006
+1.80604 17.4195
+1.41127 17.431
+1.0159 17.435
+0.620089 17.4316
+0.224012 17.4207
+-0.172163 17.4023
+-0.568265 17.3764
+-0.964123 17.3429
+-1.35956 17.3019
+-1.75442 17.2533
+-2.1485 17.1973
+-2.54165 17.1336
+-2.93368 17.0625
+-3.32442 16.9838
+-3.7137 16.8976
+-4.10133 16.804
+-4.48714 16.7029
+-4.87095 16.5943
+-5.25258 16.4783
+-5.63186 16.3549
+-6.00861 16.2242
+-6.38266 16.0861
+-6.75382 15.9408
+-7.12192 15.7883
+-7.4868 15.6286
+-7.84826 15.4618
+-8.20615 15.2879
+-8.56029 15.1071
+-8.9105 14.9193
+-9.25662 14.7247
+-9.59848 14.5232
+-9.93591 14.3151
+-10.2687 14.1003
+-10.5968 13.879
+-10.92 13.6513
+-11.238 13.4172
+-11.5508 13.1768
+-11.8582 12.9302
+-12.1601 12.6776
+-12.4562 12.4191
+-12.7465 12.1547
+-13.0308 11.8846
+-13.3089 11.6088
+-13.5807 11.3276
+-13.8461 11.041
+-14.1049 10.7491
+-14.357 10.4522
+-14.6023 10.1503
+-14.8406 9.84348
+-15.0718 9.53201
+-15.2958 9.21597
+-15.5124 8.89552
+-15.7217 8.57081
+-15.9234 8.24198
+-16.1174 7.90918
+-16.3037 7.57258
+-16.4821 7.23234
+-16.6526 6.88861
+-16.815 6.54155
+-16.9693 6.19133
+-17.1155 5.83813
+-17.2533 5.4821
+-17.3828 5.12341
+-17.5039 4.76225
+-17.6165 4.39879
+-17.7206 4.03319
+-17.8161 3.66564
+-17.903 3.29631
+-17.9812 2.92539
+-18.0506 2.55305
+-18.1114 2.17947
+-18.1633 1.80484
+-18.2064 1.42933
+-18.2407 1.05313
+-18.2661 0.676423
+-18.2827 0.299385
+-18.2904 -0.0777982
+-18.2893 -0.454945
+-18.2793 -0.831874
+-18.2605 -1.2084
+-18.2329 -1.58435
+-18.1964 -1.95953
+-18.1512 -2.33377
+-18.0972 -2.70688
+-18.0345 -3.07869
+-17.9631 -3.44902
+-17.8831 -3.81769
+-17.7945 -4.18453
+-17.6973 -4.54937
+-17.5917 -4.91202
+-17.4777 -5.27232
+-17.3553 -5.63011
+-17.2246 -5.98521
+-17.0857 -6.33745
+-16.9387 -6.68668
+-16.7837 -7.03273
+-16.6206 -7.37545
+-16.4498 -7.71468
+-16.2711 -8.05026
+-16.0848 -8.38204
+-15.8908 -8.70987
+-15.6895 -9.03361
+-15.4807 -9.35312
+-15.2647 -9.66824
+-15.0416 -9.97885
+-14.8114 -10.2848
+-14.5744 -10.586
+-14.3306 -10.8822
+-14.0802 -11.1735
+-13.8232 -11.4595
+-13.5599 -11.7403
+-13.2903 -12.0157
+-13.0147 -12.2855
+-12.7331 -12.5498
+-12.4456 -12.8083
+-12.1525 -13.061
+-11.8539 -13.3077
+-11.5499 -13.5485
+-11.2407 -13.7831
+-10.9264 -14.0114
+-10.6072 -14.2335
+-10.2833 -14.4492
+-9.95473 -14.6584
+-9.62174 -14.8611
+-9.28447 -15.0572
+-8.94308 -15.2466
+-8.59774 -15.4293
+-8.2486 -15.6051
+-7.89583 -15.7741
+-7.5396 -15.9362
+-7.18006 -16.0913
+-6.8174 -16.2394
+-6.45176 -16.3804
+-6.08333 -16.5143
+-5.71227 -16.6411
+-5.33874 -16.7607
+-4.96292 -16.8731
+-4.58498 -16.9783
+-4.20507 -17.0762
+-3.82337 -17.1669
+-3.44005 -17.2502
+-3.05527 -17.3263
+-2.6692 -17.395
+-2.28201 -17.4564
+-1.89387 -17.5105
+-1.50493 -17.5572
+-1.11536 -17.5967
+-0.725328 -17.6288
+-0.334998 -17.6535
+0.05547 -17.671
+0.445914 -17.6812
+0.836173 -17.6841
+1.22609 -17.6797
+1.6155 -17.6681
+2.00425 -17.6493
+2.39219 -17.6234
+2.77915 -17.5902
+3.16499 -17.55
+3.54955 -17.5026
+3.93268 -17.4483
+4.31423 -17.3869
+4.69405 -17.3185
+5.072 -17.2433
+5.44793 -17.1612
+5.82169 -17.0722
+6.19314 -16.9765
+6.56214 -16.8741
+6.92855 -16.765
+7.29224 -16.6494
+7.65306 -16.5272
+8.01089 -16.3985
+8.36559 -16.2635
+8.71702 -16.1221
+9.06507 -15.9744
+9.4096 -15.8206
+9.75049 -15.6606
+10.0876 -15.4946
+10.4209 -15.3226
+10.7501 -15.1447
+11.0752 -14.961
+11.3961 -14.7716
+11.7126 -14.5765
+12.0247 -14.3759
+12.3321 -14.1698
+12.635 -13.9584
+12.933 -13.7416
+13.2261 -13.5196
+13.5143 -13.2926
+13.7973 -13.0605
+14.0752 -12.8235
+14.3478 -12.5817
+14.615 -12.3352
+14.8767 -12.0841
+15.1329 -11.8284
+15.3834 -11.5684
+15.6282 -11.304
+15.8672 -11.0354
+16.1003 -10.7627
+16.3274 -10.486
+16.5484 -10.2055
+16.7633 -9.92114
+16.9721 -9.63312
+17.1745 -9.34155
+17.3707 -9.04653
+17.5604 -8.74817
+17.7436 -8.4466
+17.9204 -8.14191
+18.0905 -7.83423
+18.254 -7.52367
+18.4108 -7.21036
+18.5609 -6.89439
+18.7041 -6.5759
+18.8405 -6.25501
+18.97 -5.93182
+19.0926 -5.60646
+19.2081 -5.27906
+19.3167 -4.94972
+19.4182 -4.61858
+19.5126 -4.28575
+19.5999 -3.95135
+19.68 -3.61552
+19.753 -3.27836
+19.8187 -2.94001
+19.8772 -2.60059
+19.9284 -2.26022
+19.9724 -1.91902
+20.009 -1.57713
+20.0384 -1.23466
+20.0604 -0.891739
+20.0751 -0.548492
+20.0825 -0.205044
+20.0825 0.138479
+20.0752 0.481951
+20.0605 0.825247
+20.0385 1.16824
+20.0091 1.51081
+19.9725 1.85282
+19.9284 2.19415
+19.8771 2.53468
+19.8185 2.87427
+19.7526 3.21281
+19.6794 3.55016
+19.599 3.8862
+19.5113 4.22081
+19.4165 4.55387
+19.3144 4.88523
+19.2053 5.2148
+19.089 5.54243
+18.9656 5.868
+18.8352 6.19139
+18.6978 6.51249
+18.5535 6.83115
+18.4022 7.14728
+18.244 7.46073
+18.0791 7.77139
+17.9073 8.07915
+17.7289 8.38387
+17.5438 8.68545
+17.352 8.98376
+17.1538 9.27868
+16.9491 9.5701
+16.7379 9.8579
+16.5204 10.142
+16.2967 10.4222
+16.0667 10.6984
+15.8306 10.9706
+15.5885 11.2386
+15.3404 11.5023
+15.0865 11.7616
+14.8267 12.0163
+14.5613 12.2665
+14.2902 12.5119
+14.0135 12.7524
+13.7315 12.988
+13.4441 13.2186
+13.1515 13.444
+12.8537 13.6642
+12.5509 13.879
+12.2432 14.0883
+11.9307 14.2922
+11.6135 14.4904
+11.2916 14.6828
+10.9653 14.8695
+10.6347 15.0502
+10.2998 15.225
+9.96079 15.3937
+9.6178 15.5562
+9.27095 15.7125
+8.92037 15.8624
+8.56619 16.0059
+8.20854 16.143
+7.84757 16.2735
+7.4834 16.3974
+7.11617 16.5146
+6.74604 16.6251
+6.37314 16.7287
+5.99762 16.8254
+5.61962 16.9152
+5.23929 16.998
+4.8568 17.0738
+4.47228 17.1424
+4.08589 17.2039
+3.6978 17.2581
+3.30815 17.3052
+2.91711 17.3449
+2.52484 17.3773
+2.1315 17.4023
+1.73725 17.42
+1.34226 17.4302
+0.946704 17.433
+0.55074 17.4283
+0.15454 17.4161
+-0.241726 17.3964
+-0.637886 17.3692
+-1.03377 17.3345
+-1.4292 17.2922
+-1.82401 17.2424
+-2.21801 17.1851
+-2.61104 17.1202
+-3.00292 17.0478
+-3.39347 16.9678
+-3.78252 16.8804
+-4.16988 16.7855
+-4.55539 16.6831
+-4.93886 16.5732
+-5.32012 16.456
+-5.69899 16.3314
+-6.07529 16.1994
+-6.44885 16.0601
+-6.8195 15.9136
+-7.18705 15.7598
+-7.55134 15.5989
+-7.91219 15.4308
+-8.26942 15.2558
+-8.62287 15.0737
+-8.97236 14.8847
+-9.31772 14.6889
+-9.65879 14.4863
+-9.9954 14.277
+-10.3274 14.0611
+-10.6546 13.8386
+-10.9768 13.6098
+-11.2939 13.3745
+-11.6057 13.1331
+-11.9121 12.8854
+-12.2129 12.6318
+-12.508 12.3722
+-12.7972 12.1067
+-13.0803 11.8356
+-13.3573 11.5588
+-13.6279 11.2766
+-13.8921 10.9891
+-14.1497 10.6963
+-14.4005 10.3984
+-14.6445 10.0956
+-14.8815 9.78794
+-15.1114 9.47562
+-15.334 9.15876
+-15.5493 8.83752
+-15.7572 8.51203
+-15.9575 8.18246
+-16.1501 7.84895
+-16.335 7.51167
+-16.5119 7.17077
+-16.681 6.82641
+-16.8419 6.47875
+-16.9948 6.12798
+-17.1394 5.77424
+-17.2757 5.41771
+-17.4037 5.05856
+-17.5233 4.69696
+-17.6343 4.33309
+-17.7369 3.96712
+-17.8308 3.59923
+-17.9161 3.2296
+-17.9926 2.85841
+-18.0605 2.48582
+-18.1196 2.11204
+-18.1699 1.73723
+-18.2114 1.36158
+-18.2441 0.985264
+-18.2679 0.608474
+-18.2829 0.231388
+-18.289 -0.14581
+-18.2863 -0.522939
+-18.2747 -0.899814
+-18.2543 -1.27625
+-18.225 -1.65208
+-18.187 -2.0271
+-18.1402 -2.40115
+-18.0846 -2.77404
+-18.0204 -3.14559
+-17.9474 -3.51563
+-17.8659 -3.88397
+-17.7757 -4.25045
+-17.6771 -4.61489
+-17.5699 -4.97711
+-17.4544 -5.33696
+-17.3305 -5.69425
+-17.1984 -6.04883
+-17.0581 -6.40052
+-16.9096 -6.74916
+-16.7531 -7.0946
+-16.5887 -7.43668
+-16.4164 -7.77523
+-16.2364 -8.11011
+-16.0487 -8.44117
+-15.8535 -8.76825
+-15.6508 -9.09121
+-15.4407 -9.4099
+-15.2235 -9.7242
+-14.9991 -10.034
+-14.7677 -10.339
+-14.5295 -10.6393
+-14.2846 -10.9346
+-14.033 -11.2249
+-13.7749 -11.51
+-13.5105 -11.7898
+-13.2399 -12.0641
+-12.9632 -12.333
+-12.6806 -12.5961
+-12.3922 -12.8536
+-12.0981 -13.1052
+-11.7986 -13.3508
+-11.4937 -13.5904
+-11.1836 -13.8238
+-10.8685 -14.051
+-10.5485 -14.2719
+-10.2238 -14.4864
+-9.89445 -14.6944
+-9.56073 -14.8959
+-9.22276 -15.0907
+-8.8807 -15.2789
+-8.53471 -15.4603
+-8.18495 -15.6348
+-7.8316 -15.8025
+-7.47481 -15.9633
+-7.11475 -16.1171
+-6.75159 -16.2639
+-6.3855 -16.4036
+-6.01664 -16.5362
+-5.64518 -16.6617
+-5.27128 -16.78
+-4.89512 -16.891
+-4.51687 -16.9949
+-4.13668 -17.0915
+-3.75473 -17.1808
+-3.37119 -17.2628
+-2.98622 -17.3375
+-2.59999 -17.4049
+-2.21266 -17.4649
+-1.82441 -17.5176
+-1.43539 -17.563
+-1.04577 -17.6011
+-0.655717 -17.6319
+-0.265389 -17.6553
+0.125051 -17.6714
+0.51544 -17.6803
+0.905618 -17.6818
+1.29543 -17.6761
+1.68471 -17.6632
+2.0733 -17.6431
+2.46106 -17.6158
+2.84781 -17.5814
+3.23342 -17.5399
+3.61772 -17.4913
+4.00057 -17.4356
+4.38182 -17.373
+4.76131 -17.3034
+5.13891 -17.2269
+5.51446 -17.1436
+5.88782 -17.0534
+6.25885 -16.9565
+6.62741 -16.8529
+6.99336 -16.7427
+7.35656 -16.6259
+7.71687 -16.5026
+8.07417 -16.3728
+8.42831 -16.2367
+8.77918 -16.0942
+9.12663 -15.9455
+9.47055 -15.7906
+9.81081 -15.6296
+10.1473 -15.4625
+10.4799 -15.2895
+10.8084 -15.1107
+11.1328 -14.9261
+11.453 -14.7357
+11.7687 -14.5398
+12.08 -14.3383
+12.3868 -14.1313
+12.6888 -13.919
+12.986 -13.7015
+13.2783 -13.4787
+13.5655 -13.2509
+13.8477 -13.0181
+14.1247 -12.7804
+14.3964 -12.5379
+14.6626 -12.2907
+14.9234 -12.0389
+15.1786 -11.7826
+15.4281 -11.5219
+15.6719 -11.2569
+15.9099 -10.9877
+16.1419 -10.7145
+16.368 -10.4373
+16.588 -10.1562
+16.8018 -9.87133
+17.0095 -9.58283
+17.2108 -9.29079
+17.4059 -8.99532
+17.5945 -8.69654
+17.7766 -8.39456
+17.9522 -8.08949
+18.1212 -7.78144
+18.2835 -7.47054
+18.4392 -7.1569
+18.588 -6.84063
+18.7301 -6.52186
+18.8653 -6.2007
+18.9937 -5.87727
+19.115 -5.55169
+19.2294 -5.22409
+19.3368 -4.89457
+19.4371 -4.56327
+19.5303 -4.23031
+19.6164 -3.89579
+19.6953 -3.55986
+19.7671 -3.22263
+19.8316 -2.88423
+19.8889 -2.54477
+19.9389 -2.20438
+19.9817 -1.86319
+20.0171 -1.52131
+20.0453 -1.17889
+20.0662 -0.836027
+20.0797 -0.492862
+20.0859 -0.149517
+20.0847 0.193882
+20.0763 0.53721
+20.0604 0.880342
+20.0373 1.22315
+20.0068 1.56551
+19.969 1.9073
+19.9238 2.24838
+19.8714 2.58864
+19.8117 2.92795
+19.7446 3.26618
+19.6704 3.60321
+19.5889 3.93892
+19.5001 4.27317
+19.4042 4.60584
+19.3011 4.93681
+19.1909 5.26596
+19.0736 5.59316
+18.9492 5.91828
+18.8177 6.24121
+18.6793 6.56182
+18.534 6.87999
+18.3817 7.19559
+18.2226 7.50851
+18.0567 7.81863
+17.884 8.12582
+17.7046 8.42996
+17.5185 8.73094
+17.3259 9.02864
+17.1268 9.32293
+16.9212 9.61371
+16.7092 9.90086
+16.4908 10.1843
+16.2662 10.4638
+16.0355 10.7393
+15.7986 11.0108
+15.5557 11.278
+15.3068 11.541
+15.0521 11.7995
+14.7916 12.0535
+14.5253 12.3028
+14.2535 12.5474
+13.9762 12.7872
+13.6935 13.0219
+13.4054 13.2517
+13.1121 13.4762
+12.8137 13.6955
+12.5103 13.9095
+12.202 14.118
+11.8888 14.3209
+11.571 14.5182
+11.2486 14.7097
+10.9218 14.8955
+10.5906 15.0753
+10.2552 15.2491
+9.91572 15.4168
+9.57226 15.5784
+9.22496 15.7337
+8.87394 15.8827
+8.51934 16.0252
+8.16129 16.1613
+7.79993 16.2908
+7.4354 16.4137
+7.06783 16.5298
+6.69736 16.6392
+6.32415 16.7418
+5.94833 16.8375
+5.57006 16.9262
+5.18948 17.008
+4.80674 17.0826
+4.422 17.1502
+4.03541 17.2106
+3.64712 17.2637
+3.25731 17.3097
+2.86612 17.3483
+2.47372 17.3796
+2.08027 17.4035
+1.68593 17.4201
+1.29087 17.4292
+0.895262 17.4308
+0.499267 17.425
+0.103056 17.4117
+-0.2932 17.3909
+-0.689329 17.3625
+-1.08516 17.3267
+-1.48052 17.2833
+-1.87523 17.2323
+-2.26912 17.1738
+-2.66201 17.1078
+-3.05374 17.0342
+-3.44411 16.9531
+-3.83296 16.8645
+-4.22011 16.7685
+-4.60538 16.6649
+-4.9886 16.5539
+-5.36958 16.4355
+-5.74816 16.3097
+-6.12415 16.1766
+-6.49738 16.0362
+-6.86767 15.8885
+-7.23485 15.7337
+-7.59874 15.5716
+-7.95917 15.4025
+-8.31596 15.2263
+-8.66894 15.0432
+-9.01794 14.8532
+-9.36278 14.6563
+-9.70331 14.4526
+-10.0393 14.2423
+-10.3707 14.0253
+-10.6973 13.8019
+-11.0189 13.572
+-11.3353 13.3358
+-11.6464 13.0933
+-11.9521 12.8448
+-12.2521 12.5901
+-12.5464 12.3296
+-12.8348 12.0632
+-13.1171 11.7912
+-13.3932 11.5135
+-13.6629 11.2304
+-13.9261 10.942
+-14.1828 10.6484
+-14.4326 10.3497
+-14.6756 10.046
+-14.9116 9.73754
+-15.1404 9.42443
+-15.3619 9.10679
+-15.5761 8.78478
+-15.7828 8.45855
+-15.9819 8.12825
+-16.1734 7.79403
+-16.357 7.45606
+-16.5327 7.11448
+-16.7004 6.76947
+-16.8601 6.42118
+-17.0116 6.06978
+-17.1549 5.71545
+-17.2899 5.35834
+-17.4165 4.99864
+-17.5346 4.63651
+-17.6442 4.27212
+-17.7453 3.90566
+-17.8377 3.5373
+-17.9215 3.16722
+-17.9966 2.7956
+-18.0629 2.42262
+-18.1205 2.04845
+-18.1693 1.67329
+-18.2092 1.29731
+-18.2403 0.920699
+-18.2626 0.543637
+-18.276 0.166309
+-18.2805 -0.211103
+-18.2762 -0.588414
+-18.263 -0.965442
+-18.2409 -1.342
+-18.2101 -1.71792
+-18.1704 -2.093
+-18.122 -2.46707
+-18.0648 -2.83995
+-17.9989 -3.21147
+-17.9243 -3.58143
+-17.8411 -3.94967
+-17.7494 -4.31602
+-17.6491 -4.68029
+-17.5403 -5.04231
+-17.4231 -5.40192
+-17.2976 -5.75895
+-17.1638 -6.11322
+-17.0219 -6.46458
+-16.8718 -6.81286
+-16.7137 -7.15791
+-16.5477 -7.49955
+-16.3738 -7.83764
+-16.1922 -8.17203
+-16.003 -8.50256
+-15.8062 -8.82908
+-15.602 -9.15145
+-15.3904 -9.46952
+-15.1716 -9.78316
+-14.9458 -10.0922
+-14.713 -10.3966
+-14.4733 -10.6961
+-14.2269 -10.9907
+-13.9739 -11.2801
+-13.7145 -11.5644
+-13.4487 -11.8433
+-13.1767 -12.1167
+-12.8987 -12.3846
+-12.6148 -12.6469
+-12.3251 -12.9033
+-12.0298 -13.1539
+-11.7291 -13.3984
+-11.423 -13.6369
+-11.1118 -13.8693
+-10.7955 -14.0954
+-10.4744 -14.3151
+-10.1486 -14.5284
+-9.81823 -14.7353
+-9.48349 -14.9355
+-9.14454 -15.1291
+-8.80153 -15.316
+-8.45463 -15.4961
+-8.104 -15.6694
+-7.74981 -15.8358
+-7.39221 -15.9953
+-7.03139 -16.1478
+-6.6675 -16.2932
+-6.30071 -16.4315
+-5.93119 -16.5628
+-5.55911 -16.6868
+-5.18463 -16.8037
+-4.80792 -16.9134
+-4.42916 -17.0158
+-4.04851 -17.1109
+-3.66613 -17.1988
+-3.28219 -17.2793
+-2.89686 -17.3525
+-2.51031 -17.4184
+-2.1227 -17.477
+-1.7342 -17.5283
+-1.34498 -17.5722
+-0.955191 -17.6087
+-0.565004 -17.638
+-0.174583 -17.6599
+0.215913 -17.6745
+0.60632 -17.6819
+0.99648 -17.682
+1.38623 -17.6748
+1.77542 -17.6604
+2.16388 -17.6388
+2.55147 -17.61
+2.93802 -17.5741
+3.32339 -17.5311
+3.70741 -17.481
+4.08995 -17.4239
+4.47084 -17.3598
+4.84995 -17.2888
+5.22713 -17.2109
+5.60222 -17.1261
+5.97509 -17.0345
+6.3456 -16.9362
+6.7136 -16.8312
+7.07896 -16.7196
+7.44154 -16.6014
+7.80121 -16.4768
+8.15783 -16.3456
+8.51127 -16.2081
+8.8614 -16.0643
+9.20809 -15.9143
+9.55122 -15.7581
+9.89067 -15.5958
+10.2263 -15.4275
+10.558 -15.2533
+10.8857 -15.0733
+11.2092 -14.8874
+11.5284 -14.6959
+11.8432 -14.4988
+12.1535 -14.2962
+12.4592 -14.0881
+12.7602 -13.8747
+13.0563 -13.6561
+13.3476 -13.4323
+13.6338 -13.2034
+13.9148 -12.9696
+14.1907 -12.7309
+14.4612 -12.4874
+14.7263 -12.2393
+14.9859 -11.9866
+15.2399 -11.7294
+15.4883 -11.4678
+15.7309 -11.202
+15.9676 -10.932
+16.1984 -10.658
+16.4232 -10.38
+16.6419 -10.0982
+16.8545 -9.81265
+17.0609 -9.52347
+17.261 -9.23079
+17.4547 -8.93471
+17.642 -8.63534
+17.8228 -8.33279
+17.997 -8.02719
+18.1647 -7.71865
+18.3257 -7.40728
+18.48 -7.09319
+18.6275 -6.77651
+18.7682 -6.45736
+18.9021 -6.13584
+19.029 -5.81209
+19.149 -5.48621
+19.262 -5.15834
+19.3679 -4.82858
+19.4668 -4.49706
+19.5586 -4.1639
+19.6432 -3.82922
+19.7207 -3.49315
+19.791 -3.1558
+19.8541 -2.8173
+19.9099 -2.47778
+19.9585 -2.13735
+19.9998 -1.79614
+20.0339 -1.45427
+20.0606 -1.11187
+20.08 -0.769069
+20.0921 -0.425984
+20.0968 -0.0827423
+20.0942 0.26053
+20.0843 0.603708
+20.067 0.946665
+20.0424 1.28928
+20.0105 1.63142
+19.9713 1.97296
+19.9247 2.31379
+19.8708 2.65376
+19.8097 2.99277
+19.7413 3.33067
+19.6656 3.66735
+19.5827 4.00269
+19.4926 4.33655
+19.3953 4.66881
+19.2908 4.99935
+19.1793 5.32805
+19.0606 5.65478
+18.9349 5.97941
+18.8021 6.30183
+18.6624 6.62191
+18.5158 6.93953
+18.3622 7.25457
+18.2018 7.56691
+18.0347 7.87642
+17.8607 8.18298
+17.6801 8.48649
+17.4929 8.78681
+17.2991 9.08382
+17.0988 9.37742
+16.892 9.66748
+16.6789 9.95389
+16.4594 10.2365
+16.2337 10.5153
+16.0019 10.7901
+15.7639 11.0607
+15.5199 11.3271
+15.27 11.5892
+15.0143 11.8469
+14.7528 12.1
+14.4856 12.3485
+14.2128 12.5921
+13.9345 12.831
+13.6508 13.0648
+13.3619 13.2936
+13.0677 13.5172
+12.7684 13.7355
+12.4642 13.9485
+12.155 14.156
+11.8411 14.3579
+11.5225 14.5542
+11.1994 14.7447
+10.8718 14.9294
+10.5399 15.1081
+10.2038 15.2809
+9.86365 15.4475
+9.51955 15.608
+9.17162 15.7621
+8.82001 15.91
+8.46483 16.0514
+8.10623 16.1863
+7.74434 16.3147
+7.3793 16.4364
+7.01125 16.5514
+6.64032 16.6596
+6.26667 16.761
+5.89044 16.8554
+5.51178 16.943
+5.13084 17.0235
+4.74776 17.0969
+4.36271 17.1632
+3.97584 17.2224
+3.5873 17.2743
+3.19725 17.3189
+2.80585 17.3563
+2.41327 17.3863
+2.01967 17.409
+1.62521 17.4243
+1.23005 17.4321
+0.834375 17.4325
+0.438339 17.4254
+0.0421154 17.4108
+-0.354125 17.3887
+-0.75021 17.359
+-1.14597 17.3218
+-1.54123 17.2771
+-1.93581 17.2249
+-2.32955 17.165
+-2.72226 17.0977
+-3.11378 17.0228
+-3.50392 16.9404
+-3.89251 16.8505
+-4.27937 16.7531
+-4.66432 16.6483
+-5.0472 16.536
+-5.42781 16.4163
+-5.80599 16.2892
+-6.18155 16.1548
+-6.55432 16.0131
+-6.92413 15.8641
+-7.29079 15.708
+-7.65414 15.5447
+-8.01399 15.3743
+-8.37018 15.1969
+-8.72252 15.0125
+-9.07086 14.8212
+-9.41502 14.6231
+-9.75482 14.4182
+-10.0901 14.2067
+-10.4207 13.9885
+-10.7465 13.7639
+-11.0672 13.5328
+-11.3828 13.2954
+-11.693 13.0518
+-11.9978 12.8021
+-12.2969 12.5463
+-12.5903 12.2847
+-12.8776 12.0172
+-13.1589 11.7441
+-13.434 11.4654
+-13.7027 11.1812
+-13.9649 10.8918
+-14.2204 10.5972
+-14.4692 10.2975
+-14.711 9.99286
+-14.9458 9.68347
+-15.1735 9.36945
+-15.3939 9.05094
+-15.6068 8.72808
+-15.8123 8.40103
+-16.0102 8.06994
+-16.2004 7.73496
+-16.3827 7.39625
+-16.5571 7.05398
+-16.7235 6.7083
+-16.8819 6.35937
+-17.032 6.00737
+-17.1739 5.65246
+-17.3075 5.29481
+-17.4326 4.9346
+-17.5494 4.57199
+-17.6575 4.20716
+-17.7571 3.84029
+-17.8481 3.47155
+-17.9304 3.10112
+-18.004 2.72919
+-18.0688 2.35594
+-18.1248 1.98154
+-18.1721 1.60617
+-18.2105 1.23003
+-18.24 0.85329
+-18.2607 0.476137
+-18.2725 0.0987529
+-18.2754 -0.278678
+-18.2695 -0.655974
+-18.2547 -1.03295
+-18.2311 -1.40943
+-18.1986 -1.78522
+-18.1573 -2.16015
+-18.1072 -2.53404
+-18.0484 -2.9067
+-17.9808 -3.27796
+-17.9046 -3.64764
+-17.8198 -4.01556
+-17.7264 -4.38156
+-17.6244 -4.74545
+-17.514 -5.10706
+-17.3952 -5.46623
+-17.2681 -5.82278
+-17.1327 -6.17655
+-16.9891 -6.52737
+-16.8374 -6.87509
+-16.6778 -7.21954
+-16.5102 -7.56056
+-16.3347 -7.898
+-16.1516 -8.2317
+-15.9608 -8.56152
+-15.7625 -8.8873
+-15.5567 -9.2089
+-15.3437 -9.52618
+-15.1235 -9.83899
+-14.8962 -10.1472
+-14.6619 -10.4507
+-14.4208 -10.7493
+-14.1731 -11.0429
+-13.9187 -11.3314
+-13.6579 -11.6146
+-13.3909 -11.8925
+-13.1176 -12.1649
+-12.8383 -12.4318
+-12.5532 -12.6929
+-12.2623 -12.9482
+-11.9658 -13.1977
+-11.6638 -13.4411
+-11.3566 -13.6784
+-11.0443 -13.9095
+-10.7269 -14.1344
+-10.4047 -14.3529
+-10.0779 -14.565
+-9.74656 -14.7706
+-9.41087 -14.9695
+-9.07099 -15.1618
+-8.72709 -15.3474
+-8.37932 -15.5262
+-8.02787 -15.6982
+-7.67288 -15.8632
+-7.31453 -16.0213
+-6.95298 -16.1724
+-6.5884 -16.3164
+-6.22095 -16.4534
+-5.85081 -16.5832
+-5.47815 -16.7058
+-5.10312 -16.8212
+-4.7259 -16.9294
+-4.34665 -17.0304
+-3.96555 -17.1241
+-3.58276 -17.2104
+-3.19844 -17.2895
+-2.81278 -17.3613
+-2.42592 -17.4257
+-2.03804 -17.4828
+-1.64931 -17.5325
+-1.25989 -17.5749
+-0.869939 -17.61
+-0.479627 -17.6378
+-0.0891163 -17.6582
+0.301432 -17.6714
+0.691857 -17.6772
+1.082 -17.6758
+1.47169 -17.6671
+1.86079 -17.6513
+2.24913 -17.6282
+2.63655 -17.598
+3.0229 -17.5606
+3.40803 -17.5161
+3.79179 -17.4646
+4.17402 -17.4061
+4.55458 -17.3405
+4.93332 -17.2681
+5.31008 -17.1887
+5.68474 -17.1026
+6.05714 -17.0096
+6.42715 -16.9099
+6.79462 -16.8036
+7.15942 -16.6906
+7.52141 -16.571
+7.88045 -16.445
+8.23642 -16.3126
+8.58919 -16.1738
+8.93861 -16.0287
+9.28457 -15.8774
+9.62694 -15.7199
+9.9656 -15.5564
+10.3004 -15.3869
+10.6313 -15.2115
+10.9581 -15.0303
+11.2807 -14.8433
+11.599 -14.6506
+11.9128 -14.4524
+12.2222 -14.2487
+12.5269 -14.0395
+12.8268 -13.8251
+13.122 -13.6054
+13.4121 -13.3806
+13.6972 -13.1507
+13.9772 -12.9159
+14.2519 -12.6763
+14.5213 -12.4319
+14.7853 -12.1828
+15.0437 -11.9292
+15.2965 -11.6712
+15.5437 -11.4088
+15.785 -11.1422
+16.0205 -10.8714
+16.2501 -10.5966
+16.4736 -10.3179
+16.6911 -10.0354
+16.9024 -9.74915
+17.1075 -9.45933
+17.3063 -9.16602
+17.4987 -8.86934
+17.6847 -8.5694
+17.8641 -8.26631
+18.0371 -7.9602
+18.2034 -7.65116
+18.3631 -7.33933
+18.516 -7.02482
+18.6622 -6.70773
+18.8015 -6.3882
+18.934 -6.06633
+19.0596 -5.74225
+19.1782 -5.41608
+19.2898 -5.08793
+19.3944 -4.75793
+19.492 -4.4262
+19.5824 -4.09285
+19.6657 -3.75802
+19.7418 -3.42182
+19.8108 -3.08437
+19.8726 -2.7458
+19.9271 -2.40624
+19.9744 -2.0658
+20.0144 -1.72461
+20.0471 -1.38279
+20.0726 -1.04048
+20.0907 -0.697784
+20.1015 -0.354839
+20.105 -0.0117672
+20.1011 0.331306
+20.09 0.674257
+20.0715 1.01696
+20.0457 1.35929
+20.0125 1.70112
+19.9721 2.04232
+19.9243 2.38278
+19.8693 2.72237
+19.807 3.06095
+19.7374 3.39841
+19.6606 3.73463
+19.5765 4.06947
+19.4853 4.40281
+19.3869 4.73454
+19.2813 5.06452
+19.1687 5.39263
+19.0489 5.71876
+18.9222 6.04277
+18.7884 6.36454
+18.6477 6.68396
+18.5 7.0009
+18.3455 7.31524
+18.1841 7.62685
+18.016 7.93563
+17.8411 8.24144
+17.6596 8.54418
+17.4714 8.84371
+17.2767 9.13993
+17.0756 9.43271
+16.8679 9.72195
+16.654 10.0075
+16.4337 10.2893
+16.2072 10.5672
+15.9746 10.8411
+15.7359 11.1108
+15.4912 11.3764
+15.2406 11.6376
+14.9841 11.8943
+14.7219 12.1465
+14.4541 12.394
+14.1807 12.6368
+13.9018 12.8747
+13.6176 13.1076
+13.3281 13.3354
+13.0334 13.5581
+12.7336 13.7755
+12.4289 13.9875
+12.1193 14.194
+11.8049 14.395
+11.486 14.5902
+11.1624 14.7798
+10.8345 14.9635
+10.5023 15.1413
+10.1659 15.313
+9.82543 15.4787
+9.48106 15.6381
+9.13289 15.7913
+8.78105 15.9382
+8.42567 16.0786
+8.06688 16.2125
+7.70483 16.3399
+7.33965 16.4606
+6.97148 16.5746
+6.60046 16.6819
+6.22673 16.7823
+5.85045 16.8758
+5.47175 16.9624
+5.09079 17.0419
+4.70772 17.1144
+4.3227 17.1797
+3.93587 17.2379
+3.54739 17.2889
+3.15743 17.3327
+2.76614 17.3691
+2.37368 17.3982
+1.98022 17.42
+1.58592 17.4343
+1.19094 17.4413
+0.795462 17.4407
+0.39964 17.4327
+0.00364702 17.4172
+-0.392347 17.3942
+-0.788172 17.3637
+-1.18365 17.3257
+-1.57862 17.2801
+-1.97291 17.227
+-2.36633 17.1663
+-2.75871 17.0981
+-3.14988 17.0224
+-3.53966 16.9392
+-3.92788 16.8484
+-4.31435 16.7502
+-4.69891 16.6446
+-5.08137 16.5315
+-5.46156 16.411
+-5.83929 16.2832
+-6.2144 16.148
+-6.5867 16.0055
+-6.95603 15.8558
+-7.32219 15.699
+-7.68503 15.5349
+-8.04436 15.3638
+-8.40001 15.1857
+-8.75181 15.0006
+-9.09959 14.8086
+-9.44318 14.6097
+-9.78241 14.4042
+-10.1171 14.1919
+-10.4471 13.9731
+-10.7723 13.7478
+-11.0924 13.516
+-11.4073 13.278
+-11.7169 13.0337
+-12.021 12.7833
+-12.3195 12.5269
+-12.6121 12.2646
+-12.8988 11.9965
+-13.1794 11.7228
+-13.4538 11.4435
+-13.7218 11.1587
+-13.9832 10.8687
+-14.238 10.5734
+-14.486 10.2731
+-14.7271 9.96796
+-14.9611 9.658
+-15.188 9.34342
+-15.4076 9.02435
+-15.6198 8.70094
+-15.8244 8.37335
+-16.0215 8.04173
+-16.2108 7.70622
+-16.3922 7.36699
+-16.5658 7.0242
+-16.7313 6.67801
+-16.8887 6.32858
+-17.038 5.97609
+-17.179 5.62069
+-17.3116 5.26256
+-17.4359 4.90188
+-17.5516 4.53881
+-17.6589 4.17353
+-17.7575 3.80622
+-17.8475 3.43706
+-17.9288 3.06622
+-18.0015 2.69389
+-18.0653 2.32025
+-18.1204 1.94548
+-18.1666 1.56977
+-18.204 1.19329
+-18.2325 0.816227
+-18.2522 0.43877
+-18.263 0.0611005
+-18.2649 -0.316598
+-18.258 -0.694142
+-18.2421 -1.07135
+-18.2175 -1.44803
+-18.1839 -1.82401
+-18.1416 -2.19911
+-18.0905 -2.57314
+-18.0306 -2.94592
+-17.962 -3.31728
+-17.8847 -3.68704
+-17.7988 -4.05501
+-17.7044 -4.42103
+-17.6013 -4.78492
+-17.4899 -5.14651
+-17.37 -5.50562
+-17.2418 -5.8621
+-17.1053 -6.21576
+-16.9607 -6.56646
+-16.8079 -6.91401
+-16.6472 -7.25827
+-16.4785 -7.59908
+-16.302 -7.93627
+-16.1178 -8.26969
+-15.9259 -8.5992
+-15.7265 -8.92465
+-15.5197 -9.24589
+-15.3056 -9.56277
+-15.0843 -9.87516
+-14.8559 -10.1829
+-14.6205 -10.4859
+-14.3784 -10.784
+-14.1295 -11.0771
+-13.8741 -11.365
+-13.6122 -11.6477
+-13.344 -11.9249
+-13.0697 -12.1967
+-12.7894 -12.4629
+-12.5031 -12.7233
+-12.2112 -12.9779
+-11.9137 -13.2266
+-11.6107 -13.4693
+-11.3025 -13.7058
+-10.9891 -13.9362
+-10.6708 -14.1602
+-10.3476 -14.3779
+-10.0198 -14.5891
+-9.68753 -14.7938
+-9.35091 -14.9919
+-9.01012 -15.1832
+-8.66533 -15.3679
+-8.3167 -15.5457
+-7.96439 -15.7167
+-7.60857 -15.8807
+-7.24941 -16.0378
+-6.88707 -16.1878
+-6.52172 -16.3308
+-6.15353 -16.4666
+-5.78266 -16.5953
+-5.4093 -16.7169
+-5.03359 -16.8312
+-4.65572 -16.9382
+-4.27585 -17.038
+-3.89415 -17.1305
+-3.51079 -17.2157
+-3.12593 -17.2936
+-2.73975 -17.3642
+-2.35241 -17.4274
+-1.96407 -17.4832
+-1.57491 -17.5318
+-1.18509 -17.5729
+-0.794771 -17.6068
+-0.404122 -17.6333
+-0.0133061 -17.6525
+0.377515 -17.6643
+0.768181 -17.6689
+1.15853 -17.6662
+1.5484 -17.6563
+1.93764 -17.6391
+2.32608 -17.6148
+2.71358 -17.5832
+3.09998 -17.5446
+3.48512 -17.4988
+3.86885 -17.446
+4.25102 -17.3862
+4.63149 -17.3193
+5.0101 -17.2456
+5.38672 -17.1649
+5.76119 -17.0775
+6.13338 -16.9832
+6.50313 -16.8823
+6.87033 -16.7746
+7.23481 -16.6604
+7.59645 -16.5396
+7.95512 -16.4123
+8.31068 -16.2786
+8.663 -16.1386
+9.01195 -15.9923
+9.3574 -15.8398
+9.69923 -15.6811
+10.0373 -15.5164
+10.3715 -15.3458
+10.7018 -15.1692
+11.0279 -14.9868
+11.3498 -14.7987
+11.6673 -14.6049
+11.9805 -14.4055
+12.289 -14.2007
+12.5929 -13.9905
+12.892 -13.7749
+13.1863 -13.5542
+13.4755 -13.3283
+13.7597 -13.0975
+14.0388 -12.8617
+14.3125 -12.621
+14.5809 -12.3757
+14.8438 -12.1257
+15.1012 -11.8712
+15.353 -11.6122
+15.599 -11.349
+15.8393 -11.0815
+16.0736 -10.8099
+16.302 -10.5343
+16.5244 -10.2548
+16.7407 -9.97149
+16.9508 -9.68451
+17.1546 -9.39396
+17.3521 -9.09996
+17.5433 -8.8026
+17.728 -8.50201
+17.9061 -8.1983
+18.0778 -7.89158
+18.2427 -7.58196
+18.401 -7.26958
+18.5526 -6.95453
+18.6974 -6.63693
+18.8353 -6.31692
+18.9664 -5.99459
+19.0906 -5.67007
+19.2078 -5.34349
+19.318 -5.01496
+19.4211 -4.6846
+19.5172 -4.35253
+19.6062 -4.01888
+19.688 -3.68376
+19.7627 -3.34731
+19.8302 -3.00963
+19.8905 -2.67086
+19.9435 -2.33112
+19.9893 -1.99054
+20.0278 -1.64923
+20.0591 -1.30731
+20.083 -0.964929
+20.0997 -0.622193
+20.109 -0.27923
+20.111 0.0638337
+20.1057 0.406874
+20.093 0.749766
+20.073 1.09238
+20.0457 1.4346
+20.0111 1.7763
+19.9692 2.11735
+19.92 2.45762
+19.8635 2.797
+19.7997 3.13535
+19.7287 3.47256
+19.6505 3.80849
+19.5651 4.14302
+19.4724 4.47604
+19.3726 4.80741
+19.2657 5.13701
+19.1517 5.46471
+19.0306 5.79041
+18.9026 6.11396
+18.7675 6.43525
+18.6254 6.75416
+18.4765 7.07056
+18.3207 7.38434
+18.1581 7.69537
+17.9888 8.00354
+17.8127 8.30871
+17.63 8.61078
+17.4407 8.90963
+17.2449 9.20514
+17.0425 9.49718
+16.8338 9.78566
+16.6187 10.0704
+16.3974 10.3514
+16.1698 10.6285
+15.9361 10.9015
+15.6964 11.1704
+15.4507 11.4351
+15.1991 11.6954
+14.9417 11.9512
+14.6786 12.2024
+14.4098 12.449
+14.1355 12.6908
+13.8558 12.9276
+13.5707 13.1595
+13.2804 13.3863
+12.9848 13.6079
+12.6843 13.8242
+12.3788 14.0351
+12.0684 14.2406
+11.7534 14.4404
+11.4337 14.6346
+11.1095 14.823
+10.7809 15.0055
+10.448 15.1821
+10.111 15.3527
+9.76996 15.5171
+9.42502 15.6754
+9.07631 15.8274
+8.72396 15.9731
+8.36809 16.1123
+8.00885 16.245
+7.64637 16.3711
+7.28078 16.4906
+6.91223 16.6034
+6.54086 16.7094
+6.16681 16.8086
+5.79023 16.9009
+5.41126 16.9862
+5.03006 17.0645
+4.64678 17.1357
+4.26157 17.1999
+3.87459 17.2568
+3.48599 17.3066
+3.09593 17.3491
+2.70457 17.3843
+2.31208 17.4121
+1.9186 17.4326
+1.52432 17.4457
+1.12938 17.4514
+0.733969 17.4497
+0.338241 17.4404
+-0.0576318 17.4237
+-0.45348 17.3995
+-0.849133 17.3678
+-1.24442 17.3285
+-1.63916 17.2817
+-2.03319 17.2274
+-2.42633 17.1656
+-2.81841 17.0962
+-3.20925 17.0193
+-3.59867 16.935
+-3.9865 16.8431
+-4.37257 16.7438
+-4.75668 16.637
+-5.13868 16.5228
+-5.51837 16.4012
+-5.89559 16.2723
+-6.27016 16.1361
+-6.64189 15.9926
+-7.01062 15.8418
+-7.37618 15.6839
+-7.73838 15.5188
+-8.09705 15.3467
+-8.45202 15.1676
+-8.80311 14.9815
+-9.15016 14.7885
+-9.493 14.5888
+-9.83146 14.3823
+-10.1654 14.1691
+-10.4946 13.9494
+-10.8189 13.7232
+-11.1382 13.4906
+-11.4522 13.2517
+-11.761 13.0066
+-12.0642 12.7554
+-12.3617 12.4982
+-12.6534 12.2351
+-12.9392 11.9663
+-13.2188 11.6918
+-13.4922 11.4118
+-13.7592 11.1263
+-14.0196 10.8356
+-14.2734 10.5397
+-14.5203 10.2388
+-14.7603 9.93301
+-14.9933 9.62247
+-15.2191 9.30731
+-15.4375 8.98769
+-15.6486 8.66375
+-15.8521 8.33565
+-16.048 8.00353
+-16.2361 7.66755
+-16.4164 7.32786
+-16.5888 6.98464
+-16.7531 6.63803
+-16.9094 6.28821
+-17.0574 5.93534
+-17.1972 5.57959
+-17.3286 5.22114
+-17.4516 4.86015
+-17.5662 4.4968
+-17.6722 4.13126
+-17.7696 3.76371
+-17.8584 3.39434
+-17.9385 3.02331
+-18.0098 2.65081
+-18.0724 2.27703
+-18.1262 1.90213
+-18.1712 1.52631
+-18.2073 1.14975
+-18.2346 0.772632
+-18.253 0.395136
+-18.2625 0.017449
+-18.2631 -0.360246
+-18.2549 -0.737766
+-18.2378 -1.11493
+-18.2118 -1.49155
+-18.177 -1.86744
+-18.1334 -2.24244
+-18.081 -2.61634
+-18.0199 -2.98898
+-17.95 -3.36018
+-17.8714 -3.72975
+-17.7843 -4.09752
+-17.6885 -4.46331
+-17.5843 -4.82696
+-17.4716 -5.18829
+-17.3505 -5.54713
+-17.221 -5.9033
+-17.0834 -6.25665
+-16.9375 -6.607
+-16.7836 -6.9542
+-16.6217 -7.29808
+-16.4518 -7.63849
+-16.2742 -7.97527
+-16.0888 -8.30826
+-15.8958 -8.63731
+-15.6953 -8.96228
+-15.4874 -9.28302
+-15.2722 -9.59939
+-15.0498 -9.91124
+-14.8204 -10.2184
+-14.584 -10.5209
+-14.3408 -10.8184
+-14.0909 -11.1108
+-13.8345 -11.3981
+-13.5717 -11.6802
+-13.3026 -11.9568
+-13.0274 -12.2279
+-12.7461 -12.4933
+-12.4591 -12.7531
+-12.1663 -13.0069
+-11.8679 -13.2549
+-11.5641 -13.4968
+-11.2551 -13.7325
+-10.941 -13.9621
+-10.622 -14.1853
+-10.2981 -14.4021
+-9.96963 -14.6125
+-9.63668 -14.8162
+-9.29943 -15.0134
+-8.95802 -15.2038
+-8.61263 -15.3875
+-8.26342 -15.5644
+-7.91056 -15.7344
+-7.5542 -15.8974
+-7.19452 -16.0534
+-6.83169 -16.2024
+-6.46586 -16.3443
+-6.09722 -16.4791
+-5.72592 -16.6068
+-5.35214 -16.7272
+-4.97605 -16.8404
+-4.5978 -16.9463
+-4.21758 -17.045
+-3.83555 -17.1364
+-3.45188 -17.2204
+-3.06674 -17.2971
+-2.68029 -17.3665
+-2.29271 -17.4285
+-1.90416 -17.4832
+-1.5148 -17.5306
+-1.12481 -17.5705
+-0.734347 -17.6032
+-0.343575 -17.6285
+0.0473399 -17.6465
+0.438236 -17.6571
+0.828953 -17.6605
+1.21933 -17.6566
+1.6092 -17.6454
+1.99842 -17.6271
+2.38682 -17.6015
+2.77425 -17.5687
+3.16055 -17.5288
+3.54558 -17.4818
+3.92918 -17.4278
+4.31119 -17.3667
+4.69148 -17.2987
+5.06989 -17.2237
+5.44627 -17.1419
+5.82049 -17.0532
+6.1924 -16.9577
+6.56186 -16.8556
+6.92872 -16.7468
+7.29286 -16.6313
+7.65413 -16.5094
+8.0124 -16.3809
+8.36753 -16.2461
+8.7194 -16.1049
+9.06788 -15.9575
+9.41283 -15.8038
+9.75414 -15.6441
+10.0917 -15.4783
+10.4253 -15.3065
+10.755 -15.1288
+11.0805 -14.9453
+11.4017 -14.7561
+11.7186 -14.5613
+12.0311 -14.3609
+12.3389 -14.155
+12.6421 -13.9438
+12.9405 -13.7273
+13.2339 -13.5055
+13.5224 -13.2787
+13.8058 -13.0469
+14.084 -12.8101
+14.3569 -12.5686
+14.6244 -12.3223
+14.8865 -12.0714
+15.1429 -11.8161
+15.3938 -11.5563
+15.6389 -11.2922
+15.8782 -11.0239
+16.1115 -10.7515
+16.339 -10.4751
+16.5603 -10.1948
+16.7755 -9.91079
+16.9846 -9.6231
+17.1873 -9.33186
+17.3838 -9.03718
+17.5738 -8.73917
+17.7574 -8.43795
+17.9344 -8.13363
+18.1049 -7.82633
+18.2687 -7.51615
+18.4258 -7.20322
+18.5762 -6.88765
+18.7198 -6.56956
+18.8565 -6.24906
+18.9864 -5.92629
+19.1093 -5.60135
+19.2253 -5.27437
+19.3342 -4.94546
+19.4361 -4.61476
+19.531 -4.28237
+19.6187 -3.94842
+19.6992 -3.61304
+19.7726 -3.27634
+19.8388 -2.93845
+19.8978 -2.59949
+19.9496 -2.25959
+19.994 -1.91887
+20.0313 -1.57744
+20.0612 -1.23545
+20.0838 -0.893001
+20.0991 -0.55023
+20.1071 -0.20726
+20.1078 0.135786
+20.1011 0.478782
+20.0872 0.821604
+20.0659 1.16413
+20.0373 1.50623
+20.0013 1.84778
+19.9581 2.18865
+19.9076 2.52873
+19.8498 2.86788
+19.7847 3.20598
+19.7124 3.54291
+19.6329 3.87855
+19.5462 4.21276
+19.4523 4.54542
+19.3512 4.87641
+19.2431 5.20561
+19.1278 5.5329
+19.0055 5.85814
+18.8762 6.18122
+18.7399 6.50202
+18.5967 6.8204
+18.4466 7.13626
+18.2896 7.44947
+18.1259 7.75992
+17.9554 8.06747
+17.7782 8.37202
+17.5944 8.67344
+17.404 8.97161
+17.207 9.26643
+17.0037 9.55778
+16.7939 9.84553
+16.5778 10.1296
+16.3554 10.4098
+16.1269 10.6861
+15.8923 10.9583
+15.6516 11.2264
+15.405 11.4903
+15.1526 11.7497
+14.8943 12.0047
+14.6304 12.255
+14.3608 12.5007
+14.0858 12.7416
+13.8053 12.9775
+13.5195 13.2085
+13.2284 13.4343
+12.9323 13.655
+12.6311 13.8703
+12.325 14.0802
+12.014 14.2846
+11.6984 14.4835
+11.3782 14.6766
+11.0535 14.864
+10.7244 15.0455
+10.3911 15.221
+10.0537 15.3905
+9.71231 15.5539
+9.36702 15.7111
+9.01799 15.862
+8.66534 16.0065
+8.30921 16.1446
+7.94973 16.2762
+7.58703 16.4012
+7.22126 16.5196
+6.85256 16.6312
+6.48105 16.7361
+6.1069 16.8341
+5.73024 16.9253
+5.35123 17.0094
+4.97001 17.0866
+4.58673 17.1566
+4.20155 17.2196
+3.81462 17.2754
+3.42609 17.324
+3.03613 17.3653
+2.6449 17.3993
+2.25255 17.426
+1.85924 17.4454
+1.46514 17.4573
+1.07042 17.4619
+0.675244 17.459
+0.279773 17.4486
+-0.115819 17.4308
+-0.511364 17.4055
+-0.90669 17.3726
+-1.30163 17.3323
+-1.696 17.2844
+-2.08963 17.2291
+-2.48236 17.1662
+-2.874 17.0958
+-3.26437 17.0179
+-3.65331 16.9325
+-4.04064 16.8396
+-4.42618 16.7393
+-4.80975 16.6315
+-5.19119 16.5164
+-5.5703 16.3938
+-5.94692 16.264
+-6.32087 16.1268
+-6.69197 15.9824
+-7.06005 15.8307
+&
+@target G0.S4
+@type xy
+11.4706 -25.7229
+11.7583 -25.6068
+12.0447 -25.4879
+12.3298 -25.3662
+12.6136 -25.2418
+12.896 -25.1146
+13.177 -24.9848
+13.4566 -24.8522
+13.7348 -24.717
+14.0115 -24.5791
+14.2866 -24.4385
+14.5602 -24.2953
+14.8323 -24.1494
+15.1027 -24.001
+15.3715 -23.8499
+15.6386 -23.6963
+15.904 -23.5401
+16.1677 -23.3813
+16.4297 -23.22
+16.6899 -23.0562
+16.9482 -22.8899
+17.2048 -22.7211
+17.4594 -22.5498
+17.7122 -22.3761
+17.9631 -22.2
+18.212 -22.0214
+18.4589 -21.8405
+18.7038 -21.6572
+18.9467 -21.4715
+19.1875 -21.2835
+19.4262 -21.0932
+19.6629 -20.9006
+19.8973 -20.7057
+20.1297 -20.5086
+20.3598 -20.3092
+20.5877 -20.1076
+20.8134 -19.9039
+21.0368 -19.6979
+21.2579 -19.4899
+21.4767 -19.2796
+21.6931 -19.0673
+21.9072 -18.8529
+22.1189 -18.6365
+22.3282 -18.418
+22.535 -18.1975
+22.7394 -17.975
+22.9413 -17.7506
+23.1407 -17.5242
+23.3376 -17.2959
+23.5319 -17.0657
+23.7237 -16.8337
+23.9128 -16.5998
+24.0994 -16.3641
+24.2833 -16.1266
+24.4645 -15.8873
+24.6431 -15.6463
+24.819 -15.4036
+24.9921 -15.1592
+25.1625 -14.9131
+25.3302 -14.6654
+25.4951 -14.4161
+25.6571 -14.1652
+25.8164 -13.9128
+25.9729 -13.6588
+26.1265 -13.4034
+26.2772 -13.1464
+26.425 -12.888
+26.57 -12.6282
+26.712 -12.3671
+26.8511 -12.1045
+26.9872 -11.8406
+27.1204 -11.5755
+27.2506 -11.309
+27.3777 -11.0413
+27.5019 -10.7724
+27.6231 -10.5023
+27.7412 -10.2311
+27.8562 -9.95871
+27.9682 -9.68524
+28.0772 -9.4107
+28.183 -9.13513
+28.2857 -8.85854
+28.3853 -8.58098
+28.4817 -8.30248
+28.5751 -8.02306
+28.6652 -7.74275
+28.7523 -7.46159
+28.8361 -7.17961
+28.9168 -6.89683
+28.9942 -6.6133
+29.0685 -6.32903
+29.1395 -6.04406
+29.2074 -5.75842
+29.272 -5.47215
+29.3333 -5.18528
+29.3915 -4.89783
+29.4463 -4.60984
+29.498 -4.32134
+29.5463 -4.03236
+29.5914 -3.74294
+29.6332 -3.4531
+29.6717 -3.16288
+29.707 -2.87231
+29.7389 -2.58142
+29.7676 -2.29025
+29.793 -1.99882
+29.815 -1.70717
+29.8338 -1.41533
+29.8492 -1.12334
+29.8613 -0.831216
+29.8702 -0.539003
+29.8757 -0.246731
+29.8779 0.0455681
+29.8767 0.337863
+29.8723 0.630119
+29.8645 0.922306
+29.8535 1.21439
+29.8391 1.50634
+29.8214 1.79812
+29.8004 2.0897
+29.776 2.38105
+29.7484 2.67214
+29.7174 2.96293
+29.6832 3.25339
+29.6456 3.54349
+29.6048 3.83319
+29.5606 4.12247
+29.5132 4.41129
+29.4625 4.69961
+29.4085 4.98742
+29.3512 5.27467
+29.2907 5.56133
+29.2269 5.84738
+29.1598 6.13277
+29.0895 6.41748
+29.016 6.70148
+28.9392 6.98473
+28.8592 7.2672
+28.776 7.54887
+28.6896 7.82969
+28.6 8.10964
+28.5072 8.38868
+28.4112 8.66679
+28.312 8.94393
+28.2097 9.22008
+28.1043 9.49519
+27.9957 9.76925
+27.884 10.0422
+27.7691 10.3141
+27.6512 10.5848
+27.5302 10.8543
+27.4061 11.1226
+27.279 11.3896
+27.1488 11.6554
+27.0156 11.9199
+26.8793 12.1831
+26.7401 12.4449
+26.5979 12.7053
+26.4527 12.9643
+26.3045 13.2218
+26.1535 13.4779
+25.9994 13.7324
+25.8425 13.9855
+25.6827 14.2369
+25.5201 14.4868
+25.3546 14.735
+25.1862 14.9816
+25.015 15.2266
+24.8411 15.4698
+24.6643 15.7113
+24.4848 15.951
+24.3026 16.189
+24.1177 16.4251
+23.93 16.6595
+23.7397 16.8919
+23.5467 17.1225
+23.3511 17.3511
+23.1529 17.5778
+22.9521 17.8026
+22.7487 18.0253
+22.5428 18.2461
+22.3344 18.4648
+22.1234 18.6814
+21.91 18.8959
+21.6942 19.1084
+21.4759 19.3187
+21.2552 19.5268
+21.0321 19.7327
+20.8067 19.9365
+20.579 20.138
+20.3489 20.3373
+20.1166 20.5342
+19.882 20.7289
+19.6453 20.9213
+19.4063 21.1114
+19.1651 21.299
+18.9218 21.4843
+18.6764 21.6672
+18.4289 21.8477
+18.1793 22.0257
+17.9277 22.2013
+17.6742 22.3744
+17.4186 22.5449
+17.1611 22.713
+16.9016 22.8785
+16.6403 23.0415
+16.3771 23.2019
+16.1121 23.3597
+15.8453 23.5149
+15.5767 23.6675
+15.3064 23.8174
+15.0343 23.9646
+14.7606 24.1092
+14.4852 24.2511
+14.2083 24.3903
+13.9297 24.5268
+13.6496 24.6605
+13.3679 24.7914
+13.0848 24.9196
+12.8002 25.045
+12.5141 25.1677
+12.2267 25.2875
+11.9379 25.4045
+11.6478 25.5186
+11.3564 25.6299
+11.0637 25.7384
+10.7697 25.8439
+10.4746 25.9466
+10.1783 26.0464
+9.8809 26.1433
+9.58237 26.2373
+9.28277 26.3284
+8.98213 26.4165
+8.6805 26.5016
+8.3779 26.5839
+8.07436 26.6631
+7.76993 26.7394
+7.46463 26.8127
+7.1585 26.883
+6.85157 26.9504
+6.54388 27.0147
+6.23546 27.076
+5.92635 27.1343
+5.61657 27.1896
+5.30617 27.2418
+4.99518 27.291
+4.68364 27.3372
+4.37157 27.3804
+4.05902 27.4205
+3.74601 27.4575
+3.43259 27.4915
+3.11879 27.5224
+2.80464 27.5503
+2.49018 27.5751
+2.17544 27.5969
+1.86046 27.6156
+1.54527 27.6312
+1.22991 27.6438
+0.91442 27.6533
+0.598823 27.6597
+0.28316 27.663
+-0.0325346 27.6633
+-0.348225 27.6605
+-0.663878 27.6546
+-0.979456 27.6457
+-1.29493 27.6337
+-1.61025 27.6187
+-1.9254 27.6006
+-2.24034 27.5794
+-2.55502 27.5551
+-2.86943 27.5279
+-3.18351 27.4975
+-3.49725 27.4642
+-3.81059 27.4278
+-4.12352 27.3883
+-4.43599 27.3458
+-4.74797 27.3003
+-5.05942 27.2518
+-5.37032 27.2003
+-5.68062 27.1457
+-5.99029 27.0882
+-6.2993 27.0277
+-6.60761 26.9642
+-6.9152 26.8977
+-7.22202 26.8282
+-7.52804 26.7558
+-7.83324 26.6804
+-8.13756 26.6021
+-8.44099 26.5208
+-8.74349 26.4366
+-9.04503 26.3495
+-9.34557 26.2595
+-9.64507 26.1666
+-9.94352 26.0709
+-10.2409 25.9722
+-10.5371 25.8707
+-10.8322 25.7664
+-11.126 25.6592
+-11.4187 25.5491
+-11.7101 25.4363
+-12.0002 25.3207
+-12.2889 25.2023
+-12.5764 25.0811
+-12.8624 24.9572
+-13.1471 24.8305
+-13.4303 24.7011
+-13.712 24.569
+-13.9922 24.4342
+-14.2709 24.2967
+-14.548 24.1565
+-14.8235 24.0137
+-15.0974 23.8683
+-15.3696 23.7202
+-15.6402 23.5696
+-15.909 23.4163
+-16.1761 23.2605
+-16.4414 23.1022
+-16.7049 22.9413
+-16.9666 22.7779
+-17.2265 22.612
+-17.4844 22.4436
+-17.7404 22.2728
+-17.9945 22.0995
+-18.2467 21.9239
+-18.4968 21.7458
+-18.7449 21.5654
+-18.991 21.3826
+-19.235 21.1974
+-19.4769 21.01
+-19.7167 20.8203
+-19.9543 20.6283
+-20.1897 20.434
+-20.423 20.2375
+-20.654 20.0388
+-20.8828 19.8379
+-21.1092 19.6349
+-21.3334 19.4297
+-21.5553 19.2224
+-21.7748 19.013
+-21.992 18.8016
+-22.2067 18.5881
+-22.4191 18.3726
+-22.629 18.155
+-22.8364 17.9355
+-23.0414 17.7141
+-23.2438 17.4907
+-23.4438 17.2654
+-23.6412 17.0383
+-23.836 16.8093
+-24.0282 16.5785
+-24.2179 16.3459
+-24.4049 16.1115
+-24.5892 15.8753
+-24.7709 15.6375
+-24.9499 15.3979
+-25.1262 15.1567
+-25.2998 14.9138
+-25.4706 14.6694
+-25.6387 14.4233
+-25.804 14.1757
+-25.9665 13.9265
+-26.1262 13.6758
+-26.2831 13.4237
+-26.4371 13.1701
+-26.5883 12.915
+-26.7366 12.6586
+-26.882 12.4008
+-27.0245 12.1417
+-27.1641 11.8813
+-27.3007 11.6195
+-27.4344 11.3566
+-27.5652 11.0924
+-27.693 10.8269
+-27.8177 10.5604
+-27.9395 10.2927
+-28.0583 10.0239
+-28.174 9.75396
+-28.2867 9.48301
+-28.3964 9.21104
+-28.503 8.93807
+-28.6065 8.66415
+-28.707 8.38929
+-28.8044 8.11353
+-28.8986 7.83689
+-28.9898 7.55941
+-29.0778 7.28112
+-29.1627 7.00204
+-29.2445 6.72222
+-29.3231 6.44166
+-29.3986 6.16042
+-29.4709 5.87851
+-29.5401 5.59597
+-29.6061 5.31283
+-29.6689 5.02912
+-29.7285 4.74487
+-29.7849 4.46011
+-29.8382 4.17488
+-29.8882 3.88919
+-29.935 3.60309
+-29.9786 3.3166
+-30.0191 3.02975
+-30.0562 2.74258
+-30.0902 2.45512
+-30.121 2.1674
+-30.1485 1.87944
+-30.1728 1.59128
+-30.1938 1.30295
+-30.2117 1.01448
+-30.2263 0.725901
+-30.2376 0.437245
+-30.2458 0.148543
+-30.2507 -0.140175
+-30.2523 -0.428879
+-30.2508 -0.717537
+-30.2459 -1.00612
+-30.2379 -1.29459
+-30.2266 -1.58293
+-30.2121 -1.87109
+-30.1944 -2.15906
+-30.1735 -2.44679
+-30.1493 -2.73427
+-30.1219 -3.02145
+-30.0913 -3.30831
+-30.0575 -3.59482
+-30.0204 -3.88094
+-29.9802 -4.16665
+-29.9368 -4.45191
+-29.8902 -4.7367
+-29.8403 -5.02098
+-29.7874 -5.30473
+-29.7312 -5.58791
+-29.6718 -5.8705
+-29.6093 -6.15246
+-29.5437 -6.43376
+-29.4749 -6.71438
+-29.4029 -6.99428
+-29.3279 -7.27344
+-29.2497 -7.55183
+-29.1684 -7.82941
+-29.0839 -8.10616
+-28.9964 -8.38204
+-28.9058 -8.65703
+-28.8121 -8.9311
+-28.7154 -9.20422
+-28.6156 -9.47636
+-28.5127 -9.7475
+-28.4069 -10.0176
+-28.298 -10.2866
+-28.186 -10.5546
+-28.0711 -10.8214
+-27.9532 -11.087
+-27.8324 -11.3515
+-27.7085 -11.6148
+-27.5818 -11.8768
+-27.4521 -12.1376
+-27.3194 -12.3971
+-27.1839 -12.6553
+-27.0455 -12.9121
+-26.9042 -13.1676
+-26.7601 -13.4216
+-26.6131 -13.6742
+-26.4632 -13.9254
+-26.3106 -14.1751
+-26.1552 -14.4233
+-25.997 -14.67
+-25.836 -14.9151
+-25.6723 -15.1586
+-25.5059 -15.4005
+-25.3367 -15.6408
+-25.1649 -15.8794
+-24.9904 -16.1163
+-24.8132 -16.3515
+-24.6334 -16.585
+-24.451 -16.8167
+-24.266 -17.0467
+-24.0784 -17.2748
+-23.8883 -17.5011
+-23.6956 -17.7255
+-23.5004 -17.9481
+-23.3027 -18.1687
+-23.1026 -18.3874
+-22.9 -18.6042
+-22.6949 -18.819
+-22.4875 -19.0318
+-22.2776 -19.2425
+-22.0654 -19.4513
+-21.8509 -19.6579
+-21.634 -19.8625
+-21.4149 -20.065
+-21.1935 -20.2653
+-20.9698 -20.4635
+-20.7439 -20.6595
+-20.5158 -20.8534
+-20.2855 -21.045
+-20.053 -21.2344
+-19.8185 -21.4215
+-19.5818 -21.6063
+-19.3431 -21.7889
+-19.1023 -21.9691
+-18.8594 -22.147
+-18.6146 -22.3226
+-18.3678 -22.4958
+-18.119 -22.6666
+-17.8684 -22.835
+-17.6158 -23.0009
+-17.3613 -23.1645
+-17.105 -23.3255
+-16.8469 -23.4841
+-16.587 -23.6402
+-16.3253 -23.7938
+-16.062 -23.9448
+-15.7968 -24.0933
+-15.5301 -24.2393
+-15.2616 -24.3827
+-14.9916 -24.5235
+-14.7199 -24.6616
+-14.4467 -24.7972
+-14.172 -24.9301
+-13.8957 -25.0604
+-13.618 -25.188
+-13.3388 -25.313
+-13.0582 -25.4352
+-12.7762 -25.5547
+-12.4929 -25.6716
+-12.2082 -25.7857
+-11.9223 -25.897
+-11.635 -26.0056
+-11.3465 -26.1114
+-11.0569 -26.2145
+-10.766 -26.3147
+-10.474 -26.4122
+-10.1809 -26.5069
+-9.88668 -26.5987
+-9.59142 -26.6877
+-9.29515 -26.7739
+-8.99788 -26.8572
+-8.69966 -26.9376
+-8.40051 -27.0152
+-8.10047 -27.0899
+-7.79956 -27.1617
+-7.49782 -27.2307
+-7.19529 -27.2967
+-6.89199 -27.3598
+-6.58795 -27.42
+-6.28321 -27.4773
+-5.97781 -27.5317
+-5.67176 -27.5831
+-5.36511 -27.6315
+-5.05789 -27.6771
+-4.75013 -27.7196
+-4.44186 -27.7593
+-4.13312 -27.7959
+-3.82393 -27.8296
+-3.51434 -27.8603
+-3.20438 -27.8881
+-2.89407 -27.9128
+-2.58345 -27.9346
+-2.27256 -27.9534
+-1.96143 -27.9692
+-1.65008 -27.9821
+-1.33856 -27.9919
+-1.0269 -27.9987
+-0.715125 -28.0026
+-0.403277 -28.0034
+-0.0913854 -28.0013
+0.220515 -27.9962
+0.532392 -27.988
+0.844211 -27.9769
+1.15594 -27.9628
+1.46754 -27.9457
+1.77899 -27.9255
+2.09025 -27.9024
+2.40128 -27.8764
+2.71206 -27.8473
+3.02254 -27.8152
+3.3327 -27.7802
+3.6425 -27.7422
+3.95191 -27.7012
+4.2609 -27.6572
+4.56943 -27.6102
+4.87747 -27.5603
+5.18499 -27.5075
+5.49195 -27.4517
+5.79832 -27.3929
+6.10407 -27.3312
+6.40916 -27.2666
+6.71356 -27.199
+7.01724 -27.1285
+7.32016 -27.0551
+7.6223 -26.9788
+7.92362 -26.8996
+8.22408 -26.8175
+8.52366 -26.7325
+8.82232 -26.6446
+9.12003 -26.5539
+9.41676 -26.4603
+9.71248 -26.3638
+10.0071 -26.2645
+10.3007 -26.1624
+10.5932 -26.0574
+10.8846 -25.9497
+11.1747 -25.8391
+11.4637 -25.7258
+11.7514 -25.6097
+12.0378 -25.4908
+12.323 -25.3692
+12.6068 -25.2448
+12.8893 -25.1177
+13.1703 -24.9879
+13.45 -24.8554
+13.7282 -24.7202
+14.0049 -24.5823
+14.2801 -24.4418
+14.5537 -24.2986
+14.8258 -24.1528
+15.0962 -24.0044
+15.3651 -23.8534
+15.6322 -23.6998
+15.8977 -23.5436
+16.1614 -23.3849
+16.4234 -23.2236
+16.6836 -23.0598
+16.942 -22.8936
+17.1986 -22.7248
+17.4533 -22.5536
+17.7061 -22.3799
+17.957 -22.2038
+18.2059 -22.0253
+18.4529 -21.8444
+18.6978 -21.6611
+18.9407 -21.4755
+19.1816 -21.2875
+19.4204 -21.0972
+19.657 -20.9046
+19.8915 -20.7098
+20.1239 -20.5127
+20.3541 -20.3133
+20.582 -20.1118
+20.8077 -19.908
+21.0311 -19.7021
+21.2523 -19.4941
+21.4711 -19.2839
+21.6876 -19.0716
+21.9017 -18.8572
+22.1134 -18.6408
+22.3228 -18.4223
+22.5296 -18.2018
+22.7341 -17.9794
+22.936 -17.7549
+23.1354 -17.5286
+23.3323 -17.3003
+23.5267 -17.0701
+23.7185 -16.8381
+23.9077 -16.6042
+24.0942 -16.3685
+24.2782 -16.131
+24.4595 -15.8917
+24.6381 -15.6507
+24.814 -15.408
+24.9871 -15.1636
+25.1576 -14.9175
+25.3253 -14.6698
+25.4902 -14.4205
+25.6523 -14.1696
+25.8116 -13.9172
+25.9681 -13.6632
+26.1217 -13.4077
+26.2725 -13.1508
+26.4204 -12.8924
+26.5653 -12.6326
+26.7074 -12.3714
+26.8465 -12.1089
+26.9827 -11.845
+27.1159 -11.5798
+27.2461 -11.3133
+27.3733 -11.0456
+27.4975 -10.7767
+27.6187 -10.5066
+27.7369 -10.2353
+27.852 -9.96293
+27.964 -9.68944
+28.0729 -9.41489
+28.1788 -9.13929
+28.2815 -8.86269
+28.3811 -8.58511
+28.4776 -8.30659
+28.571 -8.02715
+28.6612 -7.74682
+28.7482 -7.46564
+28.8321 -7.18363
+28.9128 -6.90083
+28.9903 -6.61727
+29.0645 -6.33297
+29.1356 -6.04798
+29.2035 -5.76231
+29.2681 -5.47601
+29.3295 -5.18911
+29.3876 -4.90163
+29.4425 -4.6136
+29.4942 -4.32507
+29.5425 -4.03606
+29.5876 -3.7466
+29.6295 -3.45672
+29.668 -3.16647
+29.7033 -2.87586
+29.7352 -2.58493
+29.7639 -2.29372
+29.7893 -2.00225
+29.8113 -1.71056
+29.8301 -1.41868
+29.8455 -1.12665
+29.8577 -0.834485
+29.8665 -0.54223
+29.872 -0.249915
+29.8742 0.0424291
+29.8731 0.334768
+29.8687 0.627071
+29.8609 0.919304
+29.8499 1.21144
+29.8355 1.50343
+29.8178 1.79526
+29.7968 2.08689
+29.7724 2.37829
+29.7448 2.66943
+29.7139 2.96026
+29.6796 3.25077
+29.6421 3.54092
+29.6012 3.83067
+29.5571 4.12
+29.5096 4.40887
+29.4589 4.69725
+29.4049 4.9851
+29.3477 5.2724
+29.2871 5.55911
+29.2233 5.84521
+29.1563 6.13065
+29.0859 6.41541
+29.0124 6.69945
+28.9356 6.98275
+28.8556 7.26527
+28.7724 7.54698
+28.686 7.82785
+28.5963 8.10785
+28.5035 8.38694
+28.4075 8.6651
+28.3083 8.94229
+28.206 9.21848
+28.1005 9.49365
+27.9919 9.76775
+27.8802 10.0408
+27.7654 10.3127
+27.6474 10.5834
+27.5264 10.853
+27.4023 11.1213
+27.2751 11.3884
+27.1449 11.6543
+27.0117 11.9188
+26.8754 12.182
+26.7362 12.4438
+26.5939 12.7043
+26.4487 12.9633
+26.3005 13.2209
+26.1494 13.477
+25.9954 13.7316
+25.8384 13.9846
+25.6786 14.2361
+25.5159 14.4861
+25.3504 14.7343
+25.182 14.981
+25.0108 15.2259
+24.8368 15.4692
+24.66 15.7107
+24.4805 15.9505
+24.2982 16.1885
+24.1132 16.4247
+23.9255 16.659
+23.7352 16.8915
+23.5421 17.1221
+23.3465 17.3508
+23.1482 17.5775
+22.9474 17.8023
+22.744 18.0251
+22.538 18.2458
+22.3295 18.4646
+22.1185 18.6812
+21.9051 18.8958
+21.6892 19.1083
+21.4709 19.3186
+21.2501 19.5267
+21.027 19.7327
+20.8016 19.9365
+20.5738 20.138
+20.3437 20.3373
+20.1113 20.5343
+19.8767 20.729
+19.6399 20.9214
+19.4008 21.1115
+19.1596 21.2992
+18.9163 21.4845
+18.6708 21.6674
+18.4233 21.8479
+18.1737 22.0259
+17.922 22.2015
+17.6684 22.3746
+17.4128 22.5452
+17.1552 22.7133
+16.8957 22.8788
+16.6344 23.0418
+16.3711 23.2022
+16.1061 23.36
+15.8392 23.5152
+15.5706 23.6678
+15.3002 23.8177
+15.0281 23.9649
+14.7544 24.1095
+14.479 24.2514
+14.2019 24.3906
+13.9233 24.5271
+13.6432 24.6608
+13.3615 24.7918
+13.0783 24.9199
+12.7936 25.0454
+12.5076 25.168
+12.2201 25.2878
+11.9313 25.4048
+11.6411 25.5189
+11.3497 25.6302
+11.0569 25.7386
+10.763 25.8442
+10.4678 25.9469
+10.1715 26.0467
+9.874 26.1435
+9.57543 26.2375
+9.27579 26.3285
+8.97512 26.4167
+8.67345 26.5018
+8.37082 26.584
+8.06724 26.6633
+7.76278 26.7395
+7.45744 26.8128
+7.15127 26.8831
+6.84431 26.9504
+6.53659 27.0147
+6.22814 27.076
+5.91899 27.1343
+5.60919 27.1896
+5.29876 27.2418
+4.98774 27.291
+4.67617 27.3372
+4.36407 27.3803
+4.05149 27.4204
+3.73846 27.4574
+3.42502 27.4914
+3.11119 27.5223
+2.79702 27.5502
+2.48253 27.5749
+2.16777 27.5967
+1.85277 27.6154
+1.53756 27.631
+1.22219 27.6435
+0.906673 27.653
+0.591059 27.6594
+0.275379 27.6627
+-0.0403313 27.6629
+-0.356037 27.6601
+-0.671703 27.6542
+-0.987295 27.6453
+-1.30278 27.6333
+-1.61811 27.6182
+-1.93327 27.6001
+-2.24822 27.5789
+-2.56291 27.5546
+-2.87732 27.5273
+-3.19141 27.497
+-3.50515 27.4636
+-3.8185 27.4272
+-4.13143 27.3877
+-4.4439 27.3452
+-4.75588 27.2997
+-5.06734 27.2512
+-5.37823 27.1996
+-5.68853 27.145
+-5.9982 27.0875
+-6.30721 27.0269
+-6.61552 26.9634
+-6.9231 26.8969
+-7.22992 26.8274
+-7.53593 26.755
+-7.84112 26.6796
+-8.14544 26.6013
+-8.44886 26.52
+-8.75135 26.4358
+-9.05288 26.3487
+-9.3534 26.2587
+-9.6529 26.1658
+-9.95133 26.07
+-10.2487 25.9713
+-10.5449 25.8698
+-10.8399 25.7654
+-11.1338 25.6582
+-11.4264 25.5482
+-11.7178 25.4354
+-12.0079 25.3197
+-12.2966 25.2013
+-12.584 25.0801
+-12.8701 24.9562
+-13.1547 24.8295
+-13.4379 24.7001
+-13.7196 24.568
+-13.9997 24.4332
+-14.2784 24.2957
+-14.5555 24.1555
+-14.831 24.0127
+-15.1049 23.8672
+-15.3771 23.7192
+-15.6476 23.5685
+-15.9164 23.4153
+-16.1835 23.2595
+-16.4488 23.1011
+-16.7123 22.9402
+-16.974 22.7769
+-17.2338 22.611
+-17.4917 22.4426
+-17.7477 22.2718
+-18.0018 22.0986
+-18.2539 21.9229
+-18.504 21.7449
+-18.7521 21.5644
+-18.9982 21.3817
+-19.2421 21.1965
+-19.484 21.0091
+-19.7238 20.8194
+-19.9614 20.6274
+-20.1968 20.4332
+-20.43 20.2367
+-20.661 20.038
+-20.8898 19.8372
+-21.1162 19.6342
+-21.3404 19.429
+-21.5622 19.2217
+-21.7817 19.0124
+-21.9989 18.801
+-22.2136 18.5875
+-22.4259 18.372
+-22.6358 18.1545
+-22.8432 17.9351
+-23.0482 17.7136
+-23.2506 17.4903
+-23.4505 17.2651
+-23.6479 17.038
+-23.8427 16.809
+-24.0349 16.5782
+-24.2245 16.3457
+-24.4115 16.1113
+-24.5959 15.8752
+-24.7775 15.6374
+-24.9565 15.3979
+-25.1328 15.1567
+-25.3064 14.9139
+-25.4772 14.6695
+-25.6453 14.4234
+-25.8106 14.1759
+-25.9731 13.9267
+-26.1327 13.6761
+-26.2896 13.424
+-26.4436 13.1705
+-26.5948 12.9155
+-26.7431 12.6591
+-26.8885 12.4014
+-27.031 12.1423
+-27.1706 11.8819
+-27.3072 11.6203
+-27.4409 11.3574
+-27.5717 11.0932
+-27.6995 10.8279
+-27.8243 10.5614
+-27.946 10.2937
+-28.0648 10.0249
+-28.1806 9.75511
+-28.2933 9.48422
+-28.403 9.21231
+-28.5096 8.93941
+-28.6131 8.66555
+-28.7136 8.39075
+-28.811 8.11506
+-28.9053 7.83848
+-28.9964 7.56107
+-29.0845 7.28285
+-29.1694 7.00384
+-29.2512 6.72408
+-29.3299 6.44359
+-29.4054 6.16242
+-29.4778 5.88058
+-29.547 5.59811
+-29.613 5.31504
+-29.6758 5.0314
+-29.7355 4.74722
+-29.7919 4.46253
+-29.8452 4.17736
+-29.8953 3.89175
+-29.9422 3.60572
+-29.9858 3.3193
+-30.0263 3.03252
+-30.0635 2.74542
+-30.0976 2.45803
+-30.1284 2.17037
+-30.1559 1.88249
+-30.1803 1.5944
+-30.2014 1.30614
+-30.2193 1.01774
+-30.2339 0.72923
+-30.2454 0.440644
+-30.2536 0.152011
+-30.2585 -0.136638
+-30.2603 -0.425272
+-30.2587 -0.713861
+-30.254 -1.00237
+-30.246 -1.29078
+-30.2348 -1.57905
+-30.2204 -1.86714
+-30.2028 -2.15504
+-30.1819 -2.44271
+-30.1578 -2.73012
+-30.1305 -3.01724
+-30.0999 -3.30404
+-30.0662 -3.59048
+-30.0292 -3.87654
+-29.9891 -4.16219
+-29.9458 -4.44739
+-29.8992 -4.73212
+-29.8495 -5.01634
+-29.7966 -5.30003
+-29.7405 -5.58316
+-29.6813 -5.86569
+-29.6189 -6.14759
+-29.5533 -6.42885
+-29.4846 -6.70941
+-29.4127 -6.98927
+-29.3378 -7.26838
+-29.2597 -7.54671
+-29.1784 -7.82424
+-29.0941 -8.10095
+-29.0067 -8.37679
+-28.9162 -8.65174
+-28.8226 -8.92576
+-28.726 -9.19885
+-28.6263 -9.47095
+-28.5236 -9.74204
+-28.4178 -10.0121
+-28.309 -10.2811
+-28.1972 -10.549
+-28.0824 -10.8158
+-27.9646 -11.0814
+-27.8439 -11.3459
+-27.7202 -11.6091
+-27.5935 -11.8712
+-27.4639 -12.1319
+-27.3314 -12.3914
+-27.196 -12.6495
+-27.0577 -12.9063
+-26.9166 -13.1618
+-26.7725 -13.4158
+-26.6257 -13.6684
+-26.476 -13.9196
+-26.3235 -14.1693
+-26.1682 -14.4175
+-26.0101 -14.6641
+-25.8493 -14.9092
+-25.6857 -15.1528
+-25.5194 -15.3947
+-25.3504 -15.635
+-25.1787 -15.8736
+-25.0043 -16.1105
+-24.8273 -16.3457
+-24.6476 -16.5792
+-24.4654 -16.8109
+-24.2805 -17.0409
+-24.0931 -17.269
+-23.9031 -17.4953
+-23.7105 -17.7198
+-23.5155 -17.9424
+-23.3179 -18.163
+-23.1179 -18.3818
+-22.9155 -18.5986
+-22.7106 -18.8134
+-22.5032 -19.0262
+-22.2935 -19.237
+-22.0815 -19.4458
+-21.8671 -19.6525
+-21.6504 -19.8571
+-21.4313 -20.0596
+-21.2101 -20.26
+-20.9865 -20.4582
+-20.7607 -20.6543
+-20.5328 -20.8482
+-20.3026 -21.0398
+-20.0703 -21.2293
+-19.8359 -21.4164
+-19.5994 -21.6014
+-19.3608 -21.784
+-19.1201 -21.9643
+-18.8774 -22.1423
+-18.6327 -22.3179
+-18.386 -22.4911
+-18.1374 -22.662
+-17.8868 -22.8305
+-17.6344 -22.9965
+-17.3801 -23.1601
+-17.1239 -23.3213
+-16.8659 -23.48
+-16.6062 -23.6361
+-16.3446 -23.7898
+-16.0813 -23.9409
+-15.8164 -24.0896
+-15.5497 -24.2356
+-15.2814 -24.3791
+-15.0115 -24.52
+-14.74 -24.6583
+-14.4669 -24.7939
+-14.1922 -24.9269
+-13.9161 -25.0573
+-13.6385 -25.1851
+-13.3594 -25.3101
+-13.079 -25.4325
+-12.7971 -25.5521
+-12.5139 -25.6691
+-12.2293 -25.7833
+-11.9435 -25.8948
+-11.6563 -26.0035
+-11.368 -26.1094
+-11.0784 -26.2126
+-10.7876 -26.313
+-10.4957 -26.4106
+-10.2027 -26.5054
+-9.90863 -26.5974
+-9.61347 -26.6865
+-9.3173 -26.7728
+-9.02013 -26.8563
+-8.722 -26.9369
+-8.42294 -27.0146
+-8.12299 -27.0895
+-7.82217 -27.1614
+-7.52052 -27.2305
+-7.21807 -27.2967
+-6.91486 -27.3599
+-6.6109 -27.4203
+-6.30624 -27.4777
+-6.00091 -27.5322
+-5.69494 -27.5838
+-5.38836 -27.6324
+-5.08121 -27.6781
+-4.77352 -27.7209
+-4.46532 -27.7606
+-4.15664 -27.7975
+-3.84752 -27.8313
+-3.53799 -27.8622
+-3.22808 -27.8901
+-2.91783 -27.915
+-2.60727 -27.937
+-2.29642 -27.9559
+-1.98533 -27.9719
+-1.67403 -27.9849
+-1.36255 -27.9949
+-1.05093 -28.0019
+-0.739192 -28.0059
+-0.427375 -28.007
+-0.115513 -28.005
+0.196361 -28
+0.508215 -27.9921
+0.820014 -27.9811
+1.13172 -27.9671
+1.44332 -27.9502
+1.75475 -27.9303
+2.066 -27.9073
+2.37702 -27.8814
+2.6878 -27.8525
+2.99828 -27.8206
+3.30844 -27.7858
+3.61825 -27.7479
+3.92767 -27.7071
+4.23667 -27.6633
+4.54521 -27.6166
+4.85327 -27.5668
+5.16081 -27.5142
+5.46779 -27.4585
+5.77419 -27.3999
+6.07997 -27.3384
+6.38509 -27.274
+6.68953 -27.2066
+6.99324 -27.1363
+7.29621 -27.063
+7.59839 -26.9869
+7.89976 -26.9079
+8.20027 -26.8259
+8.49991 -26.7411
+8.79862 -26.6534
+9.09639 -26.5629
+9.39318 -26.4695
+9.68896 -26.3732
+9.9837 -26.2741
+10.2774 -26.1721
+10.5699 -26.0674
+10.8613 -25.9598
+11.1516 -25.8494
+11.4406 -25.7363
+11.7284 -25.6203
+12.0149 -25.5016
+12.3002 -25.3802
+12.5841 -25.256
+12.8666 -25.129
+13.1478 -24.9994
+13.4275 -24.8671
+13.7058 -24.7321
+13.9826 -24.5944
+14.2579 -24.454
+14.5317 -24.311
+14.8039 -24.1654
+15.0744 -24.0171
+15.3434 -23.8663
+15.6107 -23.7128
+15.8763 -23.5568
+16.1401 -23.3983
+16.4022 -23.2372
+16.6626 -23.0736
+16.9211 -22.9075
+17.1778 -22.7389
+17.4327 -22.5678
+17.6856 -22.3943
+17.9366 -22.2184
+18.1857 -22.04
+18.4328 -21.8593
+18.6779 -21.6762
+18.921 -21.4907
+19.162 -21.3029
+19.4009 -21.1127
+19.6377 -20.9203
+19.8724 -20.7256
+20.1049 -20.5286
+20.3352 -20.3294
+20.5633 -20.128
+20.7892 -19.9244
+21.0128 -19.7187
+21.2341 -19.5107
+21.4531 -19.3007
+21.6698 -19.0885
+21.8841 -18.8743
+22.096 -18.658
+22.3055 -18.4397
+22.5126 -18.2193
+22.7172 -17.997
+22.9193 -17.7727
+23.1189 -17.5465
+23.316 -17.3183
+23.5105 -17.0882
+23.7025 -16.8563
+23.8919 -16.6226
+24.0786 -16.387
+24.2628 -16.1496
+24.4443 -15.9104
+24.6231 -15.6696
+24.7992 -15.427
+24.9725 -15.1827
+25.1432 -14.9367
+25.3111 -14.6891
+25.4762 -14.4399
+25.6385 -14.1891
+25.798 -13.9368
+25.9547 -13.6829
+26.1085 -13.4275
+26.2595 -13.1706
+26.4076 -12.9123
+26.5528 -12.6526
+26.695 -12.3915
+26.8343 -12.129
+26.9707 -11.8652
+27.1041 -11.6001
+27.2345 -11.3337
+27.362 -11.0661
+27.4864 -10.7972
+27.6078 -10.5272
+27.7261 -10.256
+27.8414 -9.98366
+27.9537 -9.71023
+28.0628 -9.43573
+28.1689 -9.16019
+28.2718 -8.88363
+28.3717 -8.6061
+28.4684 -8.32762
+28.5619 -8.04822
+28.6523 -7.76793
+28.7396 -7.48678
+28.8237 -7.20481
+28.9046 -6.92204
+28.9822 -6.6385
+29.0567 -6.35423
+29.128 -6.06926
+29.1961 -5.78362
+29.2609 -5.49733
+29.3225 -5.21044
+29.3808 -4.92297
+29.4359 -4.63496
+29.4878 -4.34643
+29.5364 -4.05742
+29.5817 -3.76796
+29.6237 -3.47808
+29.6624 -3.18781
+29.6979 -2.8972
+29.7301 -2.60626
+29.7589 -2.31503
+29.7845 -2.02354
+29.8068 -1.73183
+29.8257 -1.43993
+29.8414 -1.14787
+29.8537 -0.855677
+29.8628 -0.563392
+29.8685 -0.271044
+29.8709 0.021335
+29.87 0.313712
+29.8657 0.606054
+29.8582 0.898329
+29.8473 1.1905
+29.8331 1.48255
+29.8156 1.77443
+29.7948 2.06611
+29.7707 2.35756
+29.7432 2.64875
+29.7125 2.93965
+29.6784 3.23022
+29.641 3.52043
+29.6004 3.81025
+29.5564 4.09964
+29.5092 4.38858
+29.4586 4.67703
+29.4048 4.96495
+29.3477 5.25233
+29.2874 5.53912
+29.2237 5.82529
+29.1569 6.11081
+29.0867 6.39565
+29.0134 6.67978
+28.9367 6.96317
+28.8569 7.24577
+28.7739 7.52757
+28.6876 7.80853
+28.5981 8.08862
+28.5055 8.36781
+28.4096 8.64606
+28.3106 8.92335
+28.2085 9.19964
+28.1031 9.4749
+27.9947 9.74911
+27.8831 10.0222
+27.7684 10.2942
+27.6506 10.5651
+27.5297 10.8347
+27.4058 11.1032
+27.2787 11.3704
+27.1487 11.6364
+27.0156 11.901
+26.8794 12.1643
+26.7403 12.4263
+26.5982 12.6869
+26.4531 12.946
+26.3051 13.2037
+26.1541 13.46
+26.0002 13.7147
+25.8433 13.9679
+25.6836 14.2195
+25.521 14.4695
+25.3556 14.7179
+25.1873 14.9647
+25.0162 15.2098
+24.8423 15.4532
+24.6657 15.6949
+24.4863 15.9348
+24.3041 16.1729
+24.1192 16.4093
+23.9316 16.6437
+23.7414 16.8764
+23.5484 17.1071
+23.3529 17.3359
+23.1547 17.5628
+22.954 17.7877
+22.7506 18.0107
+22.5448 18.2316
+22.3364 18.4504
+22.1255 18.6672
+21.9121 18.882
+21.6963 19.0946
+21.478 19.305
+21.2574 19.5133
+21.0343 19.7195
+20.8089 19.9234
+20.5812 20.1251
+20.3512 20.3245
+20.1189 20.5217
+19.8844 20.7165
+19.6476 20.9091
+19.4086 21.0993
+19.1675 21.2871
+18.9242 21.4726
+18.6788 21.6557
+18.4313 21.8363
+18.1817 22.0145
+17.9301 22.1902
+17.6765 22.3635
+17.421 22.5342
+17.1635 22.7025
+16.904 22.8682
+16.6427 23.0313
+16.3795 23.1919
+16.1145 23.3498
+15.8476 23.5052
+15.579 23.6579
+15.3087 23.808
+15.0366 23.9554
+14.7629 24.1001
+14.4875 24.2422
+14.2105 24.3815
+13.9319 24.5181
+13.6518 24.652
+13.3701 24.7831
+13.087 24.9114
+12.8023 25.037
+12.5163 25.1597
+12.2288 25.2797
+11.94 25.3968
+11.6498 25.5111
+11.3584 25.6226
+11.0657 25.7311
+10.7717 25.8369
+10.4765 25.9397
+10.1802 26.0396
+9.88273 26.1366
+9.58416 26.2307
+9.28452 26.3219
+8.98384 26.4102
+8.68216 26.4955
+8.37951 26.5778
+8.07593 26.6572
+7.77145 26.7336
+7.4661 26.807
+7.15992 26.8775
+6.85294 26.9449
+6.54519 27.0094
+6.23672 27.0708
+5.92755 27.1292
+5.61773 27.1846
+5.30728 27.237
+4.99623 27.2863
+4.68463 27.3326
+4.37251 27.3759
+4.05991 27.4161
+3.74685 27.4533
+3.43338 27.4874
+3.11952 27.5184
+2.80532 27.5464
+2.4908 27.5714
+2.17601 27.5932
+1.86098 27.612
+1.54574 27.6278
+1.23033 27.6404
+0.914779 27.65
+0.599129 27.6566
+0.283412 27.66
+-0.0323355 27.6604
+-0.34808 27.6577
+-0.663785 27.652
+-0.979416 27.6432
+-1.29494 27.6313
+-1.61032 27.6163
+-1.92552 27.5983
+-2.2405 27.5773
+-2.55524 27.5531
+-2.8697 27.526
+-3.18383 27.4957
+-3.49762 27.4625
+-3.81101 27.4262
+-4.12399 27.3868
+-4.4365 27.3444
+-4.74853 27.299
+-5.06003 27.2506
+-5.37097 27.1992
+-5.68132 27.1448
+-5.99104 27.0873
+-6.3001 27.0269
+-6.60846 26.9635
+-6.91609 26.8971
+-7.22296 26.8277
+-7.52903 26.7554
+-7.83427 26.6801
+-8.13865 26.6019
+-8.44213 26.5207
+-8.74468 26.4366
+-9.04626 26.3496
+-9.34685 26.2597
+-9.6464 26.1669
+-9.9449 26.0713
+-10.2423 25.9727
+-10.5386 25.8713
+-10.8337 25.767
+-11.1276 25.66
+-11.4203 25.55
+-11.7117 25.4373
+-12.0019 25.3218
+-12.2907 25.2035
+-12.5782 25.0824
+-12.8643 24.9586
+-13.149 24.832
+-13.4322 24.7027
+-13.714 24.5707
+-13.9942 24.436
+-14.273 24.2986
+-14.5501 24.1585
+-14.8257 24.0158
+-15.0996 23.8705
+-15.3719 23.7225
+-15.6425 23.572
+-15.9114 23.4188
+-16.1786 23.2631
+-16.4439 23.1049
+-16.7075 22.9441
+-16.9693 22.7808
+-17.2291 22.6151
+-17.4872 22.4468
+-17.7433 22.2761
+-17.9974 22.103
+-18.2496 21.9274
+-18.4998 21.7495
+-18.748 21.5692
+-18.9941 21.3865
+-19.2382 21.2015
+-19.4801 21.0142
+-19.72 20.8245
+-19.9576 20.6327
+-20.1931 20.4385
+-20.4265 20.2422
+-20.6575 20.0436
+-20.8864 19.8428
+-21.1129 19.6399
+-21.3372 19.4349
+-21.5591 19.2277
+-21.7787 19.0185
+-21.9959 18.8072
+-22.2108 18.5938
+-22.4232 18.3784
+-22.6332 18.161
+-22.8407 17.9417
+-23.0457 17.7203
+-23.2483 17.4971
+-23.4483 17.272
+-23.6457 17.045
+-23.8406 16.8161
+-24.033 16.5854
+-24.2227 16.353
+-24.4098 16.1187
+-24.5942 15.8827
+-24.776 15.645
+-24.9551 15.4056
+-25.1314 15.1645
+-25.3051 14.9218
+-25.476 14.6774
+-25.6442 14.4315
+-25.8096 14.184
+-25.9722 13.935
+-26.132 13.6845
+-26.289 13.4325
+-26.4432 13.179
+-26.5944 12.9241
+-26.7428 12.6679
+-26.8884 12.4102
+-27.031 12.1512
+-27.1707 11.8909
+-27.3075 11.6294
+-27.4413 11.3665
+-27.5722 11.1025
+-27.7001 10.8372
+-27.825 10.5708
+-27.9469 10.3032
+-28.0658 10.0346
+-28.1817 9.76481
+-28.2946 9.49401
+-28.4044 9.22218
+-28.5111 8.94937
+-28.6148 8.67559
+-28.7154 8.40088
+-28.813 8.12527
+-28.9074 7.84878
+-28.9987 7.57145
+-29.0869 7.29331
+-29.172 7.01438
+-29.254 6.7347
+-29.3328 6.4543
+-29.4084 6.17321
+-29.481 5.89145
+-29.5503 5.60906
+-29.6165 5.32607
+-29.6795 5.04251
+-29.7393 4.75841
+-29.7959 4.4738
+-29.8494 4.18871
+-29.8996 3.90317
+-29.9466 3.61721
+-29.9905 3.33087
+-30.0311 3.04416
+-30.0685 2.75714
+-30.1027 2.46981
+-30.1337 2.18223
+-30.1614 1.89441
+-30.1859 1.60638
+-30.2072 1.31819
+-30.2253 1.02986
+-30.2401 0.741411
+-30.2518 0.452887
+-30.2601 0.164315
+-30.2653 -0.124274
+-30.2672 -0.412851
+-30.2659 -0.701383
+-30.2613 -0.98984
+-30.2535 -1.27819
+-30.2425 -1.56641
+-30.2283 -1.85445
+-30.2108 -2.1423
+-30.1901 -2.42993
+-30.1662 -2.71729
+-30.1391 -3.00436
+-30.1088 -3.29112
+-30.0752 -3.57752
+-30.0385 -3.86354
+-29.9985 -4.14915
+-29.9554 -4.43432
+-29.9091 -4.71901
+-29.8596 -5.00321
+-29.8069 -5.28687
+-29.751 -5.56997
+-29.692 -5.85247
+-29.6298 -6.13436
+-29.5644 -6.41559
+-29.4959 -6.69613
+-29.4243 -6.97597
+-29.3496 -7.25506
+-29.2717 -7.53338
+-29.1907 -7.81091
+-29.1066 -8.0876
+-29.0194 -8.36343
+-28.9291 -8.63837
+-28.8358 -8.91239
+-28.7394 -9.18547
+-28.6399 -9.45757
+-28.5374 -9.72867
+-28.4319 -9.99873
+-28.3233 -10.2677
+-28.2117 -10.5356
+-28.0972 -10.8024
+-27.9796 -11.0681
+-27.8591 -11.3326
+-27.7356 -11.5958
+-27.6092 -11.8579
+-27.4799 -12.1187
+-27.3476 -12.3781
+-27.2124 -12.6363
+-27.0744 -12.8932
+-26.9335 -13.1486
+-26.7897 -13.4027
+-26.6431 -13.6554
+-26.4936 -13.9066
+-26.3414 -14.1563
+-26.1863 -14.4045
+-26.0285 -14.6512
+-25.8679 -14.8964
+-25.7046 -15.14
+-25.5385 -15.3819
+-25.3697 -15.6222
+-25.1983 -15.8609
+-25.0242 -16.0979
+-24.8474 -16.3332
+-24.668 -16.5668
+-24.4859 -16.7986
+-24.3013 -17.0286
+-24.1141 -17.2568
+-23.9243 -17.4832
+-23.7321 -17.7077
+-23.5372 -17.9304
+-23.3399 -18.1511
+-23.1402 -18.3699
+-22.9379 -18.5868
+-22.7333 -18.8017
+-22.5262 -19.0147
+-22.3168 -19.2256
+-22.1049 -19.4344
+-21.8908 -19.6412
+-21.6743 -19.846
+-21.4555 -20.0486
+-21.2344 -20.2491
+-21.0111 -20.4474
+-20.7856 -20.6436
+-20.5578 -20.8376
+-20.3279 -21.0294
+-20.0958 -21.219
+-19.8616 -21.4063
+-19.6253 -21.5913
+-19.3869 -21.7741
+-19.1465 -21.9545
+-18.904 -22.1326
+-18.6595 -22.3084
+-18.4131 -22.4818
+-18.1647 -22.6528
+-17.9144 -22.8215
+-17.6621 -22.9877
+-17.408 -23.1514
+-17.1521 -23.3127
+-16.8943 -23.4716
+-16.6347 -23.6279
+-16.3734 -23.7818
+-16.1103 -23.9331
+-15.8456 -24.0819
+-15.5791 -24.2281
+-15.311 -24.3718
+-15.0413 -24.5129
+-14.77 -24.6513
+-14.4971 -24.7872
+-14.2226 -24.9204
+-13.9467 -25.051
+-13.6693 -25.1789
+-13.3904 -25.3042
+-13.1101 -25.4268
+-12.8284 -25.5466
+-12.5454 -25.6638
+-12.261 -25.7782
+-11.9753 -25.8899
+-11.6884 -25.9989
+-11.4002 -26.105
+-11.1108 -26.2084
+-10.8202 -26.3091
+-10.5284 -26.4069
+-10.2356 -26.5019
+-9.94165 -26.5941
+-9.64665 -26.6835
+-9.35063 -26.77
+-9.05361 -26.8537
+-8.75563 -26.9346
+-8.45672 -27.0125
+-8.15691 -27.0876
+-7.85623 -27.1599
+-7.55471 -27.2292
+-7.25239 -27.2956
+-6.9493 -27.3591
+-6.64547 -27.4197
+-6.34093 -27.4774
+-6.03571 -27.5322
+-5.72986 -27.584
+-5.42339 -27.6329
+-5.11634 -27.6789
+-4.80875 -27.7219
+-4.50065 -27.7619
+-4.19207 -27.799
+-3.88304 -27.8331
+-3.5736 -27.8643
+-3.26377 -27.8925
+-2.9536 -27.9177
+-2.64311 -27.9399
+-2.33234 -27.9592
+-2.02132 -27.9754
+-1.71009 -27.9887
+-1.39867 -27.999
+-1.0871 -28.0063
+-0.775419 -28.0106
+-0.463652 -28.0119
+-0.151836 -28.0102
+0.159997 -28.0056
+0.471812 -27.9979
+0.783578 -27.9873
+1.09526 -27.9736
+1.40682 -27.957
+1.71824 -27.9373
+2.02947 -27.9147
+2.34048 -27.8891
+2.65124 -27.8605
+2.96172 -27.8289
+3.27188 -27.7944
+3.58169 -27.7568
+3.89112 -27.7163
+4.20013 -27.6728
+4.50868 -27.6264
+4.81676 -27.577
+5.12432 -27.5246
+5.43133 -27.4693
+5.73775 -27.411
+6.04356 -27.3498
+6.34872 -27.2857
+6.6532 -27.2186
+6.95697 -27.1486
+7.25999 -27.0757
+7.56222 -26.9999
+7.86365 -26.9211
+8.16423 -26.8395
+8.46393 -26.755
+8.76272 -26.6676
+9.06056 -26.5774
+9.35744 -26.4843
+9.6533 -26.3883
+9.94812 -26.2895
+10.2419 -26.1879
+10.5345 -26.0834
+10.826 -25.9761
+11.1164 -25.8661
+11.4055 -25.7532
+11.6934 -25.6376
+11.9801 -25.5192
+12.2655 -25.398
+12.5495 -25.2742
+12.8322 -25.1475
+13.1135 -25.0182
+13.3933 -24.8862
+13.6718 -24.7514
+13.9487 -24.614
+14.2242 -24.474
+14.4981 -24.3312
+14.7704 -24.1859
+15.0412 -24.0379
+15.3103 -23.8874
+15.5777 -23.7342
+15.8435 -23.5785
+16.1075 -23.4202
+16.3699 -23.2594
+16.6304 -23.0961
+16.8891 -22.9303
+17.146 -22.7619
+17.401 -22.5912
+17.6542 -22.4179
+17.9054 -22.2422
+18.1547 -22.0641
+18.402 -21.8837
+18.6474 -21.7008
+18.8906 -21.5156
+19.1319 -21.328
+19.371 -21.1381
+19.6081 -20.946
+19.843 -20.7515
+20.0758 -20.5548
+20.3063 -20.3559
+20.5347 -20.1547
+20.7608 -19.9513
+20.9847 -19.7458
+21.2063 -19.5381
+21.4256 -19.3283
+21.6425 -19.1164
+21.8571 -18.9024
+22.0693 -18.6863
+22.279 -18.4682
+22.4864 -18.2481
+22.6913 -18.026
+22.8937 -17.8019
+23.0936 -17.5759
+23.291 -17.348
+23.4858 -17.1181
+23.6781 -16.8864
+23.8678 -16.6528
+24.0549 -16.4175
+24.2393 -16.1803
+24.4211 -15.9413
+24.6002 -15.7007
+24.7766 -15.4582
+24.9503 -15.2141
+25.1213 -14.9684
+25.2895 -14.721
+25.455 -14.4719
+25.6176 -14.2213
+25.7774 -13.9691
+25.9345 -13.7154
+26.0886 -13.4602
+26.2399 -13.2035
+26.3883 -12.9454
+26.5338 -12.6858
+26.6764 -12.4249
+26.8161 -12.1625
+26.9528 -11.8989
+27.0866 -11.6339
+27.2173 -11.3677
+27.3451 -11.1002
+27.4699 -10.8315
+27.5916 -10.5615
+27.7103 -10.2905
+27.826 -10.0182
+27.9386 -9.74493
+28.0481 -9.47054
+28.1545 -9.19511
+28.2578 -8.91866
+28.358 -8.64122
+28.455 -8.36284
+28.549 -8.08353
+28.6397 -7.80332
+28.7273 -7.52226
+28.8118 -7.24036
+28.893 -6.95767
+28.9711 -6.6742
+29.0459 -6.39
+29.1176 -6.10509
+29.186 -5.81951
+29.2512 -5.53328
+29.3131 -5.24643
+29.3719 -4.95901
+29.4273 -4.67104
+29.4795 -4.38255
+29.5285 -4.09357
+29.5741 -3.80414
+29.6165 -3.51429
+29.6556 -3.22405
+29.6915 -2.93345
+29.724 -2.64252
+29.7532 -2.3513
+29.7792 -2.05982
+29.8018 -1.76811
+29.8212 -1.47621
+29.8372 -1.18414
+29.8499 -0.891938
+29.8593 -0.599637
+29.8654 -0.307269
+29.8681 -0.0148671
+29.8676 0.277537
+29.8637 0.56991
+29.8565 0.86222
+29.846 1.15443
+29.8322 1.44652
+29.815 1.73845
+29.7945 2.03018
+29.7708 2.32169
+29.7437 2.61294
+29.7133 2.90389
+29.6796 3.19453
+29.6426 3.48481
+29.6022 3.7747
+29.5586 4.06418
+29.5117 4.35319
+29.4615 4.64173
+29.4081 4.92975
+29.3513 5.21722
+29.2913 5.5041
+29.228 5.79038
+29.1615 6.076
+29.0917 6.36095
+29.0186 6.64519
+28.9423 6.92869
+28.8628 7.21142
+28.7801 7.49334
+28.6942 7.77442
+28.605 8.05464
+28.5127 8.33396
+28.4172 8.61235
+28.3185 8.88977
+28.2166 9.1662
+28.1116 9.44161
+28.0035 9.71597
+27.8922 9.98924
+27.7778 10.2614
+27.6603 10.5324
+27.5397 10.8022
+27.416 11.0709
+27.2893 11.3382
+27.1595 11.6044
+27.0267 11.8692
+26.8908 12.1327
+26.752 12.3948
+26.6101 12.6556
+26.4653 12.9149
+26.3176 13.1728
+26.1668 13.4292
+26.0132 13.6842
+25.8566 13.9375
+25.6972 14.1894
+25.5348 14.4396
+25.3697 14.6882
+25.2016 14.9352
+25.0308 15.1805
+24.8571 15.4242
+24.6807 15.666
+24.5015 15.9062
+24.3196 16.1445
+24.1349 16.3811
+23.9476 16.6158
+23.7576 16.8486
+23.5649 17.0796
+23.3695 17.3087
+23.1716 17.5358
+22.971 17.7609
+22.7679 17.9841
+22.5623 18.2053
+22.3541 18.4244
+22.1434 18.6414
+21.9302 18.8564
+21.7146 19.0692
+21.4965 19.28
+21.276 19.4885
+21.0532 19.6949
+20.828 19.8991
+20.6004 20.101
+20.3706 20.3007
+20.1385 20.4981
+19.9041 20.6932
+19.6675 20.886
+19.4287 21.0765
+&
+@target G0.S5
+@type xy
+-15.5389 -25.216
+-15.262 -25.3851
+-14.9833 -25.5513
+-14.7029 -25.7146
+-14.4209 -25.8751
+-14.1373 -26.0327
+-13.8522 -26.1874
+-13.5655 -26.3392
+-13.2773 -26.4881
+-12.9876 -26.634
+-12.6965 -26.7771
+-12.404 -26.9171
+-12.1101 -27.0543
+-11.8149 -27.1884
+-11.5184 -27.3196
+-11.2207 -27.4479
+-10.9218 -27.5731
+-10.6216 -27.6954
+-10.3203 -27.8146
+-10.0179 -27.9309
+-9.71447 -28.0442
+-9.40996 -28.1544
+-9.10445 -28.2617
+-8.79797 -28.3659
+-8.49055 -28.4672
+-8.18223 -28.5654
+-7.87306 -28.6606
+-7.56305 -28.7529
+-7.25226 -28.8421
+-6.9407 -28.9282
+-6.62843 -29.0114
+-6.31547 -29.0916
+-6.00185 -29.1688
+-5.68762 -29.243
+-5.37281 -29.3141
+-5.05745 -29.3823
+-4.74157 -29.4475
+-4.42522 -29.5098
+-4.10842 -29.569
+-3.7912 -29.6253
+-3.47361 -29.6786
+-3.15567 -29.729
+-2.83742 -29.7764
+-2.51889 -29.8209
+-2.20011 -29.8625
+-1.88111 -29.9011
+-1.56193 -29.9368
+-1.2426 -29.9696
+-0.923155 -29.9996
+-0.603617 -30.0266
+-0.284021 -30.0508
+0.0356029 -30.0721
+0.355223 -30.0905
+0.67481 -30.1061
+0.994334 -30.1189
+1.31377 -30.1289
+1.63308 -30.1361
+1.95223 -30.1405
+2.27121 -30.1421
+2.58998 -30.141
+2.90852 -30.1371
+3.22679 -30.1305
+3.54477 -30.1212
+3.86244 -30.1091
+4.17975 -30.0944
+4.4967 -30.077
+4.81325 -30.057
+5.12938 -30.0343
+5.44506 -30.009
+5.76026 -29.9811
+6.07497 -29.9506
+6.38916 -29.9175
+6.7028 -29.8818
+7.01586 -29.8436
+7.32834 -29.8029
+7.6402 -29.7597
+7.95142 -29.714
+8.26197 -29.6658
+8.57185 -29.6152
+8.88101 -29.5621
+9.18946 -29.5066
+9.49715 -29.4487
+9.80407 -29.3885
+10.1102 -29.3258
+10.4155 -29.2608
+10.72 -29.1935
+11.0237 -29.1239
+11.3265 -29.052
+11.6284 -28.9778
+11.9294 -28.9013
+12.2294 -28.8227
+12.5286 -28.7418
+12.8267 -28.6587
+13.1239 -28.5734
+13.4201 -28.486
+13.7153 -28.3964
+14.0095 -28.3047
+14.3026 -28.2109
+14.5947 -28.1151
+14.8857 -28.0171
+15.1756 -27.9172
+15.4645 -27.8151
+15.7522 -27.7111
+16.0387 -27.6051
+16.3242 -27.4972
+16.6084 -27.3873
+16.8915 -27.2754
+17.1735 -27.1617
+17.4542 -27.046
+17.7337 -26.9285
+18.012 -26.8091
+18.2891 -26.6879
+18.5649 -26.5649
+18.8395 -26.4401
+19.1128 -26.3135
+19.3848 -26.1852
+19.6555 -26.0551
+19.925 -25.9233
+20.1931 -25.7898
+20.4599 -25.6546
+20.7254 -25.5177
+20.9896 -25.3792
+21.2524 -25.2391
+21.5138 -25.0973
+21.7739 -24.954
+22.0326 -24.8091
+22.29 -24.6627
+22.5459 -24.5147
+22.8005 -24.3651
+23.0536 -24.2141
+23.3053 -24.0616
+23.5557 -23.9077
+23.8045 -23.7523
+24.052 -23.5954
+24.298 -23.4372
+24.5426 -23.2776
+24.7857 -23.1165
+25.0274 -22.9542
+25.2676 -22.7904
+25.5063 -22.6254
+25.7436 -22.4591
+25.9794 -22.2914
+26.2136 -22.1225
+26.4464 -21.9523
+26.6778 -21.7809
+26.9076 -21.6083
+27.1359 -21.4344
+27.3627 -21.2594
+27.588 -21.0832
+27.8117 -20.9058
+28.034 -20.7273
+28.2547 -20.5477
+28.4739 -20.3669
+28.6916 -20.1851
+28.9077 -20.0022
+29.1223 -19.8182
+29.3354 -19.6331
+29.5469 -19.4471
+29.7569 -19.26
+29.9653 -19.0719
+30.1722 -18.8828
+30.3775 -18.6928
+30.5813 -18.5018
+30.7835 -18.3099
+30.9841 -18.117
+31.1832 -17.9232
+31.3808 -17.7285
+31.5767 -17.533
+31.7711 -17.3366
+31.964 -17.1393
+32.1553 -16.9412
+32.345 -16.7422
+32.5331 -16.5424
+32.7197 -16.3419
+32.9046 -16.1405
+33.0881 -15.9384
+33.2699 -15.7355
+33.4502 -15.5319
+33.6289 -15.3276
+33.806 -15.1225
+33.9816 -14.9167
+34.1555 -14.7103
+34.3279 -14.5031
+34.4988 -14.2953
+34.668 -14.0869
+34.8357 -13.8778
+35.0018 -13.668
+35.1663 -13.4577
+35.3293 -13.2468
+35.4907 -13.0352
+35.6505 -12.8231
+35.8087 -12.6104
+35.9654 -12.3972
+36.1205 -12.1834
+36.274 -11.9691
+36.426 -11.7543
+36.5763 -11.539
+36.7252 -11.3232
+36.8724 -11.1069
+37.0181 -10.8901
+37.1622 -10.6729
+37.3048 -10.4552
+37.4458 -10.2371
+37.5852 -10.0185
+37.7231 -9.79959
+37.8594 -9.58022
+37.9942 -9.36046
+38.1274 -9.14032
+38.2591 -8.91981
+38.3892 -8.69893
+38.5178 -8.47771
+38.6448 -8.25614
+38.7702 -8.03425
+38.8942 -7.81203
+39.0166 -7.5895
+39.1374 -7.36668
+39.2567 -7.14356
+39.3745 -6.92017
+39.4907 -6.6965
+39.6054 -6.47258
+39.7186 -6.2484
+39.8302 -6.02399
+39.9403 -5.79934
+40.0489 -5.57448
+40.156 -5.3494
+40.2615 -5.12412
+40.3656 -4.89864
+40.4681 -4.67298
+40.5691 -4.44715
+40.6686 -4.22115
+40.7666 -3.995
+40.8631 -3.7687
+40.9581 -3.54226
+41.0516 -3.31569
+41.1435 -3.089
+41.234 -2.86219
+41.323 -2.63529
+41.4105 -2.40828
+41.4966 -2.18119
+41.5811 -1.95403
+41.6642 -1.72679
+41.7458 -1.49949
+41.8259 -1.27214
+41.9045 -1.04475
+41.9817 -0.817317
+42.0574 -0.589856
+42.1316 -0.362375
+42.2044 -0.134882
+42.2757 0.0926161
+42.3455 0.320111
+42.4139 0.547595
+42.4809 0.77506
+42.5464 1.0025
+42.6104 1.2299
+42.673 1.45727
+42.7342 1.68458
+42.794 1.91184
+42.8523 2.13903
+42.9091 2.36615
+42.9646 2.5932
+43.0186 2.82015
+43.0712 3.04702
+43.1224 3.27378
+43.1722 3.50044
+43.2206 3.72698
+43.2675 3.9534
+43.3131 4.17969
+43.3573 4.40585
+43.4 4.63186
+43.4414 4.85773
+43.4813 5.08344
+43.5199 5.30899
+43.5571 5.53437
+43.5929 5.75957
+43.6273 5.98459
+43.6604 6.20942
+43.6921 6.43406
+43.7224 6.65849
+43.7513 6.88272
+43.7789 7.10673
+43.8051 7.33052
+43.83 7.55409
+43.8535 7.77742
+43.8757 8.00051
+43.8965 8.22335
+43.9159 8.44595
+43.9341 8.66829
+43.9509 8.89036
+43.9663 9.11216
+43.9805 9.33369
+43.9933 9.55493
+44.0047 9.77589
+44.0149 9.99655
+44.0237 10.2169
+44.0312 10.437
+44.0375 10.6567
+44.0424 10.8762
+44.046 11.0953
+44.0483 11.3141
+44.0493 11.5325
+44.049 11.7506
+44.0474 11.9684
+44.0445 12.1858
+44.0404 12.4029
+44.0349 12.6196
+44.0282 12.8359
+44.0203 13.0519
+44.011 13.2675
+44.0005 13.4827
+43.9887 13.6975
+43.9756 13.9119
+43.9613 14.1259
+43.9458 14.3396
+43.929 14.5528
+43.9109 14.7656
+43.8916 14.978
+43.8711 15.1899
+43.8493 15.4015
+43.8263 15.6126
+43.8021 15.8232
+43.7766 16.0334
+43.7499 16.2432
+43.722 16.4525
+43.6929 16.6614
+43.6626 16.8698
+43.631 17.0777
+43.5983 17.2852
+43.5643 17.4922
+43.5292 17.6987
+43.4928 17.9047
+43.4553 18.1102
+43.4166 18.3152
+43.3766 18.5198
+43.3355 18.7238
+43.2933 18.9273
+43.2498 19.1303
+43.2052 19.3328
+43.1594 19.5347
+43.1124 19.7362
+43.0643 19.9371
+43.015 20.1374
+42.9646 20.3372
+42.913 20.5365
+42.8603 20.7352
+42.8064 20.9334
+42.7514 21.131
+42.6952 21.3281
+42.6379 21.5246
+42.5795 21.7205
+42.5199 21.9158
+42.4593 22.1106
+42.3975 22.3047
+42.3345 22.4983
+42.2705 22.6913
+42.2054 22.8837
+42.1391 23.0755
+42.0717 23.2667
+42.0033 23.4573
+41.9337 23.6473
+41.8631 23.8366
+41.7914 24.0253
+41.7185 24.2134
+41.6446 24.4009
+41.5696 24.5878
+41.4936 24.774
+41.4164 24.9595
+41.3382 25.1445
+41.2589 25.3287
+41.1786 25.5123
+41.0972 25.6953
+41.0147 25.8776
+40.9312 26.0592
+40.8467 26.2402
+40.761 26.4205
+40.6744 26.6001
+40.5867 26.7791
+40.498 26.9573
+40.4082 27.1349
+40.3174 27.3118
+40.2256 27.488
+40.1328 27.6634
+40.0389 27.8382
+39.9441 28.0123
+39.8482 28.1857
+39.7513 28.3583
+39.6534 28.5302
+39.5545 28.7015
+39.4546 28.8719
+39.3537 29.0417
+39.2518 29.2107
+39.1489 29.379
+39.0451 29.5466
+38.9402 29.7134
+38.8344 29.8795
+38.7276 30.0448
+38.6198 30.2093
+38.5111 30.3731
+38.4014 30.5362
+38.2908 30.6984
+38.1791 30.86
+38.0666 31.0207
+37.953 31.1807
+37.8386 31.3398
+37.7232 31.4982
+37.6068 31.6559
+37.4895 31.8127
+37.3713 31.9687
+37.2521 32.124
+37.1321 32.2784
+37.0111 32.4321
+36.8891 32.5849
+36.7663 32.7369
+36.6425 32.8881
+36.5179 33.0385
+36.3923 33.1881
+36.2658 33.3369
+36.1385 33.4848
+36.0102 33.6319
+35.8811 33.7781
+35.751 33.9236
+35.6201 34.0682
+35.4883 34.2119
+35.3556 34.3548
+35.222 34.4969
+35.0876 34.6381
+34.9523 34.7784
+34.8161 34.9179
+34.6791 35.0565
+34.5412 35.1942
+34.4025 35.3311
+34.2629 35.4671
+34.1224 35.6023
+33.9812 35.7365
+33.8391 35.8699
+33.6961 36.0024
+33.5523 36.134
+33.4077 36.2647
+33.2623 36.3945
+33.116 36.5234
+32.9689 36.6514
+32.8211 36.7785
+32.6724 36.9047
+32.5229 37.03
+32.3725 37.1544
+32.2214 37.2778
+32.0695 37.4003
+31.9168 37.5219
+31.7633 37.6426
+31.6091 37.7624
+31.454 37.8812
+31.2982 37.999
+31.1416 38.116
+30.9842 38.232
+30.826 38.347
+30.6671 38.4611
+30.5075 38.5742
+30.347 38.6864
+30.1859 38.7976
+30.0239 38.9079
+29.8613 39.0172
+29.6978 39.1255
+29.5337 39.2329
+29.3688 39.3393
+29.2032 39.4447
+29.0368 39.5491
+28.8698 39.6525
+28.702 39.755
+28.5335 39.8564
+28.3643 39.9569
+28.1944 40.0564
+28.0238 40.1549
+27.8524 40.2523
+27.6804 40.3488
+27.5077 40.4442
+27.3343 40.5387
+27.1602 40.6321
+26.9855 40.7245
+26.81 40.8159
+26.6339 40.9062
+26.4571 40.9956
+26.2797 41.0839
+26.1016 41.1711
+25.9228 41.2574
+25.7434 41.3426
+25.5633 41.4267
+25.3826 41.5098
+25.2012 41.5919
+25.0193 41.6729
+24.8366 41.7528
+24.6534 41.8317
+24.4695 41.9095
+24.285 41.9863
+24.0999 42.062
+23.9141 42.1366
+23.7278 42.2102
+23.5408 42.2826
+23.3533 42.354
+23.1651 42.4243
+22.9764 42.4936
+22.7871 42.5617
+22.5972 42.6288
+22.4067 42.6947
+22.2156 42.7596
+22.024 42.8233
+21.8318 42.886
+21.639 42.9475
+21.4457 43.0079
+21.2518 43.0672
+21.0573 43.1254
+20.8623 43.1825
+20.6668 43.2385
+20.4708 43.2933
+20.2742 43.347
+20.077 43.3996
+19.8794 43.4511
+19.6812 43.5014
+19.4825 43.5505
+19.2833 43.5985
+19.0836 43.6454
+18.8834 43.6912
+18.6827 43.7357
+18.4815 43.7791
+18.2798 43.8214
+18.0777 43.8625
+17.875 43.9024
+17.6719 43.9412
+17.4683 43.9788
+17.2642 44.0152
+17.0597 44.0505
+16.8547 44.0846
+16.6493 44.1174
+16.4434 44.1491
+16.2371 44.1797
+16.0303 44.209
+15.8231 44.2371
+15.6155 44.2641
+15.4075 44.2898
+15.199 44.3143
+14.9901 44.3376
+14.7808 44.3598
+14.5712 44.3807
+14.3611 44.4004
+14.1506 44.4188
+13.9397 44.4361
+13.7285 44.4521
+13.5168 44.4669
+13.3048 44.4805
+13.0924 44.4928
+12.8797 44.5039
+12.6666 44.5138
+12.4532 44.5224
+12.2394 44.5298
+12.0252 44.5359
+11.8107 44.5408
+11.5959 44.5444
+11.3808 44.5468
+11.1653 44.5479
+10.9496 44.5478
+10.7335 44.5464
+10.5171 44.5437
+10.3004 44.5397
+10.0834 44.5345
+9.86612 44.528
+9.64856 44.5202
+9.43072 44.5112
+9.21261 44.5008
+8.99424 44.4892
+8.7756 44.4762
+8.55671 44.462
+8.33757 44.4465
+8.11818 44.4297
+7.89856 44.4116
+7.67871 44.3922
+7.45862 44.3714
+7.23832 44.3494
+7.01781 44.326
+6.79708 44.3014
+6.57615 44.2754
+6.35503 44.2481
+6.13372 44.2194
+5.91222 44.1895
+5.69054 44.1582
+5.46869 44.1255
+5.24668 44.0916
+5.02451 44.0563
+4.80218 44.0196
+4.57971 43.9816
+4.3571 43.9423
+4.13435 43.9016
+3.91148 43.8596
+3.68848 43.8162
+3.46538 43.7715
+3.24216 43.7254
+3.01884 43.6779
+2.79543 43.629
+2.57193 43.5788
+2.34835 43.5273
+2.12469 43.4743
+1.90097 43.42
+1.67719 43.3643
+1.45335 43.3072
+1.22947 43.2487
+1.00555 43.1889
+0.781595 43.1276
+0.557616 43.065
+0.333619 43.001
+0.10961 42.9355
+-0.114401 42.8687
+-0.338409 42.8005
+-0.562406 42.7308
+-0.786384 42.6598
+-1.01034 42.5874
+-1.23425 42.5135
+-1.45813 42.4382
+-1.68196 42.3615
+-1.90573 42.2834
+-2.12944 42.2039
+-2.35308 42.123
+-2.57664 42.0406
+-2.80011 41.9568
+-3.02348 41.8715
+-3.24675 41.7849
+-3.46991 41.6968
+-3.69295 41.6072
+-3.91586 41.5162
+-4.13864 41.4238
+-4.36127 41.33
+-4.58375 41.2347
+-4.80607 41.1379
+-5.02822 41.0397
+-5.25019 40.94
+-5.47198 40.8389
+-5.69357 40.7364
+-5.91495 40.6323
+-6.13613 40.5269
+-6.35708 40.4199
+-6.5778 40.3115
+-6.79829 40.2016
+-7.01852 40.0903
+-7.2385 39.9775
+-7.45822 39.8632
+-7.67765 39.7475
+-7.89681 39.6302
+-8.11567 39.5115
+-8.33422 39.3914
+-8.55246 39.2697
+-8.77038 39.1466
+-8.98797 39.022
+-9.20522 38.8959
+-9.42212 38.7683
+-9.63865 38.6392
+-9.85482 38.5087
+-10.0706 38.3766
+-10.286 38.2431
+-10.501 38.108
+-10.7156 37.9715
+-10.9297 37.8335
+-11.1434 37.694
+-11.3567 37.553
+-11.5696 37.4105
+-11.7819 37.2665
+-11.9938 37.121
+-12.2052 36.974
+-12.4162 36.8256
+-12.6266 36.6756
+-12.8365 36.5241
+-13.0458 36.3711
+-13.2547 36.2166
+-13.4629 36.0606
+-13.6707 35.9031
+-13.8778 35.7441
+-14.0844 35.5836
+-14.2903 35.4216
+-14.4957 35.258
+-14.7004 35.093
+-14.9045 34.9265
+-15.108 34.7585
+-15.3108 34.5889
+-15.513 34.4179
+-15.7144 34.2454
+-15.9152 34.0713
+-16.1153 33.8958
+-16.3147 33.7187
+-16.5133 33.5402
+-16.7112 33.3601
+-16.9083 33.1785
+-17.1047 32.9955
+-17.3003 32.8109
+-17.4951 32.6249
+-17.6891 32.4373
+-17.8823 32.2483
+-18.0747 32.0577
+-18.2662 31.8657
+-18.4569 31.6721
+-18.6467 31.4771
+-18.8356 31.2806
+-19.0236 31.0826
+-19.2107 30.8831
+-19.3969 30.6821
+-19.5822 30.4797
+-19.7665 30.2758
+-19.9498 30.0704
+-20.1322 29.8635
+-20.3135 29.6551
+-20.4939 29.4453
+-20.6732 29.234
+-20.8515 29.0212
+-21.0288 28.807
+-21.205 28.5913
+-21.3801 28.3742
+-21.5541 28.1556
+-21.727 27.9355
+-21.8987 27.714
+-22.0694 27.4911
+-22.2389 27.2667
+-22.4072 27.0409
+-22.5743 26.8137
+-22.7402 26.5851
+-22.9049 26.355
+-23.0684 26.1235
+-23.2307 25.8906
+-23.3916 25.6563
+-23.5513 25.4205
+-23.7097 25.1834
+-23.8668 24.9449
+-24.0225 24.705
+-24.177 24.4637
+-24.33 24.2211
+-24.4817 23.977
+-24.632 23.7317
+-24.7808 23.4849
+-24.9283 23.2368
+-25.0743 22.9874
+-25.2189 22.7366
+-25.3619 22.4845
+-25.5035 22.2311
+-25.6436 21.9763
+-25.7821 21.7203
+-25.9191 21.4629
+-26.0546 21.2043
+-26.1885 20.9443
+-26.3207 20.6831
+-26.4514 20.4207
+-26.5804 20.1569
+-26.7078 19.8919
+-26.8335 19.6257
+-26.9575 19.3583
+-27.0799 19.0896
+-27.2005 18.8197
+-27.3194 18.5486
+-27.4365 18.2764
+-27.5518 18.0029
+-27.6654 17.7283
+-27.7772 17.4525
+-27.8871 17.1756
+-27.9952 16.8975
+-28.1014 16.6183
+-28.2058 16.338
+-28.3082 16.0566
+-28.4088 15.7741
+-28.5074 15.4906
+-28.604 15.206
+-28.6987 14.9203
+-28.7914 14.6336
+-28.8821 14.3459
+-28.9708 14.0572
+-29.0574 13.7675
+-29.142 13.4768
+-29.2244 13.1851
+-29.3048 12.8925
+-29.3831 12.599
+-29.4592 12.3046
+-29.5332 12.0092
+-29.6051 11.713
+-29.6747 11.4159
+-29.7421 11.118
+-29.8073 10.8192
+-29.8703 10.5196
+-29.931 10.2192
+-29.9894 9.91809
+-30.0456 9.61618
+-30.0994 9.31353
+-30.1509 9.01016
+-30.2001 8.70609
+-30.2468 8.40134
+-30.2912 8.09592
+-30.3333 7.78987
+-30.3729 7.48319
+-30.41 7.17592
+-30.4447 6.86806
+-30.477 6.55966
+-30.5067 6.25071
+-30.534 5.94126
+-30.5588 5.63132
+-30.581 5.32091
+-30.6007 5.01006
+-30.6178 4.69878
+-30.6323 4.38712
+-30.6442 4.07508
+-30.6536 3.76269
+-30.6603 3.44999
+-30.6643 3.13698
+-30.6657 2.82371
+-30.6645 2.51019
+-30.6606 2.19645
+-30.6539 1.88251
+-30.6446 1.56841
+-30.6325 1.25418
+-30.6177 0.939825
+-30.6002 0.625391
+-30.5798 0.3109
+-30.5568 -0.00361878
+-30.5309 -0.318137
+-30.5022 -0.632626
+-30.4707 -0.947056
+-30.4364 -1.2614
+-30.3993 -1.57562
+-30.3593 -1.8897
+-30.3165 -2.2036
+-30.2708 -2.5173
+-30.2222 -2.83075
+-30.1708 -3.14393
+-30.1165 -3.45682
+-30.0593 -3.76937
+-29.9991 -4.08156
+-29.9361 -4.39335
+-29.8701 -4.70471
+-29.8013 -5.01562
+-29.7294 -5.32602
+-29.6547 -5.63591
+-29.577 -5.94523
+-29.4964 -6.25397
+-29.4128 -6.56207
+-29.3262 -6.86952
+-29.2367 -7.17627
+-29.1443 -7.4823
+-29.0488 -7.78757
+-28.9504 -8.09204
+-28.8491 -8.39568
+-28.7448 -8.69846
+-28.6375 -9.00034
+-28.5272 -9.30129
+-28.414 -9.60127
+-28.2978 -9.90024
+-28.1786 -10.1982
+-28.0565 -10.4951
+-27.9314 -10.7908
+-27.8033 -11.0854
+-27.6724 -11.3789
+-27.5384 -11.6711
+-27.4015 -11.9621
+-27.2617 -12.2518
+-27.119 -12.5402
+-26.9733 -12.8272
+-26.8247 -13.1129
+-26.6732 -13.3971
+-26.5188 -13.6799
+-26.3615 -13.9611
+-26.2013 -14.2409
+-26.0383 -14.5191
+-25.8724 -14.7957
+-25.7037 -15.0706
+-25.5321 -15.344
+-25.3577 -15.6156
+-25.1805 -15.8855
+-25.0005 -16.1536
+-24.8177 -16.4199
+-24.6321 -16.6844
+-24.4438 -16.947
+-24.2528 -17.2078
+-24.0591 -17.4666
+-23.8626 -17.7234
+-23.6635 -17.9783
+-23.4617 -18.2311
+-23.2573 -18.4819
+-23.0502 -18.7306
+-22.8406 -18.9772
+-22.6283 -19.2216
+-22.4135 -19.4639
+-22.1962 -19.704
+-21.9764 -19.9418
+-21.754 -20.1774
+-21.5292 -20.4107
+-21.302 -20.6417
+-21.0723 -20.8703
+-20.8402 -21.0966
+-20.6058 -21.3204
+-20.369 -21.5419
+-20.13 -21.7608
+-19.8886 -21.9774
+-19.645 -22.1914
+-19.3991 -22.4029
+-19.151 -22.6118
+-18.9008 -22.8182
+-18.6484 -23.022
+-18.3939 -23.2232
+-18.1373 -23.4217
+-17.8786 -23.6176
+-17.6179 -23.8109
+-17.3553 -24.0014
+-17.0906 -24.1892
+-16.8241 -24.3743
+-16.5556 -24.5566
+-16.2853 -24.7362
+-16.0131 -24.913
+-15.7392 -25.087
+-15.4635 -25.2581
+-15.186 -25.4265
+-14.9068 -25.592
+-14.626 -25.7546
+-14.3436 -25.9144
+-14.0595 -26.0713
+-13.7739 -26.2252
+-13.4868 -26.3763
+-13.1981 -26.5245
+-12.908 -26.6697
+-12.6165 -26.812
+-12.3236 -26.9513
+-12.0294 -27.0877
+-11.7338 -27.2211
+-11.437 -27.3516
+-11.1389 -27.479
+-10.8396 -27.6035
+-10.5391 -27.725
+-10.2375 -27.8435
+-9.93474 -27.959
+-9.63096 -28.0715
+-9.32614 -28.181
+-9.02033 -28.2875
+-8.71356 -28.391
+-8.40587 -28.4915
+-8.09728 -28.589
+-7.78785 -28.6834
+-7.47759 -28.7748
+-7.16656 -28.8633
+-6.85478 -28.9487
+-6.54228 -29.0311
+-6.22911 -29.1105
+-5.9153 -29.1869
+-5.60087 -29.2603
+-5.28588 -29.3307
+-4.97034 -29.3982
+-4.6543 -29.4626
+-4.33779 -29.5241
+-4.02084 -29.5825
+-3.70349 -29.6381
+-3.38577 -29.6906
+-3.06771 -29.7402
+-2.74935 -29.7869
+-2.43072 -29.8306
+-2.11184 -29.8714
+-1.79276 -29.9093
+-1.47351 -29.9442
+-1.15411 -29.9763
+-0.834605 -30.0055
+-0.515016 -30.0317
+-0.195378 -30.0552
+0.124279 -30.0757
+0.443925 -30.0934
+0.763529 -30.1083
+1.08306 -30.1204
+1.40249 -30.1296
+1.7218 -30.1361
+2.04094 -30.1398
+2.3599 -30.1407
+2.67864 -30.1388
+2.99714 -30.1342
+3.31536 -30.1269
+3.63329 -30.1168
+3.95089 -30.1041
+4.26815 -30.0887
+4.58502 -30.0706
+4.90149 -30.0499
+5.21753 -30.0265
+5.53311 -30.0005
+5.84822 -29.9719
+6.16281 -29.9407
+6.47688 -29.907
+6.7904 -29.8706
+7.10334 -29.8318
+7.41568 -29.7904
+7.7274 -29.7466
+8.03847 -29.7002
+8.34887 -29.6514
+8.65859 -29.6001
+8.96759 -29.5464
+9.27586 -29.4903
+9.58338 -29.4318
+9.89012 -29.3709
+10.1961 -29.3076
+10.5012 -29.242
+10.8055 -29.1741
+11.1089 -29.1039
+11.4115 -29.0314
+11.7132 -28.9566
+12.014 -28.8796
+12.3138 -28.8004
+12.6127 -28.7189
+12.9107 -28.6353
+13.2076 -28.5494
+13.5036 -28.4615
+13.7985 -28.3714
+14.0925 -28.2791
+14.3853 -28.1848
+14.6772 -28.0884
+14.9679 -27.99
+15.2576 -27.8895
+15.5461 -27.787
+15.8335 -27.6825
+16.1198 -27.576
+16.405 -27.4675
+16.689 -27.3571
+16.9718 -27.2448
+17.2534 -27.1306
+17.5339 -27.0145
+17.8131 -26.8965
+18.0911 -26.7767
+18.3678 -26.655
+18.6434 -26.5315
+18.9176 -26.4063
+19.1906 -26.2793
+19.4623 -26.1505
+19.7327 -26.02
+20.0018 -25.8878
+20.2697 -25.7538
+20.5361 -25.6182
+20.8013 -25.481
+21.0651 -25.3421
+21.3276 -25.2016
+21.5887 -25.0595
+21.8485 -24.9157
+22.1068 -24.7705
+22.3638 -24.6236
+22.6194 -24.4753
+22.8736 -24.3254
+23.1264 -24.1741
+23.3778 -24.0212
+23.6278 -23.8669
+23.8763 -23.7112
+24.1234 -23.554
+24.3691 -23.3954
+24.6133 -23.2355
+24.8561 -23.0741
+25.0974 -22.9115
+25.3372 -22.7474
+25.5756 -22.5821
+25.8125 -22.4155
+26.0479 -22.2475
+26.2818 -22.0783
+26.5143 -21.9079
+26.7452 -21.7362
+26.9747 -21.5633
+27.2026 -21.3892
+27.429 -21.2139
+27.6539 -21.0374
+27.8774 -20.8598
+28.0992 -20.681
+28.3196 -20.5012
+28.5384 -20.3202
+28.7557 -20.1381
+28.9715 -19.955
+29.1857 -19.7708
+29.3984 -19.5855
+29.6096 -19.3992
+29.8192 -19.212
+30.0272 -19.0237
+30.2337 -18.8344
+30.4387 -18.6442
+30.6421 -18.453
+30.8439 -18.2609
+31.0442 -18.0678
+31.243 -17.8739
+31.4401 -17.679
+31.6357 -17.4833
+31.8298 -17.2867
+32.0222 -17.0893
+32.2131 -16.891
+32.4025 -16.6919
+32.5902 -16.492
+32.7764 -16.2913
+32.961 -16.0898
+33.1441 -15.8876
+33.3256 -15.6846
+33.5055 -15.4808
+33.6838 -15.2763
+33.8606 -15.0712
+34.0358 -14.8653
+34.2094 -14.6587
+34.3814 -14.4515
+34.5519 -14.2435
+34.7208 -14.035
+34.8881 -13.8258
+35.0539 -13.616
+35.218 -13.4055
+35.3806 -13.1945
+35.5417 -12.9829
+35.7011 -12.7707
+35.859 -12.558
+36.0153 -12.3447
+36.1701 -12.1308
+36.3232 -11.9165
+36.4748 -11.7016
+36.6249 -11.4862
+36.7734 -11.2703
+36.9203 -11.054
+37.0656 -10.8372
+37.2094 -10.6199
+37.3516 -10.4022
+37.4923 -10.184
+37.6314 -9.96543
+37.7689 -9.74643
+37.9049 -9.52704
+38.0394 -9.30725
+38.1722 -9.08709
+38.3036 -8.86655
+38.4334 -8.64566
+38.5616 -8.42442
+38.6883 -8.20284
+38.8134 -7.98093
+38.937 -7.75871
+39.0591 -7.53618
+39.1796 -7.31335
+39.2986 -7.09024
+39.416 -6.86684
+39.532 -6.64319
+39.6463 -6.41927
+39.7592 -6.19511
+39.8705 -5.9707
+39.9803 -5.74607
+40.0886 -5.52123
+40.1954 -5.29617
+40.3006 -5.07091
+40.4044 -4.84546
+40.5066 -4.61983
+40.6073 -4.39403
+40.7065 -4.16806
+40.8042 -3.94194
+40.9004 -3.71568
+40.9951 -3.48928
+41.0883 -3.26275
+41.18 -3.0361
+41.2702 -2.80934
+41.3589 -2.58249
+41.4461 -2.35553
+41.5319 -2.1285
+41.6161 -1.90138
+41.6989 -1.6742
+41.7802 -1.44696
+41.86 -1.21967
+41.9384 -0.99234
+42.0153 -0.764972
+42.0907 -0.537576
+42.1647 -0.310162
+42.2372 -0.0827375
+42.3082 0.14469
+42.3778 0.372113
+42.446 0.599523
+42.5126 0.826912
+42.5779 1.05427
+42.6417 1.2816
+42.7041 1.50888
+42.765 1.73611
+42.8245 1.96329
+42.8825 2.1904
+42.9392 2.41743
+42.9944 2.64439
+43.0482 2.87125
+43.1005 3.09803
+43.1515 3.3247
+43.201 3.55126
+43.2492 3.77771
+43.2959 4.00403
+43.3412 4.23022
+43.3852 4.45628
+43.4277 4.6822
+43.4688 4.90796
+43.5086 5.13357
+43.5469 5.35901
+43.5839 5.58428
+43.6195 5.80938
+43.6537 6.03429
+43.6865 6.25901
+43.718 6.48354
+43.7481 6.70786
+43.7768 6.93198
+43.8042 7.15588
+43.8302 7.37955
+43.8549 7.603
+43.8782 7.82621
+43.9002 8.04919
+43.9208 8.27191
+43.9401 8.49439
+43.958 8.7166
+43.9746 8.93855
+43.9899 9.16023
+44.0038 9.38164
+44.0164 9.60276
+44.0277 9.82359
+44.0377 10.0441
+44.0464 10.2644
+44.0537 10.4843
+44.0597 10.7039
+44.0645 10.9232
+44.0679 11.1422
+44.07 11.3609
+44.0709 11.5792
+44.0704 11.7972
+44.0687 12.0148
+44.0656 12.2321
+44.0613 12.449
+44.0557 12.6656
+44.0489 12.8818
+44.0407 13.0976
+44.0313 13.313
+44.0207 13.5281
+44.0087 13.7428
+43.9955 13.9571
+43.9811 14.171
+43.9654 14.3845
+43.9484 14.5975
+43.9303 14.8102
+43.9108 15.0224
+43.8902 15.2343
+43.8682 15.4457
+43.8451 15.6566
+43.8207 15.8671
+43.7952 16.0772
+43.7683 16.2869
+43.7403 16.496
+43.7111 16.7048
+43.6806 16.913
+43.649 17.1208
+43.6161 17.3281
+43.582 17.535
+43.5468 17.7413
+43.5103 17.9472
+43.4726 18.1526
+43.4338 18.3574
+43.3938 18.5618
+43.3526 18.7657
+43.3102 18.9691
+43.2667 19.1719
+43.2219 19.3743
+43.176 19.5761
+43.129 19.7774
+43.0808 19.9781
+43.0314 20.1783
+42.9809 20.378
+42.9292 20.5771
+42.8764 20.7757
+42.8224 20.9737
+42.7673 21.1712
+42.7111 21.3681
+42.6537 21.5644
+42.5952 21.7602
+42.5356 21.9554
+42.4748 22.15
+42.4129 22.344
+42.35 22.5375
+42.2859 22.7303
+42.2206 22.9226
+42.1543 23.1142
+42.0869 23.3053
+42.0184 23.4957
+41.9488 23.6856
+41.8781 23.8748
+41.8063 24.0633
+41.7334 24.2513
+41.6594 24.4386
+41.5844 24.6253
+41.5083 24.8114
+41.4311 24.9968
+41.3528 25.1816
+41.2735 25.3657
+41.1931 25.5492
+41.1117 25.732
+41.0292 25.9142
+40.9456 26.0957
+40.861 26.2765
+40.7754 26.4567
+40.6887 26.6362
+40.601 26.815
+40.5122 26.9931
+40.4225 27.1705
+40.3317 27.3473
+40.2398 27.5233
+40.147 27.6987
+40.0531 27.8733
+39.9582 28.0473
+39.8623 28.2205
+39.7654 28.393
+39.6675 28.5648
+39.5686 28.7359
+39.4686 28.9062
+39.3677 29.0759
+39.2659 29.2448
+39.163 29.4129
+39.0591 29.5803
+38.9543 29.747
+38.8484 29.913
+38.7416 30.0781
+38.6339 30.2426
+38.5252 30.4063
+38.4155 30.5692
+38.3048 30.7313
+38.1932 30.8927
+38.0806 31.0533
+37.9671 31.2132
+37.8527 31.3722
+37.7373 31.5305
+37.6209 31.688
+37.5037 31.8447
+37.3855 32.0006
+37.2663 32.1557
+37.1463 32.3101
+37.0253 32.4636
+36.9034 32.6163
+36.7806 32.7682
+36.6569 32.9193
+36.5322 33.0696
+36.4067 33.2191
+36.2803 33.3677
+36.1529 33.5155
+36.0247 33.6625
+35.8956 33.8086
+35.7656 33.954
+35.6347 34.0984
+35.5029 34.2421
+35.3703 34.3849
+35.2367 34.5268
+35.1023 34.6679
+34.9671 34.8081
+34.831 34.9475
+34.694 35.086
+34.5562 35.2237
+34.4175 35.3605
+34.2779 35.4964
+34.1376 35.6314
+33.9963 35.7655
+33.8543 35.8988
+33.7114 36.0312
+33.5677 36.1627
+33.4231 36.2933
+33.2777 36.423
+33.1316 36.5518
+32.9845 36.6798
+32.8367 36.8068
+32.6881 36.9329
+32.5386 37.0581
+32.3884 37.1823
+32.2374 37.3057
+32.0855 37.4281
+31.9329 37.5497
+31.7795 37.6703
+31.6253 37.7899
+31.4703 37.9086
+31.3146 38.0264
+31.158 38.1433
+31.0007 38.2592
+30.8427 38.3742
+30.6838 38.4882
+30.5242 38.6012
+30.3639 38.7134
+30.2028 38.8245
+30.041 38.9347
+29.8784 39.0439
+29.7151 39.1522
+29.551 39.2595
+29.3862 39.3658
+29.2207 39.4711
+29.0544 39.5755
+28.8874 39.6788
+28.7198 39.7812
+28.5514 39.8826
+28.3822 39.983
+28.2124 40.0824
+28.0419 40.1808
+27.8707 40.2783
+27.6988 40.3747
+27.5261 40.4701
+27.3528 40.5644
+27.1789 40.6578
+27.0042 40.7502
+26.8289 40.8415
+26.6529 40.9318
+26.4762 41.0211
+26.2988 41.1094
+26.1208 41.1966
+25.9422 41.2828
+25.7629 41.3679
+25.5829 41.452
+25.4023 41.5351
+25.2211 41.6171
+25.0392 41.6981
+24.8567 41.778
+24.6735 41.8568
+24.4898 41.9346
+24.3054 42.0113
+24.1204 42.087
+23.9348 42.1616
+23.7485 42.2351
+23.5617 42.3076
+23.3743 42.3789
+23.1862 42.4492
+22.9976 42.5184
+22.8084 42.5865
+22.6186 42.6536
+22.4283 42.7195
+22.2373 42.7843
+22.0458 42.8481
+21.8537 42.9107
+21.6611 42.9722
+21.4679 43.0327
+21.2741 43.092
+21.0798 43.1502
+20.8849 43.2072
+20.6895 43.2632
+20.4936 43.318
+20.2971 43.3717
+20.1001 43.4243
+19.9026 43.4757
+19.7046 43.5261
+19.506 43.5752
+19.3069 43.6233
+19.1074 43.6701
+18.9073 43.7159
+18.7067 43.7605
+18.5057 43.8039
+18.3041 43.8462
+18.1021 43.8873
+17.8995 43.9272
+17.6965 43.966
+17.4931 44.0036
+17.2891 44.0401
+17.0848 44.0753
+16.8799 44.1094
+16.6746 44.1423
+16.4689 44.1741
+16.2627 44.2046
+16.056 44.234
+15.849 44.2621
+15.6415 44.2891
+15.4336 44.3149
+15.2253 44.3394
+15.0165 44.3628
+14.8074 44.3849
+14.5978 44.4059
+14.3879 44.4256
+14.1775 44.4441
+13.9668 44.4614
+13.7556 44.4775
+13.5441 44.4924
+13.3323 44.506
+13.12 44.5184
+12.9074 44.5295
+12.6945 44.5394
+12.4811 44.5481
+12.2675 44.5556
+12.0535 44.5618
+11.8391 44.5667
+11.6244 44.5704
+11.4094 44.5728
+11.1941 44.574
+10.9785 44.5739
+10.7625 44.5726
+10.5462 44.57
+10.3297 44.5661
+10.1128 44.561
+9.89567 44.5545
+9.67824 44.5468
+9.46053 44.5378
+9.24255 44.5276
+9.0243 44.516
+8.80579 44.5032
+8.58702 44.4891
+8.36801 44.4736
+8.14875 44.4569
+7.92925 44.4389
+7.70952 44.4196
+7.48956 44.3989
+7.26938 44.377
+7.04899 44.3537
+6.82839 44.3292
+6.60758 44.3033
+6.38658 44.2761
+6.16539 44.2476
+5.94401 44.2177
+5.72245 44.1865
+5.50072 44.154
+5.27882 44.1202
+5.05677 44.085
+4.83456 44.0485
+4.6122 44.0106
+4.3897 43.9714
+4.16707 43.9308
+3.94431 43.8889
+3.72142 43.8457
+3.49843 43.801
+3.27532 43.7551
+3.05211 43.7077
+2.8288 43.659
+2.60541 43.609
+2.38194 43.5575
+2.15839 43.5047
+1.93477 43.4505
+1.71109 43.395
+1.48735 43.338
+1.26357 43.2797
+1.03975 43.22
+0.815891 43.1589
+0.592008 43.0965
+0.368105 43.0326
+0.144191 42.9673
+-0.079728 42.9007
+-0.303645 42.8326
+-0.527551 42.7631
+-0.751441 42.6922
+-0.975306 42.62
+-1.19914 42.5463
+-1.42293 42.4712
+-1.64668 42.3947
+-1.87037 42.3167
+-2.094 42.2374
+-2.31755 42.1566
+-2.54103 42.0744
+-2.76443 41.9908
+-2.98773 41.9058
+-3.21093 41.8193
+-3.43401 41.7314
+-3.65698 41.642
+-3.87983 41.5512
+-4.10254 41.459
+-4.3251 41.3654
+-4.54752 41.2703
+-4.76978 41.1737
+-4.99187 41.0757
+-5.21378 40.9763
+-5.43551 40.8754
+-5.65705 40.773
+-5.87838 40.6692
+-6.0995 40.5639
+-6.32041 40.4572
+-6.54108 40.349
+-6.76152 40.2394
+-6.98171 40.1282
+-7.20165 40.0157
+-7.42132 39.9016
+-7.64072 39.7861
+-7.85984 39.6691
+-8.07867 39.5506
+-8.29719 39.4307
+-8.51541 39.3093
+-8.7333 39.1864
+-8.95086 39.062
+-9.16809 38.9361
+-9.38497 38.8088
+-9.60148 38.68
+-9.81763 38.5497
+-10.0334 38.4179
+-10.2488 38.2846
+-10.4638 38.1498
+-10.6783 38.0135
+-10.8925 37.8758
+-11.1062 37.7365
+-11.3195 37.5958
+-11.5324 37.4536
+-11.7447 37.3098
+-11.9566 37.1646
+-12.1681 37.0179
+-12.379 36.8697
+-12.5894 36.7199
+-12.7993 36.5687
+-13.0087 36.416
+-13.2176 36.2618
+-13.4259 36.106
+-13.6336 35.9488
+-13.8408 35.7901
+-14.0474 35.6299
+-14.2534 35.4681
+-14.4588 35.3049
+-14.6636 35.1402
+-14.8678 34.9739
+-15.0713 34.8062
+-15.2742 34.6369
+-15.4764 34.4662
+-15.6779 34.2939
+-15.8787 34.1202
+-16.0789 33.9449
+-16.2783 33.7682
+-16.477 33.5899
+-16.675 33.4102
+-16.8722 33.2289
+-17.0687 33.0461
+-17.2644 32.8619
+-17.4593 32.6761
+-17.6534 32.4889
+-17.8467 32.3001
+-18.0392 32.1099
+-18.2308 31.9182
+-18.4216 31.7249
+-18.6115 31.5302
+-18.8005 31.334
+-18.9887 31.1363
+-19.1759 30.9372
+-19.3622 30.7365
+-19.5476 30.5344
+-19.732 30.3307
+-19.9155 30.1256
+-20.098 29.9191
+-20.2795 29.711
+-20.46 29.5015
+-20.6395 29.2905
+-20.818 29.0781
+-20.9954 28.8642
+-21.1718 28.6488
+-21.347 28.432
+-21.5212 28.2137
+-21.6943 27.994
+-21.8663 27.7729
+-22.0371 27.5502
+-22.2068 27.3262
+-22.3753 27.1007
+-22.5426 26.8738
+-22.7088 26.6455
+-22.8737 26.4157
+-23.0374 26.1845
+-23.1998 25.9519
+-23.361 25.718
+-23.5209 25.4826
+-23.6796 25.2458
+-23.8369 25.0076
+-23.9929 24.768
+-24.1476 24.527
+-24.3009 24.2847
+-24.4528 24.041
+-24.6034 23.7959
+-24.7525 23.5495
+-24.9002 23.3017
+-25.0465 23.0526
+-25.1914 22.8022
+-25.3347 22.5504
+-25.4766 22.2973
+-25.617 22.0428
+-25.7558 21.7871
+-25.8932 21.5301
+-26.0289 21.2717
+-26.1631 21.0121
+-26.2957 20.7512
+-26.4267 20.489
+-26.5561 20.2256
+-26.6838 19.961
+-26.8099 19.695
+-26.9343 19.4279
+-27.057 19.1595
+-27.1779 18.89
+-27.2972 18.6192
+-27.4147 18.3472
+-27.5304 18.074
+-27.6444 17.7997
+-27.7565 17.5242
+-27.8669 17.2476
+-27.9754 16.9698
+-28.082 16.6909
+-28.1868 16.4109
+-28.2896 16.1298
+-28.3906 15.8476
+-28.4897 15.5643
+-28.5867 15.28
+-28.6819 14.9946
+-28.775 14.7082
+-28.8662 14.4207
+-28.9553 14.1323
+-29.0424 13.8428
+-29.1274 13.5524
+-29.2104 13.261
+-29.2913 12.9686
+-29.37 12.6754
+-29.4467 12.3812
+-29.5212 12.0861
+-29.5935 11.7901
+-29.6637 11.4932
+-29.7316 11.1955
+-29.7973 10.897
+-29.8608 10.5976
+-29.9221 10.2975
+-29.9811 9.99655
+-30.0378 9.69485
+-30.0921 9.39241
+-30.1442 9.08924
+-30.1939 8.78537
+-30.2413 8.48081
+-30.2863 8.17558
+-30.3289 7.86971
+-30.3691 7.56322
+-30.4068 7.25611
+-30.4421 6.94843
+-30.475 6.64019
+-30.5054 6.3314
+-30.5333 6.0221
+-30.5586 5.71231
+-30.5815 5.40204
+-30.6018 5.09132
+-30.6196 4.78018
+-30.6347 4.46864
+-30.6473 4.15672
+-30.6573 3.84445
+-30.6647 3.53184
+-30.6694 3.21894
+-30.6715 2.90576
+-30.6709 2.59232
+-30.6677 2.27866
+-30.6617 1.9648
+-30.6531 1.65077
+-30.6417 1.33659
+-30.6276 1.02229
+-30.6108 0.707904
+-30.5912 0.393451
+-30.5688 0.0789631
+-30.5437 -0.235532
+-30.5158 -0.550005
+-30.485 -0.864428
+-30.4515 -1.17877
+-30.4151 -1.493
+-30.3759 -1.80709
+-30.3338 -2.12102
+-30.2889 -2.43474
+-30.2411 -2.74823
+-30.1904 -3.06146
+-30.1368 -3.3744
+-30.0804 -3.68701
+-30.021 -3.99927
+-29.9588 -4.31114
+-29.8936 -4.62259
+-29.8255 -4.93359
+-29.7545 -5.2441
+-29.6805 -5.5541
+-29.6036 -5.86355
+-29.5238 -6.17241
+-29.441 -6.48066
+-29.3553 -6.78826
+-29.2666 -7.09517
+-29.1749 -7.40136
+-29.0803 -7.70681
+-28.9827 -8.01147
+-28.8822 -8.3153
+-28.7787 -8.61829
+-28.6722 -8.92038
+-28.5627 -9.22155
+-28.4503 -9.52177
+-28.3349 -9.82099
+-28.2166 -10.1192
+-28.0953 -10.4163
+-27.971 -10.7123
+-27.8438 -11.0072
+-27.7136 -11.301
+-27.5805 -11.5935
+-27.4445 -11.8848
+-27.3055 -12.1748
+-27.1635 -12.4635
+-27.0187 -12.7509
+-26.8709 -13.0369
+-26.7202 -13.3215
+-26.5666 -13.6047
+-26.4102 -13.8863
+-26.2508 -14.1665
+-26.0886 -14.4451
+-25.9235 -14.7221
+-25.7556 -14.9975
+-25.5848 -15.2712
+-25.4112 -15.5433
+-25.2348 -15.8136
+-25.0556 -16.0822
+-24.8736 -16.349
+-24.6889 -16.6139
+-24.5014 -16.8771
+-24.3111 -17.1383
+-24.1182 -17.3976
+-23.9225 -17.655
+-23.7242 -17.9104
+-23.5232 -18.1637
+-23.3195 -18.4151
+-23.1132 -18.6643
+-22.9043 -18.9115
+-22.6928 -19.1565
+-22.4788 -19.3994
+-22.2622 -19.64
+-22.0431 -19.8785
+-21.8215 -20.1147
+-21.5974 -20.3486
+-21.3709 -20.5802
+-21.142 -20.8094
+-20.9106 -21.0363
+-20.6769 -21.2608
+-20.4408 -21.4829
+-20.2024 -21.7026
+-19.9617 -21.9198
+-19.7188 -22.1345
+-19.4736 -22.3467
+-19.2262 -22.5563
+-18.9766 -22.7634
+-18.7248 -22.9679
+-18.471 -23.1698
+-18.215 -23.3691
+-17.957 -23.5657
+-17.6969 -23.7597
+-17.4349 -23.9509
+-17.1708 -24.1395
+-16.9049 -24.3253
+-16.637 -24.5084
+-16.3672 -24.6888
+-16.0956 -24.8663
+-15.8222 -25.0411
+-15.5471 -25.2131
+-15.2701 -25.3822
+-14.9915 -25.5485
+-14.7112 -25.7119
+-14.4293 -25.8725
+-14.1457 -26.0302
+-13.8606 -26.185
+-13.5739 -26.3369
+-13.2858 -26.4859
+-12.9961 -26.6319
+-12.7051 -26.775
+-12.4126 -26.9152
+-12.1188 -27.0524
+-11.8236 -27.1867
+-11.5272 -27.318
+-11.2295 -27.4463
+-10.9306 -27.5717
+-10.6305 -27.694
+-10.3292 -27.8134
+-10.0269 -27.9298
+-9.72345 -28.0431
+-9.41898 -28.1535
+-9.11349 -28.2609
+-8.80704 -28.3652
+-8.49966 -28.4666
+-8.19137 -28.5649
+-7.88223 -28.6603
+-7.57225 -28.7526
+-7.26148 -28.8419
+-6.94996 -28.9282
+-6.63771 -29.0115
+-6.32478 -29.0918
+-6.01119 -29.1691
+-5.69699 -29.2434
+-5.3822 -29.3147
+-5.06686 -29.383
+-4.75101 -29.4483
+-4.43468 -29.5107
+-4.1179 -29.5701
+-3.8007 -29.6265
+-3.48313 -29.6799
+-3.16521 -29.7304
+-2.84697 -29.778
+-2.52846 -29.8226
+-2.2097 -29.8643
+-1.89072 -29.903
+-1.57155 -29.9389
+-1.25223 -29.9718
+-0.932797 -30.0019
+-0.61327 -30.029
+-0.293684 -30.0533
+0.0259299 -30.0748
+0.345541 -30.0934
+0.66512 -30.1091
+0.984636 -30.1221
+1.30406 -30.1322
+1.62336 -30.1395
+1.94252 -30.144
+2.26149 -30.1458
+2.58026 -30.1448
+2.89879 -30.1411
+3.21707 -30.1346
+3.53505 -30.1254
+3.85271 -30.1135
+4.17003 -30.0989
+4.48699 -30.0817
+4.80354 -30.0618
+5.11968 -30.0392
+5.43536 -30.0141
+5.75058 -29.9863
+6.0653 -29.9559
+6.3795 -29.923
+6.69315 -29.8875
+7.00623 -29.8495
+7.31872 -29.8089
+7.6306 -29.7658
+7.94184 -29.7203
+8.25241 -29.6722
+8.56231 -29.6218
+8.8715 -29.5688
+9.17997 -29.5135
+9.48768 -29.4558
+9.79464 -29.3957
+10.1008 -29.3332
+10.4062 -29.2683
+10.7107 -29.2012
+11.0144 -29.1317
+11.3172 -29.06
+11.6191 -28.9859
+11.9201 -28.9097
+12.2203 -28.8312
+12.5194 -28.7504
+12.8176 -28.6675
+13.1149 -28.5824
+13.4111 -28.4952
+13.7064 -28.4058
+14.0006 -28.3143
+14.2938 -28.2206
+14.5859 -28.1249
+14.877 -28.0272
+15.1669 -27.9274
+15.4558 -27.8256
+15.7436 -27.7217
+16.0302 -27.6159
+16.3157 -27.5081
+16.6 -27.3984
+16.8832 -27.2867
+17.1652 -27.1732
+17.446 -27.0577
+17.7256 -26.9404
+18.0039 -26.8212
+18.2811 -26.7002
+18.557 -26.5774
+18.8316 -26.4527
+19.105 -26.3263
+19.3771 -26.1982
+19.6479 -26.0683
+19.9174 -25.9367
+20.1856 -25.8033
+20.4525 -25.6683
+20.7181 -25.5317
+20.9823 -25.3934
+21.2452 -25.2534
+21.5067 -25.1119
+21.7669 -24.9687
+22.0257 -24.824
+22.2831 -24.6777
+22.5392 -24.5299
+22.7938 -24.3806
+23.047 -24.2298
+23.2989 -24.0775
+23.5493 -23.9237
+23.7983 -23.7685
+24.0458 -23.6119
+24.292 -23.4538
+24.5366 -23.2944
+24.7799 -23.1336
+25.0216 -22.9714
+25.262 -22.8079
+25.5008 -22.643
+25.7382 -22.4769
+25.9741 -22.3094
+26.2085 -22.1407
+26.4414 -21.9707
+26.6728 -21.7995
+26.9028 -21.6271
+27.1312 -21.4534
+27.3581 -21.2786
+27.5836 -21.1026
+27.8075 -20.9254
+28.0298 -20.7471
+28.2507 -20.5677
+28.4701 -20.3871
+28.6879 -20.2055
+28.9041 -20.0227
+29.1189 -19.839
+29.3321 -19.6541
+29.5438 -19.4683
+29.7539 -19.2814
+29.9625 -19.0935
+30.1695 -18.9046
+30.375 -18.7148
+30.5789 -18.524
+30.7813 -18.3323
+30.9821 -18.1396
+31.1813 -17.946
+31.379 -17.7515
+31.5752 -17.5562
+31.7698 -17.36
+31.9628 -17.1629
+32.1542 -16.965
+32.3441 -16.7662
+32.5324 -16.5666
+32.7191 -16.3663
+32.9043 -16.1651
+33.0879 -15.9632
+33.2699 -15.7605
+33.4504 -15.5571
+33.6293 -15.353
+33.8066 -15.1481
+33.9823 -14.9425
+34.1565 -14.7363
+34.3291 -14.5293
+34.5001 -14.3217
+34.6696 -14.1135
+34.8374 -13.9046
+35.0037 -13.695
+35.1685 -13.4849
+35.3316 -13.2741
+&

Added: trunk/libs/numeric/odeint/examples/solar_system.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/solar_system.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,201 @@
+/* Boost libs/numeric/odeint/examples/solar_system.cpp
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 Mario Mulansky
+
+ Solar system example for Hamiltonian stepper
+
+ 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)
+ */
+
+
+#include <iostream>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+#include "point_type.hpp"
+
+//[ container_type_definition
+// we simulate 5 planets and the sun
+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;
+//]
+
+
+
+
+
+
+
+//[ coordinate_function
+const double gravitational_constant = 2.95912208286e-4;
+
+struct solar_system_coor
+{
+ const mass_type &m_masses;
+
+ solar_system_coor( const mass_type &masses ) : m_masses( masses ) { }
+
+ void operator()( const container_type &p , container_type &dqdt ) const
+ {
+ for( size_t i=0 ; i<n ; ++i )
+ dqdt[i] = p[i] / m_masses[i];
+ }
+};
+//]
+
+
+//[ momentum_function
+struct solar_system_momentum
+{
+ const mass_type &m_masses;
+
+ solar_system_momentum( const mass_type &masses ) : m_masses( masses ) { }
+
+ void operator()( const container_type &q , container_type &dpdt ) const
+ {
+ const size_t n = q.size();
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ dpdt[i] = 0.0;
+ for( size_t j=0 ; j<i ; ++j )
+ {
+ point_type diff = q[j] - q[i];
+ double d = abs( diff );
+ diff *= ( gravitational_constant * m_masses[i] * m_masses[j] / d / d / d );
+ dpdt[i] += diff;
+ dpdt[j] -= diff;
+
+ }
+ }
+ }
+};
+//]
+
+
+
+
+
+
+
+//[ some_helpers
+point_type center_of_mass( const container_type &x , const mass_type &m )
+{
+ double overall_mass = 0.0;
+ point_type mean( 0.0 );
+ for( size_t i=0 ; i<x.size() ; ++i )
+ {
+ overall_mass += m[i];
+ mean += m[i] * x[i];
+ }
+ if( !x.empty() ) mean /= overall_mass;
+ return mean;
+}
+
+
+double energy( const container_type &q , const container_type &p , const mass_type &masses )
+{
+ const size_t n = q.size();
+ double en = 0.0;
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ en += 0.5 * norm( p[i] ) / masses[i];
+ for( size_t j=0 ; j<i ; ++j )
+ {
+ double diff = abs( q[i] - q[j] );
+ en -= gravitational_constant * masses[j] * masses[i] / diff;
+ }
+ }
+ return en;
+}
+//]
+
+
+//[ streaming_observer
+struct streaming_observer
+{
+ std::ostream& m_out;
+
+ streaming_observer( std::ostream &out ) : m_out( out ) { }
+
+ template< class State >
+ void operator()( const State &x , double t ) const
+ {
+ container_type &q = x.first;
+ m_out << t;
+ for( size_t i=0 ; i<q.size() ; ++i ) m_out << "\t" << q[i];
+ m_out << "\n";
+ }
+};
+//]
+
+
+int main( int argc , char **argv )
+{
+
+ using namespace std;
+ using namespace boost::numeric::odeint;
+
+ mass_type masses = {{
+ 1.00000597682 , // sun
+ 0.000954786104043 , // jupiter
+ 0.000285583733151 , // saturn
+ 0.0000437273164546 , // uranus
+ 0.0000517759138449 , // neptune
+ 1.0 / ( 1.3e8 ) // pluto
+ }};
+
+ container_type q = {{
+ point_type( 0.0 , 0.0 , 0.0 ) , // sun
+ point_type( -3.5023653 , -3.8169847 , -1.5507963 ) , // jupiter
+ point_type( 9.0755314 , -3.0458353 , -1.6483708 ) , // saturn
+ point_type( 8.3101420 , -16.2901086 , -7.2521278 ) , // uranus
+ point_type( 11.4707666 , -25.7294829 , -10.8169456 ) , // neptune
+ point_type( -15.5387357 , -25.2225594 , -3.1902382 ) // pluto
+ }};
+
+ container_type p = {{
+ point_type( 0.0 , 0.0 , 0.0 ) , // sun
+ point_type( 0.00565429 , -0.00412490 , -0.00190589 ) , // jupiter
+ point_type( 0.00168318 , 0.00483525 , 0.00192462 ) , // saturn
+ point_type( 0.00354178 , 0.00137102 , 0.00055029 ) , // uranus
+ point_type( 0.00288930 , 0.00114527 , 0.00039677 ) , // neptune
+ point_type( 0.00276725 , -0.00170702 , -0.00136504 ) // pluto
+ }};
+
+ point_type qmean = center_of_mass( q , masses );
+ point_type pmean = center_of_mass( p , masses );
+ for( size_t i=0 ; i<n ; ++i )
+ {
+ q[i] -= qmean ;
+ p[i] -= pmean;
+ }
+
+ for( size_t i=0 ; i<n ; ++i ) p[i] *= masses[i];
+
+ //[ integration_solar_system
+ typedef symplectic_rkn_sb3a_mclachlan< container_type > stepper_type;
+ const double dt = 100.0;
+
+ integrate_const(
+ stepper_type() ,
+ make_pair( solar_system_coor( masses ) , solar_system_momentum( masses ) ) ,
+ make_pair( boost::ref( q ) , boost::ref( p ) ) ,
+ 0.0 , 200000.0 , dt , streaming_observer( cout ) );
+ //]
+
+
+ return 0;
+}
+
+
+/*
+Plot with gnuplot:
+p "solar_system.dat" u 2:4 w l,"solar_system.dat" u 5:7 w l,"solar_system.dat" u 8:10 w l,"solar_system.dat" u 11:13 w l,"solar_system.dat" u 14:16 w l,"solar_system.dat" u 17:19 w l
+ */

Added: trunk/libs/numeric/odeint/examples/stepper_details.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/stepper_details.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,197 @@
+/*
+ * stepper_details.cpp
+ *
+ * This example demonstrates some details about the steppers in odeint.
+ *
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+#include <iostream>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+const size_t N = 3;
+
+typedef boost::array< double , N > state_type;
+
+//[ system_function_structure
+void sys( const state_type & /*x*/ , state_type & /*dxdt*/ , const double /*t*/ )
+{
+ // ...
+}
+//]
+
+void sys1( const state_type &/*x*/ , state_type &/*dxdt*/ , const double /*t*/ )
+{
+}
+
+void sys2( const state_type &/*x*/ , state_type &/*dxdt*/ , const double /*t*/ )
+{
+}
+
+
+//[ symplectic_stepper_detail_system_function
+typedef boost::array< double , 1 > vector_type;
+
+
+struct harm_osc_f1
+{
+ void operator()( const vector_type &p , vector_type &dqdt )
+ {
+ dqdt[0] = p[0];
+ }
+};
+
+struct harm_osc_f2
+{
+ void operator()( const vector_type &q , vector_type &dpdt )
+ {
+ dpdt[0] = -q[0];
+ }
+};
+//]
+
+//[ symplectic_stepper_detail_system_class
+struct harm_osc
+{
+ void f1( const vector_type &p , vector_type &dqdt ) const
+ {
+ dqdt[0] = p[0];
+ }
+
+ void f2( const vector_type &q , vector_type &dpdt ) const
+ {
+ dpdt[0] = -q[0];
+ }
+};
+//]
+
+int main( int argc , char **argv )
+{
+ using namespace std;
+
+ // Explicit stepper example
+ {
+ double t( 0.0 ) , dt( 0.1 );
+ state_type in , out , dxdtin , inout;
+ //[ explicit_stepper_detail_example
+ runge_kutta4< state_type > rk;
+ rk.do_step( sys1 , inout , t , dt ); // In-place transformation of inout
+ rk.do_step( sys2 , inout , t , dt ); // call with different system: Ok
+ rk.do_step( sys1 , in , t , out , dt ); // Out-of-place transformation
+ rk.do_step( sys1 , inout , dxdtin , t , dt ); // In-place tranformation of inout
+ rk.do_step( sys1 , in , dxdtin , t , out , dt ); // Out-of-place transformation
+ //]
+ }
+
+
+
+ // FSAL stepper example
+ {
+ double t( 0.0 ) , dt( 0.1 );
+ state_type in , in2 , in3 , out , dxdtin , dxdtout , inout , dxdtinout;
+ //[ fsal_stepper_detail_example
+ runge_kutta_dopri5< state_type > rk;
+ rk.do_step( sys1 , in , t , out , dt );
+ rk.do_step( sys2 , in , t , out , dt ); // DONT do this, sys1 is assumed
+
+ rk.do_step( sys2 , in2 , t , out , dt );
+ rk.do_step( sys2 , in3 , t , out , dt ); // DONT do this, in2 is assumed
+
+ rk.do_step( sys1 , inout , dxdtinout , t , dt );
+ rk.do_step( sys2 , inout , dxdtinout , t , dt ); // Ok, internal derivative is not used, dxdtinout is updated
+
+ rk.do_step( sys1 , in , dxdtin , t , out , dxdtout , dt );
+ rk.do_step( sys2 , in , dxdtin , t , out , dxdtout , dt ); // Ok, internal derivative is not used
+ //]
+ }
+
+
+ // Symplectic harmonic oscillator example
+ {
+ double t( 0.0 ) , dt( 0.1 );
+ //[ symplectic_stepper_detail_example
+ pair< vector_type , vector_type > x;
+ x.first[0] = 1.0; x.second[0] = 0.0;
+ symplectic_rkn_sb3a_mclachlan< vector_type > rkn;
+ rkn.do_step( make_pair( harm_osc_f1() , harm_osc_f2() ) , x , t , dt );
+ //]
+
+ //[ symplectic_stepper_detail_system_class_example
+ harm_osc h;
+ rkn.do_step( make_pair( boost::bind( &harm_osc::f1 , h , _1 , _2 ) , boost::bind( &harm_osc::f2 , h , _1 , _2 ) ) ,
+ x , t , dt );
+ //]
+ }
+
+ // Simplified harmonic oscillator example
+ {
+ double t = 0.0, dt = 0.1;
+ //[ simplified_symplectic_stepper_example
+ pair< vector_type , vector_type > x;
+ x.first[0] = 1.0; x.second[0] = 0.0;
+ symplectic_rkn_sb3a_mclachlan< vector_type > rkn;
+ rkn.do_step( harm_osc_f1() , x , t , dt );
+ //]
+
+ vector_type q = {{ 1.0 }} , p = {{ 0.0 }};
+ //[ symplectic_stepper_detail_ref_usage
+ rkn.do_step( harm_osc_f1() , make_pair( boost::ref( q ) , boost::ref( p ) ) , t , dt );
+ rkn.do_step( harm_osc_f1() , q , p , t , dt );
+ rkn.do_step( make_pair( harm_osc_f1() , harm_osc_f2() ) , q , p , t , dt );
+ //]
+ }
+
+ // adams_bashforth_moulton stepper example
+ {
+ double t = 0.0 , dt = 0.1;
+ state_type inout;
+ //[ multistep_detail_example
+ adams_bashforth_moulton< 5 , state_type > abm;
+ abm.initialize( sys , inout , t , dt );
+ abm.do_step( sys , inout , t , dt );
+ //]
+
+ //[ multistep_detail_own_stepper_initialization
+ abm.initialize( runge_kutta_fehlberg78< state_type >() , sys , inout , t , dt );
+ //]
+ }
+
+
+
+ // dense output stepper examples
+ {
+ double t = 0.0 , dt = 0.1;
+ state_type in;
+ //[ dense_output_detail_example
+ dense_output_runge_kutta< controlled_runge_kutta< runge_kutta_dopri5< state_type > > > dense;
+ dense.initialize( in , t , dt );
+ pair< double , double > times = dense.do_step( sys );
+ //]
+
+ state_type inout;
+ double t_start = 0.0 , t_end = 1.0;
+ //[ dense_output_detail_generation1
+ typedef boost::numeric::odeint::result_of::make_dense_output<
+ runge_kutta_dopri5< state_type > >::type dense_stepper_type;
+ dense_stepper_type dense2 = make_dense_output( 1.0e-6 , 1.0e-6 , runge_kutta_dopri5< state_type >() );
+ //]
+
+ //[ dense_output_detail_generation2
+ integrate_const( make_dense_output( 1.0e-6 , 1.0e-6 , runge_kutta_dopri5< state_type >() ) , sys , inout , t_start , t_end , dt );
+ //]
+ }
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/stiff_system.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/stiff_system.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,117 @@
+/*
+ * rosenbrock4.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+#include <iostream>
+#include <fstream>
+#include <utility>
+
+#include <boost/numeric/odeint.hpp>
+
+#include <boost/phoenix/core.hpp>
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+namespace phoenix = boost::phoenix;
+
+
+
+//[ stiff_system_definition
+typedef boost::numeric::ublas::vector< double > vector_type;
+typedef boost::numeric::ublas::matrix< double > matrix_type;
+
+struct stiff_system
+{
+ void operator()( const vector_type &x , vector_type &dxdt , double /* t */ )
+ {
+ dxdt[ 0 ] = -101.0 * x[ 0 ] - 100.0 * x[ 1 ];
+ dxdt[ 1 ] = x[ 0 ];
+ }
+};
+
+struct stiff_system_jacobi
+{
+ void operator()( const vector_type & /* x */ , matrix_type &J , const double & /* t */ , vector_type &dfdt )
+ {
+ J( 0 , 0 ) = -101.0;
+ J( 0 , 1 ) = -100.0;
+ J( 1 , 0 ) = 1.0;
+ J( 1 , 1 ) = 0.0;
+ dfdt[0] = 0.0;
+ dfdt[1] = 0.0;
+ }
+};
+//]
+
+
+
+/*
+//[ stiff_system_alternative_definition
+typedef boost::numeric::ublas::vector< double > vector_type;
+typedef boost::numeric::ublas::matrix< double > matrix_type;
+
+struct stiff_system
+{
+ template< class State >
+ void operator()( const State &x , State &dxdt , double t )
+ {
+ ...
+ }
+};
+
+struct stiff_system_jacobi
+{
+ template< class State , class Matrix >
+ void operator()( const State &x , Matrix &J , const double &t , State &dfdt )
+ {
+ ...
+ }
+};
+//]
+ */
+
+
+
+int main( int argc , char **argv )
+{
+// typedef rosenbrock4< double > stepper_type;
+// typedef rosenbrock4_controller< stepper_type > controlled_stepper_type;
+// typedef rosenbrock4_dense_output< controlled_stepper_type > dense_output_type;
+ //[ integrate_stiff_system
+ vector_type x( 2 , 1.0 );
+
+ size_t num_of_steps = integrate_const( make_dense_output< rosenbrock4< double > >( 1.0e-6 , 1.0e-6 ) ,
+ make_pair( stiff_system() , stiff_system_jacobi() ) ,
+ x , 0.0 , 50.0 , 0.01 ,
+ cout << phoenix::arg_names::arg2 << " " << phoenix::arg_names::arg1[0] << "\n" );
+ //]
+ clog << num_of_steps << endl;
+
+
+
+// typedef runge_kutta_dopri5< vector_type > dopri5_type;
+// typedef controlled_runge_kutta< dopri5_type > controlled_dopri5_type;
+// typedef dense_output_runge_kutta< controlled_dopri5_type > dense_output_dopri5_type;
+ //[ integrate_stiff_system_alternative
+
+ vector_type x2( 2 , 1.0 );
+
+ size_t num_of_steps2 = integrate_const( make_dense_output< runge_kutta_dopri5< vector_type > >( 1.0e-6 , 1.0e-6 ) ,
+ stiff_system() , x2 , 0.0 , 50.0 , 0.01 ,
+ cout << phoenix::arg_names::arg2 << " " << phoenix::arg_names::arg1[0] << "\n" );
+ //]
+ clog << num_of_steps2 << endl;
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/stochastic_euler.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/stochastic_euler.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,146 @@
+/*
+ libs/numeric/odeint/examples/stochastic_euler.hpp
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 Mario Mulansky
+
+ Stochastic euler stepper example and Ornstein-Uhlenbeck process
+
+ 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)
+ */
+
+
+#include <vector>
+#include <iostream>
+#include <boost/random.hpp>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+
+/*
+//[ stochastic_euler_class_definition
+template< size_t N > class stochastic_euler
+{
+public:
+
+ typedef boost::array< double , N > state_type;
+ typedef boost::array< double , N > deriv_type;
+ typedef double value_type;
+ typedef double time_type;
+ typedef unsigned short order_type;
+ typedef boost::numeric::odeint::stepper_tag stepper_category;
+
+ static order_type order( void ) { return 1; }
+
+ // ...
+};
+//]
+*/
+
+
+/*
+//[ stochastic_euler_do_step
+template< size_t N > class stochastic_euler
+{
+public:
+
+ // ...
+
+ template< class System >
+ void do_step( System system , state_type &x , time_type t , time_type dt ) const
+ {
+ deriv_type det , stoch ;
+ system.first( x , det );
+ system.second( x , stoch );
+ for( size_t i=0 ; i<x.size() ; ++i )
+ x[i] += dt * det[i] + sqrt( dt ) * stoch[i];
+ }
+};
+//]
+*/
+
+
+
+
+//[ stochastic_euler_class
+template< size_t N >
+class stochastic_euler
+{
+public:
+
+ typedef boost::array< double , N > state_type;
+ typedef boost::array< double , N > deriv_type;
+ typedef double value_type;
+ typedef double time_type;
+ typedef unsigned short order_type;
+
+ typedef boost::numeric::odeint::stepper_tag stepper_category;
+
+ static order_type order( void ) { return 1; }
+
+ template< class System >
+ void do_step( System system , state_type &x , time_type t , time_type dt ) const
+ {
+ deriv_type det , stoch ;
+ system.first( x , det );
+ system.second( x , stoch );
+ for( size_t i=0 ; i<x.size() ; ++i )
+ x[i] += dt * det[i] + sqrt( dt ) * stoch[i];
+ }
+};
+//]
+
+
+
+//[ stochastic_euler_ornstein_uhlenbeck_def
+const static size_t N = 1;
+typedef boost::array< double , N > state_type;
+
+struct ornstein_det
+{
+ void operator()( const state_type &x , state_type &dxdt ) const
+ {
+ dxdt[0] = -x[0];
+ }
+};
+
+struct ornstein_stoch
+{
+ boost::mt19937 m_rng;
+ boost::normal_distribution<> m_dist;
+
+ ornstein_stoch( double sigma ) : m_rng() , m_dist( 0.0 , sigma ) { }
+
+ void operator()( const state_type &x , state_type &dxdt )
+ {
+ dxdt[0] = m_dist( m_rng );
+ }
+};
+//]
+
+struct streaming_observer
+{
+ template< class State >
+ void operator()( const State &x , double t ) const
+ {
+ std::cout << t << "\t" << x[0] << "\n";
+ }
+};
+
+
+int main( int argc , char **argv )
+{
+ using namespace std;
+ using namespace boost::numeric::odeint;
+
+ //[ ornstein_uhlenbeck_main
+ double dt = 0.1;
+ state_type x = {{ 1.0 }};
+ integrate_const( stochastic_euler< N >() , make_pair( ornstein_det() , ornstein_stoch( 1.0 ) ) ,
+ x , 0.0 , 10.0 , dt , streaming_observer() );
+ //]
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/stuart_landau.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/stuart_landau.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,87 @@
+/*
+ * stuart_landau.cpp
+ *
+ * This example demonstrates how one can use odeint can be used with state types consisting of complex variables.
+ *
+ * Copyright 2009-2012 Karsten Ahnert and 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)
+ */
+
+#include <iostream>
+#include <complex>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//[ stuart_landau_system_function
+typedef complex< double > state_type;
+
+struct stuart_landau
+{
+ double m_eta;
+ double m_alpha;
+
+ stuart_landau( double eta = 1.0 , double alpha = 1.0 )
+ : m_eta( eta ) , m_alpha( alpha ) { }
+
+ void operator()( const state_type &x , state_type &dxdt , double t ) const
+ {
+ const complex< double > I( 0.0 , 1.0 );
+ dxdt = ( 1.0 + m_eta * I ) * x - ( 1.0 + m_alpha * I ) * norm( x ) * x;
+ }
+};
+//]
+
+
+/*
+//[ stuart_landau_system_function_alternative
+double eta = 1.0;
+double alpha = 1.0;
+
+void stuart_landau( const state_type &x , state_type &dxdt , double t )
+{
+ const complex< double > I( 0.0 , 1.0 );
+ dxdt[0] = ( 1.0 + m_eta * I ) * x[0] - ( 1.0 + m_alpha * I ) * norm( x[0] ) * x[0];
+}
+//]
+*/
+
+
+struct streaming_observer
+{
+ std::ostream& m_out;
+
+ streaming_observer( std::ostream &out ) : m_out( out ) { }
+
+ template< class State >
+ void operator()( const State &x , double t ) const
+ {
+ m_out << t;
+ m_out << "\t" << x.real() << "\t" << x.imag() ;
+ m_out << "\n";
+ }
+};
+
+
+
+
+int main( int argc , char **argv )
+{
+ //[ stuart_landau_integration
+ state_type x = complex< double >( 1.0 , 0.0 );
+
+ const double dt = 0.1;
+
+ typedef runge_kutta4< state_type , double , state_type , double ,
+ vector_space_algebra > stepper_type;
+
+ integrate_const( stepper_type() , stuart_landau( 2.0 , 1.0 ) , x , 0.0 , 10.0 , dt , streaming_observer( cout ) );
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/thrust/Makefile
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/thrust/Makefile 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,66 @@
+# Copyright 2009-2012 Karsten Ahnert
+# Copyright 2009-2012 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)
+
+
+
+# CUDA_ROOT = /home/karsten/boost/cuda4.1/cuda/
+CUDA_ROOT = /usr/local/cuda
+ARCH = sm_13
+
+CC = gcc-4.4
+CXX = gcc-4.4
+NVCC = $(CUDA_ROOT)/bin/nvcc
+# NVCC = g++
+
+INCLUDES += -I$(BOOST_ROOT) -I$(THRUST_ROOT) -I$(CUDA_ROOT)/include -I../../../../..
+
+NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) --compiler-bindir=/usr/bin/g++-4.4 -Xcompiler -fopenmp -DTHRUST_DEVICE_BACKEND=THRUST_DEVICE_BACKEND_OMP
+# NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) --compiler-bindir=/usr/bin/g++-4.3 -Xcompiler -fopenmp -DTHRUST_DEVICE_BACKEND=THRUST_DEVICE_BACKEND_OMP
+
+# NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) --compiler-bindir=/usr/bin/g++-4.3
+
+#--compiler-bindir=/usr/bin/g++-4.4
+#-Xcompiler -fopenmp -DTHRUST_DEVICE_BACKEND=THRUST_DEVICE_BACKEND_OMP
+# NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) --compiler-bindir=/usr/bin/g++-4.3
+#-Xcompiler -fopenmp -DTHRUST_DEVICE_BACKEND=THRUST_DEVICE_BACKEND_OMP
+
+
+LDLIBS = -lcudart -lgomp
+LDFLAGS = -L$(CUDA_ROOT)/lib64
+
+%.co : %.cu
+ $(NVCC) $(NVCCFLAGS) -c $< -o $@
+
+
+all : phase_oscillator_chain phase_oscillator_ensemble lorenz_parameters relaxation
+
+
+phase_oscillator_chain.co : phase_oscillator_chain.cu
+phase_oscillator_chain : phase_oscillator_chain.co
+ $(CC) -o phase_oscillator_chain $(LDFLAGS) $(LDLIBS) phase_oscillator_chain.co
+
+
+
+phase_oscillator_ensemble.co : phase_oscillator_ensemble.cu
+phase_oscillator_ensemble : phase_oscillator_ensemble.co
+ $(CC) -o phase_oscillator_ensemble $(LDFLAGS) $(LDLIBS) phase_oscillator_ensemble.co
+
+
+
+lorenz_parameters : lorenz_parameters.co
+ $(CC) -o lorenz_parameters $(LDFLAGS) $(LDLIBS) lorenz_parameters.co
+lorenz_parameters.co : lorenz_parameters.cu
+
+
+relaxation : relaxation.co
+ $(CC) -o relaxation $(LDFLAGS) $(LDLIBS) relaxation.co
+relaxation.co : relaxation.cu
+
+
+
+clean :
+ -rm *~ *.o *.co phase_oscillator_chain phase_oscillator_ensemble lorenz_parameters relaxation

Added: trunk/libs/numeric/odeint/examples/thrust/lorenz_parameters.cu
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/thrust/lorenz_parameters.cu 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,299 @@
+ /*
+ * phase_oscillator_ensemble.cu
+ *
+ * The example how the phase_oscillator ensemble can be implemented using CUDA and thrust
+ *
+ * Created on: July 15, 2011
+ * Author: karsten
+ */
+
+
+#include <iostream>
+#include <cmath>
+#include <utility>
+
+
+#include <thrust/device_vector.h>
+#include <thrust/reduce.h>
+#include <thrust/functional.h>
+
+#include <boost/numeric/odeint.hpp>
+
+#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp>
+
+#include <boost/random/mersenne_twister.hpp>
+#include <boost/random/uniform_real.hpp>
+#include <boost/random/variate_generator.hpp>
+
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//change this to float if your device does not support double computation
+typedef double value_type;
+
+//change this to host_vector< ... > of you want to run on CPU
+typedef thrust::device_vector< value_type > state_type;
+typedef thrust::device_vector< size_t > index_vector_type;
+// typedef thrust::host_vector< value_type > state_type;
+// typedef thrust::host_vector< size_t > index_vector_type;
+
+
+const value_type sigma = 10.0;
+const value_type b = 8.0 / 3.0;
+
+
+//[ thrust_lorenz_parameters_define_simple_system
+struct lorenz_system
+{
+ struct lorenz_functor
+ {
+ template< class T >
+ __host__ __device__
+ void operator()( T t ) const
+ {
+ // unpack the parameter we want to vary and the Lorenz variables
+ value_type R = thrust::get< 3 >( t );
+ value_type x = thrust::get< 0 >( t );
+ value_type y = thrust::get< 1 >( t );
+ value_type z = thrust::get< 2 >( t );
+ thrust::get< 4 >( t ) = sigma * ( y - x );
+ thrust::get< 5 >( t ) = R * x - y - x * z;
+ thrust::get< 6 >( t ) = -b * z + x * y ;
+
+ }
+ };
+
+ lorenz_system( size_t N , const state_type &beta )
+ : m_N( N ) , m_beta( beta ) { }
+
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , value_type t ) const
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( x ) ,
+ boost::begin( x ) + m_N ,
+ boost::begin( x ) + 2 * m_N ,
+ m_beta.begin() ,
+ boost::begin( dxdt ) ,
+ boost::begin( dxdt ) + m_N ,
+ boost::begin( dxdt ) + 2 * m_N ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( x ) + m_N ,
+ boost::begin( x ) + 2 * m_N ,
+ boost::begin( x ) + 3 * m_N ,
+ m_beta.begin() ,
+ boost::begin( dxdt ) + m_N ,
+ boost::begin( dxdt ) + 2 * m_N ,
+ boost::begin( dxdt ) + 3 * m_N ) ) ,
+ lorenz_functor() );
+ }
+ size_t m_N;
+ const state_type &m_beta;
+};
+//]
+
+struct lorenz_perturbation_system
+{
+ struct lorenz_perturbation_functor
+ {
+ template< class T >
+ __host__ __device__
+ void operator()( T t ) const
+ {
+ value_type R = thrust::get< 1 >( t );
+ value_type x = thrust::get< 0 >( thrust::get< 0 >( t ) );
+ value_type y = thrust::get< 1 >( thrust::get< 0 >( t ) );
+ value_type z = thrust::get< 2 >( thrust::get< 0 >( t ) );
+ value_type dx = thrust::get< 3 >( thrust::get< 0 >( t ) );
+ value_type dy = thrust::get< 4 >( thrust::get< 0 >( t ) );
+ value_type dz = thrust::get< 5 >( thrust::get< 0 >( t ) );
+ thrust::get< 0 >( thrust::get< 2 >( t ) ) = sigma * ( y - x );
+ thrust::get< 1 >( thrust::get< 2 >( t ) ) = R * x - y - x * z;
+ thrust::get< 2 >( thrust::get< 2 >( t ) ) = -b * z + x * y ;
+ thrust::get< 3 >( thrust::get< 2 >( t ) ) = sigma * ( dy - dx );
+ thrust::get< 4 >( thrust::get< 2 >( t ) ) = ( R - z ) * dx - dy - x * dz;
+ thrust::get< 5 >( thrust::get< 2 >( t ) ) = y * dx + x * dy - b * dz;
+ }
+ };
+
+ lorenz_perturbation_system( size_t N , const state_type &beta )
+ : m_N( N ) , m_beta( beta ) { }
+
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , value_type t ) const
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple(
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( x ) ,
+ boost::begin( x ) + m_N ,
+ boost::begin( x ) + 2 * m_N ,
+ boost::begin( x ) + 3 * m_N ,
+ boost::begin( x ) + 4 * m_N ,
+ boost::begin( x ) + 5 * m_N ) ) ,
+ m_beta.begin() ,
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( dxdt ) ,
+ boost::begin( dxdt ) + m_N ,
+ boost::begin( dxdt ) + 2 * m_N ,
+ boost::begin( dxdt ) + 3 * m_N ,
+ boost::begin( dxdt ) + 4 * m_N ,
+ boost::begin( dxdt ) + 5 * m_N ) )
+ ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple(
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( x ) + m_N ,
+ boost::begin( x ) + 2 * m_N ,
+ boost::begin( x ) + 3 * m_N ,
+ boost::begin( x ) + 4 * m_N ,
+ boost::begin( x ) + 5 * m_N ,
+ boost::begin( x ) + 6 * m_N ) ) ,
+ m_beta.begin() ,
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( dxdt ) + m_N ,
+ boost::begin( dxdt ) + 2 * m_N ,
+ boost::begin( dxdt ) + 3 * m_N ,
+ boost::begin( dxdt ) + 4 * m_N ,
+ boost::begin( dxdt ) + 5 * m_N ,
+ boost::begin( dxdt ) + 6 * m_N ) )
+ ) ) ,
+ lorenz_perturbation_functor() );
+ }
+
+ size_t m_N;
+ const state_type &m_beta;
+};
+
+struct lyap_observer
+{
+ //[thrust_lorenz_parameters_observer_functor
+ struct lyap_functor
+ {
+ template< class T >
+ __host__ __device__
+ void operator()( T t ) const
+ {
+ value_type &dx = thrust::get< 0 >( t );
+ value_type &dy = thrust::get< 1 >( t );
+ value_type &dz = thrust::get< 2 >( t );
+ value_type norm = sqrt( dx * dx + dy * dy + dz * dz );
+ dx /= norm;
+ dy /= norm;
+ dz /= norm;
+ thrust::get< 3 >( t ) += log( norm );
+ }
+ };
+ //]
+
+ lyap_observer( size_t N , size_t every = 100 )
+ : m_N( N ) , m_lyap( N ) , m_every( every ) , m_count( 0 )
+ {
+ thrust::fill( m_lyap.begin() , m_lyap.end() , 0.0 );
+ }
+
+ template< class Lyap >
+ void fill_lyap( Lyap &lyap )
+ {
+ thrust::copy( m_lyap.begin() , m_lyap.end() , lyap.begin() );
+ for( size_t i=0 ; i<lyap.size() ; ++i )
+ lyap[i] /= m_t_overall;
+ }
+
+
+ template< class State >
+ void operator()( State &x , value_type t )
+ {
+ if( ( m_count != 0 ) && ( ( m_count % m_every ) == 0 ) )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( x ) + 3 * m_N ,
+ boost::begin( x ) + 4 * m_N ,
+ boost::begin( x ) + 5 * m_N ,
+ m_lyap.begin() ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple(
+ boost::begin( x ) + 4 * m_N ,
+ boost::begin( x ) + 5 * m_N ,
+ boost::begin( x ) + 6 * m_N ,
+ m_lyap.end() ) ) ,
+ lyap_functor() );
+ clog << t << "\n";
+ }
+ ++m_count;
+ m_t_overall = t;
+ }
+
+ size_t m_N;
+ state_type m_lyap;
+ size_t m_every;
+ size_t m_count;
+ value_type m_t_overall;
+};
+
+const size_t N = 1024*2;
+const value_type dt = 0.01;
+
+
+int main( int arc , char* argv[] )
+{
+ int driver_version , runtime_version;
+ cudaDriverGetVersion( &driver_version );
+ cudaRuntimeGetVersion ( &runtime_version );
+ cout << driver_version << "\t" << runtime_version << endl;
+
+
+ //[ thrust_lorenz_parameters_define_beta
+ vector< value_type > beta_host( N );
+ const value_type beta_min = 0.0 , beta_max = 56.0;
+ for( size_t i=0 ; i<N ; ++i )
+ beta_host[i] = beta_min + value_type( i ) * ( beta_max - beta_min ) / value_type( N - 1 );
+
+ state_type beta = beta_host;
+ //]
+
+ //[ thrust_lorenz_parameters_integration
+ state_type x( 6 * N );
+
+ // initialize x,y,z
+ thrust::fill( x.begin() , x.begin() + 3 * N , 10.0 );
+
+ // initial dx
+ thrust::fill( x.begin() + 3 * N , x.begin() + 4 * N , 1.0 );
+
+ // initialize dy,dz
+ thrust::fill( x.begin() + 4 * N , x.end() , 0.0 );
+
+
+ // create error stepper, can be used with make_controlled or make_dense_output
+ typedef runge_kutta_dopri5< state_type , value_type , state_type , value_type , thrust_algebra , thrust_operations > stepper_type;
+
+
+ lorenz_system lorenz( N , beta );
+ lorenz_perturbation_system lorenz_perturbation( N , beta );
+ lyap_observer obs( N , 1 );
+
+ // calculate transients
+ integrate_adaptive( make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() ) , lorenz , std::make_pair( x.begin() , x.begin() + 3 * N ) , 0.0 , 10.0 , dt );
+
+ // calculate the Lyapunov exponents -- the main loop
+ double t = 0.0;
+ while( t < 10000.0 )
+ {
+ integrate_adaptive( make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() ) , lorenz_perturbation , x , t , t + 1.0 , 0.1 );
+ t += 1.0;
+ obs( x , t );
+ }
+
+ vector< value_type > lyap( N );
+ obs.fill_lyap( lyap );
+
+ for( size_t i=0 ; i<N ; ++i )
+ cout << beta_host[i] << "\t" << lyap[i] << "\n";
+ //]
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,156 @@
+/*
+ * phase_osc_chain.cu
+ *
+ * Created on: Apr 1, 2011
+ * Author: mario
+ */
+
+/*
+ * This example shows how to use odeint on CUDA devices with thrust.
+ * Note that we require at least Version 3.2 of the nVidia CUDA SDK
+ * and the thrust library should be installed in the CUDA include
+ * folder.
+ *
+ * As example we use a chain of phase oscillators with nearest neighbour
+ * coupling, as described in:
+ *
+ * Avis H. Cohen, Philip J. Holmes and Richard H. Rand:
+ * JOURNAL OF MATHEMATICAL BIOLOGY Volume 13, Number 3, 345-369,
+ *
+ */
+
+#include <iostream>
+#include <cmath>
+
+#include <thrust/device_vector.h>
+#include <thrust/iterator/permutation_iterator.h>
+#include <thrust/iterator/counting_iterator.h>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/integrate/integrate_const.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp>
+
+using namespace std;
+
+using namespace boost::numeric::odeint;
+
+
+//change this to float if your device does not support double computation
+typedef double value_type;
+
+
+//[ thrust_phase_chain_system
+//change this to host_vector< ... > if you want to run on CPU
+typedef thrust::device_vector< value_type > state_type;
+typedef thrust::device_vector< size_t > index_vector_type;
+//typedef thrust::host_vector< value_type > state_type;
+//typedef thrust::host_vector< size_t > index_vector_type;
+
+//<-
+/*
+ * This implements the rhs of the dynamical equation:
+ * \phi'_0 = \omega_0 + sin( \phi_1 - \phi_0 )
+ * \phi'_i = \omega_i + sin( \phi_i+1 - \phi_i ) + sin( \phi_i - \phi_i-1 )
+ * \phi'_N-1 = \omega_N-1 + sin( \phi_N-1 - \phi_N-2 )
+ */
+//->
+class phase_oscillators
+{
+
+public:
+
+ struct sys_functor
+ {
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t ) // this functor works on tuples of values
+ {
+ // first, unpack the tuple into value, neighbors and omega
+ const value_type phi = thrust::get<0>(t);
+ const value_type phi_left = thrust::get<1>(t); // left neighbor
+ const value_type phi_right = thrust::get<2>(t); // right neighbor
+ const value_type omega = thrust::get<3>(t);
+ // the dynamical equation
+ thrust::get<4>(t) = omega + sin( phi_right - phi ) + sin( phi - phi_left );
+ }
+ };
+
+ phase_oscillators( const state_type &omega )
+ : m_omega( omega ) , m_N( omega.size() ) , m_prev( omega.size() ) , m_next( omega.size() )
+ {
+ // build indices pointing to left and right neighbours
+ thrust::counting_iterator<size_t> c( 0 );
+ thrust::copy( c , c+m_N-1 , m_prev.begin()+1 );
+ m_prev[0] = 0; // m_prev = { 0 , 0 , 1 , 2 , 3 , ... , N-1 }
+
+ thrust::copy( c+1 , c+m_N , m_next.begin() );
+ m_next[m_N-1] = m_N-1; // m_next = { 1 , 2 , 3 , ... , N-1 , N-1 }
+ }
+
+ void operator() ( const state_type &x , state_type &dxdt , const value_type dt )
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator(
+ thrust::make_tuple(
+ x.begin() ,
+ thrust::make_permutation_iterator( x.begin() , m_prev.begin() ) ,
+ thrust::make_permutation_iterator( x.begin() , m_next.begin() ) ,
+ m_omega.begin() ,
+ dxdt.begin()
+ ) ),
+ thrust::make_zip_iterator(
+ thrust::make_tuple(
+ x.end() ,
+ thrust::make_permutation_iterator( x.begin() , m_prev.end() ) ,
+ thrust::make_permutation_iterator( x.begin() , m_next.end() ) ,
+ m_omega.end() ,
+ dxdt.end()) ) ,
+ sys_functor()
+ );
+ }
+
+private:
+
+ const state_type &m_omega;
+ const size_t m_N;
+ index_vector_type m_prev;
+ index_vector_type m_next;
+};
+//]
+
+const size_t N = 32768;
+const value_type pi = 3.1415926535897932384626433832795029;
+const value_type epsilon = 6.0 / ( N * N ); // should be < 8/N^2 to see phase locking
+const value_type dt = 0.1;
+
+int main( int arc , char* argv[] )
+{
+ //[ thrust_phase_chain_integration
+ // create initial conditions and omegas on host:
+ vector< value_type > x_host( N );
+ vector< value_type > omega_host( N );
+ for( size_t i=0 ; i<N ; ++i )
+ {
+ x_host[i] = 2.0 * pi * drand48();
+ omega_host[i] = ( N - i ) * epsilon; // decreasing frequencies
+ }
+
+ // copy to device
+ state_type x = x_host;
+ state_type omega = omega_host;
+
+ // create stepper
+ runge_kutta4< state_type , value_type , state_type , value_type , thrust_algebra , thrust_operations > stepper;
+
+ // create phase oscillator system function
+ phase_oscillators sys( omega );
+
+ // integrate
+ integrate_const( stepper , sys , x , 0.0 , 10.0 , dt );
+
+ thrust::copy( x.begin() , x.end() , std::ostream_iterator< value_type >( std::cout , "\n" ) );
+ std::cout << std::endl;
+ //]
+}

Added: trunk/libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,281 @@
+/*
+ * phase_oscillator_ensemble.cu
+ *
+ * The example how the phase_oscillator ensemble can be implemented using CUDA and thrust
+ *
+ * Created on: July 15, 2011
+ * Author: karsten
+ */
+
+
+#include <iostream>
+#include <fstream>
+#include <cmath>
+#include <utility>
+
+#include <thrust/device_vector.h>
+#include <thrust/reduce.h>
+#include <thrust/functional.h>
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp>
+
+#include <boost/timer.hpp>
+#include <boost/random/cauchy_distribution.hpp>
+
+using namespace std;
+
+using namespace boost::numeric::odeint;
+
+/*
+ * Sorry for that dirty hack, but nvcc has large problems with boost::random.
+ *
+ * Nevertheless we need the cauchy distribution from boost::random, and therefore
+ * we need a generator. Here it is:
+ */
+struct drand48_generator
+{
+ typedef double result_type;
+ result_type operator()( void ) const { return drand48(); }
+ result_type min( void ) const { return 0.0; }
+ result_type max( void ) const { return 1.0; }
+};
+
+//[ thrust_phase_ensemble_state_type
+//change this to float if your device does not support double computation
+typedef double value_type;
+
+//change this to host_vector< ... > of you want to run on CPU
+typedef thrust::device_vector< value_type > state_type;
+// typedef thrust::host_vector< value_type > state_type;
+//]
+
+
+//[ thrust_phase_ensemble_mean_field_calculator
+struct mean_field_calculator
+{
+ struct sin_functor : public thrust::unary_function< value_type , value_type >
+ {
+ __host__ __device__
+ value_type operator()( value_type x) const
+ {
+ return sin( x );
+ }
+ };
+
+ struct cos_functor : public thrust::unary_function< value_type , value_type >
+ {
+ __host__ __device__
+ value_type operator()( value_type x) const
+ {
+ return cos( x );
+ }
+ };
+
+ static std::pair< value_type , value_type > get_mean( const state_type &x )
+ {
+ //[ thrust_phase_ensemble_sin_sum
+ value_type sin_sum = thrust::reduce(
+ thrust::make_transform_iterator( x.begin() , sin_functor() ) ,
+ thrust::make_transform_iterator( x.end() , sin_functor() ) );
+ //]
+ value_type cos_sum = thrust::reduce(
+ thrust::make_transform_iterator( x.begin() , cos_functor() ) ,
+ thrust::make_transform_iterator( x.end() , cos_functor() ) );
+
+ cos_sum /= value_type( x.size() );
+ sin_sum /= value_type( x.size() );
+
+ value_type K = sqrt( cos_sum * cos_sum + sin_sum * sin_sum );
+ value_type Theta = atan2( sin_sum , cos_sum );
+
+ return std::make_pair( K , Theta );
+ }
+};
+//]
+
+
+
+//[ thrust_phase_ensemble_sys_function
+class phase_oscillator_ensemble
+{
+
+public:
+
+ struct sys_functor
+ {
+ value_type m_K , m_Theta , m_epsilon;
+
+ sys_functor( value_type K , value_type Theta , value_type epsilon )
+ : m_K( K ) , m_Theta( Theta ) , m_epsilon( epsilon ) { }
+
+ template< class Tuple >
+ __host__ __device__
+ void operator()( Tuple t )
+ {
+ thrust::get<2>(t) = thrust::get<1>(t) + m_epsilon * m_K * sin( m_Theta - thrust::get<0>(t) );
+ }
+ };
+
+ // ...
+ //<-
+ phase_oscillator_ensemble( size_t N , value_type g = 1.0 , value_type epsilon = 1.0 )
+ : m_omega() , m_N( N ) , m_epsilon( epsilon )
+ {
+ create_frequencies( g );
+ }
+
+ void create_frequencies( value_type g )
+ {
+ boost::cauchy_distribution< value_type > cauchy( 0.0 , g );
+// boost::variate_generator< boost::mt19937&, boost::cauchy_distribution< value_type > > gen( rng , cauchy );
+ drand48_generator d48;
+ vector< value_type > omega( m_N );
+ for( size_t i=0 ; i<m_N ; ++i )
+ omega[i] = cauchy( d48 );
+// generate( omega.begin() , omega.end() , gen );
+ m_omega = omega;
+ }
+
+ void set_epsilon( value_type epsilon ) { m_epsilon = epsilon; }
+
+ value_type get_epsilon( void ) const { return m_epsilon; }
+ //->
+
+ void operator() ( const state_type &x , state_type &dxdt , const value_type dt ) const
+ {
+ std::pair< value_type , value_type > mean_field = mean_field_calculator::get_mean( x );
+
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( x.begin() , m_omega.begin() , dxdt.begin() ) ),
+ thrust::make_zip_iterator( thrust::make_tuple( x.end() , m_omega.end() , dxdt.end()) ) ,
+ sys_functor( mean_field.first , mean_field.second , m_epsilon )
+ );
+ }
+
+ // ...
+ //<-
+private:
+
+ state_type m_omega;
+ const size_t m_N;
+ value_type m_epsilon;
+ //->
+};
+//]
+
+
+//[ thrust_phase_ensemble_observer
+struct statistics_observer
+{
+ value_type m_K_mean;
+ size_t m_count;
+
+ statistics_observer( void )
+ : m_K_mean( 0.0 ) , m_count( 0 ) { }
+
+ template< class State >
+ void operator()( const State &x , value_type t )
+ {
+ std::pair< value_type , value_type > mean = mean_field_calculator::get_mean( x );
+ m_K_mean += mean.first;
+ ++m_count;
+ }
+
+ value_type get_K_mean( void ) const { return ( m_count != 0 ) ? m_K_mean / value_type( m_count ) : 0.0 ; }
+
+ void reset( void ) { m_K_mean = 0.0; m_count = 0; }
+};
+//]
+
+
+
+// const size_t N = 16384 * 128;
+const size_t N = 16384;
+const value_type pi = 3.1415926535897932384626433832795029;
+const value_type dt = 0.1;
+const value_type d_epsilon = 0.1;
+const value_type epsilon_min = 0.0;
+const value_type epsilon_max = 5.0;
+const value_type t_transients = 10.0;
+const value_type t_max = 100.0;
+
+int main( int arc , char* argv[] )
+{
+ // initial conditions on host
+ vector< value_type > x_host( N );
+ for( size_t i=0 ; i<N ; ++i ) x_host[i] = 2.0 * pi * drand48();
+
+ //[ thrust_phase_ensemble_system_instance
+ phase_oscillator_ensemble ensemble( N , 1.0 );
+ //]
+
+
+
+ boost::timer timer;
+ boost::timer timer_local;
+ double dopri5_time = 0.0 , rk4_time = 0.0;
+ {
+ //[thrust_phase_ensemble_define_dopri5
+ typedef runge_kutta_dopri5< state_type , value_type , state_type , value_type , thrust_algebra , thrust_operations > stepper_type;
+ //]
+
+ ofstream fout( "phase_ensemble_dopri5.dat" );
+ timer.restart();
+ for( value_type epsilon = epsilon_min ; epsilon < epsilon_max ; epsilon += d_epsilon )
+ {
+ ensemble.set_epsilon( epsilon );
+ statistics_observer obs;
+ state_type x = x_host;
+
+ timer_local.restart();
+
+ // calculate some transients steps
+ //[ thrust_phase_ensemble_integration
+ size_t steps1 = integrate_const( make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() ) , boost::ref( ensemble ) , x , 0.0 , t_transients , dt );
+ //]
+
+ // integrate and compute the statistics
+ size_t steps2 = integrate_const( make_dense_output( 1.0e-6 , 1.0e-6 , stepper_type() ) , boost::ref( ensemble ) , x , 0.0 , t_max , dt , boost::ref( obs ) );
+
+ fout << epsilon << "\t" << obs.get_K_mean() << endl;
+ cout << "Dopri5 : " << epsilon << "\t" << obs.get_K_mean() << "\t" << timer_local.elapsed() << "\t" << steps1 << "\t" << steps2 << endl;
+ }
+ dopri5_time = timer.elapsed();
+ }
+
+
+
+ {
+ //[ thrust_phase_ensemble_define_rk4
+ typedef runge_kutta4< state_type , value_type , state_type , value_type , thrust_algebra , thrust_operations > stepper_type;
+ //]
+
+ ofstream fout( "phase_ensemble_rk4.dat" );
+ timer.restart();
+ for( value_type epsilon = epsilon_min ; epsilon < epsilon_max ; epsilon += d_epsilon )
+ {
+ ensemble.set_epsilon( epsilon );
+ statistics_observer obs;
+ state_type x = x_host;
+
+ timer_local.restart();
+
+ // calculate some transients steps
+ size_t steps1 = integrate_const( stepper_type() , boost::ref( ensemble ) , x , 0.0 , t_transients , dt );
+
+ // integrate and compute the statistics
+ size_t steps2 = integrate_const( stepper_type() , boost::ref( ensemble ) , x , 0.0 , t_max , dt , boost::ref( obs ) );
+ fout << epsilon << "\t" << obs.get_K_mean() << endl;
+ cout << "RK4 : " << epsilon << "\t" << obs.get_K_mean() << "\t" << timer_local.elapsed() << "\t" << steps1 << "\t" << steps2 << endl;
+ }
+ rk4_time = timer.elapsed();
+ }
+
+ cout << "Dopri 5 : " << dopri5_time << " s\n";
+ cout << "RK4 : " << rk4_time << "\n";
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/thrust/relaxation.cu
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/thrust/relaxation.cu 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,73 @@
+/*
+ * Solves many relaxation equations dxdt = - a * x in parallel and for different values of a.
+ * The relaxation equations are completely uncoupled.
+ */
+
+#include <thrust/device_vector.h>
+
+#include <boost/ref.hpp>
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp>
+
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+// change to float if your GPU does not support doubles
+typedef double value_type;
+typedef thrust::device_vector< value_type > state_type;
+typedef runge_kutta4< state_type , value_type , state_type , value_type , thrust_algebra , thrust_operations > stepper_type;
+
+struct relaxation
+{
+ struct relaxation_functor
+ {
+ template< class T >
+ __host__ __device__
+ void operator()( T t ) const
+ {
+ // unpack the parameter we want to vary and the Lorenz variables
+ value_type a = thrust::get< 1 >( t );
+ value_type x = thrust::get< 0 >( t );
+ thrust::get< 2 >( t ) = -a * x;
+ }
+ };
+
+ relaxation( size_t N , const state_type &a )
+ : m_N( N ) , m_a( a ) { }
+
+ void operator()( const state_type &x , state_type &dxdt , value_type t ) const
+ {
+ thrust::for_each(
+ thrust::make_zip_iterator( thrust::make_tuple( x.begin() , m_a.begin() , dxdt.begin() ) ) ,
+ thrust::make_zip_iterator( thrust::make_tuple( x.end() , m_a.end() , dxdt.end() ) ) ,
+ relaxation_functor() );
+ }
+
+ size_t m_N;
+ const state_type &m_a;
+};
+
+const size_t N = 1024 * 1024;
+const value_type dt = 0.01;
+
+int main( int arc , char* argv[] )
+{
+ // initialize the relaxation constants a
+ vector< value_type > a_host( N );
+ for( size_t i=0 ; i<N ; ++i ) a_host[i] = drand48();
+ state_type a = a_host;
+
+ // initialize the intial state x
+ state_type x( N );
+ thrust::fill( x.begin() , x.end() , 1.0 );
+
+ // integrate
+ relaxation relax( N , a );
+ integrate_const( stepper_type() , boost::ref( relax ) , x , 0.0 , 10.0 , dt );
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,152 @@
+/*
+ * two_dimensional_phase_lattice.cpp
+ *
+ * This example show how one can use matrices as state types in odeint.
+ *
+ * Copyright 2009-2012 Karsten Ahnert and 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)
+ */
+
+#include <iostream>
+#include <map>
+#include <string>
+#include <fstream>
+
+#ifndef M_PI //not there on windows
+#define M_PI 3.1415927 //...
+#endif
+
+#include <boost/numeric/odeint.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+//[ two_dimensional_phase_lattice_definition
+typedef boost::numeric::ublas::matrix< double > state_type;
+
+struct two_dimensional_phase_lattice
+{
+ two_dimensional_phase_lattice( double gamma = 0.5 )
+ : m_gamma( gamma ) { }
+
+ void operator()( const state_type &x , state_type &dxdt , double /* t */ ) const
+ {
+ size_t size1 = x.size1() , size2 = x.size2();
+
+ for( size_t i=1 ; i<size1-1 ; ++i )
+ {
+ for( size_t j=1 ; j<size2-1 ; ++j )
+ {
+ dxdt( i , j ) =
+ coupling_func( x( i + 1 , j ) - x( i , j ) ) +
+ coupling_func( x( i - 1 , j ) - x( i , j ) ) +
+ coupling_func( x( i , j + 1 ) - x( i , j ) ) +
+ coupling_func( x( i , j - 1 ) - x( i , j ) );
+ }
+ }
+
+ for( size_t i=0 ; i<x.size1() ; ++i ) dxdt( i , 0 ) = dxdt( i , x.size2() -1 ) = 0.0;
+ for( size_t j=0 ; j<x.size2() ; ++j ) dxdt( 0 , j ) = dxdt( x.size1() -1 , j ) = 0.0;
+ }
+
+ double coupling_func( double x ) const
+ {
+ return sin( x ) - m_gamma * ( 1.0 - cos( x ) );
+ }
+
+ double m_gamma;
+};
+//]
+
+
+struct write_for_gnuplot
+{
+ size_t m_every , m_count;
+
+ write_for_gnuplot( size_t every = 10 )
+ : m_every( every ) , m_count( 0 ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ if( ( m_count % m_every ) == 0 )
+ {
+ clog << t << endl;
+ cout << "sp '-'" << endl;
+ for( size_t i=0 ; i<x.size1() ; ++i )
+ {
+ for( size_t j=0 ; j<x.size2() ; ++j )
+ {
+ cout << i << "\t" << j << "\t" << sin( x( i , j ) ) << "\n";
+ }
+ cout << "\n";
+ }
+ cout << "e" << endl;
+ }
+
+ ++m_count;
+ }
+};
+
+class write_snapshots
+{
+public:
+
+ typedef std::map< size_t , std::string > map_type;
+
+ write_snapshots( void ) : m_count( 0 ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ map< size_t , string >::const_iterator it = m_snapshots.find( m_count );
+ if( it != m_snapshots.end() )
+ {
+ ofstream fout( it->second.c_str() );
+ for( size_t i=0 ; i<x.size1() ; ++i )
+ {
+ for( size_t j=0 ; j<x.size2() ; ++j )
+ {
+ fout << i << "\t" << j << "\t" << x( i , j ) << "\t" << sin( x( i , j ) ) << "\n";
+ }
+ fout << "\n";
+ }
+ }
+ ++m_count;
+ }
+
+ map_type& snapshots( void ) { return m_snapshots; }
+ const map_type& snapshots( void ) const { return m_snapshots; }
+
+private:
+
+ size_t m_count;
+ map_type m_snapshots;
+};
+
+
+int main( int argc , char **argv )
+{
+ size_t size1 = 128 , size2 = 128;
+ state_type x( size1 , size2 , 0.0 );
+
+ for( size_t i=(size1/2-10) ; i<(size1/2+10) ; ++i )
+ for( size_t j=(size2/2-10) ; j<(size2/2+10) ; ++j )
+ x( i , j ) = static_cast<double>( rand() ) / RAND_MAX * 2.0 * M_PI;
+
+ write_snapshots snapshots;
+ snapshots.snapshots().insert( make_pair( size_t( 0 ) , string( "lat_0000.dat" ) ) );
+ snapshots.snapshots().insert( make_pair( size_t( 100 ) , string( "lat_0100.dat" ) ) );
+ snapshots.snapshots().insert( make_pair( size_t( 1000 ) , string( "lat_1000.dat" ) ) );
+ observer_collection< state_type , double > obs;
+ obs.observers().push_back( write_for_gnuplot( 10 ) );
+ obs.observers().push_back( snapshots );
+
+ cout << "set term x11" << endl;
+ cout << "set pm3d map" << endl;
+ integrate_const( runge_kutta4< state_type >() , two_dimensional_phase_lattice( 1.2 ) ,
+ x , 0.0 , 1001.0 , 0.1 , boost::ref( obs ) );
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/ublas/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/ublas/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,13 @@
+# Copyright 2009 Karsten Ahnert and 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)
+
+
+project
+ : requirements
+ <include>../../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ ;
+
+exe lorenz_ublas : lorenz_ublas.cpp ;

Added: trunk/libs/numeric/odeint/examples/ublas/lorenz_ublas.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/ublas/lorenz_ublas.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+
+#include <boost/numeric/odeint.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+
+/* define ublas::vector<double> as resizeable
+ * this is not neccessarily required because this definition already
+ * exists in util/ublas_wrapper.hpp.
+ * However, for completeness and educational purpose it is repeated here.
+ */
+
+//[ ublas_resizeable
+typedef boost::numeric::ublas::vector< double > state_type;
+
+namespace boost { namespace numeric { namespace odeint {
+
+template<>
+struct is_resizeable< state_type >
+{
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+
+} } }
+//]
+
+void lorenz( const state_type &x , state_type &dxdt , const double t )
+{
+ const double sigma( 10.0 );
+ const double R( 28.0 );
+ const double b( 8.0 / 3.0 );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+}
+
+using namespace boost::numeric::odeint;
+
+//[ublas_main
+int main()
+{
+ state_type x(3);
+ x[0] = 10.0; x[1] = 5.0 ; x[2] = 0.0;
+ typedef runge_kutta4< state_type , double , state_type , double , vector_space_algebra > stepper;
+ integrate_const( stepper() , lorenz , x ,
+ 0.0 , 10.0 , 0.1 );
+}
+//]

Added: trunk/libs/numeric/odeint/examples/van_der_pol_stiff.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/van_der_pol_stiff.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,93 @@
+/*
+ * van_der_pol_stiff.cpp
+ *
+ * Created on: Dec 12, 2011
+ *
+ * Copyright 2011 Rajeev Singh
+ *
+ * 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)
+ */
+
+#include <iostream>
+#include <fstream>
+#include <utility>
+
+#include <boost/numeric/odeint.hpp>
+
+#include <boost/phoenix/core.hpp>
+#include <boost/phoenix/operator.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+namespace phoenix = boost::phoenix;
+
+const double mu = 1000.0;
+
+
+typedef boost::numeric::ublas::vector< double > vector_type;
+typedef boost::numeric::ublas::matrix< double > matrix_type;
+
+struct vdp_stiff
+{
+ void operator()( const vector_type &x , vector_type &dxdt , double t )
+ {
+ dxdt[0] = x[1];
+ dxdt[1] = -x[0] - mu * x[1] * (x[0]*x[0]-1.0);
+ }
+};
+
+struct vdp_stiff_jacobi
+{
+ void operator()( const vector_type &x , matrix_type &J , const double &t , vector_type &dfdt )
+ {
+ J(0, 0) = 0.0;
+ J(0, 1) = 1.0;
+ J(1, 0) = -1.0 - 2.0*mu * x[0] * x[1];
+ J(1, 1) = -mu * ( x[0] * x[0] - 1.0);
+
+ dfdt[0] = 0.0;
+ dfdt[1] = 0.0;
+ }
+};
+
+
+int main( int argc , char **argv )
+{
+ //[ integrate_stiff_system
+ vector_type x( 2 );
+ /* initialize random seed: */
+ srand ( time(NULL) );
+
+ // initial conditions
+ for (int i=0; i<2; i++)
+ x[i] = 1.0; //(1.0 * rand()) / RAND_MAX;
+
+ size_t num_of_steps = integrate_const( make_dense_output< rosenbrock4< double > >( 1.0e-6 , 1.0e-6 ) ,
+ make_pair( vdp_stiff() , vdp_stiff_jacobi() ) ,
+ x , 0.0 , 1000.0 , 1.0
+ , cout << phoenix::arg_names::arg2 << " " << phoenix::arg_names::arg1[0] << " " << phoenix::arg_names::arg1[1] << "\n"
+ );
+ //]
+ clog << num_of_steps << endl;
+
+
+
+ //[ integrate_stiff_system_alternative
+
+ vector_type x2( 2 );
+ // initial conditions
+ for (int i=0; i<2; i++)
+ x2[i] = 1.0; //(1.0 * rand()) / RAND_MAX;
+
+ size_t num_of_steps2 = integrate_const( make_dense_output< runge_kutta_dopri5< vector_type > >( 1.0e-6 , 1.0e-6 ) ,
+ vdp_stiff() , x2 , 0.0 , 1000.0 , 1.0
+ , cout << phoenix::arg_names::arg2 << " " << phoenix::arg_names::arg1[0] << " " << phoenix::arg_names::arg1[1] << "\n"
+ );
+ //]
+ clog << num_of_steps2 << endl;
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/examples/vexcl/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/vexcl/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,31 @@
+# Copyright 2009-2012 Karsten Ahnert
+# Copyright 2009-2012 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)
+
+
+import boost ;
+import os ;
+
+boost.use-project ;
+
+
+# change these lines to fit you configuration
+local HOME = [ os.environ HOME ] ;
+VEXCL_INCLUDE = $(HOME)/boost/vexcl ;
+CUDA_INCLUDE = /usr/local/cuda/include ;
+
+
+lib opencl : : <name>OpenCL ;
+
+project : requirements
+ <library>/boost//headers
+ <include>../../../../..
+ <include>$(VEXCL_INCLUDE)
+ <include>$(CUDA_INCLUDE)
+ <toolset>gcc:<cxxflags>-std=c++0x
+ ;
+
+exe lorenz_ensemble : lorenz_ensemble.cpp opencl ;
\ No newline at end of file

Added: trunk/libs/numeric/odeint/examples/vexcl/lorenz_ensemble.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/examples/vexcl/lorenz_ensemble.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+#include <iostream>
+#include <vector>
+
+#include <vexcl/vexcl.hpp>
+
+#include <boost/numeric/odeint.hpp>
+//[ vexcl_includes
+#include <boost/numeric/odeint/external/vexcl/vexcl_resize.hpp>
+//]
+
+namespace odeint = boost::numeric::odeint;
+
+//[ vexcl_state_types
+typedef vex::vector< double > vector_type;
+typedef vex::multivector< double, 3 > state_type;
+//]
+
+
+//[ vexcl_system
+const double sigma = 10.0;
+const double b = 8.0 / 3.0;
+
+struct sys_func
+{
+ const vector_type &R;
+
+ sys_func( const vector_type &_R ) : R( _R ) { }
+
+ void operator()( const state_type &x , state_type &dxdt , double t ) const
+ {
+ dxdt(0) = -sigma * ( x(0) - x(1) );
+ dxdt(1) = R * x(0) - x(1) - x(0) * x(2);
+ dxdt(2) = - b * x(2) + x(0) * x(1);
+ }
+};
+//]
+
+
+int main( int argc , char **argv )
+{
+ using namespace std;
+ using namespace odeint;
+
+ //[ vexcl_main
+ // setup the opencl context
+ vex::Context ctx( vex::Filter::Type(CL_DEVICE_TYPE_GPU) );
+ std::cout << ctx << std::endl;
+
+ // set up number of system, time step and integration time
+ const size_t n = 1024 * 1024;
+ const double dt = 0.01;
+ const double t_max = 100.0;
+
+ // initialize R
+ double Rmin = 0.1 , Rmax = 50.0 , dR = ( Rmax - Rmin ) / double( n - 1 );
+ std::vector<double> x( n * 3 ) , r( n );
+ for( size_t i=0 ; i<n ; ++i ) r[i] = Rmin + dR * double( i );
+ vector_type R( ctx.queue() , r );
+
+ // initialize the state of the lorenz ensemble
+ state_type X(ctx.queue(), n);
+ X(0) = 10.0;
+ X(1) = 10.0;
+ X(2) = 10.0;
+
+ // create a stepper
+ runge_kutta4<
+ state_type , double , state_type , double ,
+ odeint::vector_space_algebra , odeint::default_operations
+ > stepper;
+
+ // solve the system
+ integrate_const( stepper , sys_func( R ) , X , 0.0 , t_max , dt );
+ //]
+
+ std::vector< double > res( 3 * n );
+ vex::copy( X(0) , res );
+ for( size_t i=0 ; i<n ; ++i )
+ cout << r[i] << "\t" << res[i] << "\t" << "\n";
+}

Added: trunk/libs/numeric/odeint/performance/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,75 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+import os ;
+import modules ;
+import path ;
+
+project
+ : requirements
+ <define>BOOST_ALL_NO_LIB=1
+ <include>../../../..
+ : default-build release
+ ;
+
+
+lib libgsl : : <name>gsl ;
+lib libgslcblas : : <name>gslcblas ;
+
+lib libmkl : : <name>mkl_intel_lp64 <link>shared ;
+lib libmkl_core : : <name>mkl_core <link>shared ;
+lib libmkl_intel_thread : : <name>mkl_intel_thread ;
+lib libiomp5 : : <name>iomp5 ;
+lib libpthread : : <name>pthread ;
+
+exe odeint_rk4_lorenz_array
+ : odeint_rk4_lorenz_array.cpp
+ ;
+
+exe odeint_rk4_lorenz_range
+ : odeint_rk4_lorenz_range.cpp
+ ;
+
+# exe odeint_rk4_lorenz_fusion
+# : odeint_rk4_lorenz_fusion.cpp
+# ;
+
+exe generic_odeint_rk4_lorenz
+ : generic_odeint_rk4_lorenz.cpp
+ : <toolset>intel:<cxxflags>-inline-forceinline
+ ;
+
+exe nr_rk4_lorenz
+ : nr_rk4_lorenz.cpp
+ ;
+
+exe rt_generic_rk4_lorenz
+ : rt_generic_rk4_lorenz.cpp
+ ;
+
+exe gsl_rk4_lorenz
+ : gsl_rk4_lorenz.cpp libgslcblas libgsl
+ ;
+
+exe odeint_rk4_phase_lattice
+ : odeint_rk4_phase_lattice.cpp
+ ;
+
+exe odeint_rk4_phase_lattice_mkl
+ : odeint_rk4_phase_lattice_mkl.cpp libpthread libiomp5 libmkl_core libmkl_intel_thread libmkl
+ ;
+
+exe nr_rk4_phase_lattice
+ : nr_rk4_phase_lattice.cpp
+ ;
+
+exe rt_generic_rk4_phase_lattice
+ : rt_generic_rk4_phase_lattice.cpp
+ ;
+
+
+exe const_step_iterator
+ : const_step_iterator.cpp
+ : <cxxflags>-std=c++0x
+ ;
\ No newline at end of file

Added: trunk/libs/numeric/odeint/performance/const_step_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/const_step_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,164 @@
+/*
+ * odeint_rk4_lorenz.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+#include <algorithm>
+#include <array>
+
+#include <boost/range/algorithm.hpp>
+#include <boost/range/adaptor/filtered.hpp>
+#include <boost/range/numeric.hpp>
+#include <boost/timer.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/generation.hpp>
+#include <boost/numeric/odeint/iterator/const_step_iterator.hpp>
+#include <boost/numeric/odeint/iterator/const_step_time_iterator.hpp>
+#include <boost/numeric/odeint/integrate/integrate_const.hpp>
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+typedef std::array< double , 3 > state_type;
+typedef std::vector< double > state_type2;
+
+std::ostream& operator<<( std::ostream &out , const state_type &x )
+{
+ out << x[0] << "\t" << x[1] << "\t" << x[2];
+ return out;
+}
+
+std::ostream& operator<<( std::ostream &out , const state_type2 &x )
+{
+ if( !x.empty() ) out << x[0];
+ for( size_t i=1 ; i<x.size() ; ++i ) out << "\t" << x[i];
+ return out;
+}
+
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , double t ) const
+ {
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+boost::timer timer;
+
+void test1_iterator( double t_end = 1000000.0 , double dt = 0.01 )
+{
+ cout << "Test 1 Iterator with array : ";
+ timer.restart();
+
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto first = make_const_step_iterator_begin( stepper , lorenz() , x , 0.0 , t_end , dt );
+ auto last = make_const_step_iterator_end( stepper , lorenz() , x );
+ for( ; first != last ; )
+ ++first;
+
+ cout << "\t" << x << " elapsed time : " << timer.elapsed() << " s" << endl;
+}
+
+void test1_time_iterator( double t_end = 1000000.0 , double dt = 0.01 )
+{
+ cout << "Test 1 Time iterator with array : ";
+ timer.restart();
+
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ auto first = make_const_step_time_iterator_begin( stepper , lorenz() , x , 0.0 , t_end , dt );
+ auto last = make_const_step_time_iterator_end( stepper , lorenz() , x );
+ for( ; first != last ; )
+ ++first;
+
+ cout << "\t" << x << " elapsed time : " << timer.elapsed() << " s" << endl;
+}
+
+void test1_integrate( double t_end = 1000000.0 , double dt = 0.01 )
+{
+ cout << "Test 1 Integrate with array : ";
+ timer.restart();
+
+ runge_kutta4< state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ integrate_const( stepper , lorenz() , x , 0.0 , t_end , dt );
+
+ cout << "\t" << x << " elapsed time : " << timer.elapsed() << " s" << endl;
+}
+
+
+
+
+void test2_iterator( double t_end = 1000000.0 , double dt = 0.01 )
+{
+ cout << "Test 2 Iterator with vector : ";
+ timer.restart();
+
+ runge_kutta4< state_type2 > stepper;
+ state_type2 x = { 10.0 , 10.0 , 10.0 };
+ auto first = make_const_step_iterator_begin( stepper , lorenz() , x , 0.0 , t_end , dt );
+ auto last = make_const_step_iterator_end( stepper , lorenz() , x );
+ for( ; first != last ; )
+ ++first;
+
+ cout << "\t" << x << " elapsed time : " << timer.elapsed() << " s" << endl;
+}
+
+void test2_time_iterator( double t_end = 1000000.0 , double dt = 0.01 )
+{
+ cout << "Test 2 Time iterator with vector : ";
+ timer.restart();
+
+ runge_kutta4< state_type2 > stepper;
+ state_type2 x = { 10.0 , 10.0 , 10.0 };
+ auto first = make_const_step_time_iterator_begin( stepper , lorenz() , x , 0.0 , t_end , dt );
+ auto last = make_const_step_time_iterator_end( stepper , lorenz() , x );
+ for( ; first != last ; )
+ ++first;
+
+ cout << "\t" << x << " elapsed time : " << timer.elapsed() << " s" << endl;
+}
+
+void test2_integrate( double t_end = 1000000.0 , double dt = 0.01 )
+{
+ cout << "Test 2 Integrate with vector : ";
+ timer.restart();
+ runge_kutta4< state_type2 > stepper;
+ state_type2 x = { 10.0 , 10.0 , 10.0 };
+ integrate_const( stepper , lorenz() , x , 0.0 , t_end , dt );
+ cout << "\t" << x << " elapsed time : " << timer.elapsed() << " s" << endl;
+}
+
+
+
+int main( int argc , char **argv )
+{
+ test1_iterator( 1000000.0 );
+ test1_time_iterator( 1000000.0 );
+ test1_integrate( 1000000.0 );
+
+ test2_iterator( 1000000.0 );
+ test2_time_iterator( 1000000.0 );
+ test2_integrate( 1000000.0 );
+
+
+
+ return 0;
+}

Added: trunk/libs/numeric/odeint/performance/fusion_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/fusion_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,202 @@
+/*
+ * fusion_algebra.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 FUSION_ALGEBRA_HPP_
+#define FUSION_ALGEBRA_HPP_
+
+#include <boost/array.hpp>
+
+#include <iostream>
+
+
+template< size_t n >
+struct fusion_algebra
+{
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , n > &a ,
+ const boost::array< T , dim > k_vector[n] , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i];// + a[0]*dt*k_vector[0][i];
+ for( size_t j = 0 ; j<n ; ++j )
+ x_tmp[i] += a[j]*dt*k_vector[j][i];
+ }
+ }
+
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp ,
+ const boost::array< double , n > &a ,
+ const boost::array< T , dim > k_vector[n] , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = a[0]*dt*k_vector[0][i];
+ for( size_t j = 1 ; j<n ; ++j )
+ x_tmp[i] += a[j]*dt*k_vector[j][i];
+ }
+ }
+
+};
+
+
+
+
+/** hand-wise implementation for performance improvement for n = 1..4 **/
+
+/* !!!!!!! Actually, this is factor 3 slower with intel compiler, so we don'y use it !!!!!
+ * Update: It increases performance on msvc 9.0 by about 30%, so it is activated for MSVC
+ */
+
+//#ifdef BOOST_MSVC
+
+template<>
+struct fusion_algebra< 1 >
+{
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , 1 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i]
+ + a[0]*dt*k_vector[0][i];
+ }
+ }
+
+};
+
+
+template<>
+struct fusion_algebra< 2 >
+{
+
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , 2 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i]
+ + a[0]*dt*k_vector[0][i]
+ + a[1]*dt*k_vector[1][i];
+ }
+ }
+
+};
+
+
+template<>
+struct fusion_algebra< 3 >
+{
+
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , 3 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i]
+ + a[0]*dt*k_vector[0][i]
+ + a[1]*dt*k_vector[1][i]
+ + a[2]*dt*k_vector[2][i];
+ }
+ }
+
+};
+
+template<>
+struct fusion_algebra< 4 >
+{
+
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , 4 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i]
+ + a[0]*dt*k_vector[0][i]
+ + a[1]*dt*k_vector[1][i]
+ + a[2]*dt*k_vector[2][i]
+ + a[3]*dt*k_vector[3][i];
+ }
+ }
+
+};
+
+template<>
+struct fusion_algebra< 5 >
+{
+
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , 5 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i]
+ + a[0]*dt*k_vector[0][i]
+ + a[1]*dt*k_vector[1][i]
+ + a[2]*dt*k_vector[2][i]
+ + a[3]*dt*k_vector[3][i]
+ + a[4]*dt*k_vector[4][i];
+ }
+ }
+
+};
+
+template<>
+struct fusion_algebra< 6 >
+{
+
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
+ const boost::array< double , 6 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i]
+ + a[0]*dt*k_vector[0][i]
+ + a[1]*dt*k_vector[1][i]
+ + a[2]*dt*k_vector[2][i]
+ + a[3]*dt*k_vector[3][i]
+ + a[4]*dt*k_vector[4][i]
+ + a[5]*dt*k_vector[5][i];
+ }
+ }
+
+ template< typename T , size_t dim >
+ inline static void foreach(boost::array<T , dim> &x_tmp ,
+ const boost::array<double , 6> &a ,
+ const boost::array<T , dim> *k_vector , const double dt)
+ {
+ for (size_t i = 0 ; i < dim ; ++i)
+ {
+ x_tmp[i] = a[0] * dt * k_vector[0][i] + a[1] * dt * k_vector[1][i]
+ + a[2] * dt * k_vector[2][i] + a[3] * dt * k_vector[3][i]
+ + a[4] * dt * k_vector[4][i] + a[5] * dt * k_vector[5][i];
+ }
+ }
+
+};
+
+//#endif /* BOOST_MSVC */
+
+#endif /* FUSION_ALGEBRA_HPP_ */

Added: trunk/libs/numeric/odeint/performance/fusion_explicit_error_rk.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/fusion_explicit_error_rk.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,63 @@
+/*
+ * fusion_explicit_error_rk.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 FUSION_EXPLICIT_ERROR_RK_HPP_
+#define FUSION_EXPLICIT_ERROR_RK_HPP_
+
+#include "fusion_explicit_rk_new.hpp"
+#include "fusion_algebra.hpp"
+
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+
+using namespace std;
+
+template< class StateType , size_t stage_count >
+class explicit_error_rk : public explicit_rk< StateType , stage_count >
+{
+
+public:
+
+ typedef explicit_rk< StateType , stage_count > base;
+
+ typedef StateType state_type;
+
+ typedef typename base::stage_indices stage_indices;
+
+ typedef typename base::coef_a_type coef_a_type;
+
+ typedef typename base::coef_b_type coef_b_type;
+ typedef typename base::coef_c_type coef_c_type;
+
+ public:
+
+ explicit_error_rk( const coef_a_type &a ,
+ const coef_b_type &b ,
+ const coef_b_type &b2 ,
+ const coef_c_type &c )
+ : base( a , b , c ) , m_b2( b2 )
+ { }
+
+ template< class System >
+ void inline do_step( System system , state_type &x , const double t , const double dt , state_type &x_err )
+ {
+ base::do_step( system , x , t , dt );
+ // compute error estimate
+ fusion_algebra< stage_count >::foreach( x_err , m_b2 , base::m_F , dt );
+ }
+
+private:
+
+ const coef_b_type m_b2;
+};
+
+#endif /* FUSION_EXPLICIT_ERROR_RK_HPP_ */

Added: trunk/libs/numeric/odeint/performance/fusion_explicit_rk_new.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/fusion_explicit_rk_new.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,217 @@
+/*
+ * fusion_runge_kutta.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 FUSION_EXPLICIT_RK_HPP_
+#define FUSION_EXPLICIT_RK_HPP_
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/push_back.hpp>
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/size_t.hpp>
+
+#include <boost/fusion/container.hpp>
+#include <boost/fusion/algorithm/iteration.hpp>
+
+#include <boost/array.hpp>
+
+#include "fusion_algebra.hpp"
+//#include "fusion_foreach_performance.hpp"
+
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+
+using namespace std;
+
+struct intermediate_stage {};
+struct last_stage {};
+
+
+
+template< class T , class Constant >
+struct array_wrapper
+{
+ typedef const typename boost::array< T , Constant::value > type;
+};
+
+template< class T , size_t i , class StageCategory >
+struct stage
+{
+ T c;
+ boost::array< T , i > a;
+ typedef StageCategory category;
+};
+
+template< class T , size_t i>
+struct stage< T , i , last_stage >
+{
+ T c;
+ boost::array< T , i > b;
+ typedef last_stage category;
+};
+
+
+
+template< class T , class Constant , class StageCategory >
+struct stage_wrapper
+{
+ typedef stage< T , Constant::value , StageCategory > type;
+};
+
+
+template< class StateType , size_t stage_count >
+class explicit_rk
+{
+
+public:
+
+ typedef StateType state_type;
+
+ typedef mpl::range_c< size_t , 1 , stage_count > stage_indices;
+
+ typedef typename fusion::result_of::as_vector
+ <
+ typename mpl::copy
+ <
+ stage_indices ,
+ mpl::inserter
+ <
+ mpl::vector0< > ,
+ mpl::push_back< mpl::_1 , array_wrapper< double , mpl::_2 > >
+ >
+ >::type
+ >::type coef_a_type;
+
+ typedef boost::array< double , stage_count > coef_b_type;
+ typedef boost::array< double , stage_count > coef_c_type;
+
+ typedef typename fusion::result_of::as_vector
+ <
+ typename mpl::push_back
+ <
+ typename mpl::copy
+ <
+ stage_indices,
+ mpl::inserter
+ <
+ mpl::vector0<> ,
+ mpl::push_back< mpl::_1 , stage_wrapper< double , mpl::_2 , intermediate_stage > >
+ >
+ >::type ,
+ stage< double , stage_count , last_stage >
+ >::type
+ >::type stage_vector_base;
+
+
+ struct stage_vector : public stage_vector_base
+ {
+ struct do_insertion
+ {
+ stage_vector_base &m_base;
+ const coef_a_type &m_a;
+ const coef_c_type &m_c;
+
+ do_insertion( stage_vector_base &base , const coef_a_type &a , const coef_c_type &c )
+ : m_base( base ) , m_a( a ) , m_c( c ) { }
+
+ template< class Index >
+ void operator()( Index ) const
+ {
+ //fusion::at< Index >( m_base ) = stage< double , Index::value+1 , intermediate_stage >( m_c[ Index::value ] , fusion::at< Index >( m_a ) );
+ fusion::at< Index >( m_base ).c = m_c[ Index::value ];
+ fusion::at< Index >( m_base ).a = fusion::at< Index >( m_a );
+ }
+ };
+
+ stage_vector( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c )
+ {
+ typedef mpl::range_c< size_t , 0 , stage_count - 1 > indices;
+ mpl::for_each< indices >( do_insertion( *this , a , c ) );
+ //fusion::at_c< 0 >( fusion::at_c< stage_count - 1 >( *this ) ) = stage_count - 1 ;
+ fusion::at_c< stage_count - 1 >( *this ).c = c[ stage_count - 1 ];
+ fusion::at_c< stage_count - 1 >( *this ).b = b;
+ }
+ };
+
+
+
+ template< class System >
+ struct calculate_stage
+ {
+ System &system;
+ state_type &x , &x_tmp;
+ state_type *F;
+ const double t;
+ const double dt;
+
+ calculate_stage( System &_system , state_type &_x , state_type &_x_tmp , state_type *_F ,
+ const double _t , const double _dt )
+ : system( _system ) , x( _x ) , x_tmp( _x_tmp ) , F( _F ) , t( _t ) , dt( _dt )
+ {}
+
+
+ template< typename T , size_t stage_number >
+ void inline operator()( stage< T , stage_number , intermediate_stage > const &stage ) const
+ //typename stage_fusion_wrapper< T , mpl::size_t< stage_number > , intermediate_stage >::type const &stage ) const
+ {
+ if( stage_number == 1 )
+ system( x , F[stage_number-1] , t + stage.c * dt );
+ else
+ system( x_tmp , F[stage_number-1] , t + stage.c * dt );
+
+ fusion_algebra<stage_number>::foreach( x_tmp , x , stage.a , F , dt);
+ }
+
+
+ template< typename T , size_t stage_number >
+ void inline operator()( stage< T , stage_number , last_stage > const &stage ) const
+ //void operator()( typename stage_fusion_wrapper< T , mpl::size_t< stage_number > , last_stage >::type const &stage ) const
+ {
+ if( stage_number == 1 )
+ system( x , F[stage_number-1] , t + stage.c * dt );
+ else
+ system( x_tmp , F[stage_number-1] , t + stage.c * dt );
+
+ fusion_algebra<stage_number>::foreach( x , x , stage.b , F , dt);
+ }
+
+
+ };
+
+public:
+
+ explicit_rk( const coef_a_type &a ,
+ const coef_b_type &b ,
+ const coef_c_type &c )
+ : m_stages( a , b , c )
+
+ { }
+
+
+ template< class System >
+ void inline do_step( System system , state_type &x , const double t , const double dt )
+ {
+ fusion::for_each( m_stages , calculate_stage< System >( system , x , m_x_tmp , m_F , t , dt ) );
+ }
+
+private:
+
+ stage_vector m_stages;
+ state_type m_x_tmp;
+
+protected:
+ state_type m_F[stage_count];
+
+};
+
+#endif /* FUSION_EXPLICIT_RK_HPP_ */

Added: trunk/libs/numeric/odeint/performance/generic_odeint_rk4_lorenz.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/generic_odeint_rk4_lorenz.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+//#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/array_algebra.hpp>
+
+#include "rk_performance_test_case.hpp"
+
+#include "lorenz.hpp"
+
+using namespace boost::numeric::odeint;
+
+typedef boost::array< double , 3 > state_type;
+
+/*
+typedef explicit_generic_rk< 4 , 4 , state_type , double , state_type , double , array_algebra > rk4_type;
+
+typedef rk4_type::coef_a_type coef_a_type;
+typedef rk4_type::coef_b_type coef_b_type;
+typedef rk4_type::coef_c_type coef_c_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 coef_a_type a = fusion::make_vector( a1 , a2 , a3 );
+const coef_b_type b = {{ 1.0/6 , 1.0/3 , 1.0/3 , 1.0/6 }};
+const coef_c_type c = {{ 0.0 , 0.5 , 0.5 , 1.0 }};
+*/
+
+typedef runge_kutta4< state_type , double , state_type , double , array_algebra > rk4_type;
+
+
+class rk4_wrapper
+{
+
+public:
+
+ rk4_wrapper()
+ // : m_stepper( a , b , c )
+ {}
+
+ void reset_init_cond()
+ {
+ m_x[0] = 10.0 * rand() / RAND_MAX;
+ m_x[1] = 10.0 * rand() / RAND_MAX;
+ m_x[2] = 10.0 * rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( lorenz(), m_x , m_t , dt );
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk4_type m_stepper;
+};
+
+
+
+int main()
+{
+ srand( 12312354 );
+
+ rk4_wrapper stepper;
+
+ run( stepper );
+}

Added: trunk/libs/numeric/odeint/performance/gsl_rk4_lorenz.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/gsl_rk4_lorenz.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,71 @@
+/*
+ * gsl_rk4_lorenz.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <gsl/gsl_odeiv.h>
+
+#include "rk_performance_test_case.hpp"
+
+#include "lorenz_gsl.hpp"
+
+const size_t dim = 3;
+
+class gsl_wrapper
+{
+public:
+
+ gsl_wrapper()
+ {
+ m_s = gsl_odeiv_step_alloc( gsl_odeiv_step_rk4 , dim);
+ m_sys.function = lorenz_gsl;
+ m_sys.jacobian = 0;
+ m_sys.dimension = dim;
+ m_sys.params = 0;
+ }
+
+ void reset_init_cond()
+ {
+ m_x[0] = 10.0 * rand() / RAND_MAX;
+ m_x[1] = 10.0 * rand() / RAND_MAX;
+ m_x[2] = 10.0 * rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ gsl_odeiv_step_apply ( m_s , m_t , dt , m_x , m_x_err , 0 , 0 , &m_sys );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+ ~gsl_wrapper()
+ {
+ gsl_odeiv_step_free( m_s );
+ }
+
+private:
+ double m_x[dim];
+ double m_x_err[dim];
+ double m_t;
+ gsl_odeiv_step *m_s;
+ gsl_odeiv_system m_sys;
+};
+
+
+
+int main()
+{
+ gsl_wrapper stepper;
+
+ run( stepper , 20000000 / 3 , 1E-10 * 3);
+}

Added: trunk/libs/numeric/odeint/performance/lorenz.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/lorenz.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,46 @@
+/*
+ * lorenz.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 LORENZ_HPP_
+#define LORENZ_HPP_
+
+#include <boost/array.hpp>
+
+struct lorenz
+{
+ template< class state_type >
+ void inline operator()( const state_type &x , state_type &dxdt , const double t ) const
+ {
+ const double sigma = 10.0;
+ const double R = 28.0;
+ const double b = 8.0 / 3.0;
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0]*x[1] - b * x[2];
+ }
+};
+
+
+typedef boost::array< double , 3 > state_type;
+
+
+inline void lorenz_func( const state_type &x , state_type &dxdt , const double t )
+{
+ const double sigma = 10.0;
+ const double R = 28.0;
+ const double b = 8.0 / 3.0;
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0]*x[1] - b * x[2];
+}
+
+#endif /* LORENZ_HPP_ */

Added: trunk/libs/numeric/odeint/performance/lorenz_gsl.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/lorenz_gsl.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,30 @@
+/*
+ * lorenz_gsl.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 LORENZ_GSL_HPP_
+#define LORENZ_GSL_HPP_
+
+#include <gsl/gsl_matrix.h>
+
+int lorenz_gsl( const double t , const double y[] , double f[] , void *params)
+{
+ const double sigma = 10.0;
+ const double R = 28.0;
+ const double b = 8.0 / 3.0;
+
+ f[0] = sigma * ( y[1] - y[0] );
+ f[1] = R * y[0] - y[1] - y[0] * y[2];
+ f[2] = y[0]*y[1] - b * y[2];
+ return GSL_SUCCESS;
+}
+
+#endif

Added: trunk/libs/numeric/odeint/performance/nr_rk4_lorenz.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/nr_rk4_lorenz.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,84 @@
+/*
+ * nr_rk4_lorenz.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include "rk_performance_test_case.hpp"
+
+#include "lorenz.hpp"
+
+const size_t dim = 3;
+
+typedef boost::array< double , dim > state_type;
+
+
+template< class System , typename T , size_t dim >
+void rk4_step( const System sys , boost::array< T , dim > &x , const double t , const double dt )
+{ // fast rk4 implementation adapted from the book 'Numerical Recipes'
+ size_t i;
+ const double hh = dt*0.5;
+ const double h6 = dt/6.0;
+ const double th = t+hh;
+ boost::array< T , dim > dydx , dym , dyt , yt;
+
+ sys( x , dydx , t );
+
+ for( i=0 ; i<dim ; i++ )
+ yt[i] = x[i] + hh*dydx[i];
+
+ sys( yt , dyt , th );
+ for( i=0 ; i<dim ; i++ )
+ yt[i] = x[i] + hh*dyt[i];
+
+ sys( yt , dym , th );
+ for( i=0 ; i<dim ; i++ ) {
+ yt[i] = x[i] + dt*dym[i];
+ dym[i] += dyt[i];
+ }
+ sys( yt , dyt , t+dt );
+ for( i=0 ; i<dim ; i++ )
+ x[i] += h6*( dydx[i] + dyt[i] + 2.0*dym[i] );
+}
+
+
+class nr_wrapper
+{
+public:
+ void reset_init_cond()
+ {
+ m_x[0] = 10.0 * rand() / RAND_MAX;
+ m_x[1] = 10.0 * rand() / RAND_MAX;
+ m_x[2] = 10.0 * rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ rk4_step( lorenz() , m_x , m_t , dt );
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+};
+
+
+
+int main()
+{
+ nr_wrapper stepper;
+
+ run( stepper );
+}

Added: trunk/libs/numeric/odeint/performance/nr_rk4_phase_lattice.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/nr_rk4_phase_lattice.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,85 @@
+/*
+ * nr_rk4_phase_lattice.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include "rk_performance_test_case.hpp"
+
+#include "phase_lattice.hpp"
+
+const size_t dim = 1024;
+
+typedef boost::array< double , dim > state_type;
+
+
+template< class System , typename T , size_t dim >
+void rk4_step( const System sys , boost::array< T , dim > &x , const double t , const double dt )
+{ // fast rk4 implementation adapted from the book 'Numerical Recipes'
+ size_t i;
+ const double hh = dt*0.5;
+ const double h6 = dt/6.0;
+ const double th = t+hh;
+ boost::array< T , dim > dydx , dym , dyt , yt;
+
+ sys( x , dydx , t );
+
+ for( i=0 ; i<dim ; i++ )
+ yt[i] = x[i] + hh*dydx[i];
+
+ sys( yt , dyt , th );
+ for( i=0 ; i<dim ; i++ )
+ yt[i] = x[i] + hh*dyt[i];
+
+ sys( yt , dym , th );
+ for( i=0 ; i<dim ; i++ ) {
+ yt[i] = x[i] + dt*dym[i];
+ dym[i] += dyt[i];
+ }
+ sys( yt , dyt , t+dt );
+ for( i=0 ; i<dim ; i++ )
+ x[i] += h6*( dydx[i] + dyt[i] + 2.0*dym[i] );
+}
+
+
+class nr_wrapper
+{
+public:
+ void reset_init_cond()
+ {
+ for( size_t i = 0 ; i<dim ; ++i )
+ m_x[i] = 2.0*3.1415927*rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ rk4_step( phase_lattice<dim>() , m_x , m_t , dt );
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+};
+
+
+
+int main()
+{
+ srand( 12312354 );
+
+ nr_wrapper stepper;
+
+ run( stepper , 10000 , 1E-6 );
+}

Added: trunk/libs/numeric/odeint/performance/odeint_rk4_lorenz_array.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/odeint_rk4_lorenz_array.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,71 @@
+/*
+ * odeint_rk4_lorenz.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/array_algebra.hpp>
+
+#include "rk_performance_test_case.hpp"
+
+#include "lorenz.hpp"
+
+typedef boost::array< double , 3 > state_type;
+typedef boost::numeric::odeint::runge_kutta4< state_type , double , state_type , double ,
+ boost::numeric::odeint::array_algebra > rk4_odeint_type;
+
+
+class odeint_wrapper
+{
+public:
+ void reset_init_cond()
+ {
+ /* random */
+ /*
+ m_x[0] = 10.0 * rand() / RAND_MAX;
+ m_x[1] = 10.0 * rand() / RAND_MAX;
+ m_x[2] = 10.0 * rand() / RAND_MAX;
+ */
+ /* hand chosen random (cf fortran) */
+ m_x[0] = 8.5;
+ m_x[1] = 3.1;
+ m_x[2] = 1.2;
+
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( lorenz() , m_x , m_t , dt );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk4_odeint_type m_stepper;
+};
+
+
+
+int main()
+{
+ srand( 12312354 );
+
+ odeint_wrapper stepper;
+
+ run( stepper );
+}

Added: trunk/libs/numeric/odeint/performance/odeint_rk4_lorenz_range.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/odeint_rk4_lorenz_range.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,59 @@
+/*
+ * odeint_rk4_lorenz_def_alg.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/algebra/array_algebra.hpp>
+
+#include "rk_performance_test_case.hpp"
+
+#include "lorenz.hpp"
+
+typedef boost::array< double , 3 > state_type;
+typedef boost::numeric::odeint::runge_kutta4_classic< state_type > rk4_odeint_type;
+
+
+class odeint_wrapper
+{
+public:
+ void reset_init_cond()
+ {
+ m_x[0] = 10.0 * rand() / RAND_MAX;
+ m_x[1] = 10.0 * rand() / RAND_MAX;
+ m_x[2] = 10.0 * rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( lorenz() , m_x , m_t , dt );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk4_odeint_type m_stepper;
+};
+
+
+
+int main()
+{
+ odeint_wrapper stepper;
+
+ run( stepper );
+}

Added: trunk/libs/numeric/odeint/performance/odeint_rk4_phase_lattice.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/odeint_rk4_phase_lattice.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,64 @@
+/*
+ * odeint_rk4_phase_lattice.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <cmath>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/array_algebra.hpp>
+
+#include "rk_performance_test_case.hpp"
+
+#include "phase_lattice.hpp"
+
+const size_t N = 1024;
+
+typedef boost::array< double , N > state_type;
+typedef boost::numeric::odeint::runge_kutta4_classic< state_type , double , state_type , double , boost::numeric::odeint::array_algebra> rk4_odeint_type;
+
+class odeint_wrapper
+{
+public:
+ void reset_init_cond()
+ {
+ for( size_t i = 0 ; i<N ; ++i )
+ m_x[i] = 2.0*3.1415927*rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( phase_lattice<N>() , m_x , m_t , dt );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk4_odeint_type m_stepper;
+};
+
+
+
+int main()
+{
+ srand( 12312354 );
+
+ odeint_wrapper stepper;
+
+ run( stepper , 10000 , 1E-6 );
+}

Added: trunk/libs/numeric/odeint/performance/odeint_rk4_phase_lattice_mkl.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/odeint_rk4_phase_lattice_mkl.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,69 @@
+/*
+ * odeint_rk4_phase_lattice_mkl.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+#include <boost/numeric/odeint/external/mkl/mkl_operations.hpp>
+
+
+#include "rk_performance_test_case.hpp"
+
+#include "phase_lattice.hpp"
+#include "phase_lattice_mkl.hpp"
+
+const size_t N = 1024;
+
+typedef boost::array< double , N > state_type;
+typedef boost::numeric::odeint::runge_kutta4< state_type
+ , double , state_type , double ,
+ boost::numeric::odeint::vector_space_algebra ,
+ boost::numeric::odeint::mkl_operations
+ > rk4_odeint_type;
+
+
+class odeint_wrapper
+{
+public:
+ void reset_init_cond()
+ {
+ for( size_t i = 0 ; i<N ; ++i )
+ m_x[i] = 2.0*3.1415927*rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( phase_lattice_mkl<N>() , m_x , m_t , dt );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk4_odeint_type m_stepper;
+};
+
+
+
+int main()
+{
+ srand( 12312354 );
+
+ odeint_wrapper stepper;
+
+ run( stepper , 10000 , 1E-6 );
+}

Added: trunk/libs/numeric/odeint/performance/performance.py
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/performance.py 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,70 @@
+"""
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+"""
+
+
+from os import popen
+from os import system
+from os.path import isfile
+from numpy import *
+#from pylab import *
+
+#toolset = "gcc-4.5"
+#toolset = "intel-11.1"
+toolset = "msvc"
+#toolset = "msvc-10.0"
+
+#bin_path = "bin/gcc-4.5/release/"
+#bin_path = "bin/intel-linux-11.1/release/"
+bin_path = "bin\\msvc-10.0\\release\\threading-multi\\"
+extension = ".exe"
+#extension = ""
+
+bins = [ "odeint_rk4_lorenz_array" , "odeint_rk4_lorenz_range" , "generic_odeint_rk4_lorenz" , "nr_rk4_lorenz" , "rt_generic_rk4_lorenz" , "gsl_rk4_lorenz" ]
+
+results = []
+
+print "Performance tests for " , bin_path
+print
+
+for bin in bins:
+ #system( "bjam toolset=" + toolset + " -a " + bin );
+ if isfile( bin_path + bin + extension):
+ print "Running" , bin
+ res = popen( bin_path+bin+extension ).read()
+ print bin , res
+ results.append( res )
+ else:
+ print "no executable found:" , bin_path + bin + extension
+ results.append( 0 )
+
+print "Results from" , bin_path
+print
+
+for i in range(len(bins)):
+ print bins[i] , results[i]
+
+res = array( results , dtype='float' )
+savetxt( bin_path + "rk4_lorenz.dat" , res )
+
+res = 100*res[0]/res
+
+bar_width = 0.6
+
+"""
+figure(1)
+title("Runge-Kutta 4 with " + toolset , fontsize=20)
+bar( arange(6) , res , bar_width , color='blue' , linewidth=4 , edgecolor='blue' , ecolor='red') #, elinewidth=2, ecolor='red' )
+xlim( -0.5 , 5.5+bar_width )
+xticks( arange(6)+bar_width/2 , ('array' , 'range' , 'generic' , 'NR' , 'rt gen' , 'gsl' ) )
+ylabel('Performance in %' , fontsize=20)
+
+savefig( bin_path + "rk4_lorenz.png" )
+
+show()
+"""

Added: trunk/libs/numeric/odeint/performance/phase_lattice.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/phase_lattice.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+#include <cmath>
+
+#include <boost/array.hpp>
+
+template< size_t N >
+struct phase_lattice
+{
+ typedef double value_type;
+ typedef boost::array< value_type , N > state_type;
+
+ value_type m_epsilon;
+ state_type m_omega;
+
+ phase_lattice() : m_epsilon( 6.0/(N*N) ) // should be < 8/N^2 to see phase locking
+ {
+ for( size_t i=1 ; i<N-1 ; ++i )
+ m_omega[i] = m_epsilon*(N-i);
+ }
+
+ void inline operator()( const state_type &x , state_type &dxdt , const double t ) const
+ {
+ double c = 0.0;
+
+ for( size_t i=0 ; i<N-1 ; ++i )
+ {
+ dxdt[i] = m_omega[i] + c;
+ c = ( x[i+1] - x[i] );
+ dxdt[i] += c;
+ }
+
+ //dxdt[N-1] = m_omega[N-1] + sin( x[N-1] - x[N-2] );
+ }
+
+};

Added: trunk/libs/numeric/odeint/performance/phase_lattice_mkl.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/phase_lattice_mkl.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,57 @@
+/*
+ * phase_lattice_mkl.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 PHASE_LATTICE_MKL_HPP_
+#define PHASE_LATTICE_MKL_HPP_
+
+#include <cmath>
+
+#include <mkl_blas.h>
+#include <mkl_vml_functions.h>
+#include <boost/array.hpp>
+
+template< size_t N >
+struct phase_lattice_mkl
+{
+ typedef double value_type;
+ typedef boost::array< value_type , N > state_type;
+
+ value_type m_epsilon;
+ state_type m_omega;
+ state_type m_tmp;
+
+ phase_lattice_mkl() : m_epsilon( 6.0/(N*N) ) // should be < 8/N^2 to see phase locking
+ {
+ for( size_t i=1 ; i<N-1 ; ++i )
+ m_omega[i] = m_epsilon*(N-i);
+ }
+
+ void inline operator()( const state_type &x , state_type &dxdt , const double t )
+ {
+ const int n = x.size();
+
+ dxdt[0] = m_omega[0] + sin( x[1] - x[0] );
+
+ vdSub( n-1 , &(x[1]) , &(x[0]) , &(m_tmp[0]) );
+ vdSin( n-1 , &(m_tmp[0]) , &(m_tmp[0]) );
+ vdAdd( n-2 , &(m_tmp[0]) , &(m_tmp[1]) , &(dxdt[1]) );
+ vdAdd( n-2 , &(dxdt[1]) , &(m_omega[1]) , &(dxdt[1]) );
+
+ dxdt[N-1] = m_omega[N-1] + sin( x[N-1] - x[N-2] );
+ }
+
+};
+
+
+#endif /* PHASE_LATTICE_MKL_HPP_ */

Added: trunk/libs/numeric/odeint/performance/plot_result.py
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/plot_result.py 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,40 @@
+"""
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+"""
+
+
+from pylab import *
+
+#toolset = "gcc-4.5"
+toolset = "intel-11.1"
+#toolset = "msvc"
+#toolset = "msvc-10.0"
+
+#bin_path = "bin/gcc-4.5/release/"
+bin_path = "bin/intel-linux-11.1/release/"
+#bin_path = "bin\\msvc-10.0\\release\\" #threading-multi\\"
+#extension = ".exe"
+extension = ""
+
+res = loadtxt( bin_path + "rk4_lorenz.dat" )
+
+res = 100*res[0]/res
+
+bar_width = 0.6
+
+figure(1)
+title("Runge-Kutta 4 with " + toolset , fontsize=20)
+bar( arange(6) , res , bar_width , color='blue' , linewidth=4 , edgecolor='blue' , ecolor='red') #, elinewidth=2, ecolor='red' )
+xlim( -0.5 , 5.5+bar_width )
+ylim( 0 , max( res ) + 10 )
+xticks( arange(6)+bar_width/2 , ('array' , 'range' , 'generic' , 'NR' , 'rt gen' , 'gsl' ) )
+ylabel('Performance in %' , fontsize=20)
+
+savefig( bin_path + "rk4_lorenz.png" )
+
+show()

Added: trunk/libs/numeric/odeint/performance/rk4_lorenz.f
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/rk4_lorenz.f 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,53 @@
+C
+C NUMERICAL MATHEMATICS AND COMPUTING, CHENEY/KINCAID, (c) 1985
+C
+C FILE: rk4sys.f
+C
+C RUNGE-KUTTA METHOD OF ORDER 4 FOR A SYSTEM OF ODE'S (RK4SYS,XPSYS)
+C
+ DOUBLE PRECISION X,T,H
+ DIMENSION X(3)
+ DATA N/3/, T/0.0/, X/8.5,3.1,1.2/
+ DATA H/1E-10/, NSTEP/20000000/
+ CALL RK4SYS(N,T,X,H,NSTEP)
+ STOP
+ END
+
+ SUBROUTINE XPSYS(X,F)
+ DOUBLE PRECISION X,F
+ DIMENSION X(3),F(3)
+ F(1) = 10.0 * ( X(2) - X(1) )
+ F(2) = 28.0 * X(1) - X(2) - X(1) * X(3)
+ F(3) = X(1)*X(2) - (8.0/3.0) * X(3)
+ RETURN
+ END
+
+ SUBROUTINE RK4SYS(N,T,X,H,NSTEP)
+ DOUBLE PRECISION X,Y,T,H,F1,F2,F3,F4
+ DIMENSION X(N),Y(N),F1(N),F2(N),F3(N),F4(N)
+ PRINT 7,T,(X(I),I=1,N)
+ H2 = 0.5*H
+ START = T
+ DO 6 K = 1,NSTEP
+ CALL XPSYS(X,F1)
+ DO 2 I = 1,N
+ Y(I) = X(I) + H2*F1(I)
+ 2 CONTINUE
+ CALL XPSYS(Y,F2)
+ DO 3 I = 1,N
+ Y(I) = X(I) + H2*F2(I)
+ 3 CONTINUE
+ CALL XPSYS(Y,F3)
+ DO 4 I = 1,N
+ Y(I) = X(I) + H*F3(I)
+ 4 CONTINUE
+ CALL XPSYS(Y,F4)
+ DO 5 I = 1,N
+ X(I) = X(I) + H*(F1(I) + 2.0*(F2(I) + F3(I)) + F4(I))/6.0
+ 5 CONTINUE
+ 6 CONTINUE
+ PRINT 7,T,(X(I),I = 1,N)
+ 7 FORMAT(2X,'T,X:',E10.3,5(2X,E22.14))
+ RETURN
+ END
+

Added: trunk/libs/numeric/odeint/performance/rk_performance_test_case.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/rk_performance_test_case.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,68 @@
+/*
+ * rk_performance_test_case.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <iostream>
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+#include <boost/timer.hpp>
+
+#define tab "\t"
+
+using namespace std;
+using namespace boost::accumulators;
+
+typedef accumulator_set<
+ double , stats< tag::mean , tag::variance >
+ > accumulator_type;
+
+ostream& operator<<( ostream& out , accumulator_type &acc )
+{
+ out << boost::accumulators::mean( acc ) << tab;
+// out << boost::accumulators::variance( acc ) << tab;
+ return out;
+}
+
+typedef boost::timer timer_type;
+
+
+template< class Stepper >
+void run( Stepper &stepper , const size_t num_of_steps = 20000000 , const double dt = 1E-10 )
+{
+ const size_t loops = 20;
+
+ accumulator_type acc;
+ timer_type timer;
+
+ srand( 12312354 );
+
+ // transient
+ //stepper.reset_init_cond( );
+ //for( size_t i = 0 ; i < num_of_steps ; ++i )
+ // stepper.do_step( dt );
+
+ for( size_t n=0 ; n<loops+1 ; ++n )
+ {
+ stepper.reset_init_cond( );
+
+ timer.restart();
+ for( size_t i = 0 ; i < num_of_steps ; ++i )
+ stepper.do_step( dt );
+ if( n>0 )
+ { // take first run as transient
+ acc(timer.elapsed());
+ clog.precision(8);
+ clog.width(10);
+ clog << acc << " " << stepper.state(0) << endl;
+ }
+ }
+ cout << acc << endl;
+}

Added: trunk/libs/numeric/odeint/performance/rt_algebra.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/rt_algebra.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <vector>
+
+using namespace std;
+
+struct rt_algebra
+{
+ template< typename T , size_t dim >
+ inline static void foreach( boost::array< T , dim > & x_tmp ,
+ const boost::array< T , dim > &x ,
+ //const vector< double > &a ,
+ const double* a ,
+ const boost::array< T , dim > *k_vector ,
+ const double dt , const size_t s )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ x_tmp[i] = x[i];
+ for( size_t j = 0 ; j<s ; ++j )
+ x_tmp[i] += a[j]*dt*k_vector[j][i];
+ }
+ }
+};

Added: trunk/libs/numeric/odeint/performance/rt_explicit_rk.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/rt_explicit_rk.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,87 @@
+/*
+ * rt_explicit_rk.hpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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 RT_EXPLICIT_RK_HPP_
+#define RT_EXPLICIT_RK_HPP_
+
+#include <vector>
+
+#include "rt_algebra.hpp"
+
+using namespace std;
+
+template< class StateType >
+class rt_explicit_rk
+{
+public:
+ typedef StateType state_type;
+ typedef double* const * coeff_a_type;
+ typedef vector< double > coeff_b_type;
+ typedef vector< double > coeff_c_type;
+
+ rt_explicit_rk( size_t stage_count ) : m_s( stage_count )
+ {
+ m_F = new state_type[ m_s ];
+ }
+
+ rt_explicit_rk( const size_t stage_count ,
+ const coeff_a_type a ,
+ const coeff_b_type &b , const coeff_c_type &c )
+ : m_s( stage_count ) , m_a( a ) , m_b( b ) , m_c( c )
+ {
+ m_F = new state_type[ m_s ];
+ }
+
+ ~rt_explicit_rk()
+ {
+ delete[] m_F;
+ }
+
+ /* void set_params( coeff_a_type &a , coeff_b_type &b , coeff_c_type &c )
+ {
+ m_a = a;
+ m_b = b;
+ m_c = c;
+ }*/
+
+ template< class System >
+ void do_step( System sys , state_type &x , const double t , const double dt )
+ {
+ // first stage separately
+ sys( x , m_F[0] , t + m_c[0]*t );
+ if( m_s == 1 )
+ rt_algebra::foreach( x , x , &m_b[0] , m_F , dt , 1 );
+ else
+ rt_algebra::foreach( m_x_tmp , x , m_a[0] , m_F , dt , 1 );
+
+ for( size_t stage = 2 ; stage <= m_s ; ++stage )
+ {
+ sys( m_x_tmp , m_F[stage-1] , t + m_c[stage-1]*dt );
+ if( stage == m_s )
+ rt_algebra::foreach( x , x , &m_b[0] , m_F , dt , stage-1 );
+ else
+ rt_algebra::foreach( m_x_tmp , x , m_a[stage-1] , m_F , dt , stage-1 );
+ }
+ }
+
+
+private:
+ const size_t m_s;
+ const coeff_a_type m_a;
+ const coeff_b_type m_b;
+ const coeff_c_type m_c;
+
+ state_type m_x_tmp;
+ state_type *m_F;
+};
+
+#endif /* RT_EXPLICIT_RK_HPP_ */

Added: trunk/libs/numeric/odeint/performance/rt_generic_rk4_lorenz.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/rt_generic_rk4_lorenz.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,81 @@
+/*
+ * rt_generic_rk4_lorenz.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include "rt_explicit_rk.hpp"
+
+#include "rk_performance_test_case.hpp"
+
+#include "lorenz.hpp"
+
+typedef boost::array< double , 3 > state_type;
+
+typedef rt_explicit_rk< state_type > rk_stepper_type;
+
+const size_t stage_count = 4;
+
+
+class rt_generic_wrapper
+{
+public:
+
+ rt_generic_wrapper( const double * const * a ,
+ const rk_stepper_type::coeff_b_type &b ,
+ const rk_stepper_type::coeff_c_type &c )
+ : m_stepper( stage_count ,
+ (rk_stepper_type::coeff_a_type) a , b , c )
+ { }
+
+ void reset_init_cond()
+ {
+ m_x[0] = 10.0 * rand() / RAND_MAX;
+ m_x[1] = 10.0 * rand() / RAND_MAX;
+ m_x[2] = 10.0 * rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( lorenz() , m_x , m_t , dt );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk_stepper_type m_stepper;
+};
+
+
+
+int main()
+{
+
+ const double a_tmp[3*4/2] = { 0.5 ,
+ 0.0 , 1.0 ,
+ 0.0 , 0.0 , 1.0 };
+ const double* const a[3] = { a_tmp , a_tmp+1 , a_tmp+3 };
+
+ rk_stepper_type::coeff_b_type b( stage_count );
+ b[0] = 1.0/6; b[1] = 1.0/3; b[2] = 1.0/3; b[3] = 1.0/6;
+
+ rk_stepper_type::coeff_c_type c( stage_count );
+ c[0] = 0.0; c[1] = 0.5; c[2] = 0.5; c[3] = 1.0;
+
+ rt_generic_wrapper stepper( a , b , c );
+
+ run( stepper );
+}

Added: trunk/libs/numeric/odeint/performance/rt_generic_rk4_phase_lattice.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/performance/rt_generic_rk4_phase_lattice.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,83 @@
+/*
+ * rt_generic_rk4_lorenz.cpp
+ *
+ * Copyright 2009-2012 Karsten Ahnert
+ * Copyright 2009-2012 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)
+ */
+
+
+#include <boost/array.hpp>
+
+#include "rt_explicit_rk.hpp"
+
+#include "rk_performance_test_case.hpp"
+
+#include "phase_lattice.hpp"
+
+const size_t N = 1024;
+
+typedef boost::array< double , N > state_type;
+
+typedef rt_explicit_rk< state_type > rk_stepper_type;
+
+const size_t stage_count = 4;
+
+
+class rt_generic_wrapper
+{
+public:
+
+ rt_generic_wrapper( const double * const * a ,
+ const rk_stepper_type::coeff_b_type &b ,
+ const rk_stepper_type::coeff_c_type &c )
+ : m_stepper( stage_count ,
+ (rk_stepper_type::coeff_a_type) a , b , c )
+ { }
+
+ void reset_init_cond()
+ {
+ for( size_t i = 0 ; i<N ; ++i )
+ m_x[i] = 2.0*3.1415927*rand() / RAND_MAX;
+ m_t = 0.0;
+ }
+
+ inline void do_step( const double dt )
+ {
+ m_stepper.do_step( phase_lattice<N>() , m_x , m_t , dt );
+ //m_t += dt;
+ }
+
+ double state( const size_t i ) const
+ { return m_x[i]; }
+
+private:
+ state_type m_x;
+ double m_t;
+ rk_stepper_type m_stepper;
+};
+
+
+
+int main()
+{
+ srand( 12312354 );
+
+ const double a_tmp[3*4/2] = { 0.5 ,
+ 0.0 , 1.0 ,
+ 0.0 , 0.0 , 1.0 };
+ const double* const a[3] = { a_tmp , a_tmp+1 , a_tmp+3 };
+
+ rk_stepper_type::coeff_b_type b( stage_count );
+ b[0] = 1.0/6; b[1] = 1.0/3; b[2] = 1.0/3; b[3] = 1.0/6;
+
+ rk_stepper_type::coeff_c_type c( stage_count );
+ c[0] = 0.0; c[1] = 0.5; c[2] = 0.5; c[3] = 1.0;
+
+ rt_generic_wrapper stepper( a , b , c );
+
+ run( stepper , 10000 , 1E-6 );
+}

Added: trunk/libs/numeric/odeint/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,60 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+# bring in rules for testing
+
+
+import testing ;
+
+use-project boost : $(BOOST_ROOT) ;
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <define>BOOST_ALL_NO_LIB=1
+ <include>../../../..
+ <link>static
+ <toolset>clang:<cxxflags>-Wno-unused-variable
+
+# <cxxflags>-D_SCL_SECURE_NO_WARNINGS
+ ;
+
+test-suite "odeint"
+ :
+ [ run euler_stepper.cpp ]
+ [ run runge_kutta_concepts.cpp ]
+ [ run runge_kutta_error_concepts.cpp ]
+ [ run runge_kutta_controlled_concepts.cpp ]
+ [ run resizing.cpp ]
+ [ run default_operations.cpp ]
+ [ run range_algebra.cpp ]
+ [ run implicit_euler.cpp ]
+ [ run fusion_algebra.cpp ]
+ [ run stepper_with_units.cpp ]
+ [ run stepper_copying.cpp ]
+ [ run stepper_with_ranges.cpp ]
+ [ run rosenbrock4.cpp ]
+ [ run is_pair.cpp ]
+ [ run adams_bashforth.cpp ]
+ [ run adams_moulton.cpp ]
+ [ run adams_bashforth_moulton.cpp ]
+ [ run generic_stepper.cpp ]
+ [ run generic_error_stepper.cpp ]
+ [ run bulirsch_stoer.cpp ]
+ [ run integrate_times.cpp ]
+ [ run integrate.cpp ]
+ [ run integrate_implicit.cpp ]
+ [ run generation.cpp ]
+ [ run trivial_state.cpp ]
+ [ run const_step_iterator.cpp ]
+ [ run const_step_time_iterator.cpp ]
+ [ run adaptive_iterator.cpp ]
+ [ run adaptive_time_iterator.cpp ]
+ [ run is_resizeable.cpp ]
+ [ run resize.cpp ]
+ [ run same_size.cpp ]
+ [ run symplectic_steppers.cpp ]
+ [ run custom_controller.cpp ]
+ : <testing.launcher>valgrind
+ ;

Added: trunk/libs/numeric/odeint/test/adams_bashforth.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/adams_bashforth.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,232 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/adams_bashforth.cpp
+
+ [begin_description]
+ This file tests the use of the adams bashforth stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+// disable checked iterator warning for msvc
+
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_adams_bashforth
+
+#include <utility>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/range_c.hpp>
+
+
+#include <boost/numeric/odeint/stepper/adams_bashforth.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+
+struct lorenz
+{
+ template< class State , class Deriv , class Value >
+ void operator()( const State &_x , Deriv &_dxdt , const Value &dt ) const
+ {
+ const value_type sigma = 10.0;
+ const value_type R = 28.0;
+ const value_type b = 8.0 / 3.0;
+
+ typename boost::range_iterator< const State >::type x = boost::begin( _x );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( _dxdt );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0]*x[1] - b * x[2];
+ }
+};
+
+template< class State >
+class rk4_decorator
+{
+public:
+
+ size_t do_count;
+
+ template< class System , class StateIn , class DerivIn , class StateOut >
+ void do_step( System system , const StateIn &in , const DerivIn &dxdt , value_type t , StateOut &out , value_type dt )
+ {
+ m_stepper.do_step( system , in , dxdt , t , out , dt );
+ ++do_count;
+ }
+
+ template< class System , class StateInOut , class DerivIn >
+ void do_step( System system , StateInOut &x , const DerivIn &dxdt , value_type t , value_type dt )
+ {
+ m_stepper.do_step( system , x , dxdt , t , dt );
+ ++do_count;
+ }
+
+
+ runge_kutta4< State > m_stepper;
+
+private:
+
+
+};
+
+
+BOOST_AUTO_TEST_SUITE( adams_bashforth_test )
+
+BOOST_AUTO_TEST_CASE( test_adams_bashforth_coefficients )
+{
+ detail::adams_bashforth_coefficients< value_type , 1 > c1;
+ detail::adams_bashforth_coefficients< value_type , 2 > c2;
+ detail::adams_bashforth_coefficients< value_type , 3 > c3;
+ detail::adams_bashforth_coefficients< value_type , 4 > c4;
+ detail::adams_bashforth_coefficients< value_type , 5 > c5;
+ detail::adams_bashforth_coefficients< value_type , 6 > c6;
+ detail::adams_bashforth_coefficients< value_type , 7 > c7;
+ detail::adams_bashforth_coefficients< value_type , 8 > c8;
+}
+
+BOOST_AUTO_TEST_CASE( test_rotating_buffer )
+{
+ const size_t N = 5;
+ detail::rotating_buffer< size_t , N > buffer;
+ for( size_t i=0 ; i<N ; ++i ) buffer[i] = i;
+
+ for( size_t i=0 ; i<N ; ++i )
+ BOOST_CHECK_EQUAL( buffer[i] , i );
+
+ buffer.rotate();
+
+ for( size_t i=1 ; i<N ; ++i )
+ BOOST_CHECK_EQUAL( buffer[i] , i - 1 );
+ BOOST_CHECK_EQUAL( buffer[0] , size_t( N-1 ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_copying )
+{
+ typedef boost::array< double , 1 > state_type;
+ typedef adams_bashforth< 2 , state_type > stepper_type;
+
+ stepper_type s1;
+ s1.step_storage()[0].m_v[0] = 1.5;
+ s1.step_storage()[1].m_v[0] = 2.25;
+
+ stepper_type s2( s1 );
+ BOOST_CHECK_CLOSE( s1.step_storage()[0].m_v[0] , s2.step_storage()[0].m_v[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( s1.step_storage()[1].m_v[0] , s2.step_storage()[1].m_v[0] , 1.0e-14 );
+ BOOST_CHECK( ( &(s1.step_storage()[0]) ) != ( &(s2.step_storage()[0]) ) );
+
+ stepper_type s3;
+ state_type *p1 = &( s3.step_storage()[0].m_v ) , *p2 = &( s3.step_storage()[1].m_v );
+ s3 = s1;
+ BOOST_CHECK( p1 == ( &( s3.step_storage()[0].m_v ) ) );
+ BOOST_CHECK( p2 == ( &( s3.step_storage()[1].m_v ) ) );
+
+ BOOST_CHECK_CLOSE( s1.step_storage()[0].m_v[0] , s3.step_storage()[0].m_v[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( s1.step_storage()[1].m_v[0] , s3.step_storage()[1].m_v[0] , 1.0e-14 );
+}
+
+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;
+
+ adams_bashforth< steps , state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ const value_type dt = 0.01;
+ value_type t = 0.0;
+
+ stepper.initialize( lorenz() , x , t , dt );
+ BOOST_CHECK_CLOSE( t , value_type( steps - 1 ) * dt , 1.0e-14 );
+
+ stepper.do_step( lorenz() , x , t , dt );
+}
+
+BOOST_AUTO_TEST_CASE( test_instantiation )
+{
+ typedef boost::array< double , 3 > state_type;
+ adams_bashforth< 1 , state_type > s1;
+ adams_bashforth< 2 , state_type > s2;
+ adams_bashforth< 3 , state_type > s3;
+ adams_bashforth< 4 , state_type > s4;
+ adams_bashforth< 5 , state_type > s5;
+ adams_bashforth< 6 , state_type > s6;
+ adams_bashforth< 7 , state_type > s7;
+ adams_bashforth< 8 , state_type > s8;
+
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ value_type t = 0.0 , dt = 0.01;
+ s1.do_step( lorenz() , x , t , dt );
+ s2.do_step( lorenz() , x , t , dt );
+ s3.do_step( lorenz() , x , t , dt );
+ s4.do_step( lorenz() , x , t , dt );
+ s5.do_step( lorenz() , x , t , dt );
+ s6.do_step( lorenz() , x , t , dt );
+// s7.do_step( lorenz() , x , t , dt );
+// s8.do_step( lorenz() , x , t , dt );
+}
+
+BOOST_AUTO_TEST_CASE( test_auto_initialization )
+{
+ typedef boost::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 ,
+ initially_resizer , rk4_decorator< state_type > > adams;
+
+ adams.initializing_stepper().do_count = 0;
+ adams.do_step( lorenz() , x , 0.0 , x , 0.1 );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 1 ) );
+
+ adams.do_step( lorenz() , x , 0.0 , x , 0.1 );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 2 ) );
+
+ adams.do_step( lorenz() , x , 0.0 , x , 0.1 );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 2 ) );
+
+ adams.do_step( lorenz() , x , 0.0 , x , 0.1 );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 2 ) );
+
+ adams.do_step( lorenz() , x , 0.0 , x , 0.1 );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 2 ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_manual_initialization )
+{
+ typedef boost::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 ,
+ initially_resizer , rk4_decorator< state_type > > adams;
+
+ adams.initializing_stepper().do_count = 0;
+ double t = 0.0 , dt = 0.1;
+ adams.initialize( lorenz() , x , t , dt );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 2 ) );
+
+ adams.do_step( lorenz() , x , 0.0 , x , 0.1 );
+ BOOST_CHECK_EQUAL( adams.initializing_stepper().do_count , size_t( 2 ) );
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/adams_bashforth_moulton.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/adams_bashforth_moulton.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,112 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/adams_bashforth_moulton.cpp
+
+ [begin_description]
+ This file tests the use of the Adams-Bashforth-Moulton.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#define BOOST_TEST_MODULE odeint_adams_bashforth_moulton
+
+#include <utility>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/range_c.hpp>
+
+#include <boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+
+struct lorenz
+{
+ template< class State , class Deriv , class Value >
+ void operator()( const State &_x , Deriv &_dxdt , const Value &dt ) const
+ {
+ const value_type sigma = 10.0;
+ const value_type R = 28.0;
+ const value_type b = 8.0 / 3.0;
+
+ typename boost::range_iterator< const State >::type x = boost::begin( _x );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( _dxdt );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0]*x[1] - b * x[2];
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( adams_bashforth_moulton_test )
+
+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;
+
+ adams_bashforth_moulton< steps , state_type > stepper;
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ const value_type dt = 0.01;
+ value_type t = 0.0;
+
+ stepper.initialize( lorenz() , x , t , dt );
+ BOOST_CHECK_CLOSE( t , value_type( steps - 1 ) * dt , 1.0e-14 );
+
+ stepper.do_step( lorenz() , x , t , dt );
+}
+
+
+BOOST_AUTO_TEST_CASE( test_copying )
+{
+ typedef boost::array< double , 1 > state_type;
+ typedef adams_bashforth_moulton< 2 , state_type > stepper_type;
+
+ stepper_type s1;
+
+ stepper_type s2( s1 );
+
+ stepper_type s3;
+ s3 = s1;
+ }
+
+
+BOOST_AUTO_TEST_CASE( test_instantiation )
+{
+ typedef boost::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;
+ adams_bashforth_moulton< 4 , state_type > s4;
+ adams_bashforth_moulton< 5 , state_type > s5;
+ adams_bashforth_moulton< 6 , state_type > s6;
+ adams_bashforth_moulton< 7 , state_type > s7;
+ adams_bashforth_moulton< 8 , state_type > s8;
+
+ state_type x = {{ 10.0 , 10.0 , 10.0 }};
+ value_type t = 0.0 , dt = 0.01;
+ s1.do_step( lorenz() , x , t , dt );
+ s2.do_step( lorenz() , x , t , dt );
+ s3.do_step( lorenz() , x , t , dt );
+ s4.do_step( lorenz() , x , t , dt );
+ s5.do_step( lorenz() , x , t , dt );
+ s6.do_step( lorenz() , x , t , dt );
+// s7.do_step( lorenz() , x , t , dt );
+// s8.do_step( lorenz() , x , t , dt );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/adams_moulton.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/adams_moulton.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,104 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/adams_moulton.cpp
+
+ [begin_description]
+ This file tests the use of the Adams-Moulton stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_adams_moulton
+
+#include <utility>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/range_c.hpp>
+
+
+#include <boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp>
+#include <boost/numeric/odeint/stepper/detail/rotating_buffer.hpp>
+#include <boost/numeric/odeint/stepper/adams_moulton.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+
+struct lorenz
+{
+ template< class State , class Deriv , class Value >
+ void operator()( const State &_x , Deriv &_dxdt , const Value &dt ) const
+ {
+ const value_type sigma = 10.0;
+ const value_type R = 28.0;
+ const value_type b = 8.0 / 3.0;
+
+ typename boost::range_iterator< const State >::type x = boost::begin( _x );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( _dxdt );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0]*x[1] - b * x[2];
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( adams_moulton_test )
+
+BOOST_AUTO_TEST_CASE( test_adams_moulton_coefficients )
+{
+ detail::adams_moulton_coefficients< value_type , 1 > c1;
+ detail::adams_moulton_coefficients< value_type , 2 > c2;
+ detail::adams_moulton_coefficients< value_type , 3 > c3;
+ detail::adams_moulton_coefficients< value_type , 4 > c4;
+ detail::adams_moulton_coefficients< value_type , 5 > c5;
+ detail::adams_moulton_coefficients< value_type , 6 > c6;
+ detail::adams_moulton_coefficients< value_type , 7 > c7;
+ detail::adams_moulton_coefficients< value_type , 8 > c8;
+}
+
+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;
+
+ adams_moulton< steps , state_type > stepper;
+// state_type x = {{ 10.0 , 10.0 , 10.0 }};
+// const value_type dt = 0.01;
+// value_type t = 0.0;
+
+// stepper.do_step( lorenz() , x , t , dt );
+}
+
+BOOST_AUTO_TEST_CASE( test_instantiation )
+{
+ typedef boost::array< double , 3 > state_type;
+ adams_moulton< 1 , state_type > s1;
+ adams_moulton< 2 , state_type > s2;
+ adams_moulton< 3 , state_type > s3;
+ adams_moulton< 4 , state_type > s4;
+ adams_moulton< 5 , state_type > s5;
+ adams_moulton< 6 , state_type > s6;
+ adams_moulton< 7 , state_type > s7;
+ adams_moulton< 8 , state_type > s8;
+
+// state_type x = {{ 10.0 , 10.0 , 10.0 }};
+// value_type t = 0.0 , dt = 0.01;
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/adaptive_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/adaptive_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,116 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/adaptive_iterator.cpp
+
+ [begin_description]
+ This file tests the adaptive iterators.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_adaptive_iterator
+
+#include <iterator>
+#include <algorithm>
+#include <vector>
+
+#include <boost/numeric/odeint/config.hpp>
+#include <boost/array.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/numeric/odeint/iterator/adaptive_iterator.hpp>
+#include "dummy_steppers.hpp"
+
+namespace mpl = boost::mpl;
+using namespace boost::numeric::odeint;
+
+struct dummy_system { };
+
+typedef dummy_stepper::state_type state_type;
+typedef dummy_stepper::value_type value_type;
+
+BOOST_AUTO_TEST_SUITE( adaptive_iterator_test )
+
+typedef mpl::vector<
+ dummy_controlled_stepper
+ , dummy_dense_output_stepper
+ > dummy_steppers;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( transitivity1 , Stepper , dummy_steppers )
+{
+ typedef adaptive_iterator< Stepper , dummy_system > stepper_iterator;
+
+ state_type x = {{ 1.0 }};
+ stepper_iterator first1( Stepper() , dummy_system() , x , 2.5 , 2.0 , 0.1 );
+ stepper_iterator last1( Stepper() , dummy_system() , x );
+ stepper_iterator last2( Stepper() , dummy_system() , x );
+
+ BOOST_CHECK( first1 == last1 );
+ BOOST_CHECK( first1 == last2 );
+ BOOST_CHECK( last1 == last2 );
+}
+
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm , Stepper , dummy_steppers )
+{
+ typedef adaptive_iterator< Stepper , dummy_system > stepper_iterator;
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ stepper_iterator first( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 );
+ stepper_iterator last( Stepper() , dummy_system() , x );
+
+ std::copy( first , last , std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_factory , Stepper , dummy_steppers )
+{
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ std::copy( make_adaptive_iterator_begin( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+ make_adaptive_iterator_end( Stepper() , dummy_system() , x ) ,
+ std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_range_factory , Stepper , dummy_steppers )
+{
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ boost::range::copy( make_adaptive_range( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+ std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+}
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/adaptive_time_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/adaptive_time_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,136 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/adaptive_time_iterator.cpp
+
+ [begin_description]
+ This file tests the adaptive time iterator.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_adaptive_time_iterator
+
+#include <iterator>
+#include <algorithm>
+#include <vector>
+
+#include <boost/numeric/odeint/config.hpp>
+#include <boost/array.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/numeric/odeint/iterator/adaptive_time_iterator.hpp>
+#include "dummy_steppers.hpp"
+
+namespace mpl = boost::mpl;
+using namespace boost::numeric::odeint;
+
+struct dummy_system { };
+
+typedef dummy_stepper::state_type state_type;
+typedef dummy_stepper::value_type value_type;
+typedef dummy_stepper::time_type time_type;
+typedef std::vector< std::pair< state_type , time_type > > result_vector;
+
+BOOST_AUTO_TEST_SUITE( adaptive_time_iterator_test )
+
+typedef mpl::vector<
+// dummy_controlled_stepper
+ dummy_dense_output_stepper
+ > dummy_steppers;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( transitivity1 , Stepper , dummy_steppers )
+{
+ typedef adaptive_time_iterator< Stepper , dummy_system > stepper_iterator;
+
+ state_type x = {{ 1.0 }};
+ stepper_iterator first1( Stepper() , dummy_system() , x , 1.5 , 1.0 , 0.1 );
+ stepper_iterator last1( Stepper() , dummy_system() , x );
+ stepper_iterator last2( Stepper() , dummy_system() , x );
+
+ BOOST_CHECK( first1 == last1 );
+ BOOST_CHECK( first1 == last2 );
+ BOOST_CHECK( last1 == last2 );
+}
+
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm , Stepper , dummy_steppers )
+{
+ typedef adaptive_time_iterator< Stepper , dummy_system > stepper_iterator;
+ state_type x = {{ 1.0 }};
+ result_vector res;
+ stepper_iterator first( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 );
+ stepper_iterator last( Stepper() , dummy_system() , x );
+
+ std::copy( first , last , std::back_insert_iterator< result_vector >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0].first[0] , 1.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[0].second , 0.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].first[0] , 1.25 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].second , 0.1 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].first[0] , 1.5 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].second , 0.2 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].first[0] , 1.75 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].second , 0.3 , 1.0e-13 );
+
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+}
+
+// BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_factory , Stepper , dummy_steppers )
+// {
+// state_type x = {{ 1.0 }};
+// result_vector res;
+// std::copy( make_adaptive_time_iterator_begin( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+// make_adaptive_time_iterator_end( Stepper() , dummy_system() , x ) ,
+// std::back_insert_iterator< result_vector >( res ) );
+
+// BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+// BOOST_CHECK_CLOSE( res[0].first[0] , 1.0 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[0].second , 0.0 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[1].first[0] , 1.25 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[1].second , 0.1 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[2].first[0] , 1.5 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[2].second , 0.2 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[3].first[0] , 1.75 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[3].second , 0.3 , 1.0e-13 );
+
+// BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+// }
+
+// BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_range_factory , Stepper , dummy_steppers )
+// {
+// state_type x = {{ 1.0 }};
+// result_vector res;
+// boost::range::copy( make_adaptive_time_range( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+// std::back_insert_iterator< result_vector >( res ) );
+
+// BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+// BOOST_CHECK_CLOSE( res[0].first[0] , 1.0 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[0].second , 0.0 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[1].first[0] , 1.25 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[1].second , 0.1 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[2].first[0] , 1.5 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[2].second , 0.2 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[3].first[0] , 1.75 , 1.0e-13 );
+// BOOST_CHECK_CLOSE( res[3].second , 0.3 , 1.0e-13 );
+
+// BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+// }
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/boost_units_helpers.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/boost_units_helpers.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,59 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/dummy_boost_units.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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 LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
+#define LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
+
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+#include <boost/fusion/container.hpp>
+
+
+
+typedef double value_type;
+typedef boost::units::quantity< boost::units::si::time , value_type > time_type;
+typedef boost::units::quantity< boost::units::si::length , value_type > length_type;
+typedef boost::units::quantity< boost::units::si::velocity , value_type > velocity_type;
+typedef boost::units::quantity< boost::units::si::acceleration , value_type > acceleration_type;
+
+
+
+struct oscillator_mom_func_units
+{
+ template< class Coor , class MomDeriv >
+ void operator()( const Coor &q , MomDeriv &dp ) const
+ {
+ const boost::units::quantity< boost::units::si::frequency , value_type > omega = 1.0 * boost::units::si::hertz;
+ boost::fusion::at_c< 0 >( dp ) = - omega * omega * boost::fusion::at_c< 0 >( q );
+ }
+};
+
+struct oscillator_coor_func_units
+{
+ template< class Mom , class CoorDeriv >
+ void operator()( const Mom &p , CoorDeriv &dq ) const
+ {
+ boost::fusion::at_c< 0 >( dq ) = boost::fusion::at_c< 0 >( p );
+ }
+};
+
+
+#endif // LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED

Added: trunk/libs/numeric/odeint/test/bulirsch_stoer.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/bulirsch_stoer.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,137 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/bulirsch_stoer.cpp
+
+ [begin_description]
+ This file tests the Bulirsch-Stoer stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_bulirsch_stoer
+
+#include <utility>
+#include <iostream>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
+
+#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef boost::array< value_type , 3 > state_type;
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , double t ) const
+ {
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+ }
+};
+
+struct const_system
+{
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , double t ) const
+ {
+ dxdt[0] = 1.0;
+ dxdt[1] = 1.0;
+ dxdt[2] = 1.0;
+ }
+};
+
+struct sin_system
+{
+ template< class State , class Deriv >
+ void operator()( const State &x , Deriv &dxdt , double t ) const
+ {
+ dxdt[0] = sin( x[0] );
+ dxdt[1] = cos( x[1] );
+ dxdt[2] = sin( x[2] ) + cos( x[2] );
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( bulirsch_stoer_test )
+
+BOOST_AUTO_TEST_CASE( test_bulirsch_stoer )
+{
+ typedef bulirsch_stoer< state_type > stepper_type;
+ stepper_type stepper( 1E-9 , 1E-9 , 1.0 , 0.0 );
+
+ state_type x;
+ x[0] = 10.0 ; x[1] = 10.0 ; x[2] = 5.0;
+
+ double dt = 0.1;
+
+ //stepper.try_step( lorenz() , x , t , dt );
+
+ std::cout << "starting integration..." << std::endl;
+
+ size_t steps = integrate_adaptive( stepper , lorenz() , x , 0.0 , 10.0 , dt );
+
+ std::cout << "required steps: " << steps << std::endl;
+
+ bulirsch_stoer_dense_out< state_type > bs_do( 1E-9 , 1E-9 , 1.0 , 0.0 );
+ x[0] = 10.0 ; x[1] = 10.0 ; x[2] = 5.0;
+ double t = 0.0;
+ dt = 1E-1;
+ bs_do.initialize( x , t , dt );
+ bs_do.do_step( sin_system() );
+ std::cout << "one step successful, new time: " << bs_do.current_time() << " (" << t << ")" << std::endl;
+
+ x = bs_do.current_state();
+ std::cout << "x( " << bs_do.current_time() << " ) = [ " << x[0] << " , " << x[1] << " , " << x[2] << " ]" << std::endl;
+
+ bs_do.calc_state( bs_do.current_time()/3 , x );
+ std::cout << "x( " << bs_do.current_time()/3 << " ) = [ " << x[0] << " , " << x[1] << " , " << x[2] << " ]" << std::endl;
+
+ std::cout << std::endl << "=======================================================================" << std::endl << std::endl;
+
+ x[0] = 10.0 ; x[1] = 10.0 ; x[2] = 5.0;
+ t = 0.0; dt /= 3;
+ bs_do.initialize( x , t , dt );
+ bs_do.do_step( sin_system() );
+ x = bs_do.current_state();
+ std::cout << "x( " << bs_do.current_time() << " ) = [ " << x[0] << " , " << x[1] << " , " << x[2] << " ]" << std::endl;
+
+ t = dt;
+ bs_do.initialize( x , t , dt );
+ bs_do.do_step( sin_system() );
+ x = bs_do.current_state();
+
+ t = 2*dt;
+ bs_do.initialize( x , t , dt );
+ bs_do.do_step( sin_system() );
+ x = bs_do.current_state();
+
+ std::cout << "x( " << bs_do.current_time() << " ) = [ " << x[0] << " , " << x[1] << " , " << x[2] << " ]" << std::endl;
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/const_range.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/const_range.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,50 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/const_range.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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 LIBS_NUMERIC_ODEINT_TEST_CONST_RANGE_HPP_DEFINED
+#define LIBS_NUMERIC_ODEINT_TEST_CONST_RANGE_HPP_DEFINED
+
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/inserter.hpp>
+#include <boost/mpl/insert.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/range_c.hpp>
+#include <boost/mpl/placeholders.hpp>
+
+
+namespace mpl = boost::mpl;
+
+
+
+template< class N , class T >
+struct const_range
+{
+ typedef typename mpl::copy<
+ mpl::range_c< typename N::value_type , 0 , N::value > ,
+ mpl::inserter<
+ mpl::vector0<> ,
+ mpl::insert<
+ mpl::_1 ,
+ mpl::end< mpl::_1 > ,
+ T
+ >
+ >
+ >::type type;
+};
+
+#endif // LIBS_NUMERIC_ODEINT_TEST_CONST_RANGE_HPP_DEFINED

Added: trunk/libs/numeric/odeint/test/const_step_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/const_step_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,141 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/const_step_iterator.cpp
+
+ [begin_description]
+ This file tests the const step iterator.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_const_step_iterator
+
+#include <iterator>
+#include <algorithm>
+#include <vector>
+
+#include <boost/numeric/odeint/config.hpp>
+#include <boost/array.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/numeric/odeint/iterator/const_step_iterator.hpp>
+#include "dummy_steppers.hpp"
+
+namespace mpl = boost::mpl;
+using namespace boost::numeric::odeint;
+
+struct dummy_system { };
+
+typedef dummy_stepper::state_type state_type;
+typedef dummy_stepper::value_type value_type;
+
+BOOST_AUTO_TEST_SUITE( const_step_iterator_test )
+
+typedef mpl::vector<
+ dummy_stepper
+ , dummy_dense_output_stepper
+ > dummy_steppers;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( transitivity1 , Stepper , dummy_steppers )
+{
+ typedef const_step_iterator< Stepper , dummy_system > stepper_iterator;
+
+ state_type x = {{ 1.0 }};
+ stepper_iterator first1( Stepper() , dummy_system() , x , 2.5 , 2.0 , 0.1 );
+ stepper_iterator last1( Stepper() , dummy_system() , x );
+ stepper_iterator last2( Stepper() , dummy_system() , x );
+
+ BOOST_CHECK( first1 == last1 );
+ BOOST_CHECK( first1 == last2 );
+ BOOST_CHECK( last1 == last2 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm , Stepper , dummy_steppers )
+{
+ typedef const_step_iterator< Stepper , dummy_system > stepper_iterator;
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ stepper_iterator first( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 );
+ stepper_iterator last( Stepper() , dummy_system() , x );
+
+ std::copy( first , last , std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_negative_time_step , Stepper , dummy_steppers )
+{
+ typedef const_step_iterator< Stepper , dummy_system > stepper_iterator;
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ stepper_iterator first( Stepper() , dummy_system() , x , 0.3 , -0.05 , -0.1 );
+ stepper_iterator last( Stepper() , dummy_system() , x );
+
+ std::copy( first , last , std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_factory , Stepper , dummy_steppers )
+{
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ std::copy( make_const_step_iterator_begin( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+ make_const_step_iterator_end( Stepper() , dummy_system() , x ) ,
+ std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_range_factory , Stepper , dummy_steppers )
+{
+ state_type x = {{ 1.0 }};
+ std::vector< state_type > res;
+ boost::range::copy( make_const_step_range( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+ std::back_insert_iterator< std::vector< state_type > >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0][0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[1][0] , 1.25 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[2][0] , 1.5 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( res[3][0] , 1.75 , 1.0e-14 );
+
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-14 );
+}
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/const_step_time_iterator.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/const_step_time_iterator.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,133 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/const_step_time_iterator.cpp
+
+ [begin_description]
+ This file tests the const step time iterator.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_const_step_time_iterator
+
+#include <iterator>
+#include <algorithm>
+#include <vector>
+
+#include <boost/numeric/odeint/config.hpp>
+#include <boost/array.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/numeric/odeint/iterator/const_step_time_iterator.hpp>
+#include "dummy_steppers.hpp"
+
+namespace mpl = boost::mpl;
+using namespace boost::numeric::odeint;
+
+struct dummy_system { };
+
+typedef dummy_stepper::state_type state_type;
+typedef dummy_stepper::value_type value_type;
+typedef dummy_stepper::time_type time_type;
+typedef std::vector< std::pair< state_type , time_type > > result_vector;
+
+BOOST_AUTO_TEST_SUITE( const_step_time_iterator_test )
+
+typedef mpl::vector<
+ dummy_stepper
+ , dummy_dense_output_stepper
+ > dummy_steppers;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( transitivity1 , Stepper , dummy_steppers )
+{
+ typedef const_step_time_iterator< Stepper , dummy_system > stepper_iterator;
+
+ state_type x = {{ 1.0 }};
+ stepper_iterator first1( Stepper() , dummy_system() , x , 1.5 , 1.0 , 0.1 );
+ stepper_iterator last1( Stepper() , dummy_system() , x );
+ stepper_iterator last2( Stepper() , dummy_system() , x );
+
+ BOOST_CHECK( first1 == last1 );
+ BOOST_CHECK( first1 == last2 );
+ BOOST_CHECK( last1 == last2 );
+}
+
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm , Stepper , dummy_steppers )
+{
+ typedef const_step_time_iterator< Stepper , dummy_system > stepper_iterator;
+ state_type x = {{ 1.0 }};
+ result_vector res;
+ stepper_iterator first( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 );
+ stepper_iterator last( Stepper() , dummy_system() , x );
+
+ std::copy( first , last , std::back_insert_iterator< result_vector >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0].first[0] , 1.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[0].second , 0.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].first[0] , 1.25 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].second , 0.1 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].first[0] , 1.5 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].second , 0.2 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].first[0] , 1.75 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].second , 0.3 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-13 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_factory , Stepper , dummy_steppers )
+{
+ state_type x = {{ 1.0 }};
+ result_vector res;
+ std::copy( make_const_step_time_iterator_begin( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+ make_const_step_time_iterator_end( Stepper() , dummy_system() , x ) ,
+ std::back_insert_iterator< result_vector >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0].first[0] , 1.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[0].second , 0.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].first[0] , 1.25 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].second , 0.1 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].first[0] , 1.5 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].second , 0.2 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].first[0] , 1.75 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].second , 0.3 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-13 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_range_factory , Stepper , dummy_steppers )
+{
+ state_type x = {{ 1.0 }};
+ result_vector res;
+ boost::range::copy( make_const_step_time_range( Stepper() , dummy_system() , x , 0.0 , 0.35 , 0.1 ) ,
+ std::back_insert_iterator< result_vector >( res ) );
+
+ BOOST_CHECK_EQUAL( res.size() , size_t( 4 ) );
+ BOOST_CHECK_CLOSE( res[0].first[0] , 1.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[0].second , 0.0 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].first[0] , 1.25 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[1].second , 0.1 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].first[0] , 1.5 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[2].second , 0.2 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].first[0] , 1.75 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( res[3].second , 0.3 , 1.0e-13 );
+ BOOST_CHECK_CLOSE( x[0] , 2.0 , 1.0e-13 );
+}
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/default_operations.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/default_operations.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,268 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/default_operations.cpp
+
+ [begin_description]
+ This file tests default_operations.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+*/
+
+
+#define BOOST_TEST_MODULE odeint_standard_operations
+
+#include <cmath>
+#include <complex>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+#include <boost/mpl/list.hpp>
+
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+
+namespace units = boost::units;
+namespace si = boost::units::si;
+namespace mpl = boost::mpl;
+using boost::numeric::odeint::default_operations;
+
+
+template< class Value > struct internal_value_type { typedef Value type; };
+template< class T > struct internal_value_type< std::complex< T > > { typedef T type; };
+
+template< class T > struct default_eps;
+template<> struct default_eps< double > { static double def_eps( void ) { return 1.0e-10; } };
+template<> struct default_eps< float > { static float def_eps( void ) { return 1.0e-5; } };
+
+
+typedef units::unit< units::derived_dimension< units::time_base_dimension , 2 >::type , si::system > time_2;
+typedef units::unit< units::derived_dimension< units::time_base_dimension , 3 >::type , si::system > time_3;
+typedef units::unit< units::derived_dimension< units::time_base_dimension , 4 >::type , si::system > time_4;
+typedef units::unit< units::derived_dimension< units::time_base_dimension , 5 >::type , si::system > time_5;
+typedef units::unit< units::derived_dimension< units::time_base_dimension , 6 >::type , si::system > time_6;
+typedef units::unit< units::derived_dimension< units::time_base_dimension , 7 >::type , si::system > time_7;
+
+const time_2 second2 = si::second * si::second;
+const time_3 second3 = second2 * si::second;
+const time_4 second4 = second3 * si::second;
+const time_5 second5 = second4 * si::second;
+const time_6 second6 = second5 * si::second;
+const time_7 second7 = second6 * si::second;
+
+
+
+
+template< class Value , class Compare = typename internal_value_type< Value >::type >
+struct double_fixture
+{
+ typedef Value value_type;
+ typedef Compare compare_type;
+
+ double_fixture( const compare_type &eps_ = default_eps< compare_type >::def_eps() )
+ : m_eps( eps_ ) , res( 0.0 ) , x1( 1.0 ) , x2( 2.0 ) , x3( 3.0 ) , x4( 4.0 ) , x5( 5.0 ) , x6( 6.0 ) , x7( 7.0 ) , x8( 8.0 )
+ {}
+
+ ~double_fixture( void )
+ {
+ using std::abs;
+ BOOST_CHECK_SMALL( abs( x1 - value_type( 1.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( x2 - value_type( 2.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( x3 - value_type( 3.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( x4 - value_type( 4.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( x5 - value_type( 5.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( x6 - value_type( 6.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( x7 - value_type( 7.0 ) ) , m_eps );
+ }
+
+ const compare_type m_eps;
+ value_type res;
+ value_type x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8;
+};
+
+template< class Value , class Compare = typename internal_value_type< Value >::type >
+struct unit_fixture
+{
+ typedef Value value_type;
+ typedef Compare compare_type;
+ typedef units::quantity< si::length , value_type > length_type;
+
+ typedef units::quantity< si::time , value_type > time_type;
+ typedef units::quantity< time_2 , value_type > time_2_type;
+ typedef units::quantity< time_3 , value_type > time_3_type;
+ typedef units::quantity< time_4 , value_type > time_4_type;
+ typedef units::quantity< time_5 , value_type > time_5_type;
+ typedef units::quantity< time_6 , value_type > time_6_type;
+ typedef units::quantity< time_7 , value_type > time_7_type;
+
+ typedef units::quantity< si::velocity , value_type > velocity_type;
+ typedef units::quantity< si::acceleration , value_type > acceleration_type;
+
+ unit_fixture( const compare_type &eps_ = default_eps< compare_type >::def_eps() )
+ : m_eps( eps_ )
+ , res( 0.0 * si::meter )
+ , x( 1.0 * si::meter )
+ , d1x( 2.0 * si::meter / si::second )
+ , d2x( 3.0 * si::meter / si::second / si::second )
+ {}
+
+ ~unit_fixture( void )
+ {
+ using std::abs;
+ BOOST_CHECK_SMALL( abs( x.value() - value_type( 1.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( d1x.value() - value_type( 2.0 ) ) , m_eps );
+ BOOST_CHECK_SMALL( abs( d2x.value() - value_type( 3.0 ) ) , m_eps );
+ }
+
+ compare_type m_eps;
+ length_type res;
+ length_type x;
+ velocity_type d1x;
+ acceleration_type d2x;
+};
+
+
+typedef mpl::list< float , double , std::complex< double > > test_types;
+
+BOOST_AUTO_TEST_SUITE( check_operations_test )
+
+using std::abs;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum2_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef typename default_operations::scale_sum2< T , T > Op;
+ Op op( 1.25 , 9.81 );
+ op( f.res , f.x1 , f.x2 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 20.87 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum3_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef default_operations::scale_sum3< T , T , T > Op;
+ Op op( 1.25 , 9.81 , 0.87 );
+ op( f.res , f.x1 , f.x2 , f.x3 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 23.48 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum4_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef default_operations::scale_sum4< T , T , T , T > Op;
+ Op op( 1.25 , 9.81 , 0.87 , -0.15 );
+ op( f.res , f.x1 , f.x2 , f.x3 , f.x4 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 22.88 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum5_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef default_operations::scale_sum5< T , T , T , T , T > Op;
+ Op op( 1.25 , 9.81 , 0.87 , -0.15 , -3.3 );
+ op( f.res , f.x1 , f.x2 , f.x3 , f.x4 , f.x5 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 6.38 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum6_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef default_operations::scale_sum6< T , T , T , T , T , T > Op;
+ Op op( 1.25 , 9.81 , 0.87 , -0.15 , -3.3 , 4.2 );
+ op( f.res , f.x1 , f.x2 , f.x3 , f.x4 , f.x5 , f.x6 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 31.58 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum7_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef default_operations::scale_sum7< T , T , T , T , T , T , T > Op;
+ Op op( 1.25 , 9.81 , 0.87 , -0.15 , -3.3 , 4.2 , -0.22 );
+ op( f.res , f.x1 , f.x2 , f.x3 , f.x4 , f.x5 , f.x6 , f.x7 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 30.04 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( rel_error_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ f.res = -1.1;
+ typedef default_operations::rel_error< T > Op;
+ Op op( 0.1 , 0.2 , 0.15 , 0.12 );
+ op( f.res , -f.x1 , -f.x2 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 6.17978 ) ) , typename fix_type::compare_type( 1.0e-4 ) );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( maximum_test , T , test_types )
+{
+ typedef double_fixture< T > fix_type;
+ fix_type f;
+ typedef default_operations::maximum< typename fix_type::compare_type > Op;
+ Op op;
+ f.res = op( f.x1 , f.x2 );
+ BOOST_CHECK_SMALL( abs( f.res - T( 2.0 ) ) , f.m_eps );
+}
+
+
+
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum2_units_test , T , test_types )
+{
+ typedef unit_fixture< T > fix_type;
+ typedef typename fix_type::value_type value_type;
+ typedef typename fix_type::time_type time_type;
+ typedef typename fix_type::time_2_type time_2_type;
+ typedef typename fix_type::time_3_type time_3_type;
+ typedef typename fix_type::time_4_type time_4_type;
+ typedef typename fix_type::time_5_type time_5_type;
+ typedef typename fix_type::time_6_type time_6_type;
+ typedef typename fix_type::time_7_type time_7_type;
+
+ fix_type f;
+ typedef default_operations::scale_sum2< value_type , time_type > Op;
+ Op op( 1.0 , time_type( 1.0 * si::second ) );
+ op( f.res , f.x , f.d1x );
+ BOOST_CHECK_SMALL( abs( f.res.value() - T( 3.0 ) ) , f.m_eps );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( scale_sum3_units_test , T , test_types )
+{
+ typedef unit_fixture< T > fix_type;
+ typedef typename fix_type::value_type value_type;
+ typedef typename fix_type::time_type time_type;
+ typedef typename fix_type::time_2_type time_2_type;
+ typedef typename fix_type::time_3_type time_3_type;
+ typedef typename fix_type::time_4_type time_4_type;
+ typedef typename fix_type::time_5_type time_5_type;
+ typedef typename fix_type::time_6_type time_6_type;
+ typedef typename fix_type::time_7_type time_7_type;
+
+ fix_type f;
+ typedef default_operations::scale_sum3< value_type , time_type , time_2_type > Op;
+ Op op( 1.0 , time_type( 1.0 * si::second ) , time_2_type( 1.0 * second2 ) );
+ op( f.res , f.x , f.d1x , f.d2x );
+ BOOST_CHECK_SMALL( abs( f.res.value() - T( 6.0 ) ) , f.m_eps );
+}
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/diagnostic_state_type.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/diagnostic_state_type.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,185 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/diagnostic_state_type.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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 LIBS_NUMERIC_ODEINT_TEST_DIAGNOSTIC_STATE_TYPE_HPP_DEFINED
+#define LIBS_NUMERIC_ODEINT_TEST_DIAGNOSTIC_STATE_TYPE_HPP_DEFINED
+
+#include <boost/array.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/numeric/odeint/util/same_size.hpp>
+#include <boost/numeric/odeint/util/resize.hpp>
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+
+template< size_t N >
+struct counter
+{
+ static size_t& adjust_size_count( void )
+ {
+ static size_t m_adjust_size_count;
+ return m_adjust_size_count;
+ }
+
+ static size_t& construct_count( void )
+ {
+ static size_t m_construct_count;
+ return m_construct_count;
+ }
+
+ static size_t& copy_count( void )
+ {
+ static size_t m_copy_count;
+ return m_copy_count;
+ }
+
+ static size_t& destroy_count( void )
+ {
+ static size_t m_destroy_count;
+ return m_destroy_count;
+ }
+
+
+ static void init_counter( void )
+ {
+ counter< N >::adjust_size_count() = 0;
+ counter< N >::construct_count() = 0;
+ counter< N >::copy_count() = 0;
+ counter< N >::destroy_count() = 0;
+ }
+};
+
+template< size_t N >
+class diagnostic_type : public boost::array< double , 1 > { };
+
+
+typedef diagnostic_type< 0 > diagnostic_state_type;
+typedef diagnostic_type< 1 > diagnostic_deriv_type;
+typedef diagnostic_type< 2 > diagnostic_state_type2;
+typedef diagnostic_type< 3 > diagnostic_deriv_type2;
+
+typedef counter< 0 > counter_state;
+typedef counter< 1 > counter_deriv;
+typedef counter< 2 > counter_state2;
+typedef counter< 3 > counter_deriv2;
+
+
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+ template< size_t N >
+ struct is_resizeable< diagnostic_type< N > >
+ {
+ typedef boost::true_type type;
+ const static bool value = type::value;
+ };
+
+ template< size_t N , size_t M >
+ struct same_size_impl< diagnostic_type< N > , diagnostic_type< M > >
+ {
+ static bool same_size( const diagnostic_type< N > &x1 , const diagnostic_type< M > &x2 )
+ {
+ return false;
+ }
+ };
+
+ template< size_t N , class State1 >
+ struct same_size_impl< diagnostic_type< N > , State1 >
+ {
+ static bool same_size( const diagnostic_type< N > &x1 , const State1 &x2 )
+ {
+ return false;
+ }
+ };
+
+ template< class State1 , size_t N >
+ struct same_size_impl< State1 , diagnostic_type< N > >
+ {
+ static bool same_size( const State1 &x1 , const diagnostic_type< N > &x2 )
+ {
+ return false;
+ }
+ };
+
+
+
+ template< size_t N , class StateIn >
+ struct resize_impl< diagnostic_type< N > , StateIn >
+ {
+ static void resize( diagnostic_type< N > &x1 , const StateIn &x2 )
+ {
+ counter< N >::adjust_size_count()++;
+ }
+ };
+
+ template< size_t N >
+ struct state_wrapper< diagnostic_type< N > >
+ {
+ typedef state_wrapper< diagnostic_type< N > > state_wrapper_type;
+ typedef diagnostic_type< N > state_type;
+ typedef double value_type;
+
+ state_type m_v;
+
+ state_wrapper() : m_v()
+ {
+ counter< N >::construct_count()++;
+ }
+
+ state_wrapper( const state_type &v ) : m_v( v )
+ {
+ counter< N >::construct_count()++;
+ counter< N >::copy_count()++;
+ }
+
+ state_wrapper( const state_wrapper_type &x ) : m_v( x.m_v )
+ {
+ counter< N >::construct_count()++;
+ counter< N >::copy_count()++;
+ }
+
+ state_wrapper_type& operator=( const state_wrapper_type &x )
+ {
+ counter< N >::copy_count()++;
+ return *this;
+ }
+
+ ~state_wrapper()
+ {
+ counter< N >::destroy_count()++;
+ }
+ };
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#define TEST_COUNTERS( c , s1 , s2 , s3 ,s4 ) \
+ BOOST_CHECK_EQUAL( c::adjust_size_count() , size_t( s1 ) ); \
+ BOOST_CHECK_EQUAL( c::construct_count() , size_t( s2 ) ); \
+ BOOST_CHECK_EQUAL( c::copy_count() , size_t( s3 ) ); \
+ BOOST_CHECK_EQUAL( c::destroy_count() , size_t( s4 ) );
+
+#define TEST_COUNTERS_MSG( c , s1 , s2 , s3 ,s4 , msg ) \
+ BOOST_CHECK_EQUAL( c::adjust_size_count() , size_t( s1 ) ); \
+ BOOST_CHECK_EQUAL( c::construct_count() , size_t( s2 ) ); \
+ BOOST_CHECK_EQUAL( c::copy_count() , size_t( s3 ) ); \
+ BOOST_CHECK_EQUAL( c::destroy_count() , size_t( s4 ) );
+
+
+#endif // LIBS_NUMERIC_ODEINT_TEST_DIAGNOSTIC_STATE_TYPE_HPP_DEFINED

Added: trunk/libs/numeric/odeint/test/dummy_odes.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/dummy_odes.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,140 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/dummy_odes.hpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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 LIBS_NUMERIC_ODEINT_TEST_DUMMY_ODES_HPP_DEFINED
+#define LIBS_NUMERIC_ODEINT_TEST_DUMMY_ODES_HPP_DEFINED
+
+#include "vector_space_1d.hpp"
+
+#include <boost/fusion/include/at_c.hpp>
+
+
+
+
+
+
+/*
+ * rhs functors/functions for different state types
+ */
+struct constant_system_functor_standard
+{
+ template< class State , class Deriv , class Time >
+ void operator()( const State &x , Deriv &dxdt , const Time t ) const
+ {
+ dxdt[0] = 1.0;
+ }
+};
+
+struct constant_system_functor_vector_space
+{
+ template< class State , class Deriv , class Time >
+ void operator()( const State &x , Deriv &dxdt , const Time t ) const
+ {
+ dxdt.m_x = 1.0;
+ }
+};
+
+struct constant_system_functor_fusion
+{
+ template< class State , class Deriv , class Time >
+ void operator()( const State &x , Deriv &dxdt , const Time t ) const
+ {
+ boost::fusion::at_c< 0 >( dxdt ) = boost::fusion::at_c< 0 >( x ) / Time( 1.0 );
+ }
+};
+
+template< class State , class Deriv , class Time >
+void constant_system_standard( const State &x , Deriv &dxdt , const Time t )
+{
+ dxdt[0] = 1.0;
+}
+
+template< class State , class Deriv , class Time >
+void constant_system_vector_space( const State &x , Deriv &dxdt , const Time t )
+{
+ dxdt.m_x = 1.0;
+}
+
+template< class State , class Deriv , class Time >
+void constant_system_fusion( const State &x , Deriv &dxdt , const Time t )
+{
+ boost::fusion::at_c< 0 >( dxdt ) = boost::fusion::at_c< 0 >( x ) / Time( 1.0 );
+}
+
+
+
+
+/*
+ * rhs functors for symplectic steppers
+ */
+struct constant_mom_func
+{
+ template< class StateIn , class StateOut >
+ void operator()( const StateIn &q , StateOut &dp ) const
+ {
+ dp[0] = 1.0;
+ }
+};
+
+struct default_coor_func
+{
+ template< class StateIn , class StateOut >
+ void operator()( const StateIn &p , StateOut &dq ) const
+ {
+ dq[0] = p[0];
+ }
+};
+
+
+
+struct constant_mom_func_vector_space_1d
+{
+ template< class T >
+ void operator()( const vector_space_1d< T > &q , vector_space_1d< T > &dp ) const
+ {
+ dp.m_x = 1.0;
+ }
+};
+
+struct default_coor_func_vector_space_1d
+{
+ template< class T >
+ void operator()( const vector_space_1d< T > &p , vector_space_1d< T > &dq ) const
+ {
+ dq.m_x = p.m_x;
+ }
+};
+
+
+
+
+
+struct harmonic_oscillator
+{
+ template< class State , class Deriv , class Time >
+ void operator()( const State &x , Deriv &dxdt , Time t ) const
+ {
+ dxdt[0] = x[1];
+ dxdt[1] = - x[0];
+ }
+};
+
+
+
+
+
+#endif // LIBS_NUMERIC_ODEINT_TEST_DUMMY_ODES_HPP_DEFINED

Added: trunk/libs/numeric/odeint/test/dummy_steppers.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/dummy_steppers.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,117 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/dummy_steppers.hpp
+
+ [begin_description]
+ Dummy steppers for several tests.
+ [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_LIBS_NUMERIC_ODEINT_TEST_DUMMY_STEPPER_HPP_INCLUDED
+#define BOOST_LIBS_NUMERIC_ODEINT_TEST_DUMMY_STEPPER_HPP_INCLUDED
+
+#include <boost/array.hpp>
+#include <boost/numeric/odeint/stepper/stepper_categories.hpp>
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+struct dummy_stepper
+{
+ typedef double value_type;
+ typedef value_type time_type;
+ typedef boost::array< value_type , 1 > state_type;
+ typedef state_type deriv_type;
+ typedef unsigned short order_type;
+ typedef stepper_tag stepper_category;
+
+ order_type order( void ) const { return 1; }
+
+ template< class System >
+ void do_step( System sys , state_type &x , time_type t , time_type dt ) const
+ {
+ x[0] += 0.25;
+ }
+};
+
+struct dummy_dense_output_stepper
+{
+ typedef double value_type;
+ typedef value_type time_type;
+ typedef boost::array< value_type , 1 > state_type;
+ typedef state_type deriv_type;
+ typedef dense_output_stepper_tag stepper_category;
+
+ void initialize( const state_type &x0 , time_type t0 , time_type dt0 )
+ {
+ m_x = x0;
+ m_t = t0;
+ m_dt = dt0;
+ }
+
+ template< class System >
+ std::pair< time_type , time_type > do_step( System sys )
+ {
+ m_x[0] += 0.25;
+ m_t += m_dt;
+ return std::make_pair( m_t - m_dt , m_t );
+ }
+
+ void calc_state( time_type t_inter , state_type &x ) const
+ {
+ value_type theta = ( m_t - t_inter ) / m_dt;
+ x[0] = m_x[0] - 0.25 * theta;
+
+ }
+
+ const time_type& current_time( void ) const
+ {
+ return m_t;
+ }
+
+ const state_type& current_state( void ) const
+ {
+ return m_x;
+ }
+
+ state_type m_x;
+ time_type m_t;
+ time_type m_dt;
+};
+
+
+
+struct dummy_controlled_stepper
+{
+ typedef double value_type;
+ typedef value_type time_type;
+ typedef boost::array< value_type , 1 > state_type;
+ typedef state_type deriv_type;
+ typedef controlled_stepper_tag stepper_category;
+
+ template< class Sys >
+ controlled_step_result try_step( Sys sys , state_type &x , time_type &t , time_type &dt ) const
+ {
+ x[0] += 0.25;
+ t += dt;
+ return success;
+ }
+};
+
+
+} // odeint
+} // numeric
+} // boost
+
+
+#endif // BOOST_LIBS_NUMERIC_ODEINT_TEST_DUMMY_STEPPER_HPP_INCLUDED

Added: trunk/libs/numeric/odeint/test/euler_stepper.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/euler_stepper.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,105 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/euler_stepper.cpp
+
+ [begin_description]
+ This file tests explicit Euler stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_explicit_euler
+
+#include <boost/test/unit_test.hpp>
+
+#include <utility>
+#include <iostream>
+#include <vector>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+// test with own vector implementation
+
+class my_vec : public std::vector< double > {
+
+public:
+
+ my_vec() : std::vector< double >()
+ { }
+
+ my_vec( const my_vec &x ) : std::vector< double >( x )
+ { }
+
+
+ my_vec( size_t dim )
+ : std::vector< double >( dim )
+ { }
+
+};
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+template<>
+struct is_resizeable< my_vec >
+{
+ //struct type : public boost::true_type { };
+ typedef boost::true_type type;
+ const static bool value = type::value;
+};
+} } }
+
+typedef double value_type;
+//typedef std::vector< value_type > state_type;
+typedef my_vec state_type;
+
+/* use functors, because functions don't work with msvc 10, I guess this is a bug */
+struct sys
+{
+ void operator()( const state_type &x , state_type &dxdt , const value_type t ) const
+ {
+ std::cout << "sys start " << dxdt.size() << std::endl;
+ dxdt[0] = x[0] + 2 * x[1];
+ dxdt[1] = x[1];
+ std::cout << "sys done" << std::endl;
+ }
+};
+
+
+BOOST_AUTO_TEST_SUITE( explicit_euler_test )
+
+BOOST_AUTO_TEST_CASE( test_euler )
+{
+ range_algebra algebra;
+ euler< state_type > stepper( algebra );
+ state_type x( 2 );
+ x[0] = 0.0; x[1] = 1.0;
+
+ std::cout << "initialized" << std::endl;
+
+ const value_type eps = 1E-12;
+ const value_type dt = 0.1;
+
+ stepper.do_step( sys() , x , 0.0 , dt );
+
+ using std::abs;
+
+ // compare with analytic solution of above system
+ BOOST_CHECK_MESSAGE( abs( x[0] - 2.0*1.0*dt ) < eps , x[0] - 2.0*1.0*dt );
+ BOOST_CHECK_MESSAGE( abs( x[1] - (1.0 + dt) ) < eps , x[1] - (1.0+dt) );
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/fusion_algebra.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/fusion_algebra.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,184 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/fusion_algebra.cpp
+
+ [begin_description]
+ This file tests the Fusion algebra.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_fusion_algebra
+
+// using fusion vectors as state types requires increased macro variables
+#define BOOST_FUSION_INVOKE_MAX_ARITY 15
+#define BOOST_RESULT_OF_NUM_ARGS 15
+
+#include <cmath>
+#include <complex>
+#include <utility>
+#include <functional>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+#include <boost/fusion/container.hpp>
+
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
+
+namespace units = boost::units;
+namespace si = boost::units::si;
+namespace fusion = boost::fusion;
+
+using boost::numeric::odeint::default_operations;
+using boost::numeric::odeint::fusion_algebra;
+
+typedef double value_type;
+typedef units::quantity< si::time , value_type > time_type;
+typedef units::quantity< si::length , value_type > length_type;
+typedef units::quantity< si::velocity , value_type > velocity_type;
+typedef units::quantity< si::acceleration , value_type > acceleration_type;
+typedef fusion::vector< length_type , velocity_type > state_type;
+typedef fusion::vector< velocity_type , acceleration_type > deriv_type;
+
+const time_type dt = 0.1 * si::second;
+
+
+struct fusion_fixture
+{
+ fusion_fixture( void )
+ : res( 0.0 * si::meter , 0.0 * si::meter_per_second ) ,
+ x( 1.0 * si::meter , 1.0 * si::meter_per_second ) ,
+ k1( 1.0 * si::meter_per_second , 1.0 * si::meter_per_second_squared ) ,
+ k2( 2.0 * si::meter_per_second , 2.0 * si::meter_per_second_squared ) ,
+ k3( 3.0 * si::meter_per_second , 3.0 * si::meter_per_second_squared ) ,
+ k4( 4.0 * si::meter_per_second , 4.0 * si::meter_per_second_squared ) ,
+ k5( 5.0 * si::meter_per_second , 5.0 * si::meter_per_second_squared ) ,
+ k6( 6.0 * si::meter_per_second , 6.0 * si::meter_per_second_squared ) { }
+
+ ~fusion_fixture( void )
+ {
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( x ).value() , 1.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( x ).value() , 1.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( k1 ).value() , 1.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( k1 ).value() , 1.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( k2 ).value() , 2.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( k2 ).value() , 2.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( k3 ).value() , 3.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( k3 ).value() , 3.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( k4 ).value() , 4.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( k4 ).value() , 4.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( k5 ).value() , 5.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( k5 ).value() , 5.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( k6 ).value() , 6.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( k6 ).value() , 6.0 , 1.0e-10 );
+ }
+
+ state_type res , x;
+ deriv_type k1 , k2 , k3 , k4 , k5 , k6 ;
+};
+
+
+
+BOOST_AUTO_TEST_SUITE( fusion_algebra_test )
+
+fusion_algebra algebra;
+
+BOOST_AUTO_TEST_CASE( for_each2 )
+{
+ fusion_fixture f;
+ algebra.for_each2( f.res , f.k1 ,
+ default_operations::scale_sum1< time_type >( dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 0.1 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 0.1 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each3 )
+{
+ fusion_fixture f;
+ algebra.for_each3( f.res , f.x , f.k1 ,
+ default_operations::scale_sum2< value_type , time_type >( 1.0 , dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 1.1 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 1.1 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each4 )
+{
+ fusion_fixture f;
+ algebra.for_each4( f.res , f.x , f.k1 , f.k2 ,
+ default_operations::scale_sum3< value_type , time_type , time_type >( 1.0 , dt , dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 1.3 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 1.3 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each5 )
+{
+ fusion_fixture f;
+ algebra.for_each5( f.res , f.x , f.k1 , f.k2 , f.k3 ,
+ default_operations::scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 1.6 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 1.6 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each6 )
+{
+ fusion_fixture f;
+ algebra.for_each6( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 ,
+ default_operations::scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 2.0 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 2.0 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each7 )
+{
+ fusion_fixture f;
+ algebra.for_each7( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 , f.k5 ,
+ default_operations::scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 2.5 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 2.5 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each8 )
+{
+ fusion_fixture f;
+ algebra.for_each8( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 , f.k5 , f.k6 ,
+ default_operations::scale_sum7< value_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt , dt ) );
+ BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 3.1 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 3.1 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( for_each15 )
+{
+ fusion_fixture f;
+ algebra.for_each15( f.res , f.x , f.k1 , f.k2 , f.k3 , f.k4 , f.k5 , f.k6 , f.k1 , f.k2 , f.k3 , f.k4 , f.k5 , f.k6 , f.k1 ,
+ default_operations::scale_sum14< value_type , time_type , time_type , time_type , time_type , time_type , time_type ,
+ time_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt , dt , dt , dt , dt , dt , dt , dt , dt , dt , dt , dt , dt ) );
+ //BOOST_CHECK_CLOSE( fusion::at_c< 0 >( f.res ).value() , 3.1 , 1.0e-10 );
+ //BOOST_CHECK_CLOSE( fusion::at_c< 1 >( f.res ).value() , 3.1 , 1.0e-10 );
+}
+
+
+BOOST_AUTO_TEST_CASE( reduce )
+{
+ double sum = algebra.reduce( fusion::make_vector( 1.0 , 2.0 , 3.0 ) , std::plus< double >() , 0.0 );
+ BOOST_CHECK_CLOSE( sum , 6.0 , 1.0e-10 );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/generation.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/generation.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,87 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/generation.cpp
+
+ [begin_description]
+ This file tests the generation functions.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_generation
+
+#include <vector>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/numeric/odeint/config.hpp>
+#include <boost/numeric/odeint/stepper/generation.hpp>
+
+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 ));
+}
+
+BOOST_AUTO_TEST_SUITE( generation_test )
+
+typedef std::vector< double > state_type;
+
+typedef runge_kutta_cash_karp54< state_type > rk54_type;
+typedef runge_kutta_cash_karp54_classic< state_type > rk54_classic_type;
+typedef runge_kutta_dopri5< state_type > dopri5_type;
+typedef runge_kutta_fehlberg78< state_type > fehlberg78_type;
+typedef rosenbrock4< double > rosenbrock4_type;
+
+
+BOOST_AUTO_TEST_CASE( test_generation_dopri5 )
+{
+ check_stepper_type( make_controlled( 1.0e-6 , 1.0e-10 , dopri5_type() ) , controlled_runge_kutta< dopri5_type >() );
+ check_stepper_type( make_controlled< dopri5_type >( 1.0e-6 , 1.0e-10 ) , controlled_runge_kutta< dopri5_type >() );
+
+ check_stepper_type( make_dense_output( 1.0e-6 , 1.0e-10 , dopri5_type() ) , dense_output_runge_kutta< controlled_runge_kutta< dopri5_type > >() );
+ check_stepper_type( make_dense_output< dopri5_type >( 1.0e-6 , 1.0e-10 ) , dense_output_runge_kutta< controlled_runge_kutta< dopri5_type > >() );
+}
+
+BOOST_AUTO_TEST_CASE( test_generation_cash_karp54 )
+{
+ check_stepper_type( make_controlled( 1.0e-6 , 1.0e-10 , rk54_type() ) , controlled_runge_kutta< rk54_type >() );
+ check_stepper_type( make_controlled< rk54_type >( 1.0e-6 , 1.0e-10 ) , controlled_runge_kutta< rk54_type >() );
+}
+
+BOOST_AUTO_TEST_CASE( test_generation_cash_karp54_classic )
+{
+ check_stepper_type( make_controlled( 1.0e-6 , 1.0e-10 , rk54_classic_type() ) , controlled_runge_kutta< rk54_classic_type >() );
+ check_stepper_type( make_controlled< rk54_classic_type >( 1.0e-6 , 1.0e-10 ) , controlled_runge_kutta< rk54_classic_type >() );
+}
+
+
+BOOST_AUTO_TEST_CASE( test_generation_fehlberg78 )
+{
+ check_stepper_type( make_controlled( 1.0e-6 , 1.0e-10 , fehlberg78_type() ) , controlled_runge_kutta< fehlberg78_type >() );
+ check_stepper_type( make_controlled< fehlberg78_type >( 1.0e-6 , 1.0e-10 ) , controlled_runge_kutta< fehlberg78_type >() );
+}
+
+
+BOOST_AUTO_TEST_CASE( test_generation_rosenbrock4 )
+{
+ check_stepper_type( make_controlled( 1.0e-6 , 1.0e-10 , rosenbrock4_type() ) , rosenbrock4_controller< rosenbrock4_type >() );
+ check_stepper_type( make_controlled< rosenbrock4_type >( 1.0e-6 , 1.0e-10 ) , rosenbrock4_controller< rosenbrock4_type >() );
+
+ check_stepper_type( make_dense_output( 1.0e-6 , 1.0e-10 , rosenbrock4_type() ) , rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4_type > >() );
+ check_stepper_type( make_dense_output< rosenbrock4_type >( 1.0e-6 , 1.0e-10 ) , rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4_type > >() );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/generic_error_stepper.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/generic_error_stepper.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,111 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/generic_error_stepper.cpp
+
+ [begin_description]
+ This file tests the generic error stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_generic_error_stepper
+
+#include <iostream>
+#include <utility>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+
+#include <boost/array.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+namespace fusion = boost::fusion;
+
+typedef double value_type;
+typedef boost::array< value_type , 2 > state_type;
+
+void sys( const state_type &x , state_type &dxdt , const value_type &t )
+{
+ dxdt[ 0 ] = x[ 0 ] + 2 * x[ 1 ];
+ dxdt[ 1 ] = x[ 1 ];
+}
+
+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 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 }};
+const error_rk_generic_type::coef_b_type b2 = {{ b[0]-2825.0/27648.0 , b[1]-0.0 , b[2]-18575.0/48384.0 , b[3]-13525.0/55296.0 , b[4]-277.0/14336.0 , b[5]-0.25 }};
+const error_rk_generic_type::coef_c_type c = {{ 0.0 , 0.2 , 0.3 , 0.6 , 1.0 , 7.0/8 }};
+
+typedef runge_kutta_cash_karp54< state_type > error_rk54_ck_generic_type;
+typedef runge_kutta_cash_karp54_classic< state_type > rk54_ck_type;
+
+BOOST_AUTO_TEST_SUITE( generic_error_stepper_test )
+
+BOOST_AUTO_TEST_CASE( test_generic_error_stepper )
+{
+ //simultaneously test copying
+ error_rk_generic_type rk_generic_( a , b , b2 , c );
+ error_rk_generic_type rk_generic = rk_generic_;
+
+ error_rk54_ck_generic_type rk54_ck_generic_;
+ error_rk54_ck_generic_type rk54_ck_generic = rk54_ck_generic_;
+
+ //std::cout << stepper;
+
+ rk54_ck_type rk54_ck_;
+ rk54_ck_type rk54_ck = rk54_ck_;
+
+ typedef error_rk_generic_type::state_type state_type;
+ typedef error_rk_generic_type::value_type stepper_value_type;
+ typedef error_rk_generic_type::deriv_type deriv_type;
+ typedef error_rk_generic_type::time_type time_type;
+
+ state_type x = {{ 0.0 , 1.0 }};
+ state_type y = x;
+ state_type z = x;
+ state_type x_err , y_err , z_err;
+
+ rk_generic.do_step( sys , x , 0.0 , 0.1 , x_err );
+
+ rk54_ck_generic.do_step( sys , y , 0.0 , 0.1 , y_err);
+
+ rk54_ck.do_step( sys , z , 0.0 , 0.1 , z_err );
+
+ BOOST_CHECK_NE( 0.0 , x[0] );
+ BOOST_CHECK_NE( 1.0 , x[1] );
+ BOOST_CHECK_NE( 0.0 , x_err[0] );
+ BOOST_CHECK_NE( 0.0 , x_err[1] );
+ // compare with analytic solution of above system
+ BOOST_CHECK_EQUAL( x[0] , y[0] );
+ BOOST_CHECK_EQUAL( x[1] , y[1] );
+ BOOST_CHECK_EQUAL( x[0] , z[0] );
+ BOOST_CHECK_EQUAL( x[1] , z[1] );
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/generic_stepper.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/generic_stepper.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,104 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/generic_stepper.cpp
+
+ [begin_description]
+ This file tests the generic stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_generic_stepper
+
+#include <iostream>
+#include <utility>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+
+#include <boost/array.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+namespace fusion = boost::fusion;
+
+typedef double value_type;
+typedef boost::array< value_type , 2 > state_type;
+
+void sys( const state_type &x , state_type &dxdt , const value_type &t )
+{
+ dxdt[ 0 ] = x[ 0 ] + 2 * x[ 1 ];
+ dxdt[ 1 ] = x[ 1 ];
+}
+
+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 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 }};
+const rk_generic_type::coef_c_type c = {{ 0.0 , 0.5 , 0.5 , 1.0 }};
+
+typedef runge_kutta4_classic< state_type > rk4_type;
+
+BOOST_AUTO_TEST_SUITE( generic_stepper_test )
+
+BOOST_AUTO_TEST_CASE( test_generic_stepper )
+{
+ //simultaneously test copying
+ rk_generic_type rk_generic_( a , b , c );
+ rk_generic_type rk_generic = rk_generic_;
+
+ rk4_generic_type rk4_generic_;
+ rk4_generic_type rk4_generic = rk4_generic_;
+
+ //std::cout << stepper;
+
+ rk4_type rk4_;
+ rk4_type rk4 = rk4_;
+
+ typedef rk_generic_type::state_type state_type;
+ typedef rk_generic_type::value_type stepper_value_type;
+ typedef rk_generic_type::deriv_type deriv_type;
+ typedef rk_generic_type::time_type time_type;
+
+ state_type x = {{ 0.0 , 1.0 }};
+ state_type y = x;
+ state_type z = x;
+
+ rk_generic.do_step( sys , x , 0.0 , 0.1 );
+
+ rk4_generic.do_step( sys , y , 0.0 , 0.1 );
+
+ rk4.do_step( sys , z , 0.0 , 0.1 );
+
+ BOOST_CHECK_NE( 0.0 , x[0] );
+ BOOST_CHECK_NE( 1.0 , x[1] );
+ // compare with analytic solution of above system
+ BOOST_CHECK_EQUAL( x[0] , y[0] );
+ BOOST_CHECK_EQUAL( x[1] , y[1] );
+ BOOST_CHECK_EQUAL( x[0] , z[0] );
+ BOOST_CHECK_EQUAL( x[1] , z[1] );
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/implicit_euler.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/implicit_euler.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,86 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/implicit_euler.cpp
+
+ [begin_description]
+ This file tests the implicit Euler stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_implicit_euler
+
+#include <boost/test/unit_test.hpp>
+
+#include <utility>
+#include <iostream>
+
+#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
+//#include <boost/numeric/odeint/util/ublas_resize.hpp>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef boost::numeric::ublas::vector< value_type > state_type;
+typedef boost::numeric::ublas::matrix< value_type > matrix_type;
+
+/* use functors, because functions don't work with msvc 10, I guess this is a bug */
+struct sys
+{
+ void operator()( const state_type &x , state_type &dxdt , const value_type t ) const
+ {
+ dxdt( 0 ) = x( 0 ) + 2 * x( 1 );
+ dxdt( 1 ) = x( 1 );
+ }
+};
+
+struct jacobi
+{
+ void operator()( const state_type &x , matrix_type &jacobi , const value_type t ) const
+ {
+ jacobi( 0 , 0 ) = 1;
+ jacobi( 0 , 1 ) = 2;
+ jacobi( 1 , 0 ) = 0;
+ jacobi( 1 , 1 ) = 1;
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( implicit_euler_test )
+
+BOOST_AUTO_TEST_CASE( test_euler )
+{
+ implicit_euler< value_type > stepper;
+ state_type x( 2 );
+ x(0) = 0.0; x(1) = 1.0;
+
+ value_type eps = 1E-12;
+
+ /* make_pair doesn't work with function pointers on msvc 10 */
+ stepper.do_step( std::make_pair( sys() , jacobi() ) , x , 0.0 , 0.1 );
+
+ using std::abs;
+
+ // compare with analytic solution of above system
+ BOOST_CHECK_MESSAGE( abs( x(0) - 20.0/81.0 ) < eps , x(0) - 20.0/81.0 );
+ BOOST_CHECK_MESSAGE( abs( x(1) - 10.0/9.0 ) < eps , x(0) - 10.0/9.0 );
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/integrate.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/integrate.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,275 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/integrate.cpp
+
+ [begin_description]
+ This file tests the integrate function and its variants.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+
+#define BOOST_TEST_MODULE odeint_integrate_functions
+
+#include <vector>
+#include <cmath>
+#include <iostream>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/array.hpp>
+#include <boost/ref.hpp>
+#include <boost/iterator/counting_iterator.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/vector.hpp>
+
+// nearly everything from odeint is used in these tests
+#include <boost/numeric/odeint/integrate/integrate_const.hpp>
+#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp>
+#include <boost/numeric/odeint/integrate/integrate_times.hpp>
+#include <boost/numeric/odeint/integrate/integrate_n_steps.hpp>
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/modified_midpoint.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
+
+#include <boost/numeric/odeint/util/detail/less_with_sign.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+
+
+typedef double value_type;
+typedef std::vector< value_type > state_type;
+
+void lorenz( const state_type &x , state_type &dxdt , const value_type t )
+{
+ //const value_type sigma( 10.0 );
+ const value_type R( 28.0 );
+ const value_type b( value_type( 8.0 ) / value_type( 3.0 ) );
+
+ // first component trivial
+ dxdt[0] = 1.0; //sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+}
+
+struct push_back_time
+{
+ std::vector< double >& m_times;
+
+ state_type& m_x;
+
+ push_back_time( std::vector< double > &times , state_type &x )
+ : m_times( times ) , m_x( x ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ m_times.push_back( t );
+ boost::numeric::odeint::copy( x , m_x );
+ }
+};
+
+template< class Stepper >
+struct perform_integrate_const_test
+{
+ void operator()( const value_type t_end , const value_type dt )
+ {
+ std::cout << "Testing integrate_const with " << typeid( Stepper ).name() << std::endl;
+
+ state_type x( 3 , 10.0 ) , x_end( 3 );
+
+ std::vector< value_type > times;
+
+ integrate_const( Stepper() , lorenz , x , 0.0 , t_end ,
+ dt , push_back_time( times , x_end ) );
+
+ // int steps = times.size()-1;
+
+ //std::cout << t_end << " (" << dt << "), " << steps << " , " << times.size() << " , " << 10.0+dt*steps << "=" << x_end[0] << std::endl;
+
+ BOOST_CHECK_EQUAL( static_cast<int>(times.size()) , static_cast<int>(floor(t_end/dt))+1 );
+
+ for( size_t i=0 ; i<times.size() ; ++i )
+ {
+ //std::cout << i << " , " << times[i] << " , " << static_cast< value_type >(i)*dt << std::endl;
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_SMALL( times[i] - static_cast< value_type >(i)*dt , (i+1) * 2E-16 );
+ }
+
+ // check first, trivial, component
+ BOOST_CHECK_SMALL( (10.0 + times[times.size()-1]) - x_end[0] , 1E-6 ); // precision of steppers: 1E-6
+ //BOOST_CHECK_EQUAL( x[1] , x_end[1] );
+ //BOOST_CHECK_EQUAL( x[2] , x_end[2] );
+ }
+};
+
+template< class Stepper >
+struct perform_integrate_adaptive_test
+{
+ void operator()( const value_type t_end = 10.0 , const value_type dt = 0.03 )
+ {
+ std::cout << "Testing integrate_adaptive with " << typeid( Stepper ).name() << std::endl;
+
+ state_type x( 3 , 10.0 ) , x_end( 3 );
+
+ std::vector< value_type > times;
+
+ size_t steps = integrate_adaptive( Stepper() , *lorenz , x , 0.0 , t_end ,
+ dt , push_back_time( times , x_end ) );
+
+// std::cout << t_end << " , " << steps << " , " << times.size() << " , " << 10.0+dt*steps << "=" << x_end[0] << std::endl;
+
+ BOOST_CHECK_EQUAL( times.size() , steps+1 );
+
+ BOOST_CHECK_SMALL( times[0] - 0.0 , 2E-16 );
+ BOOST_CHECK_SMALL( times[times.size()-1] - t_end , times.size() * 2E-16 );
+
+ // check first, trivial, component
+ BOOST_CHECK_SMALL( (10.0 + t_end) - x_end[0] , 1E-6 ); // precision of steppers: 1E-6
+// BOOST_CHECK_EQUAL( x[1] , x_end[1] );
+// BOOST_CHECK_EQUAL( x[2] , x_end[2] );
+ }
+};
+
+
+template< class Stepper >
+struct perform_integrate_times_test
+{
+ void operator()( const int n = 10 , const int dn=1 , const value_type dt = 0.03 )
+ {
+ std::cout << "Testing integrate_times with " << typeid( Stepper ).name() << std::endl;
+
+ state_type x( 3 ) , x_end( 3 );
+ x[0] = x[1] = x[2] = 10.0;
+
+ std::vector< double > times;
+
+ std::vector< double > obs_times( abs(n) );
+ for( int i=0 ; boost::numeric::odeint::detail::less_with_sign( i ,
+ static_cast<int>(obs_times.size()) ,
+ dt ) ; i+=dn )
+ {
+ obs_times[i] = i;
+ }
+ // simple stepper
+ integrate_times( Stepper() , lorenz , x , obs_times.begin() , obs_times.end() ,
+ dt , push_back_time( times , x_end ) );
+
+ BOOST_CHECK_EQUAL( static_cast<int>(times.size()) , abs(n) );
+
+ for( size_t i=0 ; i<times.size() ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+
+ // check first, trivial, component
+ BOOST_CHECK_SMALL( (10.0 + 1.0*times[times.size()-1]) - x_end[0] , 1E-6 ); // precision of steppers: 1E-6
+// BOOST_CHECK_EQUAL( x[1] , x_end[1] );
+// BOOST_CHECK_EQUAL( x[2] , x_end[2] );
+ }
+};
+
+template< class Stepper >
+struct perform_integrate_n_steps_test
+{
+ void operator()( const int n = 200 , const value_type dt = 0.01 )
+ {
+ std::cout << "Testing integrate_n_steps with " << typeid( Stepper ).name() << std::endl;
+
+ state_type x( 3 ) , x_end( 3 );
+ x[0] = x[1] = x[2] = 10.0;
+
+ std::vector< double > times;
+
+ // simple stepper
+ value_type end_time = integrate_n_steps( Stepper() , lorenz , x , 0.0 , dt , n , push_back_time( times , x_end ) );
+
+ BOOST_CHECK_SMALL( end_time - n*dt , 2E-16 );
+ BOOST_CHECK_EQUAL( static_cast<int>(times.size()) , n+1 );
+
+ for( size_t i=0 ; i<times.size() ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_SMALL( times[i] - static_cast< value_type >(i)*dt , 2E-16 );
+
+ // check first, trivial, component
+ BOOST_CHECK_SMALL( (10.0 + end_time) - x_end[0] , 1E-6 ); // precision of steppers: 1E-6
+// BOOST_CHECK_EQUAL( x[1] , x_end[1] );
+// BOOST_CHECK_EQUAL( x[2] , x_end[2] );
+
+ }
+};
+
+
+
+class stepper_methods : public mpl::vector<
+ euler< state_type > ,
+ modified_midpoint< state_type > ,
+ runge_kutta4< state_type > ,
+ runge_kutta_cash_karp54< state_type > ,
+ runge_kutta_dopri5< state_type > ,
+ runge_kutta_fehlberg78< state_type > ,
+ controlled_runge_kutta< runge_kutta_cash_karp54< state_type > > ,
+ controlled_runge_kutta< runge_kutta_dopri5< state_type > > ,
+ controlled_runge_kutta< runge_kutta_fehlberg78< state_type > > ,
+ bulirsch_stoer< state_type > ,
+ dense_output_runge_kutta< controlled_runge_kutta< runge_kutta_dopri5< state_type > > >
+ //bulirsch_stoer_dense_out< state_type >
+> { };
+
+
+
+BOOST_AUTO_TEST_SUITE( integrate_test )
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_const_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_const_test< Stepper > tester;
+ tester( 1.005 , 0.01 );
+ tester( 1.0 , 0.01 );
+ tester( 1.1 , 0.01 );
+ tester( -1.005 , -0.01 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_adaptive_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_adaptive_test< Stepper > tester;
+ tester( 1.005 , 0.01 );
+ tester( 1.0 , 0.01 );
+ tester( 1.1 , 0.01 );
+ tester( -1.005 , -0.01 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_times_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_times_test< Stepper > tester;
+ tester();
+ //tester( -10 , -0.01 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_n_steps_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_n_steps_test< Stepper > tester;
+ tester();
+ tester( 200 , 0.01 );
+ tester( 200 , 0.01 );
+ tester( 200 , 0.01 );
+ tester( 200 , -0.01 );
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/integrate_implicit.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/integrate_implicit.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,226 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/integrate_implicit.cpp
+
+ [begin_description]
+ This file tests the integrate function and its variants with the implicit steppers.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#define BOOST_TEST_MODULE odeint_integrate_functions_implicit
+
+#include <vector>
+#include <cmath>
+#include <iostream>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/array.hpp>
+#include <boost/ref.hpp>
+#include <boost/iterator/counting_iterator.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/vector.hpp>
+
+#include <boost/numeric/odeint/integrate/integrate_const.hpp>
+#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp>
+#include <boost/numeric/odeint/integrate/integrate_times.hpp>
+#include <boost/numeric/odeint/integrate/integrate_n_steps.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp>
+
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+namespace ublas = boost::numeric::ublas;
+
+typedef double value_type;
+typedef ublas::vector< value_type > state_type;
+typedef boost::numeric::ublas::matrix< value_type > matrix_type;
+
+struct sys
+{
+ void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const
+ {
+ dxdt( 0 ) = x( 0 ) + 2 * x( 1 );
+ dxdt( 1 ) = x( 1 );
+ }
+};
+
+struct jacobi
+{
+ void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const
+ {
+ jacobi( 0 , 0 ) = 1;
+ jacobi( 0 , 1 ) = 2;
+ jacobi( 1 , 0 ) = 0;
+ jacobi( 1 , 1 ) = 1;
+ dfdt( 0 ) = 0.0;
+ dfdt( 1 ) = 0.0;
+ }
+};
+
+struct push_back_time
+{
+ std::vector< double >& m_times;
+
+ push_back_time( std::vector< double > &times )
+ : m_times( times ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ m_times.push_back( t );
+ }
+};
+
+template< class Stepper >
+struct perform_integrate_const_test
+{
+ void operator()( void )
+ {
+ state_type x( 2 , 1.0 );
+ const value_type dt = 0.03;
+ const value_type t_end = 10.0;
+
+ std::vector< value_type > times;
+
+ integrate_const( Stepper() , std::make_pair( sys() , jacobi() ) , x , 0.0 , t_end ,
+ dt , push_back_time( times ) );
+
+ BOOST_CHECK_EQUAL( static_cast<int>(times.size()) , static_cast<int>(floor(t_end/dt))+1 );
+
+ for( size_t i=0 ; i<times.size() ; ++i )
+ {
+ //std::cout << i << std::endl;
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_SMALL( times[i] - static_cast< value_type >(i)*dt , (i+1) * 2E-16 );
+ }
+ }
+};
+
+template< class Stepper >
+struct perform_integrate_adaptive_test
+{
+ void operator()( void )
+ {
+ state_type x( 2 , 1.0 );
+ const value_type dt = 0.03;
+ const value_type t_end = 10.0;
+
+ std::vector< value_type > times;
+
+ size_t steps = integrate_adaptive( Stepper() , std::make_pair( sys() , jacobi() ) , x , 0.0 , t_end ,
+ dt , push_back_time( times ) );
+
+ BOOST_CHECK_EQUAL( times.size() , steps+1 );
+
+ BOOST_CHECK_SMALL( times[0] - 0.0 , 2E-16 );
+ BOOST_CHECK_SMALL( times[times.size()-1] - t_end , times.size() * 2E-16 );
+ }
+};
+
+
+template< class Stepper >
+struct perform_integrate_times_test
+{
+ void operator()( void )
+ {
+ state_type x( 2 , 1.0 );
+
+ const value_type dt = 0.03;
+
+ std::vector< double > times;
+
+ // simple stepper
+ integrate_times( Stepper() , std::make_pair( sys() , jacobi() ) , x ,
+ boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
+ dt , push_back_time( times ) );
+
+ BOOST_CHECK_EQUAL( static_cast<int>(times.size()) , 10 );
+
+ for( size_t i=0 ; i<times.size() ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ }
+};
+
+template< class Stepper >
+struct perform_integrate_n_steps_test
+{
+ void operator()( void )
+ {
+ state_type x( 2 , 1.0 );
+
+ const value_type dt = 0.03;
+ const int n = 200;
+
+ std::vector< double > times;
+
+ // simple stepper
+ value_type end_time = integrate_n_steps( Stepper() , std::make_pair( sys() , jacobi() ) , x , 0.0 , dt , n , push_back_time( times ) );
+
+ BOOST_CHECK_SMALL( end_time - n*dt , 2E-16 );
+ BOOST_CHECK_EQUAL( static_cast<int>(times.size()) , n+1 );
+
+ for( size_t i=0 ; i<times.size() ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_SMALL( times[i] - static_cast< value_type >(i)*dt , (i+1) * 2E-16 );
+ }
+};
+
+
+
+class stepper_methods : public mpl::vector<
+ rosenbrock4< value_type > ,
+ rosenbrock4_controller< rosenbrock4< value_type > > ,
+ rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4< value_type > > >
+> { };
+
+
+
+BOOST_AUTO_TEST_SUITE( integrate_test )
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_const_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_const_test< Stepper > tester;
+ tester();
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_adaptive_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_adaptive_test< Stepper > tester;
+ tester();
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_times_test_case , Stepper, stepper_methods )
+{
+ perform_integrate_times_test< Stepper > tester;
+ tester();
+}
+
+
+class simple_stepper_methods : public mpl::vector<
+ rosenbrock4< value_type >
+> { };
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_n_steps_test_case , Stepper, simple_stepper_methods )
+{
+ perform_integrate_n_steps_test< Stepper > tester;
+ tester();
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/integrate_times.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/integrate_times.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,187 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/integrate_times.cpp
+
+ [begin_description]
+ This file tests the integrate_times function and its variants.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#define BOOST_TEST_MODULE odeint_integrate_times
+
+#include <boost/test/unit_test.hpp>
+
+#include <utility>
+#include <iostream>
+#include <vector>
+
+#include <boost/ref.hpp>
+#include <boost/iterator/counting_iterator.hpp>
+
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+#include <boost/numeric/odeint/integrate/integrate_times.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef std::vector< value_type > state_type;
+
+
+void lorenz( const state_type &x , state_type &dxdt , const value_type t )
+{
+ const value_type sigma( 10.0 );
+ const value_type R( 28.0 );
+ const value_type b( value_type( 8.0 ) / value_type( 3.0 ) );
+
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = -b * x[2] + x[0] * x[1];
+}
+
+struct push_back_time
+{
+ std::vector< double >& m_times;
+
+ push_back_time( std::vector< double > &times )
+ : m_times( times ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ m_times.push_back( t );
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( integrate_times_test )
+
+BOOST_AUTO_TEST_CASE( test_integrate_times )
+{
+
+ state_type x( 3 );
+ x[0] = x[1] = x[2] = 10.0;
+
+ const value_type dt = 0.03;
+
+ std::vector< double > times;
+
+ // simple stepper
+ integrate_times( runge_kutta4< state_type >() , lorenz , x , boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ times.clear();
+
+ // controlled stepper
+ integrate_times( controlled_runge_kutta< runge_kutta_dopri5< state_type > >() , lorenz , x ,
+ boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ times.clear();
+
+ //another controlled stepper
+ integrate_times( bulirsch_stoer< state_type >() , lorenz , x ,
+ boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ times.clear();
+
+
+ // dense output stepper
+
+ integrate_times( dense_output_runge_kutta< controlled_runge_kutta< runge_kutta_dopri5< state_type > > >() ,
+ lorenz , x ,
+ boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+
+
+ integrate_times( bulirsch_stoer_dense_out< state_type >() , lorenz , x ,
+ boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+
+}
+
+
+BOOST_AUTO_TEST_CASE( test_integrate_times_ranges )
+{
+
+ state_type x( 3 );
+ x[0] = x[1] = x[2] = 10.0;
+
+ const value_type dt = 0.03;
+
+ std::vector< double > times;
+
+ // simple stepper
+ integrate_times( runge_kutta4< state_type >() , lorenz , x ,
+ std::make_pair( boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ times.clear();
+
+ // controlled stepper
+ integrate_times( controlled_runge_kutta< runge_kutta_dopri5< state_type > >() , lorenz , x ,
+ std::make_pair( boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ times.clear();
+
+ //another controlled stepper
+ integrate_times( bulirsch_stoer< state_type >() , lorenz , x ,
+ std::make_pair( boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+ times.clear();
+
+
+ // dense output stepper
+ integrate_times( bulirsch_stoer_dense_out< state_type >() , lorenz , x ,
+ std::make_pair( boost::counting_iterator<int>(0) , boost::counting_iterator<int>(10) ) ,
+ dt , push_back_time( times ) );
+
+ for( int i=0 ; i<10 ; ++i )
+ // check if observer was called at times 0,1,2,...
+ BOOST_CHECK_EQUAL( times[i] , static_cast<double>(i) );
+
+}
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/is_pair.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/is_pair.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,49 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/is_pair.cpp
+
+ [begin_description]
+ This file tests the is_pair meta-function.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+*/
+
+#define BOOST_TEST_MODULE odeint_is_pair
+
+#include <utility>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/static_assert.hpp>
+
+#include <boost/numeric/odeint/util/is_pair.hpp>
+
+using namespace boost::numeric::odeint;
+
+
+
+BOOST_AUTO_TEST_SUITE( is_pair_test )
+
+BOOST_AUTO_TEST_CASE( test_is_pair )
+{
+ typedef std::pair< int , int > type1;
+ typedef std::pair< int& , int > type2;
+ typedef std::pair< int , int& > type3;
+ typedef std::pair< int& , int& > type4;
+ 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 ));
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/is_resizeable.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/is_resizeable.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,88 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/is_resizeable.cpp
+
+ [begin_description]
+ This file tests is_resizeable meta-function of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_is_resizeable
+
+#include <vector>
+#include <cmath>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+#include <boost/fusion/include/vector.hpp>
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+BOOST_AUTO_TEST_CASE( test_vector )
+{
+ BOOST_CHECK( is_resizeable< std::vector< int > >::value );
+}
+
+BOOST_AUTO_TEST_CASE( test_double )
+{
+ BOOST_CHECK( !( is_resizeable< double >::value ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_of_vector )
+{
+ typedef boost::fusion::vector< std::vector< double > , std::vector< double > > state_type;
+ BOOST_CHECK( is_resizeable< state_type >::value );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_of_double )
+{
+ typedef boost::fusion::vector< double , double > state_type;
+ BOOST_CHECK( !( is_resizeable< state_type >::value ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_mixed1 )
+{
+ typedef boost::fusion::vector< double , std::vector< double > > state_type;
+ BOOST_CHECK( is_resizeable< state_type >::value);
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_mixed2 )
+{
+ typedef boost::fusion::vector< std::vector< double > , double > state_type;
+ BOOST_CHECK( is_resizeable< state_type >::value );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_quantity_sequence )
+{
+ namespace units = boost::units;
+ namespace si = boost::units::si;
+
+ typedef double value_type;
+ typedef units::quantity< si::time , value_type > time_type;
+ typedef units::quantity< si::length , value_type > length_type;
+ typedef units::quantity< si::velocity , value_type > velocity_type;
+ typedef boost::fusion::vector< length_type , velocity_type > state_type;
+
+ BOOST_CHECK( !( is_resizeable< state_type >::value ) );
+}

Added: trunk/libs/numeric/odeint/test/numeric/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/numeric/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,29 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+# bring in rules for testing
+
+
+import testing ;
+
+use-project boost : $(BOOST_ROOT) ;
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <define>BOOST_ALL_NO_LIB=1
+ <include>../../../..
+ <link>static
+ <toolset>clang:<cxxflags>-Wno-unused-variable
+
+# <cxxflags>-D_SCL_SECURE_NO_WARNINGS
+ ;
+
+test-suite "odeint"
+ :
+ [ run runge_kutta.cpp ]
+ [ run symplectic.cpp ]
+ [ run rosenbrock.cpp ]
+ : <testing.launcher>valgrind
+ ;

Added: trunk/libs/numeric/odeint/test/numeric/rosenbrock.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/numeric/rosenbrock.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,89 @@
+/* Boost numeric test of the rosenbrock4 stepper test file
+
+ Copyright 2012 Karsten Ahnert
+ Copyright 2012 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)
+*/
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE numeric_rosenbrock
+
+#include <iostream>
+#include <cmath>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef boost::numeric::ublas::vector< value_type > state_type;
+typedef boost::numeric::ublas::matrix< value_type > matrix_type;
+
+// harmonic oscillator, analytic solution x[0] = sin( t )
+struct sys
+{
+ void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const
+ {
+ dxdt( 0 ) = x( 1 );
+ dxdt( 1 ) = -x( 0 );
+ }
+};
+
+struct jacobi
+{
+ void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const
+ {
+ jacobi( 0 , 0 ) = 0;
+ jacobi( 0 , 1 ) = 1;
+ jacobi( 1 , 0 ) = -1;
+ jacobi( 1 , 1 ) = 0;
+ dfdt( 0 ) = 0.0;
+ dfdt( 1 ) = 0.0;
+ }
+};
+
+
+BOOST_AUTO_TEST_SUITE( numeric_rosenbrock4 )
+
+BOOST_AUTO_TEST_CASE( rosenbrock4_numeric_test )
+{
+ typedef rosenbrock4< value_type > stepper_type;
+ stepper_type stepper;
+
+ const int o = stepper.order()+1;
+
+ state_type x0( 2 ) , x1( 2 );
+ x0(0) = 0.0; x0(1) = 1.0;
+
+ double dt = 0.5;
+
+ stepper.do_step( std::make_pair( sys() , jacobi() ) , x0 , 0.0 , x1 , dt );
+ const double f = 2.0 * std::abs( sin(dt) - x1(0) ) / std::pow( dt , o );
+
+ std::cout << o << " , " << f << std::endl;
+
+ while( f*std::pow( dt , o ) > 1E-16 )
+ {
+ stepper.do_step( std::make_pair( sys() , jacobi() ) , x0 , 0.0 , x1 , dt );
+ std::cout << "Testing dt=" << dt << std::endl;
+ BOOST_CHECK_SMALL( std::abs( sin(dt) - x1(0) ) , f*std::pow( dt , o ) );
+ dt *= 0.5;
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/numeric/runge_kutta.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/numeric/runge_kutta.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,168 @@
+/* Boost numeric test of the runge kutta steppers test file
+
+ Copyright 2012 Karsten Ahnert
+ Copyright 2012 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)
+*/
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE numeric_runge_kutta
+
+#include <iostream>
+#include <cmath>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/vector.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+
+typedef double value_type;
+
+typedef boost::array< double , 2 > state_type;
+
+// harmonic oscillator, analytic solution x[0] = sin( t )
+struct osc
+{
+ void operator()( const state_type &x , state_type &dxdt , const double t ) const
+ {
+ dxdt[0] = x[1];
+ dxdt[1] = -x[0];
+ }
+};
+
+/* reset dispatcher */
+template< class StepperCategory >
+struct resetter
+{
+ template< class Stepper >
+ static void reset( Stepper &stepper ) { }
+};
+
+template< >
+struct resetter< explicit_error_stepper_fsal_tag >
+{
+ template< class Stepper >
+ static void reset( Stepper &stepper )
+ { stepper.reset(); }
+};
+
+
+BOOST_AUTO_TEST_SUITE( numeric_runge_kutta_test )
+
+
+/* generic test for all runge kutta steppers */
+template< class Stepper >
+struct perform_runge_kutta_test
+{
+ void operator()( void )
+ {
+
+ Stepper stepper;
+ const int o = stepper.order()+1; //order of the error is order of approximation + 1
+
+ const state_type x0 = {{ 0.0 , 1.0 }};
+ state_type x1;
+ const double t = 0.0;
+ /* do a first step with dt=0.1 to get an estimate on the prefactor of the error dx = f * dt^(order+1) */
+ double dt = 0.5;
+ stepper.do_step( osc() , x0 , t , x1 , dt );
+ const double f = 2.0 * std::abs( sin(dt) - x1[0] ) / std::pow( dt , o ); // upper bound
+
+ std::cout << o << " , " << f << std::endl;
+
+ /* as long as we have errors above machine precision */
+ while( f*std::pow( dt , o ) > 1E-16 )
+ {
+ // reset stepper which require resetting (fsal steppers)
+ resetter< typename Stepper::stepper_category >::reset( stepper );
+
+ stepper.do_step( osc() , x0 , t , x1 , dt );
+ std::cout << "Testing dt=" << dt << std::endl;
+ BOOST_CHECK_LT( std::abs( sin(dt) - x1[0] ) , f*std::pow( dt , o ) );
+ dt *= 0.5;
+ }
+ }
+};
+
+
+/* generic error test for all runge kutta steppers */
+template< class Stepper >
+struct perform_runge_kutta_error_test
+{
+ void operator()( void )
+ {
+ Stepper stepper;
+ const int o = stepper.error_order()+1; //order of the error is order of approximation + 1
+
+ const state_type x0 = {{ 0.0 , 1.0 }};
+ state_type x1 , x_err;
+ const double t = 0.0;
+ /* do a first step with dt=0.1 to get an estimate on the prefactor of the error dx = f * dt^(order+1) */
+ double dt = 0.5;
+ stepper.do_step( osc() , x0 , t , x1 , dt , x_err );
+ const double f = 2.0 * std::abs( x_err[0] ) / std::pow( dt , o );
+
+ std::cout << o << " , " << f << " , " << x0[0] << std::endl;
+
+ /* as long as we have errors above machine precision */
+ while( f*std::pow( dt , o ) > 1E-16 )
+ {
+ // reset stepper which require resetting (fsal steppers)
+ resetter< typename Stepper::stepper_category >::reset( stepper );
+
+ stepper.do_step( osc() , x0 , t , x1 , dt , x_err );
+ std::cout << "Testing dt=" << dt << ": " << x_err[1] << std::endl;
+ BOOST_CHECK_SMALL( std::abs( x_err[0] ) , f*std::pow( dt , o ) );
+ dt *= 0.5;
+ }
+ }
+};
+
+
+typedef mpl::vector<
+ euler< state_type > ,
+ modified_midpoint< state_type > ,
+ runge_kutta4< state_type > ,
+ runge_kutta4_classic< state_type > ,
+ runge_kutta_cash_karp54_classic< state_type > ,
+ runge_kutta_cash_karp54< state_type > ,
+ runge_kutta_dopri5< state_type > ,
+ runge_kutta_fehlberg78< state_type >
+ > runge_kutta_steppers;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( runge_kutta_test , Stepper, runge_kutta_steppers )
+{
+ perform_runge_kutta_test< Stepper > tester;
+ tester();
+}
+
+
+typedef mpl::vector<
+ runge_kutta_cash_karp54_classic< state_type > ,
+ runge_kutta_cash_karp54< state_type > ,
+ runge_kutta_dopri5< state_type > ,
+ runge_kutta_fehlberg78< state_type >
+ > runge_kutta_error_steppers;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( runge_kutta_error_test , Stepper, runge_kutta_error_steppers )
+{
+ perform_runge_kutta_error_test< Stepper > tester;
+ tester();
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/numeric/symplectic.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/numeric/symplectic.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,95 @@
+/* Boost numeric test of the symplectic steppers test file
+
+ Copyright 2012 Karsten Ahnert
+ Copyright 2012 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)
+*/
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE numeric_symplectic
+
+#include <iostream>
+#include <cmath>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/vector.hpp>
+
+#include <boost/numeric/odeint.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+
+typedef double value_type;
+
+typedef boost::array< double ,1 > state_type;
+
+// harmonic oscillator, analytic solution x[0] = sin( t )
+struct osc
+{
+ void operator()( const state_type &q , state_type &dpdt ) const
+ {
+ dpdt[0] = -q[0];
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( numeric_symplectic_test )
+
+
+/* generic test for all symplectic steppers */
+template< class Stepper >
+struct perform_symplectic_test
+{
+ void operator()( void )
+ {
+
+ Stepper stepper;
+ const int o = stepper.order()+1; //order of the error is order of approximation + 1
+
+ const state_type q0 = {{ 0.0 }};
+ const state_type p0 = {{ 1.0 }};
+ state_type q1,p1;
+ std::pair< state_type , state_type >x1( q1 , p1 );
+ const double t = 0.0;
+ /* do a first step with dt=0.1 to get an estimate on the prefactor of the error dx = f * dt^(order+1) */
+ double dt = 0.5;
+ stepper.do_step( osc() , std::make_pair( q0 , p0 ) , t , x1 , dt );
+ const double f = 2.0 * std::abs( sin(dt) - x1.first[0] ) / std::pow( dt , o );
+
+ std::cout << o << " , " << f << std::endl;
+
+ /* as long as we have errors above machine precision */
+ while( f*std::pow( dt , o ) > 1E-16 )
+ {
+ stepper.do_step( osc() , std::make_pair( q0 , p0 ) , t , x1 , dt );
+ std::cout << "Testing dt=" << dt << std::endl;
+ BOOST_CHECK_SMALL( std::abs( sin(dt) - x1.first[0] ) , f*std::pow( dt , o ) );
+ dt *= 0.5;
+ }
+ }
+};
+
+
+typedef mpl::vector<
+ symplectic_euler< state_type > ,
+ symplectic_rkn_sb3a_mclachlan< state_type >
+ > symplectic_steppers;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( symplectic_test , Stepper, symplectic_steppers )
+{
+ perform_symplectic_test< Stepper > tester;
+ tester();
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/prepare_stepper_testing.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/prepare_stepper_testing.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,72 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/prepare_stepper_testing.hpp
+
+ [begin_description]
+ This file defines some helper functions for the stepper tests.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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 PREPARE_STEPPER_TESTING_HPP_
+#define PREPARE_STEPPER_TESTING_HPP_
+
+#include <boost/array.hpp>
+#include <vector>
+#include <boost/fusion/sequence.hpp>
+
+#include <boost/mpl/vector.hpp>
+
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+#include <boost/numeric/odeint/algebra/array_algebra.hpp>
+
+#include "vector_space_1d.hpp"
+
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+
+using namespace boost::numeric::odeint;
+
+/* the state types that will be tested */
+typedef std::vector< double > vector_type;
+typedef vector_space_1d< double > vector_space_type;
+typedef boost::array< double , 1 > array_type;
+
+typedef mpl::vector< vector_type , vector_space_type , array_type >::type container_types;
+
+/* choose the right algebra */
+template< class State > struct algebra_dispatcher { typedef range_algebra type; };
+template<> struct algebra_dispatcher< array_type > { typedef array_algebra type; };
+template<> struct algebra_dispatcher< vector_space_type > { typedef vector_space_algebra type; };
+template<> struct algebra_dispatcher< double > { typedef vector_space_algebra type; };
+
+
+
+/*
+typedef mpl::vector
+<
+ mpl::vector< float , boost::array< float , 1 > , boost::array< float , 1 > , constant_system_standard , stepper_type > ,
+ mpl::vector< float , boost::array< float , 1 > , std::vector< float > , constant_system_standard , stepper_type >
+ > types_and_systems_matrix;
+
+
+struct check_stepper
+{
+ template< class Vector >
+ void operator()( Vector )
+ {
+ typedef typename mpl::at_c< Vector , 0 >::type value_type;
+ typedef typename mpl::at_c< Vector , 1 >::type deriv_type;
+ typedef typename mpl::at_c< Vector , 2 >::type state_type;
+ typedef typename mpl::at_c< Vector , 3 >::type system_type;
+ }
+};
+*/
+
+#endif /* PREPARE_STEPPER_TESTING_HPP_ */

Added: trunk/libs/numeric/odeint/test/range_algebra.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/range_algebra.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,190 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/check_operations.cpp
+
+ [begin_description]
+ This file tests interaction between the algebras and the operations.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#define BOOST_TEST_MODULE odeint_standard_algebra
+
+#include <cmath>
+#include <complex>
+#include <utility>
+#include <functional>
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+#include <boost/numeric/odeint/algebra/default_operations.hpp>
+#include <boost/numeric/odeint/algebra/range_algebra.hpp>
+#include <boost/numeric/odeint/algebra/array_algebra.hpp>
+
+#include <boost/mpl/list.hpp>
+
+namespace units = boost::units;
+namespace si = boost::units::si;
+
+using boost::numeric::odeint::default_operations;
+using boost::numeric::odeint::range_algebra;
+using boost::numeric::odeint::array_algebra;
+
+
+BOOST_AUTO_TEST_SUITE( standard_algebra_test )
+
+typedef boost::mpl::list< range_algebra , array_algebra > algebra_types;
+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 }};
+ 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 );
+}
+
+
+
+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 }};
+ 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 );
+}
+
+
+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 }};
+ 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 );
+}
+
+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 }};
+ 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 );
+}
+
+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 }};
+ 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 );
+}
+
+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 }};
+ 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 );
+}
+
+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 }};
+ 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 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( reduce , algebra_type , algebra_types )
+{
+ algebra_type algebra;
+ boost::array< double , 2 > x = {{ 1.25 , 2.25 }};
+ double sum = algebra.reduce( x , std::plus< double >() , 0.0 );
+ BOOST_CHECK_CLOSE( sum , 3.5 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x[0] , 1.25 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x[1] , 2.25 , 1.0e-10 );
+}
+
+struct adder
+{
+ template< typename Value , typename T1 , typename T2 >
+ Value operator()( Value val , T1 t1 , T2 t2 ) const
+ {
+ return val + t1 + t2;
+ }
+
+ template< typename Value , typename T1 , typename T2 , typename T3 >
+ Value operator()( Value val , T1 t1 , T2 t2 , T3 t3 ) const
+ {
+ return val + t1 + t2 + t3 ;
+ }
+
+ template< typename Value , typename T1 , typename T2 , typename T3 , typename T4 >
+ Value operator()( Value val , T1 t1 , T2 t2 , T3 t3 , T4 t4 ) const
+ {
+ return val + t1 + t2 + t3 + t4 ;
+ }
+
+};
+
+BOOST_AUTO_TEST_CASE( reduce2 )
+{
+ range_algebra algebra;
+ boost::array< double , 2 > x1 = {{ 1.25 , 2.25 }} , x2 = {{ 0.5 , -1.0 }};
+ double sum = algebra.reduce2( x1 , x2 , adder() , 0.0 );
+ BOOST_CHECK_CLOSE( sum , 3.0 , 1.0e-10 );
+
+}
+
+BOOST_AUTO_TEST_CASE( reduce3 )
+{
+ range_algebra algebra;
+ boost::array< double , 2 > x1 = {{ 1.25 , 2.25 }} , x2 = {{ 0.5 , -1.0 }} , x3 = {{ 5.0 , 10.0 }};
+ double sum = algebra.reduce3( x1 , x2 , x3 , adder() , 0.0 );
+ BOOST_CHECK_CLOSE( sum , 18.0 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_CASE( reduce4 )
+{
+ range_algebra algebra;
+ boost::array< double , 2 > x1 = {{ 1.25 , 2.25 }} , x2 = {{ 0.5 , -1.0 }} , x3 = {{ 5.0 , 10.0 }} , x4 = {{ 2.0 , -1.0 }};
+ double sum = algebra.reduce4( x1 , x2 , x3 , x4 , adder() , 0.0 );
+ BOOST_CHECK_CLOSE( sum , 19.0 , 1.0e-10 );
+}
+
+
+BOOST_AUTO_TEST_CASE( for_each2_with_units )
+{
+ range_algebra algebra;
+ 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 }};
+ 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 );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/resize.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/resize.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,98 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/resize.cpp
+
+ [begin_description]
+ This file tests the resize function of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_resize
+
+#include <vector>
+#include <cmath>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/util/resize.hpp>
+#include <boost/fusion/include/vector.hpp>
+#include <boost/fusion/include/at.hpp>
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+BOOST_AUTO_TEST_CASE( test_vector )
+{
+ std::vector< double > x1( 10 );
+ std::vector< double > x2;
+ resize( x2 , x1 );
+ BOOST_CHECK( x2.size() == 10 );
+}
+
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_of_vector )
+{
+ typedef boost::fusion::vector< std::vector< double > , std::vector< double > > state_type;
+ state_type x1;
+ boost::fusion::at_c< 0 >( x1 ).resize( 10 );
+ boost::fusion::at_c< 1 >( x1 ).resize( 10 );
+ state_type x2;
+ resize( x2 , x1 );
+ BOOST_CHECK( boost::fusion::at_c< 0 >( x2 ).size() == 10 );
+ BOOST_CHECK( boost::fusion::at_c< 1 >( x2 ).size() == 10 );
+}
+
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_mixed1 )
+{
+ typedef boost::fusion::vector< std::vector< double > , double > state_type;
+ state_type x1;
+ boost::fusion::at_c< 0 >( x1 ).resize( 10 );
+ state_type x2;
+ resize( x2 , x1 );
+ BOOST_CHECK( boost::fusion::at_c< 0 >( x2 ).size() == 10 );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_vector_mixed2 )
+{
+ typedef boost::fusion::vector< double , std::vector< double > , double > state_type;
+ state_type x1;
+ boost::fusion::at_c< 1 >( x1 ).resize( 10 );
+ state_type x2;
+ resize( x2 , x1 );
+ BOOST_CHECK( boost::fusion::at_c< 1 >( x2 ).size() == 10 );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_quantity_sequence )
+{
+ namespace units = boost::units;
+ namespace si = boost::units::si;
+
+ typedef double value_type;
+ typedef units::quantity< si::time , value_type > time_type;
+ typedef units::quantity< si::length , value_type > length_type;
+ typedef units::quantity< si::velocity , value_type > velocity_type;
+ typedef boost::fusion::vector< length_type , velocity_type > state_type;
+
+ state_type x1 , x2;
+ resize( x2 , x1 );
+}

Added: trunk/libs/numeric/odeint/test/resizing.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/resizing.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,139 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/resizing.cpp
+
+ [begin_description]
+ This file tests the resizing mechanism of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_resize
+
+#include <vector>
+#include <cmath>
+
+#include <boost/array.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/at.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+
+#include <boost/numeric/odeint/util/resizer.hpp>
+#include <boost/numeric/odeint/util/is_resizeable.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+namespace mpl = boost::mpl;
+
+size_t adjust_size_count;
+
+typedef boost::array< double , 1 > test_array_type;
+
+namespace boost { namespace numeric { namespace odeint {
+
+
+ template<>
+ struct is_resizeable< test_array_type >
+ {
+ typedef boost::true_type type;
+ const static bool value = type::value;
+ };
+
+ template<>
+ struct same_size_impl< test_array_type , test_array_type >
+ {
+ static bool same_size( const test_array_type &x1 , const test_array_type &x2 )
+ {
+ return false;
+ }
+ };
+
+ template<>
+ struct resize_impl< test_array_type , test_array_type >
+ {
+ static void resize( test_array_type &x1 , const test_array_type &x2 )
+ {
+ adjust_size_count++;
+ }
+ };
+
+} } }
+
+
+
+void constant_system( const test_array_type &x , test_array_type &dxdt , double t ) { dxdt[0] = 1.0; }
+
+
+BOOST_AUTO_TEST_SUITE( check_resize_test )
+
+
+typedef euler< test_array_type , double , test_array_type , double , range_algebra , default_operations , never_resizer > euler_manual_type;
+typedef euler< test_array_type , double , test_array_type , double , range_algebra , default_operations , initially_resizer > euler_initially_type;
+typedef euler< test_array_type , double , test_array_type , double , range_algebra , default_operations , always_resizer > euler_always_type;
+
+typedef runge_kutta4_classic< test_array_type , double , test_array_type , double , range_algebra , default_operations , never_resizer > rk4_manual_type;
+typedef runge_kutta4_classic< test_array_type , double , test_array_type , double , range_algebra , default_operations , initially_resizer > rk4_initially_type;
+typedef runge_kutta4_classic< test_array_type , double , test_array_type , double , range_algebra , default_operations , always_resizer > rk4_always_type;
+
+
+typedef runge_kutta4< test_array_type , double , test_array_type , double , range_algebra , default_operations , never_resizer > rk4_gen_manual_type;
+typedef runge_kutta4< test_array_type , double , test_array_type , double , range_algebra , default_operations , initially_resizer > rk4_gen_initially_type;
+typedef runge_kutta4< test_array_type , double , test_array_type , double , range_algebra , default_operations , always_resizer > rk4_gen_always_type;
+
+
+typedef mpl::vector<
+ mpl::vector< euler_manual_type , mpl::int_<1> , mpl::int_<0> > ,
+ mpl::vector< euler_initially_type , mpl::int_<1> , mpl::int_<1> > ,
+ mpl::vector< euler_always_type , mpl::int_<1> , mpl::int_<3> > ,
+ mpl::vector< rk4_manual_type , mpl::int_<5> , mpl::int_<0> > ,
+ mpl::vector< rk4_initially_type , mpl::int_<5> , mpl::int_<1> > ,
+ mpl::vector< rk4_always_type , mpl::int_<5> , mpl::int_<3> > ,
+ mpl::vector< rk4_gen_manual_type , mpl::int_<5> , mpl::int_<0> > ,
+ mpl::vector< rk4_gen_initially_type , mpl::int_<5> , mpl::int_<1> > ,
+ mpl::vector< rk4_gen_always_type , mpl::int_<5> , mpl::int_<3> >
+ >::type resize_check_types;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_resize , T, resize_check_types )
+{
+ typedef typename mpl::at< T , mpl::int_< 0 > >::type stepper_type;
+ const size_t resize_calls = mpl::at< T , mpl::int_< 1 > >::type::value;
+ const size_t multiplicity = mpl::at< T , mpl::int_< 2 > >::type::value;
+ adjust_size_count = 0;
+
+ stepper_type stepper;
+ test_array_type x;
+ stepper.do_step( constant_system , x , 0.0 , 0.1 );
+ stepper.do_step( constant_system , x , 0.0 , 0.1 );
+ stepper.do_step( constant_system , x , 0.0 , 0.1 );
+
+ BOOST_TEST_MESSAGE( "adjust_size_count : " << adjust_size_count );
+ BOOST_CHECK_MESSAGE( adjust_size_count == resize_calls * multiplicity , "adjust_size_count : " << adjust_size_count << " expected: " << resize_calls * multiplicity );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/rosenbrock4.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/rosenbrock4.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,140 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/rosenbrock4.cpp
+
+ [begin_description]
+ This file tests the Rosenbrock 4 stepper and its controller and dense output stepper.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_rosenbrock4
+
+#include <utility>
+#include <iostream>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp>
+#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef boost::numeric::ublas::vector< value_type > state_type;
+typedef boost::numeric::ublas::matrix< value_type > matrix_type;
+
+
+struct sys
+{
+ void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const
+ {
+ dxdt( 0 ) = x( 0 ) + 2 * x( 1 );
+ dxdt( 1 ) = x( 1 );
+ }
+};
+
+struct jacobi
+{
+ void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const
+ {
+ jacobi( 0 , 0 ) = 1;
+ jacobi( 0 , 1 ) = 2;
+ jacobi( 1 , 0 ) = 0;
+ jacobi( 1 , 1 ) = 1;
+ dfdt( 0 ) = 0.0;
+ dfdt( 1 ) = 0.0;
+ }
+};
+
+BOOST_AUTO_TEST_SUITE( rosenbrock4_test )
+
+BOOST_AUTO_TEST_CASE( test_rosenbrock4_stepper )
+{
+ typedef rosenbrock4< value_type > stepper_type;
+ stepper_type stepper;
+
+ typedef stepper_type::state_type state_type;
+ typedef stepper_type::value_type stepper_value_type;
+ typedef stepper_type::deriv_type deriv_type;
+ typedef stepper_type::time_type time_type;
+
+ state_type x( 2 ) , xerr( 2 );
+ x(0) = 0.0; x(1) = 1.0;
+
+ stepper.do_step( std::make_pair( sys() , jacobi() ) , x , 0.0 , 0.1 , xerr );
+
+ stepper.do_step( std::make_pair( sys() , jacobi() ) , x , 0.0 , 0.1 );
+
+// using std::abs;
+// value_type eps = 1E-12;
+//
+// // compare with analytic solution of above system
+// BOOST_CHECK_SMALL( abs( x(0) - 20.0/81.0 ) , eps );
+// BOOST_CHECK_SMALL( abs( x(1) - 10.0/9.0 ) , eps );
+
+}
+
+BOOST_AUTO_TEST_CASE( test_rosenbrock4_controller )
+{
+ typedef rosenbrock4_controller< rosenbrock4< value_type > > stepper_type;
+ stepper_type stepper;
+
+ typedef stepper_type::state_type state_type;
+ typedef stepper_type::value_type stepper_value_type;
+ typedef stepper_type::deriv_type deriv_type;
+ typedef stepper_type::time_type time_type;
+
+ state_type x( 2 );
+ x( 0 ) = 0.0 ; x(1) = 1.0;
+
+ value_type t = 0.0 , dt = 0.01;
+ stepper.try_step( std::make_pair( sys() , jacobi() ) , x , t , dt );
+}
+
+BOOST_AUTO_TEST_CASE( test_rosenbrock4_dense_output )
+{
+ typedef rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4< value_type > > > stepper_type;
+ typedef rosenbrock4_controller< rosenbrock4< value_type > > controlled_stepper_type;
+ controlled_stepper_type c_stepper;
+ stepper_type stepper( c_stepper );
+
+ typedef stepper_type::state_type state_type;
+ typedef stepper_type::value_type stepper_value_type;
+ typedef stepper_type::deriv_type deriv_type;
+ typedef stepper_type::time_type time_type;
+ state_type x( 2 );
+ x( 0 ) = 0.0 ; x(1) = 1.0;
+ stepper.initialize( x , 0.0 , 0.1 );
+ std::pair< value_type , value_type > tr = stepper.do_step( std::make_pair( sys() , jacobi() ) );
+ stepper.calc_state( 0.5 * ( tr.first + tr.second ) , x );
+}
+
+BOOST_AUTO_TEST_CASE( test_rosenbrock4_copy_dense_output )
+{
+ typedef rosenbrock4_controller< rosenbrock4< value_type > > controlled_stepper_type;
+ typedef rosenbrock4_dense_output< controlled_stepper_type > stepper_type;
+
+ controlled_stepper_type c_stepper;
+ stepper_type stepper( c_stepper );
+ stepper_type stepper2( stepper );
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/runge_kutta_concepts.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/runge_kutta_concepts.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,169 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/runge_kutta_concepts.cpp
+
+ [begin_description]
+ This file tests the Stepper concepts of odeint with all Runge-Kutta steppers. It's one of the main tests
+ of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_runge_kutta_concepts
+
+#include <vector>
+#include <cmath>
+#include <iostream>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/ref.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+#include <boost/type_traits/add_reference.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/inserter.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/modified_midpoint.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
+
+#include "prepare_stepper_testing.hpp"
+#include "dummy_odes.hpp"
+
+using std::vector;
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+
+const double result = 2.2;
+
+const double eps = 1.0e-14;
+
+template< class Stepper , class System >
+void check_stepper_concept( Stepper &stepper , System system , typename Stepper::deriv_type &x )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::deriv_type container_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::time_type time_type;
+
+ stepper.do_step( system , x , 0.0 , 0.1 );
+}
+
+
+template< class Stepper , class State > struct perform_stepper_test;
+
+template< class Stepper >
+struct perform_stepper_test< Stepper , vector_type >
+{
+ void operator()( void )
+ {
+ vector_type x( 1 , 2.0 );
+ Stepper stepper;
+ check_stepper_concept( stepper , constant_system_standard< vector_type , vector_type , double > , x );
+ check_stepper_concept( stepper , boost::cref( constant_system_functor_standard() ) , x );
+ std::cout << x[0] << " ?= " << result << std::endl;
+ BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
+ }
+};
+
+template< class Stepper >
+struct perform_stepper_test< Stepper , vector_space_type >
+{
+ void operator()( void ) const
+ {
+ vector_space_type x;
+ x.m_x = 2.0;
+ Stepper stepper;
+ check_stepper_concept( stepper , constant_system_vector_space< vector_space_type , vector_space_type , double > , x );
+ check_stepper_concept( stepper , boost::cref( constant_system_functor_vector_space() ) , x );
+ std::cout << x.m_x << " ?= " << result << std::endl;
+ BOOST_CHECK_SMALL( fabs( x.m_x - result ) , eps );
+ }
+};
+
+template< class Stepper >
+struct perform_stepper_test< Stepper , array_type >
+{
+ void operator()( void )
+ {
+ array_type x;
+ x[0] = 2.0;
+ Stepper stepper;
+ check_stepper_concept( stepper , constant_system_standard< array_type , array_type , double> , x );
+ check_stepper_concept( stepper , boost::cref( constant_system_functor_standard() ) , x );
+ std::cout << x[0] << " ?= " << result << std::endl;
+ BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
+ }
+};
+
+
+template< class State > class stepper_methods : public mpl::vector<
+ euler< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ modified_midpoint< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta4< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta4_classic< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_cash_karp54_classic< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_cash_karp54< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_fehlberg78< State , double , State , double , typename algebra_dispatcher< State >::type >
+ > { };
+
+
+
+typedef mpl::copy
+<
+ container_types ,
+ mpl::inserter
+ <
+ mpl::vector0<> ,
+ mpl::insert_range
+ <
+ mpl::_1 ,
+ mpl::end< mpl::_1 > ,
+ stepper_methods< mpl::_2 >
+ >
+ >
+>::type all_stepper_methods;
+
+
+
+BOOST_AUTO_TEST_SUITE( runge_kutta_concept_test )
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_test , Stepper, all_stepper_methods )
+{
+ perform_stepper_test< Stepper , typename Stepper::deriv_type > tester;
+ tester();
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/runge_kutta_controlled_concepts.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/runge_kutta_controlled_concepts.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,180 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/runge_kutta_controlled_concepts.cpp
+
+ [begin_description]
+ This file tests the Stepper concepts of odeint with all Controlled Runge-Kutta steppers.
+ It's one of the main tests of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_runge_kutta_controlled_concepts
+
+#include <vector>
+#include <cmath>
+#include <iostream>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/ref.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+#include <boost/type_traits/add_reference.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/inserter.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+
+#include "prepare_stepper_testing.hpp"
+#include "dummy_odes.hpp"
+
+using std::vector;
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+
+const double result = 2.2; // two steps
+
+const double eps = 1.0e-14;
+
+template< class Stepper , class System >
+void check_controlled_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::deriv_type container_type;
+ //typedef typename stepper_type::order_type order_type; controlled_error_stepper don't necessarily have a order (burlish-stoer)
+ typedef typename stepper_type::time_type time_type;
+
+ time_type t = 0.0 , dt = 0.1;
+ controlled_step_result step_result = stepper.try_step( system , x , t , dt );
+
+ BOOST_CHECK_MESSAGE( step_result == success , "step result: " << step_result ); // error = 0 for constant system -> step size is always too small
+}
+
+
+
+template< class ControlledStepper , class State > struct perform_controlled_stepper_test;
+
+template< class ControlledStepper >
+struct perform_controlled_stepper_test< ControlledStepper , vector_type >
+{
+ void operator()( void )
+ {
+ vector_type x( 1 , 2.0 );
+ //typename ControlledStepper::stepper_type error_stepper;
+ //default_error_checker< typename ControlledStepper::value_type ,
+ // typename ControlledStepper::algebra_type ,
+ // typename ControlledStepper::operations_type > error_checker;
+ //ControlledStepper controlled_stepper( error_stepper , error_checker );
+ ControlledStepper controlled_stepper;
+ check_controlled_stepper_concept( controlled_stepper ,
+ constant_system_standard< vector_type , vector_type , double > ,
+ x );
+ check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_functor_standard() ) , x );
+ BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
+ }
+};
+
+template< class ControlledStepper >
+struct perform_controlled_stepper_test< ControlledStepper , vector_space_type >
+{
+ void operator()( void ) const
+ {
+ vector_space_type x;
+ x.m_x = 2.0;
+ /*typename ControlledStepper::stepper_type error_stepper;
+ default_error_checker< typename ControlledStepper::value_type ,
+ typename ControlledStepper::algebra_type ,
+ typename ControlledStepper::operations_type > error_checker;
+ ControlledStepper controlled_stepper( error_stepper , error_checker );*/
+ ControlledStepper controlled_stepper;
+ check_controlled_stepper_concept( controlled_stepper ,
+ constant_system_vector_space< vector_space_type , vector_space_type , double >
+ , x );
+ check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_functor_vector_space() ) , x );
+ BOOST_CHECK_SMALL( fabs( x.m_x - result ) , eps );
+ }
+};
+
+template< class ControlledStepper >
+struct perform_controlled_stepper_test< ControlledStepper , array_type >
+{
+ void operator()( void )
+ {
+ array_type x;
+ x[0] = 2.0;
+ /*typename ControlledStepper::stepper_type error_stepper;
+ default_error_checker< typename ControlledStepper::value_type ,
+ typename ControlledStepper::algebra_type ,
+ typename ControlledStepper::operations_type > error_checker;
+ ControlledStepper controlled_stepper( error_stepper , error_checker );*/
+ ControlledStepper controlled_stepper;
+ check_controlled_stepper_concept( controlled_stepper , constant_system_standard< array_type , array_type , double > , x );
+ check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_functor_standard() ) , x );
+ BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
+ }
+};
+
+template< class State > class controlled_stepper_methods : public mpl::vector<
+ controlled_runge_kutta< runge_kutta_cash_karp54_classic< State , double , State , double , typename algebra_dispatcher< State >::type > > ,
+ controlled_runge_kutta< runge_kutta_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type > > ,
+ controlled_runge_kutta< runge_kutta_fehlberg78< State , double , State , double , typename algebra_dispatcher< State >::type > > ,
+ bulirsch_stoer< State , double , State , double , typename algebra_dispatcher< State >::type >
+ > { };
+
+typedef mpl::copy
+<
+ container_types ,
+ mpl::inserter
+ <
+ mpl::vector0<> ,
+ mpl::insert_range
+ <
+ mpl::_1 ,
+ mpl::end< mpl::_1 > ,
+ controlled_stepper_methods< mpl::_2 >
+ >
+ >
+ >::type all_controlled_stepper_methods;
+
+
+
+
+BOOST_AUTO_TEST_SUITE( controlled_runge_kutta_concept_test )
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( controlled_stepper_test , ControlledStepper , all_controlled_stepper_methods )
+{
+ perform_controlled_stepper_test< ControlledStepper , typename ControlledStepper::state_type > tester;
+ tester();
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/runge_kutta_error_concepts.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/runge_kutta_error_concepts.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,160 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/runge_kutta_error_concepts.cpp
+
+ [begin_description]
+ This file tests the Stepper concepts of odeint with all Runge-Kutta Error steppers.
+ It's one of the main tests of odeint.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_runge_kutta_error_concepts
+
+#include <vector>
+#include <cmath>
+#include <iostream>
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/array.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/ref.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+#include <boost/type_traits/add_reference.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/inserter.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
+
+#include "prepare_stepper_testing.hpp"
+#include "dummy_odes.hpp"
+
+using std::vector;
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+
+const double result = 2.4; // four steps total...
+
+const double eps = 1.0e-14;
+
+template< class Stepper , class System >
+void check_error_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x , typename Stepper::state_type &xerr )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::deriv_type container_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::time_type time_type;
+
+ stepper.do_step( system , typename boost::add_reference< container_type>::type( x ), 0.0 , 0.1 );
+ stepper.do_step( system , typename boost::add_reference< container_type>::type( x ), 0.0 , 0.1 , typename boost::add_reference< container_type>::type( xerr ) );
+
+}
+
+template< class Stepper , class State > struct perform_error_stepper_test;
+
+template< class Stepper >
+struct perform_error_stepper_test< Stepper , vector_type >
+{
+ void operator()( void )
+ {
+ vector_type x( 1 , 2.0 ) , xerr( 1 );
+ Stepper stepper;
+ check_error_stepper_concept( stepper , constant_system_standard< vector_type , vector_type , double > , x , xerr );
+ check_error_stepper_concept( stepper , boost::cref( constant_system_functor_standard() ) , x , xerr );
+ BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
+ }
+};
+
+
+template< class Stepper >
+struct perform_error_stepper_test< Stepper , vector_space_type >
+{
+ void operator()( void ) const
+ {
+ vector_space_type x , xerr;
+ x.m_x = 2.0;
+ Stepper stepper;
+ check_error_stepper_concept( stepper ,
+ constant_system_vector_space< vector_space_type , vector_space_type , double > ,
+ x ,
+ xerr );
+ check_error_stepper_concept( stepper , boost::cref( constant_system_functor_vector_space() ) , x , xerr );
+ BOOST_CHECK_SMALL( fabs( x.m_x - result ) , eps );
+ }
+};
+
+template< class Stepper >
+struct perform_error_stepper_test< Stepper , array_type >
+{
+ void operator()( void )
+ {
+ array_type x , xerr;
+ x[0] = 2.0;
+ Stepper stepper;
+ check_error_stepper_concept( stepper , constant_system_standard< array_type , array_type , double > , x , xerr );
+ check_error_stepper_concept( stepper , boost::cref( constant_system_functor_standard() ) , x , xerr );
+ BOOST_CHECK_SMALL( fabs( x[0] - result ) , eps );
+ }
+};
+
+
+template< class State > class error_stepper_methods : public mpl::vector<
+ runge_kutta_cash_karp54_classic< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_cash_karp54< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_dopri5< State , double , State , double , typename algebra_dispatcher< State >::type > ,
+ runge_kutta_fehlberg78< State , double , State , double , typename algebra_dispatcher< State >::type >
+ > { };
+
+
+typedef mpl::copy
+<
+ container_types ,
+ mpl::inserter
+ <
+ mpl::vector0<> ,
+ mpl::insert_range
+ <
+ mpl::_1 ,
+ mpl::end< mpl::_1 > ,
+ error_stepper_methods< mpl::_2 >
+ >
+ >
+ >::type all_error_stepper_methods;
+
+
+BOOST_AUTO_TEST_SUITE( runge_kutta_error_concept_test )
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( error_stepper_test , Stepper , all_error_stepper_methods )
+{
+ perform_error_stepper_test< Stepper , typename Stepper::state_type > tester;
+ tester();
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/same_size.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/same_size.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,65 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/same_size.cpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_dummy
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/util/same_size.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+
+BOOST_AUTO_TEST_SUITE( same_size_test )
+
+BOOST_AUTO_TEST_CASE( test_vector_true )
+{
+ std::vector< double > v1( 10 ) , v2( 10 );
+ BOOST_CHECK_EQUAL( true , same_size( v1 , v2 ) );
+}
+
+
+BOOST_AUTO_TEST_CASE( test_vector_false )
+{
+ std::vector< double > v1( 10 ) , v2( 20 );
+ BOOST_CHECK_EQUAL( false , same_size( v1 , v2 ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_true )
+{
+ boost::fusion::vector< double , std::vector< double > > v1 , v2;
+ boost::fusion::at_c< 1 >( v1 ).resize( 10 );
+ boost::fusion::at_c< 1 >( v2 ).resize( 10 );
+ BOOST_CHECK_EQUAL( true , same_size( v1 , v2 ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_fusion_false )
+{
+ boost::fusion::vector< double , std::vector< double > > v1 , v2;
+ boost::fusion::at_c< 1 >( v1 ).resize( 10 );
+ boost::fusion::at_c< 1 >( v2 ).resize( 20 );
+ BOOST_CHECK_EQUAL( false , same_size( v1 , v2 ) );
+}
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/stepper_copying.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/stepper_copying.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,856 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/stepper_copying.cpp
+
+ [begin_description]
+ This file tests the copying of the steppers.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+*/
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+#pragma warning(disable:4996)
+#endif
+
+
+#define BOOST_TEST_MODULE odeint_stepper_copying
+
+#include <boost/test/unit_test.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+//#include <boost/numeric/odeint/util/construct.hpp>
+//#include <boost/numeric/odeint/util/destruct.hpp>
+#include <boost/numeric/odeint/util/copy.hpp>
+
+#include <boost/numeric/odeint/util/state_wrapper.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+
+template< class T , size_t Dim >
+class test_array
+{
+public:
+
+ const static size_t dim = Dim;
+ typedef T value_type;
+ typedef value_type* iterator;
+ typedef const value_type* const_iterator;
+
+ value_type& operator[]( size_t i )
+ {
+ return m_data[i];
+ }
+
+ const value_type& operator[]( size_t i ) const
+ {
+ return m_data[i];
+ }
+
+ iterator begin( void )
+ {
+ return m_data;
+ }
+
+ iterator end( void )
+ {
+ return m_data + dim;
+ }
+
+ const_iterator begin( void ) const
+ {
+ return m_data;
+ }
+
+ const_iterator end( void ) const
+ {
+ return m_data + dim;
+ }
+
+
+private:
+
+ value_type m_data[dim];
+};
+
+template< class T , size_t Dim >
+class test_array2 : public test_array< T , Dim >
+{
+};
+
+
+
+/*
+ * Explicit testing if copying was successful is difficult,
+ * hence we only test if the number of copy operations is right.
+ *
+ * Otherwise one has to prepare the states.
+ */
+
+size_t construct_count = 0;
+size_t construct2_count = 0;
+size_t destruct_count = 0;
+size_t destruct2_count = 0;
+size_t copy_count = 0;
+size_t copy2_count = 0;
+
+void reset_counter( void )
+{
+ construct_count = 0;
+ construct2_count = 0;
+ destruct_count = 0;
+ destruct2_count = 0;
+ copy_count = 0;
+ copy2_count = 0;
+}
+
+
+namespace boost { namespace numeric { namespace odeint {
+
+//provide the state_wrapper
+ template< class T , size_t Dim >
+ struct state_wrapper< test_array< T , Dim > >
+ {
+ typedef state_wrapper< test_array< T , Dim > > state_wrapper_type;
+ typedef test_array< T , Dim > state_type;
+ typedef T value_type;
+
+ state_type m_v;
+
+ state_wrapper() : m_v()
+ {
+ construct_count++;
+ }
+
+ state_wrapper( const state_type &v ) : m_v( v )
+ {
+ construct_count++;
+ copy_count++;
+ }
+
+ state_wrapper( const state_wrapper_type &x ) : m_v( x.m_v )
+ {
+ construct_count++;
+ copy_count++;
+ }
+
+ state_wrapper_type& operator=( const state_wrapper_type &x )
+ {
+ copy_count++;
+ return *this;
+ }
+
+ ~state_wrapper()
+ {
+ destruct_count++;
+ }
+ };
+
+//provide the state_wrapper
+ template< class T , size_t Dim >
+ struct state_wrapper< test_array2< T , Dim > >
+ {
+ typedef state_wrapper< test_array2< T , Dim > > state_wrapper_type;
+ typedef test_array2< T , Dim > state_type;
+ typedef T value_type;
+
+ state_type m_v;
+
+ state_wrapper() : m_v()
+ {
+ construct2_count++;
+ }
+
+ state_wrapper( const state_type &v ) : m_v( v )
+ {
+ construct2_count++;
+ copy2_count++;
+ }
+
+ state_wrapper( const state_wrapper_type &x ) : m_v( x.m_v )
+ {
+ construct2_count++;
+ copy2_count++;
+ }
+
+ state_wrapper_type& operator=( const state_wrapper_type &x )
+ {
+ copy2_count++;
+ return *this;
+ }
+
+ ~state_wrapper()
+ {
+ destruct2_count++;
+ }
+ };
+
+
+ } } }
+
+
+
+typedef test_array< double , 3 > state_type;
+typedef test_array2< double , 3 > deriv_type;
+typedef boost::numeric::odeint::euler< state_type , double , deriv_type > euler_type;
+typedef boost::numeric::odeint::runge_kutta4_classic< state_type , double , deriv_type > rk4_type;
+typedef boost::numeric::odeint::runge_kutta4< state_type , double , deriv_type > rk4_generic_type;
+typedef boost::numeric::odeint::runge_kutta_cash_karp54_classic< state_type , double , deriv_type > rk54_type;
+typedef boost::numeric::odeint::runge_kutta_cash_karp54< state_type , double , deriv_type > rk54_generic_type;
+typedef boost::numeric::odeint::runge_kutta_dopri5< state_type , double , deriv_type > dopri5_type;
+typedef boost::numeric::odeint::controlled_runge_kutta< rk54_type > controlled_rk54_type;
+typedef boost::numeric::odeint::controlled_runge_kutta< rk54_generic_type > controlled_rk54_generic_type;
+typedef boost::numeric::odeint::controlled_runge_kutta< dopri5_type > controlled_dopri5_type;
+typedef boost::numeric::odeint::dense_output_runge_kutta< euler_type > dense_output_euler_type;
+typedef boost::numeric::odeint::dense_output_runge_kutta< controlled_dopri5_type > dense_output_dopri5_type;
+
+#define CHECK_COUNTERS( c1 , c2 , c3 , c4 , c5 , c6 ) \
+ BOOST_CHECK_EQUAL( construct_count , size_t( c1 ) ); \
+ BOOST_CHECK_EQUAL( construct2_count , size_t( c2 ) ); \
+ BOOST_CHECK_EQUAL( destruct_count , size_t( c3 ) ); \
+ BOOST_CHECK_EQUAL( destruct2_count , size_t( c4) ); \
+ BOOST_CHECK_EQUAL( copy_count , size_t( c5 ) ) ; \
+ BOOST_CHECK_EQUAL( copy2_count, size_t( c6 ) )
+
+BOOST_AUTO_TEST_SUITE( stepper_copying )
+
+/*
+ * Construct + Destruct
+ * 1 deriv_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_euler_construct )
+{
+ reset_counter();
+ {
+ euler_type euler;
+ }
+ CHECK_COUNTERS( 0 , 1 , 0 , 1 , 0 , 0 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 2 * 1 deriv_type in explicit_stepper_base
+ *
+ * Copying
+ * 1 deriv_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_euler_copy_construct )
+{
+ reset_counter();
+ {
+ euler_type euler;
+ euler_type euler2( euler );
+ }
+ CHECK_COUNTERS( 0 , 1 + 1 , 0 , 1 + 1 , 0 , 1 );
+}
+
+/*
+ * Construct + Destruct
+ * 2 * 1 deriv_type in explicit_stepper_base
+ *
+ * Copying
+ * 1 deriv_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_euler_assign )
+{
+ reset_counter();
+ {
+ euler_type euler;
+ euler_type euler2;
+ euler2 = euler;
+ }
+ CHECK_COUNTERS( 0 , 2 , 0 , 2 , 0 , 1 );
+}
+
+/*
+ * Construct + Destruct
+ * 1 deriv_type in explicit_stepper_base
+ * 3 deriv_type in explicit_rk4
+ * 1 state_type in explicit_rk4
+ */
+BOOST_AUTO_TEST_CASE( explicit_rk4_construct )
+{
+ reset_counter();
+ {
+ rk4_type rk4;
+ }
+ CHECK_COUNTERS( 1 , 4 , 1 , 4 , 0 , 0 );
+}
+
+/*
+ * Construct + Destruct
+ * 2 * 1 deriv_type in explicit_stepper_base
+ * 2 * 3 deriv_type in explicit_rk4
+ * 2 * 1 state_type in explicit_rk4
+ *
+ * Copying
+ * 1 deriv_type in explicit_stepper_base
+ * 3 deriv_type in explicit_stepper_base
+ * 1 state_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_rk4_copy_construct )
+{
+ reset_counter();
+ {
+ rk4_type rk4;
+ rk4_type rk4_2( rk4 );
+ }
+ CHECK_COUNTERS( 2 , 8 , 2 , 8 , 1 , 4 );
+}
+
+/*
+ * Construct + Destruct
+ * 2 * 1 deriv_type in explicit_stepper_base
+ * 2 * 3 deriv_type in explicit_rk4
+ * 2 * 1 state_type in explicit_rk4
+ *
+ * Copying
+ * 1 deriv_type in explicit_stepper_base
+ * 3 deriv_type in explicit_stepper_base
+ * 1 state_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_rk4_assign )
+{
+ reset_counter();
+ {
+ rk4_type rk4;
+ rk4_type rk4_2;
+ rk4 = rk4_2;
+ }
+ CHECK_COUNTERS( 2 , 8 , 2 , 8 , 1 , 4 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 1 deriv_type in explicit_stepper_base
+ * 3 deriv_type in explicit_rk4
+ * 1 state_type in explicit_rk4
+ */
+BOOST_AUTO_TEST_CASE( explicit_rk4_generic_construct )
+{
+ reset_counter();
+ {
+ rk4_generic_type rk4;
+ }
+ CHECK_COUNTERS( 1 , 4 , 1 , 4 , 0 , 0 );
+}
+
+/*
+ * Construct + Destruct
+ * 2 * 1 deriv_type in explicit_stepper_base
+ * 2 * 3 deriv_type in explicit_rk4
+ * 2 * 1 state_type in explicit_rk4
+ *
+ * Copying
+ * 1 deriv_type in explicit_stepper_base
+ * 3 deriv_type in explicit_stepper_base
+ * 1 state_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_rk4_generic_copy_construct )
+{
+ reset_counter();
+ {
+ rk4_generic_type rk4;
+ rk4_generic_type rk4_2( rk4 );
+ }
+ CHECK_COUNTERS( 2 , 8 , 2 , 8 , 1 , 4 );
+}
+
+/*
+ * Construct + Destruct
+ * 2 * 1 deriv_type in explicit_stepper_base
+ * 2 * 3 deriv_type in explicit_rk4
+ * 2 * 1 state_type in explicit_rk4
+ *
+ * Copying
+ * 1 deriv_type in explicit_stepper_base
+ * 3 deriv_type in explicit_stepper_base
+ * 1 state_type in explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( explicit_rk4_generic_assign )
+{
+ reset_counter();
+ {
+ rk4_generic_type rk4;
+ rk4_generic_type rk4_2;
+ rk4 = rk4_2;
+ }
+ CHECK_COUNTERS( 2 , 8 , 2 , 8 , 1 , 4 );
+}
+
+/*
+ * Construct + Destruct
+ * 2 explicit_rk54_ck:
+ * 2 * 1 deriv_type in explicit_error_stepper_base
+ * 2 * 5 deriv_type in explicit_error_rk54_ck
+ * 2 * 1 state_type in explicit_error_rk4
+ * 1 controlled_stepper:
+ * 1 deriv_type
+ * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_rk54_ck:
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck
+ * 1 state_type from explicit_error_rk54_ck
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_construct )
+{
+ reset_counter();
+ {
+ controlled_rk54_type stepper;
+ }
+ CHECK_COUNTERS( 4 , 13 , 4 , 13 , 1 , 6 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 3 explicit_rk54_ck:
+ * 3 * 1 deriv_type in explicit_error_stepper_base
+ * 3 * 5 deriv_type in explicit_error_rk54_ck
+ * 3 * 1 state_type in explicit_error_rk4
+ * 2 controlled_stepper:
+ * 2 * 1 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_rk54_ck:
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck
+ * 1 state_type from explicit_error_rk54_ck
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck
+ * 1 state_type from explicit_error_rk54_ck
+ * 1 deriv_type from controlled_error_stepper
+ * 2 state_type from controlled_error_stepper
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_copy_construct )
+{
+ reset_counter();
+ {
+ controlled_rk54_type stepper;
+ controlled_rk54_type stepper2( stepper );
+ }
+ CHECK_COUNTERS( 7 , 20 , 7 , 20 , 4 , 13 );
+}
+
+/*
+ * Construct + Destruct
+ * 4 explicit_rk54_ck:
+ * 4 * 1 deriv_type in explicit_error_stepper_base
+ * 4 * 5 deriv_type in explicit_error_rk54_ck
+ * 4 * 1 state_type in explicit_error_rk4
+ * 2 controlled_stepper:
+ * 2 * 1 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 2 copy process of explicit_rk54_ck:
+ * 2 * 1 deriv_type from explicit_error_stepper_base
+ * 2 * 5 deriv_type from explicit_error_rk54_ck
+ * 2 * 1 state_type from explicit_error_rk54_ck
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck
+ * 1 state_type from explicit_error_rk54_ck
+ * 1 deriv_type from controlled_error_stepper
+ * 2 state_type from controlled_error_stepper
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_assign )
+{
+ reset_counter();
+ {
+ controlled_rk54_type stepper;
+ controlled_rk54_type stepper2;
+ stepper2 = stepper;
+ }
+ CHECK_COUNTERS( 8 , 26 , 8 , 26 , 5 , 19 );
+}
+
+
+
+/*
+ * Construct + Destruct
+ * 2 explicit_rk54_ck_generic:
+ * 2 * 1 deriv_type in explicit_error_stepper_base
+ * 2 * 5 deriv_type in explicit_error_rk54_ck_generic
+ * 2 * 1 state_type in explicit_error_rk54_ck_generic
+ * 1 controlled_stepper:
+ * 1 deriv_type
+ * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_rk54_ck_generic:
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_generic_construct )
+{
+ reset_counter();
+ {
+ controlled_rk54_generic_type stepper;
+ }
+ CHECK_COUNTERS( 4 , 13 , 4 , 13 , 1 , 6 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 3 explicit_rk54_ck_generic:
+ * 3 * 1 deriv_type in explicit_error_stepper_base
+ * 3 * 5 deriv_type in explicit_error_rk54_ck_generic
+ * 3 * 1 state_type in explicit_error_rk4_generic
+ * 2 controlled_stepper:
+ * 2 * 1 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_rk54_ck_generic:
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ * 1 deriv_type from controlled_error_stepper
+ * 2 state_type from controlled_error_stepper
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_generic_copy_construct )
+{
+ reset_counter();
+ {
+ controlled_rk54_generic_type stepper;
+ controlled_rk54_generic_type stepper2( stepper );
+ }
+ CHECK_COUNTERS( 7 , 20 , 7 , 20 , 4 , 13 );
+}
+
+/*
+ * Construct + Destruct
+ * 4 explicit_rk54_ck_generic:
+ * 4 * 1 deriv_type in explicit_error_stepper_base
+ * 4 * 5 deriv_type in explicit_error_rk54_ck_generic
+ * 4 * 1 state_type in explicit_error_rk4_generic
+ * 2 controlled_stepper:
+ * 2 * 1 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 2 copy process of explicit_rk54_ck_generic:
+ * 2 * 1 deriv_type from explicit_error_stepper_base
+ * 2 * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 2 * 1 state_type from explicit_error_rk54_ck_generic
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 5 deriv_type from explicit_error_rk54_ck_generic
+ * 1 state_type from explicit_error_rk54_ck_generic
+ * 1 deriv_type from controlled_error_stepper
+ * 2 state_type from controlled_error_stepper
+ */
+BOOST_AUTO_TEST_CASE( controlled_rk54_generic_assign )
+{
+ reset_counter();
+ {
+ controlled_rk54_generic_type stepper;
+ controlled_rk54_generic_type stepper2;
+ stepper2 = stepper;
+ }
+ CHECK_COUNTERS( 8 , 26 , 8 , 26 , 5 , 19 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 2 explicit_error_dopri5:
+ * 2 * 1 deriv_type in explicit_error_stepper_base_fsal
+ * 2 * 6 deriv_type in explicit_error_dopri5
+ * 2 * 1 state_type in explicit_error_dopri5
+ * 1 controlled_error_stepper (fsal):
+ * 2 deriv_type
+ * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_dopri5:
+ * 1 deriv_type from explicit_error_stepper_base_fsal
+ * 6 deriv_type from explicit_error_dopri5
+ * 1 state_type from explicit_error_dopri5
+ */
+
+BOOST_AUTO_TEST_CASE( controlled_dopri5_construct )
+{
+ reset_counter();
+ {
+ controlled_dopri5_type dopri5;
+ }
+ CHECK_COUNTERS( 2 * 1 + 2 , 2 * (6+1) + 2 , 2 * 1 + 2 , 2 * (6+1) + 2 , 1 , 1 + 6 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 3 explicit_error_dopri5:
+ * 3 * 1 deriv_type in explicit_error_stepper_base_fsal
+ * 3 * 6 deriv_type in explicit_error_dopri5
+ * 3 * 1 state_type in explicit_error_dopri5
+ * 2 controlled_error_stepper (fsal):
+ * 2 * 2 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_error_dopri5:
+ * 1 deriv_type from explicit_error_stepper_base_fsal
+ * 6 deriv_type from explicit_error_error_dopri5
+ * 1 state_type from explicit_error_error_dopri5
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base_fsal
+ * 6 deriv_type from explicit_error_dopri5
+ * 1 state_type from explicit_error_dopri5
+ * 2 deriv_type from controlled_error_stepper (fsal)
+ * 2 state_type from controlled_error_stepper (fsal)
+ */
+BOOST_AUTO_TEST_CASE( controlled_dopri5_copy_construct )
+{
+ reset_counter();
+ {
+ controlled_dopri5_type dopri5;
+ controlled_dopri5_type dopri5_2( dopri5 );
+ }
+ CHECK_COUNTERS( 3 * 1 + 2 * 2 , 3 * (6+1) + 2 * 2 , 3 * 1 + 2 * 2 , 3 * (6+1) + 2 * 2 , 1 + 1 + 2 , 1 + 6 + 1 + 6 + 2 );
+}
+
+/*
+ * Construct + Destruct
+ * 4 explicit_error_dopri5:
+ * 4 * 1 deriv_type in explicit_error_stepper_base_fsal
+ * 4 * 6 deriv_type in explicit_error_dopri5
+ * 4 * 1 state_type in explicit_error_dopri5
+ * 2 controlled_error_stepper (fsal):
+ * 2 * 2 deriv_type
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 2 copy process of explicit_error_dopri5:
+ * 2 * 1 deriv_type from explicit_error_stepper_base_fsal
+ * 2 * 6 deriv_type from explicit_error_dopri5
+ * 2 * 1 state_type from explicit_error_dopri5
+ *
+ * 1 process of copying controlled_error_stepper
+ * 1 deriv_type from explicit_error_stepper_base
+ * 6 deriv_type from explicit_error_dopri5
+ * 1 state_type from explicit_error_dopri5
+ * 2 deriv_type from controlled_error_stepper (fsal)
+ * 2 state_type from controlled_error_stepper (fsal)
+ */
+BOOST_AUTO_TEST_CASE( controlled_dopri5_assign )
+{
+ reset_counter();
+ {
+ controlled_dopri5_type dopri5;
+ controlled_dopri5_type dopri5_2;
+ dopri5_2 = dopri5;
+ }
+ CHECK_COUNTERS( 4 * 1 + 2 * 2 , 4 * (1+6) + 2 * 2 , 4 * 1 + 2 * 2 , 4 * (1+6) + 2 * 2 , 2 * 1 + 1 + 2 , 2 * (6+1) + 1 + 6 + 2 );
+}
+
+
+/*
+ * Construct + Destruct
+ * 2 explicit_euler:
+ * 2 * 1 deriv_type in explicit_stepper_base
+ * 1 dense_output_explicit:
+ * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_euler:
+ * 1 deriv_type from explicit_stepper_base
+ */
+BOOST_AUTO_TEST_CASE( dense_output_euler_construct )
+{
+ reset_counter();
+ {
+ dense_output_euler_type euler;
+ }
+ CHECK_COUNTERS( 2 , 2 * 1 , 2 , 2 * 1 , 0 , 1 );
+}
+
+/*
+ * Construct + Destruct
+ * 3 explicit_euler:
+ * 3 * 1 deriv_type in explicit_stepper_base
+ * 2 dense_output_explicit:
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 1 copy process of explicit_euler:
+ * 1 deriv_type from explicit_stepper_base
+ *
+ * 1 process of copying
+ * 1 deriv_type from explicit_stepper_base
+ * 2 state_type from dense_output_explicit
+ */
+BOOST_AUTO_TEST_CASE( dense_output_euler_copy_construct )
+{
+ reset_counter();
+ {
+ dense_output_euler_type euler;
+ dense_output_euler_type euler2( euler );
+ }
+ CHECK_COUNTERS( 2 * 2 , 3 * 1 , 2 * 2 , 3 * 1 , 2 , 1 + 1 );
+}
+
+/*
+ * Construct + Destruct
+ * 4 explicit_euler:
+ * 4 * 1 deriv_type in explicit_stepper_base
+ * 2 dense_output_explicit:
+ * 2 * 2 state_type
+ *
+ * Copying
+ * 2 copy process of explicit_euler:
+ * 2 * 1 deriv_type from explicit_stepper_base
+ *
+ * 1 process of copying dense_ouput_explicit
+ * 1 deriv_type from explicit_stepper_base
+ * 2 state_type from dense_output_explicit
+ */
+BOOST_AUTO_TEST_CASE( dense_output_euler_assign )
+{
+ reset_counter();
+ {
+ dense_output_euler_type euler;
+ dense_output_euler_type euler2;
+ euler2 = euler;
+ }
+ CHECK_COUNTERS( 2 * 2 , 4 * 1 , 2 * 2 , 4 * 1 , 2 , 2 * 1 + 1 );
+}
+
+/*
+ * Construct + Destruct
+ * 3 dense_output_dopri5:
+ * 3 * 1 deriv_type in explicit_error_stepper_base_fsal
+ * 3 * 6 deriv_type in explicit_error_dopri5
+ * 3 * 1 state_type in explicit_error_dopri5
+ * 2 controlled_error_stepper (fsal):
+ * 2 * 2 state_type
+ * 2 * 2 deriv_type
+ * 1 dense_output_controlled_explicit:
+ * 2 state_type
+ * 2 deriv_type
+ *
+ * Copying
+ * 2 copy process of explicit_error_dopri5:
+ * 2 * 1 deriv_type from explicit_erro_stepper_base_fsal
+ * 2 * 6 deriv_type in explicit_error_dopri5
+ * 2 * 1 state_type in explicit_error_dopri5
+ * 1 copy process of dense_output_controlled (fsal)
+ * 2 state_type
+ * 2 deriv_type
+ */
+BOOST_AUTO_TEST_CASE( dense_output_dopri5_construct )
+{
+ reset_counter();
+ {
+ dense_output_dopri5_type dopri5;
+ }
+ CHECK_COUNTERS( 3*1 + 2*2 + 2 , 3*(1+6) + 2*2 + 2 , 3*1 + 2*2 + 2 , 3*(1+6) + 2*2 + 2 , 2*1 + 2 , 2*(1+6) + 2 );
+}
+
+/*
+ * Construct + Destruct
+ * 4 dense_output_dopri5:
+ * 4 * 1 deriv_type in explicit_error_stepper_base_fsal
+ * 4 * 5 deriv_type in explicit_error_dopri5
+ * 4 * 1 state_type in explicit_error_dopri5
+ * 3 controlled_error_stepper (fsal):
+ * 3 * 2 state_type
+ * 3 * 2 deriv_type
+ * 2 dense_output_controlled_explicit:
+ * 2 * 2 state_type
+ * 2 * 2 deriv_type
+ *
+ * Copying
+ * 3 copy process of explicit_error_dopri5:
+ * 3 * 1 deriv_type from explicit_erro_stepper_base_fsal
+ * 3 * 6 deriv_type in explicit_error_dopri5
+ * 3 * 1 state_type in explicit_error_dopri5
+ * 2 copy process of controlled_error_stepper (fsal):
+ * 2 * 2 state_type
+ * 2 * 2 deriv_type
+ * 1 copy process of dense_output_controlled_explicit:
+ * 2 state_type
+ * 2 deriv_type
+ */
+BOOST_AUTO_TEST_CASE( dense_output_dopri5_copy_construct )
+{
+ reset_counter();
+ {
+ dense_output_dopri5_type dopri5;
+ dense_output_dopri5_type dopri5_2( dopri5 );
+ }
+ CHECK_COUNTERS( 4*1 + 3*2 + 2*2 , 4*(1+6) + 3*2 + 2*2 , 4*1 + 3*2 + 2*2 , 4*(1+6) + 3*2 + 2*2 , 3*1 + 2*2 + 1*2 , 3*(6+1) + 2*2 + 2 );
+}
+
+/*
+ * Construct + Destruct
+ * 6 dense_output_dopri5:
+ * 6 * 1 deriv_type in explicit_error_stepper_base_fsal
+ * 6 * 6 deriv_type in explicit_error_dopri5
+ * 6 * 1 state_type in explicit_error_dopri5
+ * 4 controlled_error_stepper (fsal):
+ * 4 * 2 state_type
+ * 4 * 2 deriv_type
+ * 2 dense_output_controlled_explicit:
+ * 2 * 2 state_type
+ * 2 * 2 deriv_type
+ *
+ * Copying
+ * 5 copy process of explicit_error_dopri5:
+ * 5 * 1 deriv_type from explicit_erro_stepper_base_fsal
+ * 5 * 6 deriv_type in explicit_error_dopri5
+ * 5 * 1 state_type in explicit_error_dopri5
+ * 3 copy process of controlled_error_stepper (fsal):
+ * 3 * 2 state_type
+ * 3 * 2 deriv_type
+ * 1 copy process of dense_output_controlled_explicit:
+ * 2 state_type
+ * 2 deriv_type
+ */
+BOOST_AUTO_TEST_CASE( dense_output_dopri5_assign )
+{
+ reset_counter();
+ {
+ dense_output_dopri5_type dopri5;
+ dense_output_dopri5_type dopri5_2;
+ dopri5_2 = dopri5;
+ }
+ CHECK_COUNTERS( 6*1 + 4*2 + 2*2 , 6*(6+1) + 4*2 + 2*2 , 6*1 + 4*2 + 2*2 , 6*(6+1) + 4*2 + 2*2 , 5*1 + 3*2 + 2 , 5*(6+1) + 3*2 + 2 );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
+

Added: trunk/libs/numeric/odeint/test/stepper_with_ranges.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/stepper_with_ranges.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,283 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/stepper_with_ranges.cpp
+
+ [begin_description]
+ This file tests if the steppers play well with Boost.Range.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_stepper_with_ranges
+
+#include <boost/test/unit_test.hpp>
+
+#include <vector>
+#include <utility>
+#include <iostream>
+
+#include <boost/array.hpp>
+#include <boost/range.hpp>
+#include <boost/ref.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/symplectic_euler.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+
+typedef std::vector< double > state_type;
+typedef boost::array< double , 3 > state_type2;
+
+
+/*
+ * The two systems are needed, since for steppers with more than
+ * one internal step it is difficult to calculate the exact result
+ *
+ * system1 is suited for euler
+ */
+struct system1
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t )
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = x[0];
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+
+ template< class State , class Deriv >
+ void operator()( const State &x_ , const Deriv &dxdt_ , double t )
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = x[0];
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+};
+
+/*
+ * system2 is suited for all steppers, it allows you to calculate the result analytically.
+ */
+struct system2
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t )
+ {
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = 1.0;
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+
+ template< class State , class Deriv >
+ void operator()( const State &x_ , const Deriv &dxdt_ , double t )
+ {
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0] = 1.0;
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+};
+
+
+/*
+ * Useful for Hamiltonian systems
+ */
+struct ham_sys
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ )
+ {
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+ dxdt[0] = 1.0;
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+
+ template< class State , class Deriv >
+ void operator()( const State &x_ , const Deriv &dxdt_ )
+ {
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+ dxdt[0] = 1.0;
+ dxdt[1] = 2.0;
+ dxdt[2] = 3.0;
+ }
+};
+
+
+struct vector_fixture
+{
+ const static size_t dim = 6;
+ boost::array< double , dim > in;
+ boost::array< double , dim > q;
+ boost::array< double , dim > p;
+ state_type err;
+
+ vector_fixture( void )
+ : in() , err( 3 )
+ {
+ for( size_t i=0 ; i<dim ; ++i )
+ {
+ in[ i ] = q[i] = p[i] = double( i );
+ }
+ for( size_t i=0 ; i<3 ; ++i )
+ {
+ err[i] = double( i ) * 10.0;
+ }
+ }
+
+ ~vector_fixture( void )
+ {
+ }
+};
+
+#define CHECK_VALUES( x , x0 , x1 , x2 , x3 , x4 , x5 ) \
+ BOOST_CHECK_CLOSE( x[0] , x0 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[1] , x1 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[2] , x2 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[3] , x3 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[4] , x4 , 1.0e-8 ); \
+ BOOST_CHECK_CLOSE( x[5] , x5 , 1.0e-8 )
+
+
+
+BOOST_AUTO_TEST_SUITE( stepper_with_ranges )
+
+BOOST_AUTO_TEST_CASE( explicit_euler_with_range_v1 )
+{
+ vector_fixture f;
+ boost::numeric::odeint::euler< state_type > euler;
+ euler.do_step( system1() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , 0.1 , 0.1 );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+
+
+BOOST_AUTO_TEST_CASE( explicit_error_k54_with_range_v1 )
+{
+ vector_fixture f;
+ boost::numeric::odeint::runge_kutta_cash_karp54_classic< state_type > rk54;
+ rk54.do_step( system2() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , 0.1 , 0.1 );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+BOOST_AUTO_TEST_CASE( explicit_error_k54_with_range_v5 )
+{
+ vector_fixture f;
+ boost::numeric::odeint::runge_kutta_cash_karp54_classic< state_type > rk54;
+ rk54.do_step( system2() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , 0.1 , 0.1 , f.err );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+
+BOOST_AUTO_TEST_CASE( runge_kutta_dopri5_with_range_v1 )
+{
+ vector_fixture f;
+ boost::numeric::odeint::runge_kutta_dopri5< state_type > dopri5;
+ dopri5.do_step( system2() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , 0.1 , 0.1 );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+
+BOOST_AUTO_TEST_CASE( runge_kutta_dopri5_with_range_v5 )
+{
+ vector_fixture f;
+ boost::numeric::odeint::runge_kutta_dopri5< state_type > dopri5;
+ dopri5.do_step( system2() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , 0.1 , 0.1 , f.err );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+
+BOOST_AUTO_TEST_CASE( controlled_error_stepper_rk54 )
+{
+ double t = 0.0 , dt = 0.1;
+ vector_fixture f;
+ boost::numeric::odeint::controlled_runge_kutta< boost::numeric::odeint::runge_kutta_cash_karp54_classic< state_type > > stepper;
+ stepper.try_step( system2() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , t , dt );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+BOOST_AUTO_TEST_CASE( controlled_error_stepper_dopri5 )
+{
+ double t = 0.0 , dt = 0.1;
+ vector_fixture f;
+ boost::numeric::odeint::controlled_runge_kutta< boost::numeric::odeint::runge_kutta_dopri5< state_type > > stepper;
+ stepper.try_step( system2() , std::make_pair( f.in.begin() + 1 , f.in.begin() + 4 ) , t , dt );
+ CHECK_VALUES( f.in , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+}
+
+
+BOOST_AUTO_TEST_CASE( symplectic_euler_coor_func )
+{
+ vector_fixture f;
+ boost::numeric::odeint::symplectic_euler< state_type > euler;
+ euler.do_step( ham_sys() ,
+ std::make_pair( f.q.begin() + 1 , f.q.begin() + 4 ) ,
+ std::make_pair( f.p.begin() + 3 , f.p.begin() + 6 ) ,
+ 0.0 , 0.1 );
+ CHECK_VALUES( f.q , 0.0 , 1.3 , 2.4 , 3.5 , 4.0 , 5.0 );
+ CHECK_VALUES( f.p , 0.0 , 1.0 , 2.0 , 3.1 , 4.2 , 5.3 );
+}
+
+BOOST_AUTO_TEST_CASE( symplectic_euler_coor_and_mom_func )
+{
+ vector_fixture f;
+ boost::numeric::odeint::symplectic_euler< state_type > euler;
+ euler.do_step( std::make_pair( ham_sys() , ham_sys() ) ,
+ std::make_pair( f.q.begin() + 1 , f.q.begin() + 4 ) ,
+ std::make_pair( f.p.begin() + 3 , f.p.begin() + 6 ) ,
+ 0.0 , 0.1 );
+ CHECK_VALUES( f.q , 0.0 , 1.1 , 2.2 , 3.3 , 4.0 , 5.0 );
+ CHECK_VALUES( f.p , 0.0 , 1.0 , 2.0 , 3.1 , 4.2 , 5.3 );
+}
+
+
+BOOST_AUTO_TEST_CASE( dense_output_euler_with_ranges )
+{
+ using namespace boost::numeric::odeint;
+ vector_fixture f;
+ dense_output_runge_kutta< euler< state_type > > stepper;
+ stepper.initialize( std::make_pair( f.in.begin() + 1, f.in.begin() + 4 ) , 0.0 , 0.1 );
+ stepper.do_step( system1() );
+ stepper.calc_state( 0.05 , std::make_pair( f.in.begin() + 1 ,f.in.begin() +4 ) );
+ CHECK_VALUES( f.in , 0.0 , 1.05 , 2.1 , 3.15 , 4.0 , 5.0 );
+}
+
+BOOST_AUTO_TEST_CASE( dense_output_dopri5_with_ranges )
+{
+ using namespace boost::numeric::odeint;
+ vector_fixture f;
+ dense_output_runge_kutta<
+ controlled_runge_kutta<
+ runge_kutta_dopri5< state_type >
+ > > stepper;
+ stepper.initialize( std::make_pair( f.in.begin() + 1, f.in.begin() + 4 ) , 0.0 , 0.1 );
+ stepper.do_step( system2() );
+ stepper.calc_state( 0.05 , std::make_pair( f.in.begin() + 1 ,f.in.begin() +4 ) );
+ CHECK_VALUES( f.in , 0.0 , 1.05 , 2.1 , 3.15 , 4.0 , 5.0 );
+}
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/stepper_with_units.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/stepper_with_units.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,327 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/stepper_with_units.cpp
+
+ [begin_description]
+ This file tests if the steppers play well with Boost.Units.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#define BOOST_TEST_MODULE odeint_stepper_with_units
+
+// the runge-kutta 78 stepper invoked with boost units requires increased fusion macro variables!
+// note that by default the rk78 + units test case is disabled as it requires enormous memory when compiling (5 GB)
+#define BOOST_FUSION_INVOKE_MAX_ARITY 15
+#define BOOST_RESULT_OF_NUM_ARGS 15
+
+
+#include <boost/numeric/odeint/config.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/units/systems/si/length.hpp>
+#include <boost/units/systems/si/time.hpp>
+#include <boost/units/systems/si/velocity.hpp>
+#include <boost/units/systems/si/acceleration.hpp>
+#include <boost/units/systems/si/io.hpp>
+
+#include <boost/fusion/container.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp>
+#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
+#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
+#include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
+
+
+using namespace boost::numeric::odeint;
+using namespace boost::unit_test;
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+namespace units = boost::units;
+namespace si = boost::units::si;
+
+typedef double value_type;
+typedef units::quantity< si::time , value_type > time_type;
+typedef units::quantity< si::length , value_type > length_type;
+typedef units::quantity< si::velocity , value_type > velocity_type;
+typedef units::quantity< si::acceleration , value_type > acceleration_type;
+typedef fusion::vector< length_type , velocity_type > state_type;
+typedef fusion::vector< velocity_type , acceleration_type > deriv_type;
+
+void oscillator( const state_type &x , deriv_type &dxdt , time_type t )
+{
+ const units::quantity< si::frequency , value_type > omega = 1.0 * si::hertz;
+ fusion::at_c< 0 >( dxdt ) = fusion::at_c< 1 >( x );
+ fusion::at_c< 1 >( dxdt ) = - omega * omega * fusion::at_c< 0 >( x );
+}
+
+template< class Stepper >
+void check_stepper( Stepper &stepper )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+
+ const time_type t( 0.0 * si::second );
+ time_type dt( 0.1 * si::second );
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second );
+
+ // test call method one
+ stepper.do_step( oscillator , x , t , dt );
+
+ // test call method two
+ stepper.do_step( oscillator , x , t , x , dt );
+
+ // test call method three
+ deriv_type dxdt;
+ oscillator( x , dxdt , t );
+ stepper.do_step( oscillator , x , dxdt , t , dt );
+
+ // test call method four
+ oscillator( x , dxdt , t );
+ stepper.do_step( oscillator , x , dxdt , t , x , dt );
+}
+
+template< class Stepper >
+void check_fsal_stepper( Stepper &stepper )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+
+ const time_type t( 0.0 * si::second );
+ time_type dt( 0.1 * si::second );
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second );
+
+ // test call method one
+ stepper.do_step( oscillator , x , t , dt );
+
+ // test call method two
+ stepper.do_step( oscillator , x , t , x , dt );
+
+ // test call method three
+ deriv_type dxdt;
+ oscillator( x , dxdt , t );
+ stepper.do_step( oscillator , x , dxdt , t , dt );
+
+ // test call method four
+ stepper.do_step( oscillator , x , dxdt , t , x , dxdt , dt );
+}
+
+template< class Stepper >
+void check_error_stepper( Stepper &stepper )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+
+ const time_type t( 0.0 * si::second );
+ time_type dt( 0.1 * si::second );
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second ) , xerr;
+
+ // test call method one
+ stepper.do_step( oscillator , x , t , dt , xerr );
+
+ // test call method two
+ stepper.do_step( oscillator , x , t , x , dt , xerr );
+
+ // test call method three
+ deriv_type dxdt;
+ oscillator( x , dxdt , t );
+ stepper.do_step( oscillator , x , dxdt , t , dt , xerr );
+
+ // test call method four
+ stepper.do_step( oscillator , x , dxdt , t , x , dt , xerr );
+}
+
+template< class Stepper >
+void check_fsal_error_stepper( Stepper &stepper )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::algebra_type algebra_type;
+ typedef typename stepper_type::operations_type operations_type;
+
+ const time_type t( 0.0 * si::second );
+ time_type dt( 0.1 * si::second );
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second ) , xerr;
+
+ // test call method one
+ stepper.do_step( oscillator , x , t , dt , xerr );
+
+ // test call method two
+ stepper.do_step( oscillator , x , t , x , dt , xerr );
+
+ // test call method three
+ deriv_type dxdt;
+ oscillator( x , dxdt , t );
+ stepper.do_step( oscillator , x , dxdt , t , dt , xerr );
+
+ // test call method four
+ stepper.do_step( oscillator , x , dxdt , t , x , dxdt , dt , xerr );
+}
+
+template< class Stepper >
+void check_controlled_stepper( Stepper &stepper )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+
+ time_type t( 0.0 * si::second );
+ time_type dt( 0.1 * si::second );
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second );
+
+ // test call method one
+ stepper.try_step( oscillator , x , t , dt );
+}
+
+
+template< class Stepper >
+void check_dense_output_stepper( Stepper &stepper )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type state_type;
+ typedef typename stepper_type::value_type value_type;
+ typedef typename stepper_type::deriv_type deriv_type;
+ typedef typename stepper_type::time_type time_type;
+// typedef typename stepper_type::order_type order_type;
+
+ time_type t( 0.0 * si::second );
+ time_type dt( 0.1 * si::second );
+ state_type x( 1.0 * si::meter , 0.0 * si::meter_per_second ) , x2;
+
+ stepper.initialize( x , t , dt );
+ stepper.do_step( oscillator );
+ stepper.calc_state( dt / 2.0 , x2 );
+}
+
+
+
+
+
+
+class stepper_types : public mpl::vector
+<
+ euler< state_type , value_type , deriv_type , time_type , fusion_algebra >,
+ runge_kutta4< state_type , value_type , deriv_type , time_type , fusion_algebra > ,
+ runge_kutta4_classic< state_type , value_type , deriv_type , time_type , fusion_algebra > ,
+ runge_kutta_cash_karp54< state_type , value_type , deriv_type , time_type , fusion_algebra >,
+ runge_kutta_cash_karp54_classic< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ // don't run rk78 test - gcc requires > 5GB RAM to compile this
+ //, runge_kutta_fehlberg78< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ > { };
+
+class fsal_stepper_types : public mpl::vector
+<
+ runge_kutta_dopri5< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ > { };
+
+class error_stepper_types : public mpl::vector
+<
+ runge_kutta_cash_karp54_classic< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ //, runge_kutta_fehlberg78< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ > { };
+
+class fsal_error_stepper_types : public mpl::vector
+<
+ runge_kutta_dopri5< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ > { };
+
+class controlled_stepper_types : public mpl::vector
+<
+ controlled_runge_kutta< runge_kutta_cash_karp54_classic< state_type , value_type , deriv_type , time_type , fusion_algebra > > ,
+ controlled_runge_kutta< runge_kutta_dopri5< state_type , value_type , deriv_type , time_type , fusion_algebra > >
+ , bulirsch_stoer< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ // rk78 with units needs up to 3GB memory to compile - disable testing...
+ //, controlled_runge_kutta< runge_kutta_fehlberg78< state_type , value_type , deriv_type , time_type , fusion_algebra > >
+ > { };
+
+class dense_output_stepper_types : public mpl::vector
+<
+ dense_output_runge_kutta< euler< state_type , value_type , deriv_type , time_type , fusion_algebra > > ,
+ dense_output_runge_kutta<
+ controlled_runge_kutta< runge_kutta_dopri5< state_type , value_type , deriv_type , time_type , fusion_algebra > > >
+ //, bulirsch_stoer_dense_out< state_type , value_type , deriv_type , time_type , fusion_algebra >
+ > { };
+
+
+
+
+BOOST_AUTO_TEST_SUITE( stepper_with_units )
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_test , Stepper , stepper_types )
+{
+ Stepper stepper;
+ check_stepper( stepper );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( fsl_stepper_test , Stepper , fsal_stepper_types )
+{
+ Stepper stepper;
+ check_fsal_stepper( stepper );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( error_stepper_test , Stepper , error_stepper_types )
+{
+ Stepper stepper;
+ check_error_stepper( stepper );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( fsal_error_stepper_test , Stepper , fsal_error_stepper_types )
+{
+ Stepper stepper;
+ check_fsal_error_stepper( stepper );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( controlled_stepper_test , Stepper , controlled_stepper_types )
+{
+ Stepper stepper;
+ check_controlled_stepper( stepper );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( dense_ouput_test , Stepper , dense_output_stepper_types )
+{
+ Stepper stepper;
+ check_dense_output_stepper( stepper );
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/symplectic_steppers.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/symplectic_steppers.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,392 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/symplectic_steppers.cpp
+
+ [begin_description]
+ tba.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_symplectic_steppers
+
+#define BOOST_FUSION_INVOKE_MAX_ARITY 15
+#define BOOST_RESULT_OF_NUM_ARGS 15
+#define FUSION_MAX_VECTOR_SIZE 15
+
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/array.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/zip_view.hpp>
+#include <boost/mpl/vector_c.hpp>
+#include <boost/mpl/insert_range.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/copy.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/inserter.hpp>
+#include <boost/mpl/at.hpp>
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/include/make_vector.hpp>
+
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+#include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
+#include <boost/numeric/odeint/stepper/symplectic_euler.hpp>
+#include <boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp>
+#include <boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp>
+
+#include "diagnostic_state_type.hpp"
+#include "const_range.hpp"
+#include "dummy_odes.hpp"
+#include "vector_space_1d.hpp"
+#include "boost_units_helpers.hpp"
+
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+namespace mpl = boost::mpl;
+namespace fusion = boost::fusion;
+
+class custom_range_algebra : public range_algebra { };
+class custom_default_operations : public default_operations { };
+
+
+template< class Coor , class Mom , class Value , class CoorDeriv , class MomDeriv , class Time ,
+ class Algebra , class Operations , class Resizer >
+class complete_steppers : public mpl::vector<
+ symplectic_euler< Coor , Mom , Value , CoorDeriv , MomDeriv , Time ,
+ Algebra , Operations , Resizer >
+ , symplectic_rkn_sb3a_mclachlan< Coor , Mom , Value , CoorDeriv , MomDeriv , Time ,
+ Algebra , Operations , Resizer >
+ , symplectic_rkn_sb3a_m4_mclachlan< Coor , Mom , Value , CoorDeriv , MomDeriv , Time ,
+ Algebra , Operations , Resizer >
+ > {};
+
+template< class Resizer >
+class vector_steppers : public complete_steppers<
+ diagnostic_state_type , diagnostic_state_type2 , double ,
+ diagnostic_deriv_type , diagnostic_deriv_type2 , double ,
+ custom_range_algebra , custom_default_operations , Resizer
+ > { };
+
+
+typedef mpl::vector< initially_resizer , always_resizer , never_resizer > resizers;
+typedef mpl::vector_c< int , 1 , 3 , 0 > resizer_multiplicities ;
+
+
+typedef mpl::copy<
+ resizers ,
+ mpl::inserter<
+ mpl::vector0<> ,
+ mpl::insert_range<
+ mpl::_1 ,
+ mpl::end< mpl::_1 > ,
+ vector_steppers< mpl::_2 >
+ >
+ >
+ >::type all_stepper_methods;
+
+
+typedef mpl::size< vector_steppers< initially_resizer > >::type num_steppers;
+typedef mpl::copy<
+ resizer_multiplicities ,
+ mpl::inserter<
+ mpl::vector0<> ,
+ mpl::insert_range<
+ mpl::_1 ,
+ mpl::end< mpl::_1 > ,
+ const_range< num_steppers , mpl::_2 >
+ >
+ >
+ >::type all_multiplicities;
+
+
+
+
+
+
+
+BOOST_AUTO_TEST_SUITE( symplectic_steppers_test )
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_assoc_types , Stepper , vector_steppers< initially_resizer > )
+{
+ BOOST_STATIC_ASSERT_MSG(
+ ( boost::is_same< typename Stepper::coor_type , diagnostic_state_type >::value ) ,
+ "Coordinate type" );
+ BOOST_STATIC_ASSERT_MSG(
+ ( boost::is_same< typename Stepper::momentum_type , diagnostic_state_type2 >::value ) ,
+ "Momentum type" );
+ BOOST_STATIC_ASSERT_MSG(
+ ( boost::is_same< typename Stepper::coor_deriv_type , diagnostic_deriv_type >::value ) ,
+ "Coordinate deriv type" );
+ BOOST_STATIC_ASSERT_MSG(
+ ( boost::is_same< typename Stepper::momentum_deriv_type , diagnostic_deriv_type2 >::value ) ,
+ "Momentum deriv type" );
+
+ BOOST_STATIC_ASSERT_MSG(
+ ( boost::is_same< typename Stepper::state_type , std::pair< diagnostic_state_type , diagnostic_state_type2 > >::value ) ,
+ "State type" );
+ BOOST_STATIC_ASSERT_MSG(
+ ( 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" );
+
+ 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" );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_adjust_size , Stepper , vector_steppers< initially_resizer > )
+{
+ counter_state::init_counter();
+ counter_deriv::init_counter();
+ counter_state2::init_counter();
+ counter_deriv2::init_counter();
+
+ {
+ Stepper stepper;
+ diagnostic_state_type x;
+ stepper.adjust_size( x );
+ }
+
+ TEST_COUNTERS( counter_state , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_state2 , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_deriv , 1 , 1 , 0 , 1 );
+ TEST_COUNTERS( counter_deriv2 , 1 , 1 , 0 , 1 );
+}
+
+
+typedef mpl::zip_view< mpl::vector< all_stepper_methods , all_multiplicities > >::type zipped_steppers;
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_resizing , Stepper , zipped_steppers )
+{
+ typedef typename mpl::at_c< Stepper , 0 >::type stepper_type;
+ const size_t multiplicity = mpl::at_c< Stepper , 1 >::type::value;
+
+ counter_state::init_counter();
+ counter_deriv::init_counter();
+ counter_state2::init_counter();
+ counter_deriv2::init_counter();
+
+ {
+ stepper_type stepper;
+ std::pair< diagnostic_state_type , diagnostic_state_type2 > x;
+ stepper.do_step( constant_mom_func() , x , 0.0 , 0.1 );
+ stepper.do_step( constant_mom_func() , x , 0.0 , 0.1 );
+ stepper.do_step( constant_mom_func() , x , 0.0 , 0.1 );
+ }
+
+ TEST_COUNTERS( counter_state , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_state2 , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_deriv , multiplicity , 1 , 0 , 1 );
+ TEST_COUNTERS( counter_deriv2 , multiplicity , 1 , 0 , 1 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_copying1 , Stepper , vector_steppers< initially_resizer > )
+{
+ counter_state::init_counter();
+ counter_deriv::init_counter();
+ counter_state2::init_counter();
+ counter_deriv2::init_counter();
+
+ {
+ Stepper stepper;
+ Stepper stepper2( stepper );
+ }
+
+ TEST_COUNTERS( counter_state , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_state2 , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_deriv , 0 , 2 , 1 , 2 );
+ TEST_COUNTERS( counter_deriv2 , 0 , 2 , 1 , 2 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_copying2 , Stepper , vector_steppers< initially_resizer > )
+{
+ counter_state::init_counter();
+ counter_deriv::init_counter();
+ counter_state2::init_counter();
+ counter_deriv2::init_counter();
+
+ {
+ Stepper stepper;
+ std::pair< diagnostic_state_type , diagnostic_state_type2 > x;
+ stepper.do_step( constant_mom_func() , x , 0.0 , 0.1 );
+ Stepper stepper2( stepper );
+ }
+
+ TEST_COUNTERS( counter_state , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_state2 , 0 , 0 , 0 , 0 );
+ TEST_COUNTERS( counter_deriv , 1 , 2 , 1 , 2 );
+ TEST_COUNTERS( counter_deriv2 , 1 , 2 , 1 , 2 );
+}
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_do_step_v1 , Stepper , vector_steppers< initially_resizer > )
+{
+ Stepper s;
+ std::pair< diagnostic_state_type , diagnostic_state_type2 > x1 , x2 , x3 , x4;
+ x1.first[0] = 1.0;
+ x1.second[0] = 2.0;
+ x2 = x3 = x4 = x1;
+ diagnostic_state_type x5_coor , x5_mom;
+ x5_coor[0] = x1.first[0];
+ x5_mom[0] = x1.second[0];
+
+ s.do_step( constant_mom_func() , x1 , 0.0 , 0.1 );
+
+ s.do_step( std::make_pair( default_coor_func() , constant_mom_func() ) , x2 , 0.0 , 0.1 );
+
+ default_coor_func cf;
+ constant_mom_func mf;
+ s.do_step( std::make_pair( boost::ref( cf ) , boost::ref( mf ) ) , x3 , 0.0 , 0.1 );
+
+ std::pair< default_coor_func , constant_mom_func > pf;
+ s.do_step( boost::ref( pf ) , x4 , 0.0 , 0.1 );
+
+ s.do_step( constant_mom_func() , std::make_pair( boost::ref( x5_coor ) , boost::ref( x5_mom ) ) , 0.0 , 0.1 );
+
+ // checking for absolute values is not possible here, since the steppers are to different
+ BOOST_CHECK_CLOSE( x1.first[0] , x2.first[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x2.first[0] , x3.first[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x3.first[0] , x4.first[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x4.first[0] , x5_coor[0] , 1.0e-14 );
+
+ BOOST_CHECK_CLOSE( x1.second[0] , x2.second[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x2.second[0] , x3.second[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x3.second[0] , x4.second[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x4.second[0] , x5_mom[0] , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_do_step_range , Stepper , vector_steppers< initially_resizer > )
+{
+ Stepper s;
+ diagnostic_state_type q , p ;
+ q[0] = 1.0;
+ p[0] = 2.0;
+
+ std::vector< double > x;
+ x.push_back( 1.0 );
+ x.push_back( 2.0 );
+ s.do_step( constant_mom_func() ,
+ std::make_pair( x.begin() , x.begin() + 1 ) ,
+ std::make_pair( x.begin() + 1 , x.begin() + 2 ) ,
+ 0.0 , 0.1 );
+
+ s.do_step( constant_mom_func() , q , p , 0.0 , 0.1 );
+
+ BOOST_CHECK_CLOSE( q[0] , x[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( p[0] , x[1] , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_do_step_v2 , Stepper , vector_steppers< initially_resizer > )
+{
+ Stepper s;
+ diagnostic_state_type q , p ;
+ q[0] = 1.0;
+ p[0] = 2.0;
+ diagnostic_state_type q2 = q , p2 = p;
+
+
+ s.do_step( constant_mom_func() , q , p , 0.0 , 0.1 );
+ s.do_step( constant_mom_func() , std::make_pair( boost::ref( q2 ) , boost::ref( p2 ) ) , 0.0 , 0.1 );
+
+ BOOST_CHECK_CLOSE( q[0] , q2[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( p[0] , p2[0] , 1.0e-14 );
+}
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_do_step_v3 , Stepper , vector_steppers< initially_resizer > )
+{
+ Stepper s;
+ std::pair< diagnostic_state_type , diagnostic_state_type2 > x_in , x_out;
+ x_in.first[0] = 1.0;
+ x_in.second[0] = 2.0;
+ diagnostic_state_type q2 , p2;
+ q2[0] = x_in.first[0];
+ p2[0] = x_in.second[0];
+
+
+ s.do_step( constant_mom_func() , x_in , 0.0 , x_out , 0.1 );
+ s.do_step( constant_mom_func() , std::make_pair( boost::ref( q2 ) , boost::ref( p2 ) ) , 0.0 , 0.1 );
+
+ BOOST_CHECK_CLOSE( x_in.first[0] , 1.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x_in.second[0] , 2.0 , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x_out.first[0] , q2[0] , 1.0e-14 );
+ BOOST_CHECK_CLOSE( x_out.second[0] , p2[0] , 1.0e-14 );
+}
+
+
+typedef vector_space_1d< double > vector_space;
+typedef complete_steppers< vector_space , vector_space , double ,
+ vector_space , vector_space , double ,
+ vector_space_algebra , default_operations , initially_resizer > vector_space_steppers;
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_with_vector_space_algebra , Stepper , vector_space_steppers )
+{
+ Stepper s;
+ std::pair< vector_space , vector_space > x;
+ s.do_step( constant_mom_func_vector_space_1d() , x , 0.0 , 0.1 );
+
+ s.do_step( std::make_pair( default_coor_func_vector_space_1d() , constant_mom_func_vector_space_1d() ) , x , 0.0 , 0.1 );
+}
+
+
+typedef boost::fusion::vector< length_type > coor_type;
+typedef boost::fusion::vector< velocity_type > mom_type;
+typedef boost::fusion::vector< acceleration_type > acc_type;
+typedef complete_steppers< coor_type , mom_type , double ,
+ mom_type , acc_type , time_type,
+ fusion_algebra , default_operations , initially_resizer > boost_unit_steppers;
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_with_boost_units , Stepper , boost_unit_steppers )
+{
+ namespace fusion = boost::fusion;
+ namespace si = boost::units::si;
+ Stepper s;
+
+ coor_type q = fusion::make_vector( 1.0 * si::meter );
+ mom_type p = fusion::make_vector( 2.0 * si::meter_per_second );
+ time_type t = 0.0 * si::second;
+ time_type dt = 0.1 * si::second;
+
+ coor_type q1 = q , q2 = q;
+ mom_type p1 = p , p2 = p;
+
+ s.do_step( oscillator_mom_func_units() , std::make_pair( boost::ref( q ) , boost::ref( p ) ) , t , dt );
+
+ s.do_step( std::make_pair( oscillator_coor_func_units() , oscillator_mom_func_units() ) ,
+ std::make_pair( boost::ref( q1 ) , boost::ref( p1 ) ) , t , dt );
+
+ s.do_step( oscillator_mom_func_units() , q2 , p2 , t , dt );
+
+ BOOST_CHECK_CLOSE( ( fusion::at_c< 0 >( q ).value() ) , ( fusion::at_c< 0 >( q1 ).value() ) , 1.0e-14 );
+ BOOST_CHECK_CLOSE( ( fusion::at_c< 0 >( q1 ).value() ) , ( fusion::at_c< 0 >( q2 ).value() ) , 1.0e-14 );
+ BOOST_CHECK_CLOSE( ( fusion::at_c< 0 >( p ).value() ) , ( fusion::at_c< 0 >( p1 ).value() ) , 1.0e-14 );
+ BOOST_CHECK_CLOSE( ( fusion::at_c< 0 >( p1 ).value() ) , ( fusion::at_c< 0 >( p2 ).value() ) , 1.0e-14 );
+}
+
+
+
+
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/trivial_state.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/trivial_state.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,105 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/trivial_state.cpp
+
+ [begin_description]
+ This file tests if the steppers can integrate the trivial state consisting of a single double.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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)
+ */
+
+// disable checked iterator warning for msvc
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+ #pragma warning(disable:4996)
+#endif
+
+#define BOOST_TEST_MODULE odeint_trivial_state
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/at.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp>
+#include <boost/numeric/odeint/stepper/generation.hpp>
+#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp>
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+namespace mpl = boost::mpl;
+
+typedef double state_type;
+typedef double value_type;
+typedef double deriv_type;
+typedef double time_type;
+
+void constant_system( const state_type &x , state_type &dxdt , const time_type t ) { dxdt = 1.0; }
+
+
+BOOST_AUTO_TEST_SUITE( trivial_state_test )
+
+/* test different do_step methods of simple steppers */
+
+typedef mpl::vector<
+ euler< state_type , value_type , deriv_type , time_type ,
+ vector_space_algebra , default_operations , never_resizer > ,
+ runge_kutta4< state_type , value_type , deriv_type , time_type ,
+ vector_space_algebra , default_operations , never_resizer >
+ >::type stepper_types;
+
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_do_step , T, stepper_types )
+{
+ typedef T stepper_type;
+ stepper_type stepper;
+ state_type x = 0.0;
+ time_type t = 0.0;
+ time_type dt = 0.1;
+ stepper.do_step( constant_system , x , t , dt );
+ BOOST_CHECK_CLOSE( x , 0.1 , 1.0e-10 );
+
+ // this overload is not allowed if the types of dxdt and dt are the same
+ // deriv_type dxdt = 1.0;
+ // stepper.do_step( constant_system , x , dxdt , t , dt );
+
+ state_type x_out;
+ stepper.do_step( constant_system , x , t , x_out , dt );
+ BOOST_CHECK_CLOSE( x , 0.1 , 1.0e-10 );
+ BOOST_CHECK_CLOSE( x_out , 0.2 , 1.0e-10 );
+}
+
+
+/* test integrate_adaptive with controlled steppers */
+
+typedef mpl::vector<
+ runge_kutta_cash_karp54< state_type , value_type , deriv_type , time_type ,
+ vector_space_algebra , default_operations , never_resizer > ,
+ runge_kutta_dopri5< state_type , value_type , deriv_type , time_type ,
+ vector_space_algebra , default_operations , never_resizer >
+ > error_stepper_types;
+
+BOOST_AUTO_TEST_CASE_TEMPLATE( test_integrate , T , error_stepper_types )
+{
+ typedef T stepper_type;
+ state_type x = 0.0;
+ time_type t0 = 0.0;
+ time_type t1 = 1.0;
+ time_type dt = 0.1;
+ integrate_adaptive( make_controlled< stepper_type >( 1e-6 , 1e-6 ) , constant_system , x , t0 , t1 , dt );
+ BOOST_CHECK_CLOSE( x , 1.0 , 1.0e-10 );
+}
+
+BOOST_AUTO_TEST_SUITE_END()

Added: trunk/libs/numeric/odeint/test/vector_space_1d.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test/vector_space_1d.hpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,122 @@
+/*
+ [auto_generated]
+ libs/numeric/odeint/test/trivial_state.cpp
+
+ [begin_description]
+ This file defines a vector_space 1d class with the appropriate operators.
+ [end_description]
+
+ Copyright 2009-2012 Karsten Ahnert
+ Copyright 2009-2012 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 VECTOR_SPACE_1D_HPP_INCLUDED
+#define VECTOR_SPACE_1D_HPP_INCLUDED
+
+#include <boost/config.hpp>
+#include <boost/operators.hpp>
+
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+
+template< class T >
+struct vector_space_1d :
+ boost::additive1< vector_space_1d< T > ,
+ boost::additive2< vector_space_1d< T > , T ,
+ boost::multiplicative1< vector_space_1d< T > ,
+ boost::multiplicative2< vector_space_1d< T > , T
+ > > > >
+{
+ typedef T value_type;
+
+ value_type m_x;
+
+ vector_space_1d( void ) : m_x( 0.0 ) {}
+
+ vector_space_1d& operator+=( const vector_space_1d& p )
+ {
+ m_x += p.m_x;
+ return *this;
+ }
+
+ vector_space_1d& operator-=( const vector_space_1d& p )
+ {
+ m_x -= p.m_x;
+ return *this;
+ }
+
+ vector_space_1d& operator*=( const vector_space_1d& p )
+ {
+ m_x *= p.m_x;
+ return *this;
+ }
+
+ vector_space_1d& operator/=( const vector_space_1d& p )
+ {
+ m_x /= p.m_x;
+ return *this;
+ }
+
+ vector_space_1d& operator+=( const value_type& val )
+ {
+ m_x += val;
+ return *this;
+ }
+
+ vector_space_1d& operator-=( const value_type& val )
+ {
+ m_x -= val;
+ return *this;
+ }
+
+ vector_space_1d& operator*=( const value_type &val )
+ {
+ m_x *= val;
+ return *this;
+ }
+
+ vector_space_1d& operator/=( const value_type &val )
+ {
+ m_x /= val;
+ return *this;
+ }
+};
+
+
+template< class T >
+vector_space_1d< T > abs( const vector_space_1d< T > &v)
+{
+ vector_space_1d< T > tmp;
+ tmp.m_x = std::abs( v.m_x );
+ return tmp;
+}
+
+
+template< class T >
+T max BOOST_PREVENT_MACRO_SUBSTITUTION ( const vector_space_1d< T > &v )
+{
+ return v.m_x;
+}
+
+namespace boost {
+ namespace numeric {
+ namespace odeint {
+
+ template< class T >
+ struct vector_space_reduce< vector_space_1d< T > >
+ {
+ template< class Op >
+ T operator()( const vector_space_1d< T > &v , Op op , T value )
+ {
+ return v.m_x;
+ }
+ };
+
+} // odeint
+} // numeric
+} // boost
+
+#endif // VECTOR_SPACE_1D_HPP_INCLUDED

Added: trunk/libs/numeric/odeint/test_external/gmp/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/gmp/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,25 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+# bring in rules for testing
+
+import testing ;
+use-project boost : $(BOOST_ROOT) ;
+
+project gmp
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <include>../../../../..
+ ;
+
+
+lib libgmp : : <name>gmp <link>shared ;
+lib libgmpxx : : <name>gmpxx <link>shared ;
+
+test-suite "gmp"
+ :
+ [ run check_gmp.cpp libgmpxx libgmp : : : <link>shared:<define>BOOST_TEST_DYN_LINK=1 ]
+ ;
+
+

Added: trunk/libs/numeric/odeint/test_external/gmp/check_gmp.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/gmp/check_gmp.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,56 @@
+/* Boost check_gmp.cpp test file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file tests the odeint library with the gmp arbitrary precision types
+
+ 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)
+*/
+
+#define BOOST_TEST_MODULE odeint_gmp
+
+#include <gmpxx.h>
+
+#include <boost/test/unit_test.hpp>
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+const int precision = 1024;
+
+typedef mpf_class value_type;
+typedef boost::array< value_type , 1 > state_type;
+
+
+void constant_system( state_type &x , state_type &dxdt , value_type t )
+{
+ dxdt[0] = value_type( 1.0 , precision );
+}
+
+
+BOOST_AUTO_TEST_CASE( gmp )
+{
+ /* We have to specify the desired precision in advance! */
+ mpf_set_default_prec( precision );
+
+ mpf_t eps_ , unity;
+ mpf_init( eps_ ); mpf_init( unity );
+ mpf_set_d( unity , 1.0 );
+ mpf_div_2exp( eps_ , unity , precision-1 ); // 2^(-precision+1) : smallest number that can be represented with used precision
+ value_type eps( eps_ );
+
+ runge_kutta4< state_type , value_type > stepper;
+ state_type x;
+ x[0] = 0.0;
+
+ stepper.do_step( constant_system , x , 0.0 , 0.1 );
+
+ BOOST_MESSAGE( eps );
+ BOOST_CHECK_MESSAGE( abs( x[0] - value_type( 0.1 , precision ) ) < eps , x[0] - 0.1 );
+}

Added: trunk/libs/numeric/odeint/test_external/gsl/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/gsl/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,28 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+# bring in rules for testing
+
+import testing ;
+use-project boost : $(BOOST_ROOT) ;
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <include>../../../../..
+ ;
+
+
+lib libgsl : : <name>gsl <link>shared ;
+lib libgslcblas : : <name>gslcblas <link>shared ;
+
+test-suite "gsl"
+ :
+ [ run check_gsl.cpp libgslcblas libgsl
+ :
+ :
+ : <link>shared:<define>BOOST_TEST_DYN_LINK=1
+ ]
+ ;
+

Added: trunk/libs/numeric/odeint/test_external/gsl/check_gsl.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/gsl/check_gsl.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,52 @@
+/* Boost check_gmp.cpp test file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file tests the odeint library with the gmp arbitrary precision types
+
+ 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)
+*/
+
+#define BOOST_TEST_MODULE odeint_gsl
+
+#include <gsl/gsl_vector.h>
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/external/gsl/gsl_wrapper.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+using namespace boost::unit_test;
+using namespace boost::numeric::odeint;
+
+typedef gsl_vector *state_type;
+
+const double sigma = 10.0;
+const double R = 28.0;
+const double b = 8.0 / 3.0;
+
+void lorenz( const state_type x , state_type dxdt , double t )
+{
+ gsl_vector_set( dxdt , 0 , sigma * ( gsl_vector_get(x , 1 ) - gsl_vector_get( x , 0 ) ) );
+ gsl_vector_set( dxdt , 1 , R * gsl_vector_get( x , 0 ) - gsl_vector_get( x , 1 ) - gsl_vector_get( x , 0 ) * gsl_vector_get( x , 2) );
+ gsl_vector_set( dxdt , 2 , gsl_vector_get( x , 0 ) * gsl_vector_get( x , 1 ) - b * gsl_vector_get( x , 2) );
+}
+
+BOOST_AUTO_TEST_CASE( gsl )
+{
+ euler< state_type > euler;
+
+ state_type x = gsl_vector_alloc( 3 );
+ gsl_vector_set( x , 0 , 1.0);
+ gsl_vector_set( x , 1 , 1.0);
+ gsl_vector_set( x , 2 , 2.0);
+
+ euler.do_step( lorenz , x , 0.0 , 0.1 );
+
+ //cout << gsl_vector_get( x , 0 ) << " " << gsl_vector_get( x , 1 ) << " " << gsl_vector_get( x , 2 ) << endl;
+
+ gsl_vector_free( x );
+
+}

Added: trunk/libs/numeric/odeint/test_external/mkl/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/mkl/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,30 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+# bring in rules for testing
+
+import testing ;
+use-project boost : $(BOOST_ROOT) ;
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <include>../../../../..
+ ;
+
+
+lib libmkl : : <name>mkl_intel_lp64 <link>shared ;
+lib libmkl_core : : <name>mkl_core <link>shared ;
+lib libmkl_intel_thread : : <name>mkl_intel_thread ;
+lib libiomp5 : : <name>iomp5 ;
+lib libpthread : : <name>pthread ;
+
+test-suite "mkl"
+ :
+ [ run check_mkl.cpp libpthread libiomp5 libmkl_core libmkl_intel_thread libmkl
+ :
+ :
+ : <link>shared:<define>BOOST_TEST_DYN_LINK=1
+ ]
+ ;

Added: trunk/libs/numeric/odeint/test_external/mkl/check_mkl.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/mkl/check_mkl.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,51 @@
+/* Boost check_mkl.cpp test file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file tests the odeint library with the intel mkl blas1 routines
+
+ 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)
+*/
+
+#define BOOST_TEST_MODULE test_mkl
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+#include <boost/numeric/odeint/external/mkl/mkl_operations.hpp>
+
+using namespace boost::numeric::odeint;
+
+typedef double value_type;
+typedef boost::array< value_type , 1 > state_type;
+
+
+void constant_system( state_type &x , state_type &dxdt , value_type t )
+{
+ dxdt[0] = 1.0;
+}
+
+const double eps = 1E-14;
+
+
+BOOST_AUTO_TEST_CASE( test_mkl )
+{
+
+ //to use mkl routines we have to use the vector_space_algebra and the mkl_operations
+ runge_kutta4< state_type , value_type , state_type , value_type , vector_space_algebra , mkl_operations > stepper;
+ state_type x;
+ x[0] = 0.0;
+
+ stepper.do_step( constant_system , x , 0.0 , 0.1 );
+
+ using std::abs;
+
+ std::cout << x[0] << " ?= " << 0.1 << std::endl;
+ BOOST_CHECK_SMALL( abs( x[0] - 0.1 ) , eps );
+
+}

Added: trunk/libs/numeric/odeint/test_external/mtl4/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/mtl4/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,28 @@
+# Copyright 2009 Karsten Ahnert and 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)
+
+import testing ;
+import boost ;
+
+boost.use-project ;
+
+MTL4_INCLUDE = /home/karsten/boost/MTL-4.0.8862-Linux/usr/include ;
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <include>../../../../..
+ <include>$(MTL4_INCLUDE)
+ <define>BOOST_ALL_NO_LIB=1
+ <link>static
+ :
+ : default-build release
+ ;
+
+test-suite "odeint-mtl4"
+ :
+ [ run mtl4_resize.cpp ]
+ : <testing.launcher>valgrind
+ ;

Added: trunk/libs/numeric/odeint/test_external/mtl4/mtl4_resize.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/mtl4/mtl4_resize.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,89 @@
+/* Boost mtl4_resize.cpp test file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file tests the odeint library with the mtl4 routines.
+
+ 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)
+*/
+
+#define BOOST_TEST_MODULE test_mtl4_resize
+
+#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/external/mtl4/mtl4_resize.hpp>
+#include <boost/numeric/mtl/vector/dense_vector.hpp>
+
+namespace odeint = boost::numeric::odeint;
+
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_resizeability )
+{
+ BOOST_CHECK( odeint::is_resizeable< mtl::dense_vector< double > >::value );
+}
+
+BOOST_AUTO_TEST_CASE( test_dense2D_resizeability )
+{
+ BOOST_CHECK( odeint::is_resizeable< mtl::dense2D< double > >::value );
+}
+
+BOOST_AUTO_TEST_CASE( test_compressed2D_resizeability )
+{
+ BOOST_CHECK( odeint::is_resizeable< mtl::compressed2D< double > >::value );
+}
+
+
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_vector_same_size )
+{
+ mtl::dense_vector< double > v1( 10 ) , v2( 10 );
+ BOOST_CHECK( odeint::same_size( v2 , v1 ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_dense2D_same_size )
+{
+ mtl::dense_vector< double > v( 10 );
+ mtl::dense2D< double > m( 10 , 10 );
+ BOOST_CHECK( odeint::same_size( m , v ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_compressed2D_same_size )
+{
+ mtl::dense_vector< double > v( 10 );
+ mtl::compressed2D< double > m( 10 , 10 );
+ BOOST_CHECK( odeint::same_size( m , v ) );
+}
+
+
+
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_vector_resize )
+{
+ mtl::dense_vector< double > v1( 10 );
+ mtl::dense_vector< double > v2;
+ odeint::resize( v2 , v1 );
+ BOOST_CHECK( mtl::size( v2 ) == mtl::size( v1 ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_dense2D_resize )
+{
+ mtl::dense_vector< double > v( 10 );
+ mtl::dense2D< double > m;
+
+ odeint::resize( m , v );
+ BOOST_CHECK( m.num_cols() == mtl::size( v ) );
+ BOOST_CHECK( m.num_rows() == mtl::size( v ) );
+}
+
+BOOST_AUTO_TEST_CASE( test_dense_vector_compressed2D_resize )
+{
+ mtl::dense_vector< double > v( 10 );
+ mtl::compressed2D< double > m;
+
+ odeint::resize( m , v );
+ BOOST_CHECK( m.num_cols() == mtl::size( v ) );
+ BOOST_CHECK( m.num_rows() == mtl::size( v ) );
+}

Added: trunk/libs/numeric/odeint/test_external/thrust/Makefile
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/thrust/Makefile 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,36 @@
+# Copyright 2009-2012 Karsten Ahnert
+# Copyright 2009-2012 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)
+
+
+
+CUDA_ROOT = /usr/local/cuda
+
+CC = gcc-4.4
+CXX = gcc-4.4
+NVCC = $(CUDA_ROOT)/bin/nvcc
+
+INCLUDES += -I$(BOOST_ROOT) -I$(THRUST_ROOT) -I$(CUDA_ROOT)/include -I../../../../..
+
+NVCCFLAGS = -O3 $(INCLUDES) --compiler-bindir=/usr/bin/g++-4.4
+
+LDLIBS = -lcudart
+LDFLAGS = -L$(CUDA_ROOT)/lib64
+
+%.co : %.cu
+ $(NVCC) $(NVCCFLAGS) -o $@ -c $<
+
+
+all : check_thrust
+
+
+check_thrust : check_thrust.co
+ $(CC) -o check_thrust $(LDFLAGS) $(LDLIBS) check_thrust.co
+check_thrust.co : check_thrust.cu
+
+clean :
+ -rm *~ *.o *.co check_thrust
+

Added: trunk/libs/numeric/odeint/test_external/thrust/check_thrust.cu
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/thrust/check_thrust.cu 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,74 @@
+/* Boost check_thrust.cu test file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file tests the use of the euler stepper
+
+ 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)
+*/
+
+//#include <boost/test/unit_test.hpp>
+
+#include <boost/numeric/odeint/stepper/euler.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
+#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp>
+
+#include <thrust/device_vector.h>
+#include <thrust/fill.h>
+
+using namespace boost::numeric::odeint;
+
+typedef float base_type;
+// typedef thrust::device_vector< base_type > state_type;
+typedef thrust::host_vector< base_type > state_type;
+
+void constant_system( const state_type &x , state_type &dxdt , base_type t )
+{
+ thrust::fill( dxdt.begin() , dxdt.end() , static_cast<base_type>(1.0) );
+}
+
+const base_type eps = 1.0e-7;
+
+
+template< class Stepper , class System >
+void check_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x )
+{
+ typedef Stepper stepper_type;
+ typedef typename stepper_type::state_type container_type;
+ typedef typename stepper_type::order_type order_type;
+ typedef typename stepper_type::time_type time_type;
+
+ stepper.do_step( system , x , 0.0 , 0.1 );
+ base_type xval = *boost::begin( x );
+ if( fabs( xval - 0.1 ) < eps )
+ std::clog << "TEST PASSED" << std::endl;
+ else
+ std::clog << "TEST FAILED" << std::endl;
+}
+
+void test_euler_with_thrust( void )
+{
+ state_type x(1);
+ thrust::fill( x.begin() , x.end() , static_cast<base_type>(0.0) );
+ euler< state_type , base_type , state_type , base_type , thrust_algebra , thrust_operations > euler;
+ check_stepper_concept( euler , constant_system , x );
+
+
+}
+
+/*test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ test_suite *test = BOOST_TEST_SUITE("check stepper with thrust");
+
+ test->add( BOOST_TEST_CASE( &test_euler_with_thrust ) );
+
+ return test;
+}*/
+
+int main() {
+ test_euler_with_thrust();
+}

Added: trunk/libs/numeric/odeint/test_external/vexcl/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/vexcl/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,33 @@
+# (C) Copyright 2010 : Karsten Ahnert, 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)
+
+# bring in rules for testing
+
+
+import testing ;
+
+use-project boost : $(BOOST_ROOT) ;
+VEXCL_INCLUDE = /home/karsten/boost/vexcl ;
+CUDA_INCLUDE = /usr/local/cuda/include ;
+
+
+project
+ : requirements
+ <library>/boost/test//boost_unit_test_framework
+ <define>BOOST_ALL_NO_LIB=1
+ <include>../../../../..
+ <include>$(VEXCL_INCLUDE)
+ <include>$(CUDA_INCLUDE)
+ <cxxflags>-std=c++0x
+ ;
+
+lib OpenCL : : <name>OpenCL <link>shared ;
+
+test-suite "odeint"
+ :
+ [ run lorenz.cpp OpenCL ]
+ : <testing.launcher>valgrind
+ :
+ : <link>shared:<define>BOOST_TEST_DYN_LINK=1
+ ;
\ No newline at end of file

Added: trunk/libs/numeric/odeint/test_external/vexcl/lorenz.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/numeric/odeint/test_external/vexcl/lorenz.cpp 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -0,0 +1,86 @@
+/* Boost lorenz.cpp test file
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+
+ This file tests the odeint library with the vexcl types
+
+ 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)
+*/
+
+#define BOOST_TEST_MODULE odeint_vexcl
+
+#include <vector>
+#include <iostream>
+
+#include <vexcl/vexcl.hpp>
+
+#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
+#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
+#include <boost/numeric/odeint/integrate/integrate_const.hpp>
+#include <boost/numeric/odeint/external/vexcl/vexcl_resize.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+using namespace boost::unit_test;
+namespace odeint = boost::numeric::odeint;
+
+
+typedef vex::vector< double > vector_type;
+typedef vex::multivector< double, 3 > state_type;
+
+
+
+const double sigma = 10.0;
+const double b = 8.0 / 3.0;
+
+struct sys_func
+{
+ const vector_type &R;
+
+ sys_func( const vector_type &_R ) : R( _R ) { }
+
+ void operator()( const state_type &x , state_type &dxdt , double t ) const
+ {
+ dxdt(0) = -sigma * ( x(0) - x(1) );
+ dxdt(1) = R * x(0) - x(1) - x(0) * x(2);
+ dxdt(2) = - b * x(2) + x(0) * x(1);
+ }
+};
+
+const size_t n = 1024 ;
+const double dt = 0.01;
+const double t_max = 1.0;
+
+
+BOOST_AUTO_TEST_CASE( gsl )
+{
+ vex::Context ctx( vex::Filter::Type(CL_DEVICE_TYPE_GPU) );
+
+ double Rmin = 0.1 , Rmax = 50.0 , dR = ( Rmax - Rmin ) / double( n - 1 );
+ std::vector<double> x( n * 3 ) , r( n );
+ for( size_t i=0 ; i<n ; ++i ) r[i] = Rmin + dR * double( i );
+
+ state_type X( ctx.queue() , n );
+ X(0) = 10.0;
+ X(1) = 10.0;
+ X(2) = 10.0;
+
+ vector_type R( ctx.queue() , r );
+
+ odeint::runge_kutta4<
+ state_type , double , state_type , double ,
+ odeint::vector_space_algebra , odeint::default_operations
+ > stepper;
+
+ odeint::integrate_const( stepper , sys_func( R ) , X , 0.0 , t_max , dt );
+
+ std::vector< double > res( 3 * n );
+ vex::copy( X(0) , res );
+ std::cout << res[0] << std::endl;
+
+
+
+}

Modified: trunk/status/Jamfile.v2
==============================================================================
--- trunk/status/Jamfile.v2 (original)
+++ trunk/status/Jamfile.v2 2012-11-23 09:22:23 EST (Fri, 23 Nov 2012)
@@ -111,6 +111,7 @@
     msm/test # msm-unit-tests
     numeric/conversion/test # test-suite numeric/conversion
     numeric/interval/test # test-suite numeric/interval
+ numeric/odeint/test # test-suite numeric/odeint
     numeric/ublas/test # test-suite numeirc/uBLAS
     multi_array/test # test-suite multi_array
     multi_index/test # test-suite multi_index


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk