├── .gitmodules ├── .mailmap ├── .travis.yml ├── CHANGELOG ├── Jamroot ├── README.md ├── doc ├── Jamfile.v2 ├── acknowledgements.qbk ├── concepts.qbk ├── concepts │ ├── controlled_stepper.qbk │ ├── dense_output_stepper.qbk │ ├── error_stepper.qbk │ ├── implicit_system.qbk │ ├── second_order_system.qbk │ ├── state_algebra_operations.qbk │ ├── state_wrapper.qbk │ ├── stepper.qbk │ ├── symplectic_system.qbk │ └── system.qbk ├── controlled_stepper_table.qbk ├── details.qbk ├── details_bind_member_functions.qbk ├── details_boost_range.qbk ├── details_boost_ref.qbk ├── details_generation_functions.qbk ├── details_integrate_functions.qbk ├── details_iterators.qbk ├── details_state_types_algebras_operations.qbk ├── details_steppers.qbk ├── examples_table.qbk ├── getting_started.qbk ├── html │ ├── boostbook.css │ ├── images │ │ ├── alert.png │ │ ├── blank.png │ │ ├── callouts │ │ │ ├── 1.png │ │ │ ├── 1.svg │ │ │ ├── 10.png │ │ │ ├── 10.svg │ │ │ ├── 11.png │ │ │ ├── 11.svg │ │ │ ├── 12.png │ │ │ ├── 12.svg │ │ │ ├── 13.png │ │ │ ├── 13.svg │ │ │ ├── 14.png │ │ │ ├── 14.svg │ │ │ ├── 15.png │ │ │ ├── 15.svg │ │ │ ├── 16.svg │ │ │ ├── 17.svg │ │ │ ├── 18.svg │ │ │ ├── 19.svg │ │ │ ├── 2.png │ │ │ ├── 2.svg │ │ │ ├── 20.svg │ │ │ ├── 21.svg │ │ │ ├── 22.svg │ │ │ ├── 23.svg │ │ │ ├── 24.svg │ │ │ ├── 25.svg │ │ │ ├── 26.svg │ │ │ ├── 27.svg │ │ │ ├── 28.svg │ │ │ ├── 29.svg │ │ │ ├── 3.png │ │ │ ├── 3.svg │ │ │ ├── 30.svg │ │ │ ├── 4.png │ │ │ ├── 4.svg │ │ │ ├── 5.png │ │ │ ├── 5.svg │ │ │ ├── 6.png │ │ │ ├── 6.svg │ │ │ ├── 7.png │ │ │ ├── 7.svg │ │ │ ├── 8.png │ │ │ ├── 8.svg │ │ │ ├── 9.png │ │ │ └── 9.svg │ │ ├── caution.png │ │ ├── caution.svg │ │ ├── draft.png │ │ ├── home.png │ │ ├── home.svg │ │ ├── important.png │ │ ├── important.svg │ │ ├── next.png │ │ ├── next.svg │ │ ├── next_disabled.png │ │ ├── note.png │ │ ├── note.svg │ │ ├── prev.png │ │ ├── prev.svg │ │ ├── prev_disabled.png │ │ ├── smiley.png │ │ ├── tip.png │ │ ├── tip.svg │ │ ├── toc-blank.png │ │ ├── toc-minus.png │ │ ├── toc-plus.png │ │ ├── up.png │ │ ├── up.svg │ │ ├── up_disabled.png │ │ ├── warning.png │ │ └── warning.svg │ ├── logo.jpg │ ├── phase_lattice_2d_0000.jpg │ ├── phase_lattice_2d_0100.jpg │ ├── phase_lattice_2d_1000.jpg │ └── solar_system.jpg ├── literature.qbk ├── make_controlled_table.qbk ├── make_dense_output_table.qbk ├── odeint.idx ├── odeint.qbk ├── range_table.qbk ├── stepper_table.qbk ├── tutorial.qbk ├── tutorial_chaotic_system.qbk ├── tutorial_harmonic_oscillator.qbk ├── tutorial_parallel.qbk ├── tutorial_solar_system.qbk ├── tutorial_special_topics.qbk ├── tutorial_stiff_systems.qbk ├── tutorial_thrust_cuda.qbk └── tutorial_vexcl_opencl.qbk ├── examples ├── 2d_lattice │ ├── Jamfile.v2 │ ├── lattice2d.hpp │ ├── nested_range_algebra.hpp │ ├── spreading.cpp │ └── vector_vector_resize.hpp ├── Jamfile.v2 ├── abm_precision.cpp ├── adaptive_iterator.cpp ├── bind_member_functions.cpp ├── bind_member_functions_cpp11.cpp ├── bulirsch_stoer.cpp ├── chaotic_system.cpp ├── const_step_iterator.cpp ├── elliptic.py ├── elliptic_functions.cpp ├── find_crossing.cpp ├── fpu.cpp ├── generation_functions.cpp ├── gmpxx │ ├── Makefile │ └── lorenz_gmpxx.cpp ├── gram_schmidt.hpp ├── harmonic_oscillator.cpp ├── harmonic_oscillator_units.cpp ├── heun.cpp ├── integrate_times.cpp ├── list_lattice.cpp ├── lorenz.cpp ├── lorenz_point.cpp ├── molecular_dynamics.cpp ├── molecular_dynamics_cells.cpp ├── mpi │ ├── Jamfile.v2 │ └── phase_chain.cpp ├── mtl │ ├── Jamfile.v2 │ ├── gauss_packet.cpp │ └── implicit_euler_mtl.cpp ├── multiprecision │ ├── Jamfile │ ├── cmp_precision.cpp │ └── lorenz_mp.cpp ├── my_vector.cpp ├── nt2 │ ├── Jamfile.v2 │ └── phase_oscillator_ensemble.cpp ├── openmp │ ├── Jamfile.v2 │ ├── lorenz_ensemble.cpp │ ├── lorenz_ensemble_nested.cpp │ ├── lorenz_ensemble_simple.cpp │ ├── openmp.jam │ ├── phase_chain.cpp │ └── phase_chain_omp_state.cpp ├── phase_oscillator_ensemble.cpp ├── point_type.hpp ├── quadmath │ ├── Jamfile.v2 │ └── black_hole.cpp ├── resizing_lattice.cpp ├── simple1d.cpp ├── solar_system.agr ├── solar_system.cpp ├── stepper_details.cpp ├── stiff_system.cpp ├── stochastic_euler.cpp ├── stuart_landau.cpp ├── thrust │ ├── Makefile │ ├── lorenz_parameters.cu │ ├── phase_oscillator_chain.cu │ ├── phase_oscillator_ensemble.cu │ └── relaxation.cu ├── two_dimensional_phase_lattice.cpp ├── ublas │ ├── Jamfile.v2 │ └── lorenz_ublas.cpp ├── van_der_pol_stiff.cpp └── vexcl │ ├── Jamfile.v2 │ └── lorenz_ensemble.cpp ├── fix-copyright.py ├── include └── boost │ └── numeric │ ├── odeint.hpp │ └── odeint │ ├── algebra │ ├── algebra_dispatcher.hpp │ ├── array_algebra.hpp │ ├── default_operations.hpp │ ├── detail │ │ ├── extract_value_type.hpp │ │ ├── for_each.hpp │ │ ├── macros.hpp │ │ └── norm_inf.hpp │ ├── fusion_algebra.hpp │ ├── fusion_algebra_dispatcher.hpp │ ├── multi_array_algebra.hpp │ ├── norm_result_type.hpp │ ├── operations_dispatcher.hpp │ ├── range_algebra.hpp │ └── vector_space_algebra.hpp │ ├── config.hpp │ ├── external │ ├── blaze │ │ ├── blaze_algebra_dispatcher.hpp │ │ └── blaze_resize.hpp │ ├── compute │ │ ├── compute.hpp │ │ ├── compute_algebra.hpp │ │ ├── compute_algebra_dispatcher.hpp │ │ ├── compute_operations.hpp │ │ ├── compute_operations_dispatcher.hpp │ │ └── compute_resize.hpp │ ├── eigen │ │ ├── eigen.hpp │ │ ├── eigen_algebra.hpp │ │ ├── eigen_algebra_dispatcher.hpp │ │ └── eigen_resize.hpp │ ├── gsl │ │ └── gsl_wrapper.hpp │ ├── mkl │ │ └── mkl_operations.hpp │ ├── mpi │ │ ├── mpi.hpp │ │ ├── mpi_nested_algebra.hpp │ │ ├── mpi_state.hpp │ │ └── mpi_vector_state.hpp │ ├── mtl4 │ │ ├── implicit_euler_mtl4.hpp │ │ ├── mtl4.hpp │ │ ├── mtl4_algebra_dispatcher.hpp │ │ └── mtl4_resize.hpp │ ├── nt2 │ │ ├── nt2_algebra_dispatcher.hpp │ │ ├── nt2_copy.hpp │ │ ├── nt2_norm_inf.hpp │ │ └── nt2_resize.hpp │ ├── openmp │ │ ├── openmp.hpp │ │ ├── openmp_nested_algebra.hpp │ │ ├── openmp_range_algebra.hpp │ │ └── openmp_state.hpp │ ├── thrust │ │ ├── thrust.hpp │ │ ├── thrust_algebra.hpp │ │ ├── thrust_algebra_dispatcher.hpp │ │ ├── thrust_operations.hpp │ │ ├── thrust_operations_dispatcher.hpp │ │ └── thrust_resize.hpp │ ├── vexcl │ │ ├── vexcl.hpp │ │ ├── vexcl_abs.hpp │ │ ├── vexcl_algebra_dispatcher.hpp │ │ ├── vexcl_copy.hpp │ │ ├── vexcl_norm_inf.hpp │ │ ├── vexcl_resize.hpp │ │ └── vexcl_same_instance.hpp │ └── viennacl │ │ ├── viennacl_operations.hpp │ │ └── viennacl_resize.hpp │ ├── integrate │ ├── check_adapter.hpp │ ├── detail │ │ ├── functors.hpp │ │ ├── integrate_adaptive.hpp │ │ ├── integrate_const.hpp │ │ ├── integrate_n_steps.hpp │ │ └── integrate_times.hpp │ ├── integrate.hpp │ ├── integrate_adaptive.hpp │ ├── integrate_const.hpp │ ├── integrate_n_steps.hpp │ ├── integrate_times.hpp │ ├── max_step_checker.hpp │ ├── null_observer.hpp │ └── observer_collection.hpp │ ├── iterator │ ├── adaptive_iterator.hpp │ ├── adaptive_time_iterator.hpp │ ├── const_step_iterator.hpp │ ├── const_step_time_iterator.hpp │ ├── detail │ │ └── ode_iterator_base.hpp │ ├── impl │ │ ├── adaptive_iterator_impl.hpp │ │ ├── const_step_iterator_impl.hpp │ │ ├── n_step_iterator_impl.hpp │ │ └── times_iterator_impl.hpp │ ├── integrate │ │ ├── detail │ │ │ ├── functors.hpp │ │ │ ├── integrate_adaptive.hpp │ │ │ ├── integrate_const.hpp │ │ │ ├── integrate_n_steps.hpp │ │ │ └── integrate_times.hpp │ │ ├── integrate.hpp │ │ ├── integrate_adaptive.hpp │ │ ├── integrate_const.hpp │ │ ├── integrate_n_steps.hpp │ │ ├── integrate_times.hpp │ │ ├── null_observer.hpp │ │ └── observer_collection.hpp │ ├── n_step_iterator.hpp │ ├── n_step_time_iterator.hpp │ ├── times_iterator.hpp │ └── times_time_iterator.hpp │ ├── stepper │ ├── adams_bashforth.hpp │ ├── adams_bashforth_moulton.hpp │ ├── adams_moulton.hpp │ ├── adaptive_adams_bashforth_moulton.hpp │ ├── base │ │ ├── algebra_stepper_base.hpp │ │ ├── explicit_error_stepper_base.hpp │ │ ├── explicit_error_stepper_fsal_base.hpp │ │ ├── explicit_stepper_base.hpp │ │ └── symplectic_rkn_stepper_base.hpp │ ├── bulirsch_stoer.hpp │ ├── bulirsch_stoer_dense_out.hpp │ ├── controlled_adams_bashforth_moulton.hpp │ ├── controlled_runge_kutta.hpp │ ├── controlled_step_result.hpp │ ├── dense_output_runge_kutta.hpp │ ├── detail │ │ ├── adams_bashforth_call_algebra.hpp │ │ ├── adams_bashforth_coefficients.hpp │ │ ├── adams_moulton_call_algebra.hpp │ │ ├── adams_moulton_coefficients.hpp │ │ ├── adaptive_adams_coefficients.hpp │ │ ├── generic_rk_algorithm.hpp │ │ ├── generic_rk_call_algebra.hpp │ │ ├── generic_rk_operations.hpp │ │ ├── pid_step_adjuster.hpp │ │ ├── pid_step_adjuster_coefficients.hpp │ │ └── rotating_buffer.hpp │ ├── euler.hpp │ ├── explicit_error_generic_rk.hpp │ ├── explicit_generic_rk.hpp │ ├── extrapolation_stepper.hpp │ ├── generation.hpp │ ├── generation │ │ ├── generation_controlled_adams_bashforth_moulton.hpp │ │ ├── generation_controlled_runge_kutta.hpp │ │ ├── generation_dense_output_runge_kutta.hpp │ │ ├── generation_rosenbrock4.hpp │ │ ├── generation_runge_kutta_cash_karp54.hpp │ │ ├── generation_runge_kutta_cash_karp54_classic.hpp │ │ ├── generation_runge_kutta_dopri5.hpp │ │ ├── generation_runge_kutta_fehlberg78.hpp │ │ ├── make_controlled.hpp │ │ └── make_dense_output.hpp │ ├── implicit_euler.hpp │ ├── modified_midpoint.hpp │ ├── rosenbrock4.hpp │ ├── rosenbrock4_controller.hpp │ ├── rosenbrock4_dense_output.hpp │ ├── runge_kutta4.hpp │ ├── runge_kutta4_classic.hpp │ ├── runge_kutta_cash_karp54.hpp │ ├── runge_kutta_cash_karp54_classic.hpp │ ├── runge_kutta_dopri5.hpp │ ├── runge_kutta_fehlberg78.hpp │ ├── stepper_categories.hpp │ ├── symplectic_euler.hpp │ ├── symplectic_rkn_sb3a_m4_mclachlan.hpp │ ├── symplectic_rkn_sb3a_mclachlan.hpp │ └── velocity_verlet.hpp │ ├── util │ ├── bind.hpp │ ├── copy.hpp │ ├── detail │ │ ├── is_range.hpp │ │ └── less_with_sign.hpp │ ├── is_pair.hpp │ ├── is_resizeable.hpp │ ├── multi_array_adaption.hpp │ ├── n_ary_helper.hpp │ ├── odeint_error.hpp │ ├── resize.hpp │ ├── resizer.hpp │ ├── same_instance.hpp │ ├── same_size.hpp │ ├── split.hpp │ ├── split_adaptor.hpp │ ├── state_wrapper.hpp │ ├── stepper_traits.hpp │ ├── ublas_matrix_expression.patch │ ├── ublas_wrapper.hpp │ ├── unit_helper.hpp │ └── unwrap_reference.hpp │ └── version.hpp ├── index.html ├── performance ├── Jamfile.v2 ├── Makefile ├── SIMD │ ├── Makefile │ ├── perf_roessler.sh │ ├── roessler.cpp │ └── roessler_simd.cpp ├── c_lorenz.c ├── fortran_lorenz.f90 ├── lorenz.hpp ├── odeint_rk4_array.cpp └── plot_result.py ├── test ├── Jamfile.v2 ├── adams_bashforth.cpp ├── adams_bashforth_moulton.cpp ├── adams_moulton.cpp ├── adaptive_adams_coefficients.cpp ├── adaptive_iterator.cpp ├── adaptive_time_iterator.cpp ├── algebra_dispatcher.cpp ├── boost_units_helpers.hpp ├── bulirsch_stoer.cpp ├── const_range.hpp ├── const_step_iterator.cpp ├── const_step_time_iterator.cpp ├── controlled_adams_bashforth_moulton.cpp ├── default_operations.cpp ├── diagnostic_state_type.hpp ├── dummy_observers.hpp ├── dummy_odes.hpp ├── dummy_steppers.hpp ├── euler_stepper.cpp ├── fusion_algebra.cpp ├── generation.cpp ├── generic_error_stepper.cpp ├── generic_stepper.cpp ├── implicit_euler.cpp ├── integrate.cpp ├── integrate_implicit.cpp ├── integrate_overflow.cpp ├── integrate_stepper_refs.cpp ├── integrate_times.cpp ├── integrators_symplectic.cpp ├── is_pair.cpp ├── is_resizeable.cpp ├── multi_array.cpp ├── n_step_iterator.cpp ├── n_step_time_iterator.cpp ├── numeric │ ├── Jamfile.v2 │ ├── abm_time_dependent.cpp │ ├── adams_bashforth.cpp │ ├── adams_bashforth_moulton.cpp │ ├── adaptive_adams_bashforth_moulton.cpp │ ├── order_quadrature_formula.cpp │ ├── rosenbrock.cpp │ ├── runge_kutta.cpp │ ├── symplectic.cpp │ └── velocity_verlet.cpp ├── prepare_stepper_testing.hpp ├── range_algebra.cpp ├── regression │ ├── Jamfile.v2 │ ├── regression_147.cpp │ ├── regression_149.cpp │ ├── regression_168.cpp │ └── regression_189.cpp ├── resize.cpp ├── resizing.cpp ├── resizing_test_state_type.hpp ├── rosenbrock4.cpp ├── rosenbrock4_mp.cpp ├── runge_kutta_concepts.cpp ├── runge_kutta_controlled_concepts.cpp ├── runge_kutta_error_concepts.cpp ├── same_size.cpp ├── split.cpp ├── std_array.cpp ├── step_size_limitation.cpp ├── stepper_copying.cpp ├── stepper_with_ranges.cpp ├── stepper_with_units.cpp ├── symplectic_steppers.cpp ├── times_iterator.cpp ├── times_time_iterator.cpp ├── trivial_state.cpp ├── unwrap_boost_reference.cpp ├── unwrap_reference.cpp └── velocity_verlet.cpp ├── test_external ├── eigen │ ├── Jamfile.v2 │ ├── integrate.cpp │ ├── is_resizeable.cpp │ ├── resize.cpp │ ├── runge_kutta4.cpp │ ├── runge_kutta_dopri5.cpp │ └── same_size.cpp ├── gmp │ ├── Jamfile.v2 │ ├── check_gmp.cpp │ └── gmp_integrate.cpp ├── gsl │ ├── Jamfile.v2 │ └── check_gsl.cpp ├── mkl │ ├── Jamfile.v2 │ └── check_mkl.cpp ├── mpi │ ├── Jamfile.v2 │ ├── norm_test.cpp │ ├── split_test.cpp │ └── state_test.cpp ├── mtl4 │ ├── Jamfile.v2 │ └── mtl4_resize.cpp ├── nt2 │ ├── Jamfile.v2 │ ├── algebra_dispatcher.cpp │ ├── copy.cpp │ ├── is_resizeable.cpp │ ├── norm_inf.cpp │ └── resize.cpp ├── thrust │ ├── Makefile │ └── check_thrust.cu └── vexcl │ ├── Jamfile.v2 │ ├── lorenz.cpp │ └── norm_inf.cpp └── toolset.jam.patch /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "doc"] 2 | path = doc 3 | url = git@github.com:headmyshoulder/odeint-v2.git 4 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | # git log --all --format='%an <%ae>' | sort -u 2 | # Proper Name 3 | Andreas Angelopoulos 4 | Christoph Koke 5 | Daniel James 6 | Denis Demidov 7 | Karsten Ahnert 8 | Karsten Ahnert 9 | Karsten Ahnert 10 | Kyle Lutz 11 | Mario Mulansky 12 | Mario Mulansky 13 | Mario Mulansky 14 | Mario Mulansky 15 | Pascal Germroth 16 | Sylwester Arabas 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: cpp 3 | os: 4 | - linux 5 | - osx 6 | compiler: 7 | - gcc 8 | - clang 9 | install: 10 | - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi 11 | addons: 12 | apt: 13 | sources: 14 | - ubuntu-toolchain-r-test 15 | packages: 16 | - gcc-4.8 17 | - g++-4.8 18 | - clang 19 | 20 | env: 21 | - CXXSTD="" 22 | - CXXSTD="-std=c++0x" 23 | 24 | # For now disable gcc on osx as g++4.8 is not yet available 25 | matrix: 26 | exclude: 27 | - os: osx 28 | compiler: gcc 29 | 30 | before_install: 31 | # 1.58: http://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2\?r\=\&ts\=1435589970\&use_mirror\=garr 32 | # 1.63: https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2/download?use_mirror=superb-dca2 33 | - wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2/download?use_mirror=superb-dca2 -O /tmp/boost.tar.bz2 34 | - tar jxf /tmp/boost.tar.bz2 35 | - mv boost_1_63_0 $PWD/boost-trunk 36 | - export BOOST_ROOT="$PWD/boost-trunk" 37 | 38 | - cd $BOOST_ROOT 39 | - ./bootstrap.sh 40 | - cd $TRAVIS_BUILD_DIR 41 | - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$CC" = "gcc" ]; then export CC=gcc-4.8; fi 42 | - echo $CC 43 | - $CC --version 44 | 45 | script: 46 | - $BOOST_ROOT/b2 toolset=$CC cxxflags='$CXXSTD' -j2 -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | odeint 2.1 2 | 3 | * versioning system 4 | * generation functions 5 | * bugfixing 6 | 7 | odeint 2.2 (still running) 8 | 9 | * removing same_size and resize from state_wrapper into separate functions 10 | -------------------------------------------------------------------------------- /Jamroot: -------------------------------------------------------------------------------- 1 | # Copyright 2009-2012 Karsten Ahnert 2 | # Copyright 2010-2013 Mario Mulansky 3 | # Copyright 2013 Pascal Germroth 4 | # Distributed under the Boost Software License, Version 1.0. (See 5 | # accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | import os ; 9 | import modules ; 10 | import path ; 11 | 12 | path-constant BOOST_ROOT : [ os.environ BOOST_ROOT ] ; 13 | 14 | project 15 | : requirements 16 | include&&$(BOOST_ROOT) 17 | gcc:"-Wall -Wno-unused-parameter -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-local-typedefs" 18 | clang:"-Wall -Wextra -Wno-unknown-warning-option -Wno-unused-function -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-local-typedef" 19 | intel:"-ipo" 20 | ; 21 | 22 | # tests, regression tests and examples 23 | build-project test ; 24 | build-project test/numeric ; 25 | build-project examples ; 26 | # build-project performance ; 27 | # build-project openmp ; 28 | # build-project performance/mpi ; 29 | 30 | 31 | # additional tests with external libraries : 32 | # build-project test_external/eigen ; 33 | # build-project test_external/gmp ; 34 | # build-project test_external/gsl ; 35 | # build-project test_external/mkl ; 36 | # build-project test_external/mtl4 ; 37 | # build-project test_external/thrust ; 38 | # build-project test_external/vexcl ; 39 | # build-project test_external/mpi ; 40 | 41 | 42 | # documentation: 43 | # build-project doc ; 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/headmyshoulder/odeint-v2.svg?branch=master)](https://travis-ci.org/headmyshoulder/odeint-v2) 2 | 3 | odeint is a highly flexible library for solving ordinary differential equations. 4 | -------------------------------------------------------------------------------- /doc/acknowledgements.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011-2012 Karsten Ahnert 5 | Copyright 2011-2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | [section Acknowledgments] 14 | 15 | 16 | [/ 17 | 18 | * Steven Watanabe for managing the Boost review process. 19 | * All people who participated in the odeint review process on the Boost mailing list. 20 | * Paul Bristow for helping with the documentation. 21 | * 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.. 22 | * Joachim Faulhaber for motivating us to participate in the Boost review process and many detailed comments about the library. 23 | * All users of odeint. They are the main motivation for our efforts. 24 | 25 | 26 | [h3 Contributers] 27 | 28 | * Andreas Angelopoulos implemented the sparse matrix implicit Euler stepper using the MTL4 library. 29 | * Rajeev Singh implemented the stiff Van der Pol oscillator example. 30 | * Sylwester Arabas improved the documentation. 31 | * Denis Demidov provided the adaption to the VexCL and Viennacl libraries. 32 | * Christoph Koke provided improved binders. 33 | * Lee Hodgkinson provided the black hole example. 34 | ] 35 | 36 | 37 | [endsect] 38 | -------------------------------------------------------------------------------- /doc/concepts.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011-2012 Karsten Ahnert 5 | Copyright 2011 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | [section:concepts Concepts] 14 | [# odeint.concepts] 15 | 16 | [include concepts/system.qbk] 17 | [include concepts/second_order_system.qbk] 18 | [include concepts/symplectic_system.qbk] 19 | [include concepts/implicit_system.qbk] 20 | [include concepts/stepper.qbk] 21 | [include concepts/error_stepper.qbk] 22 | [include concepts/controlled_stepper.qbk] 23 | [include concepts/dense_output_stepper.qbk] 24 | [include concepts/state_algebra_operations.qbk] 25 | [include concepts/state_wrapper.qbk] 26 | 27 | [endsect] -------------------------------------------------------------------------------- /doc/concepts/implicit_system.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011 Mario Mulansky 5 | Copyright 2011-2012 Karsten Ahnert 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | 14 | [section Implicit System] 15 | 16 | [heading Description] 17 | 18 | This concept describes how to define a ODE that can be solved by an implicit routine. 19 | Implicit routines need not only the function /f(x,t)/ but also the Jacobian /df/dx = A(x,t)/. 20 | /A/ is a matrix and implicit routines need to solve the linear problem /Ax = b/. 21 | 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]. 22 | 23 | [heading Notation] 24 | 25 | [variablelist 26 | [[`System`] [A type that is a model of `Implicit System`]] 27 | [[`Time`] [A type representing the time of the ODE]] 28 | [[`sys`] [An object of type `System`]] 29 | [[`x`] [Object of type ublas::vector]] 30 | [[`dxdt`] [Object of type ublas::vector]] 31 | [[`jacobi`] [Object of type ublas::matrix]] 32 | [[`t`] [Object of type `Time`]] 33 | ] 34 | 35 | [heading Valid Expressions] 36 | 37 | [table 38 | [[Name] [Expression] [Type] [Semantics]] 39 | [[Calculate ['dx/dt := f(x,t)]] [`sys.first( x , dxdt , t )`] [`void`] [Calculates `f(x,t)`, the result is stored into dxdt] ] 40 | [[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`] ] 41 | ] 42 | 43 | [endsect] -------------------------------------------------------------------------------- /doc/concepts/second_order_system.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright (c) 2009-2013 Karsten Ahnert 5 | Copyright (c) 2009-2013 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | [section Second Order System] 14 | 15 | [heading Description] 16 | 17 | The Second Order System concept models the algorithmic implementation of the rhs for steppers requirering the second order 18 | derivative, hence the r.h.s. of the ODE ['x'' = f(x,x',t)]. The only requirement for this concept is that it should be callable 19 | with a specific parameter syntax (see below). A Second Order System is typically implemented as a function or a functor. 20 | Systems fulfilling this concept are required by the Velocity Verlet method. 21 | 22 | [heading Notation] 23 | 24 | [variablelist 25 | [[`System`] [A type that is a model of Second Order System]] 26 | [[`Space`] [A type representing the state /x/ of the ODE]] 27 | [[`Velocity`] [A type representing the derivative /x'/ of the ODE]] 28 | [[`Acceleration`] [A type representing the second order derivative /x''/ of the ODE]] 29 | [[`Time`] [A type representing the time]] 30 | [[`sys`] [An object of type `System`]] 31 | [[`x`] [Object of type `Space`]] 32 | [[`v`] [Object of type `Velocity`]] 33 | [[`a`] [Object of type `Acceleration`]] 34 | [[`t`] [Object of type `Time`]] 35 | ] 36 | 37 | [heading Valid expressions] 38 | 39 | [table 40 | [[Name] [Expression] [Type] [Semantics]] 41 | [[Calculate ['x'' := f(x,x',t)]] [`sys( x , v , a , t )`] [`void`] [Calculates f(x,x',t), the result is stored into a.] ] 42 | ] 43 | 44 | [endsect] -------------------------------------------------------------------------------- /doc/concepts/state_wrapper.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011 Mario Mulansky 5 | Copyright 2012 Karsten Ahnert 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | [section State Wrapper] 14 | 15 | [heading Description] 16 | 17 | The `State Wrapper` concept describes the way odeint creates temporary state objects to store intermediate results within the stepper's `do_step` methods. 18 | 19 | [heading Notation] 20 | 21 | [variablelist 22 | [[`State`] [A type that is the `state_type` of the ODE]] 23 | [[`WrappedState`] [A type that is a model of State Wrapper for the state type `State`.]] 24 | [[`x`] [Object of type `State`]] 25 | [[`w`] [Object of type `WrappedState`]] 26 | ] 27 | 28 | [heading Valid Expressions] 29 | 30 | [table 31 | [[Name] [Expression] [Type] [Semantics]] 32 | [[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.]] 33 | [[Create `WrappedState` type] [`state_wrapper< State >`] [`WrappedState`] [Creates the type for a `WrappedState` for the state type `State`]] 34 | [[Constructor] [`WrappedState()`] [`WrappedState`] [Constructs a state wrapper with an empty state]] 35 | [[Copy Constructor] [`WrappedState( w )`] [`WrappedState`] [Constructs a state wrapper with a state of the same size as the state in `w`]] 36 | [[Get state] [`w.m_v`] [`State`] [Returns the `State` object of this state wrapper.]] 37 | ] 38 | 39 | [endsect] -------------------------------------------------------------------------------- /doc/concepts/system.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011 Mario Mulansky 5 | Copyright 2011-2012 Karsten Ahnert 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | [section System] 14 | 15 | [heading Description] 16 | 17 | The System concept models the algorithmic implementation of the rhs. of the ODE ['x' = f(x,t)]. 18 | The only requirement for this concept is that it should be callable with a specific parameter syntax (see below). 19 | A System is typically implemented as a function or a functor. 20 | Systems fulfilling this concept are required by all Runge-Kutta steppers as well as the Bulirsch-Stoer steppers. 21 | However, symplectic and implicit steppers work with other system concepts, see __symplectic_system and __implicit_system. 22 | 23 | [heading Notation] 24 | 25 | [variablelist 26 | [[`System`] [A type that is a model of System]] 27 | [[`State`] [A type representing the state /x/ of the ODE]] 28 | [[`Deriv`] [A type representing the derivative /x'/ of the ODE]] 29 | [[`Time`] [A type representing the time]] 30 | [[`sys`] [An object of type `System`]] 31 | [[`x`] [Object of type `State`]] 32 | [[`dxdt`] [Object of type `Deriv`]] 33 | [[`t`] [Object of type `Time`]] 34 | ] 35 | 36 | [heading Valid expressions] 37 | 38 | [table 39 | [[Name] [Expression] [Type] [Semantics]] 40 | [[Calculate ['dx/dt := f(x,t)]] [`sys( x , dxdt , t )`] [`void`] [Calculates f(x,t), the result is stored into dxdt] ] 41 | ] 42 | 43 | [endsect] -------------------------------------------------------------------------------- /doc/details.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011-2012 Karsten Ahnert 5 | Copyright 2011-2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | [section odeint in detail] 13 | 14 | [include details_steppers.qbk] 15 | 16 | [include details_generation_functions.qbk] 17 | 18 | [include details_integrate_functions.qbk] 19 | 20 | [include details_iterators.qbk] 21 | 22 | [include details_state_types_algebras_operations.qbk] 23 | 24 | [include details_boost_ref.qbk] 25 | 26 | [include details_boost_range.qbk] 27 | 28 | [include details_bind_member_functions.qbk] 29 | 30 | [endsect] 31 | -------------------------------------------------------------------------------- /doc/details_bind_member_functions.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011-2012 Karsten Ahnert 5 | Copyright 2011-2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | [section Binding member functions] 14 | 15 | [import ../examples/bind_member_functions.cpp] 16 | 17 | 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. 18 | 19 | But one can easily implement the according binders themself: 20 | 21 | [ode_wrapper] 22 | 23 | One can use this binder as follows 24 | 25 | [bind_member_function] 26 | 27 | [section Binding member functions in C++11] 28 | 29 | [import ../examples/bind_member_functions_cpp11.cpp] 30 | In C++11 one can use `std::bind` and one does not need to implement the bind themself: 31 | 32 | [bind_member_function_cpp11] 33 | 34 | [endsect] 35 | 36 | [endsect] 37 | -------------------------------------------------------------------------------- /doc/details_boost_ref.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2012 Karsten Ahnert 5 | Copyright 2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | [section Using boost::ref] 13 | 14 | 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: 15 | 16 | [c++] 17 | `` 18 | rk4.do_step( sys , x , t , dt ); // pass sys by value 19 | `` 20 | 21 | 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. 22 | 23 | In such cases you can easily use `boost::ref` (and its relative `boost::cref`) 24 | which passes its argument by reference (or constant reference). odeint will 25 | unpack the arguments and no copying at all of your system object will take place: 26 | 27 | `` 28 | rk4.do_step( boost::ref( sys ) , x , t , dt ); // pass sys as references 29 | `` 30 | 31 | The same mechanism can be used for the observers in the integrate functions. 32 | 33 | [tip If you are using C++11 you can also use `std::ref` and `std::cref`] 34 | 35 | [endsect] 36 | -------------------------------------------------------------------------------- /doc/html/images/alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/alert.png -------------------------------------------------------------------------------- /doc/html/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/blank.png -------------------------------------------------------------------------------- /doc/html/images/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/1.png -------------------------------------------------------------------------------- /doc/html/images/callouts/1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/html/images/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/10.png -------------------------------------------------------------------------------- /doc/html/images/callouts/10.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/11.png -------------------------------------------------------------------------------- /doc/html/images/callouts/11.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/html/images/callouts/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/12.png -------------------------------------------------------------------------------- /doc/html/images/callouts/12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/13.png -------------------------------------------------------------------------------- /doc/html/images/callouts/13.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/14.png -------------------------------------------------------------------------------- /doc/html/images/callouts/14.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/images/callouts/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/15.png -------------------------------------------------------------------------------- /doc/html/images/callouts/15.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/17.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/images/callouts/18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/html/images/callouts/19.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/2.png -------------------------------------------------------------------------------- /doc/html/images/callouts/2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/images/callouts/20.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/21.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/22.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/23.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/25.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/html/images/callouts/26.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/27.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/28.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/html/images/callouts/29.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/3.png -------------------------------------------------------------------------------- /doc/html/images/callouts/3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/30.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/html/images/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/4.png -------------------------------------------------------------------------------- /doc/html/images/callouts/4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/html/images/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/5.png -------------------------------------------------------------------------------- /doc/html/images/callouts/5.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/images/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/6.png -------------------------------------------------------------------------------- /doc/html/images/callouts/6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/7.png -------------------------------------------------------------------------------- /doc/html/images/callouts/7.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/html/images/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/8.png -------------------------------------------------------------------------------- /doc/html/images/callouts/8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/html/images/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/callouts/9.png -------------------------------------------------------------------------------- /doc/html/images/callouts/9.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | ]> 7 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/caution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/caution.png -------------------------------------------------------------------------------- /doc/html/images/draft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/draft.png -------------------------------------------------------------------------------- /doc/html/images/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/home.png -------------------------------------------------------------------------------- /doc/html/images/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/important.png -------------------------------------------------------------------------------- /doc/html/images/important.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | ]> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /doc/html/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/next.png -------------------------------------------------------------------------------- /doc/html/images/next.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/next_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/next_disabled.png -------------------------------------------------------------------------------- /doc/html/images/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/note.png -------------------------------------------------------------------------------- /doc/html/images/note.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ]> 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /doc/html/images/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/prev.png -------------------------------------------------------------------------------- /doc/html/images/prev.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/prev_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/prev_disabled.png -------------------------------------------------------------------------------- /doc/html/images/smiley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/smiley.png -------------------------------------------------------------------------------- /doc/html/images/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/tip.png -------------------------------------------------------------------------------- /doc/html/images/toc-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/toc-blank.png -------------------------------------------------------------------------------- /doc/html/images/toc-minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/toc-minus.png -------------------------------------------------------------------------------- /doc/html/images/toc-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/toc-plus.png -------------------------------------------------------------------------------- /doc/html/images/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/up.png -------------------------------------------------------------------------------- /doc/html/images/up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/html/images/up_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/up_disabled.png -------------------------------------------------------------------------------- /doc/html/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/images/warning.png -------------------------------------------------------------------------------- /doc/html/images/warning.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | ]> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/html/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/logo.jpg -------------------------------------------------------------------------------- /doc/html/phase_lattice_2d_0000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/phase_lattice_2d_0000.jpg -------------------------------------------------------------------------------- /doc/html/phase_lattice_2d_0100.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/phase_lattice_2d_0100.jpg -------------------------------------------------------------------------------- /doc/html/phase_lattice_2d_1000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/phase_lattice_2d_1000.jpg -------------------------------------------------------------------------------- /doc/html/solar_system.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/headmyshoulder/odeint-v2/db8b39ae27346e501941bf705362a1f4879b653c/doc/html/solar_system.jpg -------------------------------------------------------------------------------- /doc/make_controlled_table.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011-2012 Karsten Ahnert 5 | Copyright 2011-2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | 14 | [table Generation functions make_controlled( abs_error , rel_error , stepper ) 15 | [[Stepper] [Result of make_controlled] [Remarks]] 16 | [[`runge_kutta_cash_karp54`] [`controlled_runge_kutta< runge_kutta_cash_karp54 , default_error_checker<...> >`] [['a[sub x]=1], ['a[sub dxdt]=1]]] 17 | [[`runge_kutta_fehlberg78`] [`controlled_runge_kutta< runge_kutta_fehlberg78 , default_error_checker<...> >`] [['a[sub x]=1], ['a[sub dxdt]=1]]] 18 | [[`runge_kutta_dopri5`] [`controlled_runge_kutta< runge_kutta_dopri5 , default_error_checker<...> >`] [['a [sub x]=1], ['a[sub dxdt]=1]]] 19 | [[`rosenbrock4`] [`rosenbrock4_controlled< rosenbrock4 >`] [-]] 20 | ] 21 | -------------------------------------------------------------------------------- /doc/make_dense_output_table.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2011-2012 Karsten Ahnert 5 | Copyright 2011-2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | 14 | [table Generation functions make_dense_output( abs_error , rel_error , stepper ) 15 | [[Stepper] [Result of make_dense_output] [Remarks]] 16 | [[`runge_kutta_dopri5`] [`dense_output_runge_kutta< controlled_runge_kutta< runge_kutta_dopri5 , default_error_checker<...> > >`] [['a [sub x]=1], ['a[sub dxdt]=1]]] 17 | [[`rosenbrock4`] [`rosenbrock4_dense_output< rosenbrock4_controller< rosenbrock4 > >`] [-]] 18 | ] 19 | 20 | -------------------------------------------------------------------------------- /doc/odeint.idx: -------------------------------------------------------------------------------- 1 | # odeint.idx list of files and keyword to be indexed. 2 | 3 | # Copyright 2012 Karsten Ahnert 4 | # Copyright 2012 Pierre Talbot 5 | # 6 | # Use, modification and distribution is subject to the Boost Software 7 | # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 | # http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | !scan-path "boost/numeric/odeint/" ".*\.*pp" true 11 | # recurse in any sub-directories. 12 | 13 | # List of terms in the docbook (from Quickbook) to be indexed. 14 | # Convenient to order these alphabetically. 15 | 16 | # TODO - add more! 17 | 18 | acknowledgements 19 | book 20 | # C++ \ 21 | card 22 | credit 23 | deprecated 24 | Doxygen 25 | example \ 26 | equations \ 27 | graphics \ 28 | Gumm 29 | links \ 30 | images \ 31 | ISBN 32 | ISSN 33 | IBM 34 | italic \ 35 | # index index and indexes (assume not using plural indices!) 36 | index \ 37 | Luhn 38 | Mastercard 39 | modulus 40 | path \ 41 | pre-conditions \ 42 | post-conditions \ 43 | remark \ 44 | snippet \ 45 | png 46 | Quickbook 47 | Verhoeff 48 | # version \ 49 | VISA 50 | warning \ 51 | 52 | # Remove leading "A" or "The" prefixes from section titles. 53 | # !rewrite-name "(?:A|An|The)\s+(.*)" "\1" 54 | 55 | -------------------------------------------------------------------------------- /doc/range_table.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2012 Karsten Ahnert 5 | Copyright 2012 Mario Mulansky 6 | 7 | Use, modification and distribution is subject to the Boost Software License, 8 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 9 | http://www.boost.org/LICENSE_1_0.txt) 10 | =============================================================================/] 11 | 12 | 13 | 14 | [/ 15 | Steppers supporting __boost_range: 16 | 17 | * adams_bashforth_moulton 18 | * bulirsch_stoer_dense_out 19 | * bulirsch_stoer 20 | * controlled_runge_kutta 21 | * dense_output_runge_kutta 22 | * euler 23 | * explicit_error_generic_rk 24 | * explicit_generic_rk 25 | * rosenbrock4_controller 26 | * rosenbrock4_dense_output 27 | * rosenbrock4 28 | * runge_kutta4_classic 29 | * runge_kutta4 30 | * runge_kutta_cash_karp54_classic 31 | * runge_kutta_cash_karp54 32 | * runge_kutta_dopri5 33 | * runge_kutta_fehlberg78 34 | * symplectic_euler 35 | * symplectic_rkn_sb3a_mclachlan 36 | 37 | Algebras supporting __boost_range 38 | 39 | * range_algebra 40 | * thrust_algebra 41 | /] 42 | 43 | [table Steppers supporting Boost.Range 44 | [[Stepper]] 45 | [[adams_bashforth_moulton]] 46 | [[bulirsch_stoer_dense_out]] 47 | [[bulirsch_stoer]] 48 | [[controlled_runge_kutta]] 49 | [[dense_output_runge_kutta]] 50 | [[euler]] 51 | [[explicit_error_generic_rk]] 52 | [[explicit_generic_rk]] 53 | [[rosenbrock4_controller]] 54 | [[rosenbrock4_dense_output]] 55 | [[rosenbrock4]] 56 | [[runge_kutta4_classic]] 57 | [[runge_kutta4]] 58 | [[runge_kutta_cash_karp54_classic]] 59 | [[runge_kutta_cash_karp54]] 60 | [[runge_kutta_dopri5]] 61 | [[runge_kutta_fehlberg78]] 62 | [[symplectic_euler]] 63 | [[symplectic_rkn_sb3a_mclachlan]] 64 | ] 65 | 66 | [table Algebras supporting Boost.Range 67 | [[algebra]] 68 | [[range_algebra]] 69 | [[thrust_algebra]] 70 | ] -------------------------------------------------------------------------------- /doc/tutorial.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright 2010-2012 Karsten Ahnert 5 | Copyright 2010-2013 Mario Mulansky 6 | Copyright 2013 Pascal Germroth 7 | 8 | Use, modification and distribution is subject to the Boost Software License, 9 | Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 10 | http://www.boost.org/LICENSE_1_0.txt) 11 | =============================================================================/] 12 | 13 | 14 | [section Tutorial] 15 | 16 | 17 | [include tutorial_harmonic_oscillator.qbk] 18 | 19 | [include tutorial_solar_system.qbk] 20 | 21 | [include tutorial_chaotic_system.qbk] 22 | 23 | [include tutorial_stiff_systems.qbk] 24 | 25 | [include tutorial_special_topics.qbk] 26 | 27 | [include tutorial_thrust_cuda.qbk] 28 | 29 | [include tutorial_vexcl_opencl.qbk] 30 | 31 | [include tutorial_parallel.qbk] 32 | 33 | [section All examples] 34 | 35 | The following table gives an overview over all examples. 36 | 37 | [include examples_table.qbk] 38 | 39 | [endsect] 40 | 41 | 42 | 43 | 44 | 45 | 46 | [endsect] 47 | -------------------------------------------------------------------------------- /examples/2d_lattice/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Distributed under the Boost Software License, Version 1.0. (See 4 | # accompanying file LICENSE_1_0.txt or copy at 5 | # http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | project 8 | : requirements 9 | ../../../../.. 10 | BOOST_ALL_NO_LIB=1 11 | ; 12 | 13 | exe spreading : spreading.cpp ; -------------------------------------------------------------------------------- /examples/2d_lattice/nested_range_algebra.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011 Mario Mulansky 3 | Copyright 2012 Karsten Ahnert 4 | 5 | Distributed under the Boost Software License, Version 1.0. 6 | (See accompanying file LICENSE_1_0.txt or 7 | copy at http://www.boost.org/LICENSE_1_0.txt) 8 | */ 9 | 10 | 11 | /* nested range algebra */ 12 | 13 | #ifndef NESTED_RANGE_ALGEBRA 14 | #define NESTED_RANGE_ALGEBRA 15 | 16 | namespace detail { 17 | 18 | template< class Iterator1 , class Iterator2 , class Iterator3 , class Operation , class Algebra > 19 | void for_each3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Operation op , Algebra &algebra ) 20 | { 21 | for( ; first1 != last1 ; ) 22 | algebra.for_each3( *first1++ , *first2++ , *first3++ , op ); 23 | } 24 | } 25 | 26 | 27 | template< class InnerAlgebra > 28 | struct nested_range_algebra 29 | { 30 | 31 | nested_range_algebra() 32 | : m_inner_algebra() 33 | { } 34 | 35 | template< class S1 , class S2 , class S3 , class Op > 36 | void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) 37 | { 38 | detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op , m_inner_algebra ); 39 | } 40 | 41 | 42 | private: 43 | InnerAlgebra m_inner_algebra; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /examples/bind_member_functions_cpp11.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/examples/bind_member_functions.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2012 Karsten Ahnert 10 | Copyright 2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | namespace odeint = boost::numeric::odeint; 24 | 25 | 26 | 27 | typedef std::array< double , 3 > state_type; 28 | 29 | struct lorenz 30 | { 31 | void ode( const state_type &x , state_type &dxdt , double t ) const 32 | { 33 | const double sigma = 10.0; 34 | const double R = 28.0; 35 | const double b = 8.0 / 3.0; 36 | 37 | dxdt[0] = sigma * ( x[1] - x[0] ); 38 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; 39 | dxdt[2] = -b * x[2] + x[0] * x[1]; 40 | } 41 | }; 42 | 43 | int main( int argc , char *argv[] ) 44 | { 45 | using namespace boost::numeric::odeint; 46 | //[ bind_member_function_cpp11 47 | namespace pl = std::placeholders; 48 | 49 | state_type x = {{ 10.0 , 10.0 , 10.0 }}; 50 | integrate_const( runge_kutta4< state_type >() , 51 | std::bind( &lorenz::ode , lorenz() , pl::_1 , pl::_2 , pl::_3 ) , 52 | x , 0.0 , 10.0 , 0.01 ); 53 | //] 54 | return 0; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /examples/elliptic.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2011 Mario Mulansky 3 | Copyright 2012 Karsten Ahnert 4 | 5 | Stochastic euler stepper example and Ornstein-Uhlenbeck process 6 | 7 | Distributed under the Boost Software License, Version 1.0. 8 | (See accompanying file LICENSE_1_0.txt or 9 | copy at http://www.boost.org/LICENSE_1_0.txt) 10 | """ 11 | 12 | 13 | from pylab import * 14 | from scipy import special 15 | 16 | data1 = loadtxt("elliptic1.dat") 17 | data2 = loadtxt("elliptic2.dat") 18 | data3 = loadtxt("elliptic3.dat") 19 | 20 | sn1,cn1,dn1,phi1 = special.ellipj( data1[:,0] , 0.51 ) 21 | sn2,cn2,dn2,phi2 = special.ellipj( data2[:,0] , 0.51 ) 22 | sn3,cn3,dn3,phi3 = special.ellipj( data3[:,0] , 0.51 ) 23 | 24 | semilogy( data1[:,0] , abs(data1[:,1]-sn1) ) 25 | semilogy( data2[:,0] , abs(data2[:,1]-sn2) , 'ro' ) 26 | semilogy( data3[:,0] , abs(data3[:,1]-sn3) , '--' ) 27 | 28 | show() 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/gmpxx/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS = -I${BOOST_ROOT} -O2 -static 2 | LDFLAGS = -lgmpxx -lgmp 3 | 4 | lorenz_gmpxx: lorenz_gmpxx.cpp 5 | ${CXX} ${CXXFLAGS} lorenz_gmpxx.cpp ${LDFLAGS} -o lorenz_gmpxx 6 | -------------------------------------------------------------------------------- /examples/integrate_times.cpp: -------------------------------------------------------------------------------- 1 | /* Boost libs/numeric/odeint/examples/integrate_times.cpp 2 | 3 | Copyright 2009-2014 Karsten Ahnert 4 | Copyright 2009-2014 Mario Mulansky 5 | 6 | example for the use of integrate_times 7 | 8 | Distributed under the Boost Software License, Version 1.0. 9 | (See accompanying file LICENSE_1_0.txt or 10 | copy at http://www.boost.org/LICENSE_1_0.txt) 11 | */ 12 | 13 | 14 | #include 15 | #include 16 | 17 | using namespace std; 18 | using namespace boost::numeric::odeint; 19 | 20 | 21 | /* 22 | * simple 1D ODE 23 | */ 24 | 25 | void rhs( const double x , double &dxdt , const double t ) 26 | { 27 | dxdt = 3.0/(2.0*t*t) + x/(2.0*t); 28 | } 29 | 30 | void write_cout( const double &x , const double t ) 31 | { 32 | cout << t << '\t' << x << endl; 33 | } 34 | 35 | // state_type = double 36 | typedef runge_kutta_dopri5< double > stepper_type; 37 | 38 | const double dt = 0.1; 39 | 40 | int main() 41 | { 42 | // create a vector with observation time points 43 | std::vector times( 91 ); 44 | for( size_t i=0 ; i 2 | #include 3 | 4 | #include 5 | 6 | using namespace std; 7 | using namespace boost::numeric::odeint; 8 | 9 | const double sigma = 10.0; 10 | const double R = 28.0; 11 | const double b = 8.0 / 3.0; 12 | 13 | typedef boost::array< double , 3 > state_type; 14 | 15 | void lorenz( const state_type &x , state_type &dxdt , double t ) 16 | { 17 | dxdt[0] = sigma * ( x[1] - x[0] ); 18 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; 19 | dxdt[2] = -b * x[2] + x[0] * x[1]; 20 | } 21 | 22 | void write_lorenz( const state_type &x , const double t ) 23 | { 24 | cout << t << '\t' << x[0] << '\t' << x[1] << '\t' << x[2] << endl; 25 | } 26 | 27 | int main(int argc, char **argv) 28 | { 29 | state_type x = {{ 10.0 , 1.0 , 1.0 }}; // initial conditions 30 | integrate( lorenz , x , 0.0 , 25.0 , 0.1 , write_lorenz ); 31 | } 32 | -------------------------------------------------------------------------------- /examples/mpi/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2013 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Copyright 2013 Pascal Germroth 4 | # Distributed under the Boost Software License, Version 1.0. (See 5 | # accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | project 9 | : requirements 10 | BOOST_ALL_NO_LIB=1 11 | /boost//mpi 12 | /boost//timer 13 | ; 14 | 15 | exe phase_chain : phase_chain.cpp ; 16 | -------------------------------------------------------------------------------- /examples/mtl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2013 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Distributed under the Boost Software License, Version 1.0. (See 4 | # accompanying file LICENSE_1_0.txt or copy at 5 | # http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | # set your MTL4 directory here 8 | MTL4_INCLUDE = /home/mario/MTL4 ; 9 | 10 | project 11 | : requirements 12 | $(MTL4_INCLUDE) 13 | BOOST_ALL_NO_LIB=1 14 | ; 15 | 16 | exe gauss_packet : gauss_packet.cpp ; 17 | exe implicit_euler_mtl : implicit_euler_mtl.cpp ; -------------------------------------------------------------------------------- /examples/multiprecision/Jamfile: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2013 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Distributed under the Boost Software License, Version 1.0. (See 4 | # accompanying file LICENSE_1_0.txt or copy at 5 | # http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | 8 | project 9 | : requirements 10 | BOOST_ALL_NO_LIB=1 11 | : 12 | ; 13 | 14 | 15 | exe lorenz_mp : lorenz_mp.cpp ; 16 | exe cmp_precision : cmp_precision.cpp ; 17 | -------------------------------------------------------------------------------- /examples/nt2/Jamfile.v2: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | # Copyright 2014 NumScale SAS 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # See accompanying file LICENSE.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt 8 | #============================================================================== 9 | 10 | use-project boost : $(BOOST_ROOT) ; 11 | 12 | import os ; 13 | 14 | # This must be built using an NT2 installation. 15 | # NT2_ROOT_PATH should point to the build directory. 16 | # Currently, cxxflags needs to be set to the required architecture 17 | # if using avx/avx2, set the environemnt variable NT2_SIMD_FLAGS to the 18 | # required value for your compiler (i.e. -mavx2 on g++) 19 | # If using sse2/3/4 in 64 bits, this is set automatically. 20 | 21 | local NT2_ROOT_PATH = [ os.environ NT2_ROOT_PATH ] ; 22 | local NT2_SIMD_FLAGS = [ os.environ NT2_SIMD_FLAGS ] ; 23 | 24 | project 25 | : requirements 26 | BOOST_ALL_NO_LIB=1 27 | $(NT2_ROOT_PATH)/include/ 28 | static 29 | gcc:-DBOOST_SIMD_NO_STRICT_ALIASING 30 | gcc:-fno-strict-aliasing 31 | $(NT2_SIMD_FLAGS) 32 | ; 33 | 34 | exe phase_oscillator_ensemble : phase_oscillator_ensemble.cpp ; 35 | -------------------------------------------------------------------------------- /examples/openmp/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2013 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Copyright 2013 Pascal Germroth 4 | # Distributed under the Boost Software License, Version 1.0. (See 5 | # accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | use-project /boost : $(BOOST_ROOT) ; 9 | import openmp : * ; 10 | 11 | project 12 | : requirements 13 | .. 14 | BOOST_ALL_NO_LIB=1 15 | /boost//timer 16 | [ openmp ] 17 | ; 18 | 19 | exe lorenz_ensemble : lorenz_ensemble.cpp ; 20 | exe lorenz_ensemble_simple : lorenz_ensemble_simple.cpp ; 21 | exe lorenz_ensemble_nested : lorenz_ensemble_nested.cpp ; 22 | exe phase_chain : phase_chain.cpp ; 23 | exe phase_chain_omp_state : phase_chain_omp_state.cpp ; 24 | -------------------------------------------------------------------------------- /examples/openmp/openmp.jam: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Karsten Ahnert 2 | # Copyright 2013 Mario Mulansky 3 | # Copyright 2013 Pascal Germroth 4 | # Distributed under the Boost Software License, Version 1.0. (See 5 | # accompanying file LICENSE_1_0.txt or copy at 6 | # http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | 9 | # Only builds target with supported OpenMP enabled toolsets. 10 | # 11 | # use as: 12 | # exe omp : omp.cpp : [ openmp ] ; 13 | # 14 | rule openmp return 15 | # default 16 | no 17 | # GNU C++ 18 | gcc:-fopenmp 19 | gcc:-fopenmp 20 | gcc:yes 21 | # Microsoft Visual C++ 22 | msvc:/openmp 23 | msvc:/openmp 24 | msvc:yes 25 | # Intel C++ 26 | intel-linux:-openmp 27 | intel-linux:-openmp 28 | intel-linux:yes 29 | intel-win:-Qopenmp 30 | intel-win:-Qopenmp 31 | intel-win:yes 32 | # HP aC++ 33 | acc:+Oopenmp 34 | acc:+Oopenmp 35 | acc:yes 36 | # Sun Studio 37 | sun:-xopenmp 38 | sun:-xopenmp 39 | sun:yes 40 | # IBM XL 41 | vacpp:-qsmp=omp 42 | vacpp:-qsmp=omp 43 | vacpp:yes 44 | # PG++ 45 | pgi:-mp 46 | pgi:-mp 47 | pgi:yes 48 | # Pathscale 49 | pathscale:-mp 50 | pathscale:-mp 51 | pathscale:yes 52 | ; 53 | -------------------------------------------------------------------------------- /examples/quadmath/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Distributed under the Boost Software License, Version 1.0. (See 4 | # accompanying file LICENSE_1_0.txt or copy at 5 | # http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | 8 | project 9 | : requirements 10 | BOOST_ALL_NO_LIB=1 11 | : 12 | ; 13 | 14 | lib quadmath : : quadmath shared ; 15 | 16 | exe black_hole : black_hole.cpp quadmath : -std=c++0x ; -------------------------------------------------------------------------------- /examples/simple1d.cpp: -------------------------------------------------------------------------------- 1 | /* Boost libs/numeric/odeint/examples/simple1d.cpp 2 | 3 | Copyright 2012-2013 Mario Mulansky 4 | Copyright 2012 Karsten Ahnert 5 | 6 | example for a simple one-dimensional 1st order ODE 7 | 8 | Distributed under the Boost Software License, Version 1.0. 9 | (See accompanying file LICENSE_1_0.txt or 10 | copy at http://www.boost.org/LICENSE_1_0.txt) 11 | */ 12 | 13 | 14 | #include 15 | #include 16 | 17 | using namespace std; 18 | using namespace boost::numeric::odeint; 19 | 20 | 21 | /* we solve the simple ODE x' = 3/(2t^2) + x/(2t) 22 | * with initial condition x(1) = 0. 23 | * Analytic solution is x(t) = sqrt(t) - 1/t 24 | */ 25 | 26 | void rhs( const double x , double &dxdt , const double t ) 27 | { 28 | dxdt = 3.0/(2.0*t*t) + x/(2.0*t); 29 | } 30 | 31 | void write_cout( const double &x , const double t ) 32 | { 33 | cout << t << '\t' << x << endl; 34 | } 35 | 36 | // state_type = double 37 | typedef runge_kutta_dopri5< double > stepper_type; 38 | 39 | int main() 40 | { 41 | double x = 0.0; //initial value x(1) = 0 42 | // use dopri5 with stepsize control and allowed errors 10^-12, integrate t=1...10 43 | integrate_adaptive( make_controlled( 1E-12 , 1E-12 , stepper_type() ) , rhs , x , 1.0 , 10.0 , 0.1 , write_cout ); 44 | } 45 | -------------------------------------------------------------------------------- /examples/thrust/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2014 Mario Mulansky 2 | # Copyright 2011-2012 Karsten Ahnert 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or 6 | # copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | # make sure BOOST_ROOT is pointing to your boost directory 9 | # otherwise, set it here: 10 | # BOOST_ROOT = /path/to/boost 11 | 12 | # path to the cuda installation 13 | CUDA_ROOT = /usr/local/cuda 14 | # target architecture 15 | ARCH = sm_13 16 | 17 | NVCC = $(CUDA_ROOT)/bin/nvcc 18 | 19 | INCLUDES += -I../../include/ -I$(BOOST_ROOT) 20 | 21 | NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) 22 | 23 | %.o : %.cu 24 | $(NVCC) $(NVCCFLAGS) -c $< -o $@ 25 | 26 | % : %.o 27 | $(NVCC) $(NVCCFLAGS) -o $@ $< 28 | 29 | 30 | all : phase_oscillator_chain phase_oscillator_ensemble lorenz_parameters relaxation 31 | 32 | 33 | clean : 34 | -rm *~ *.o phase_oscillator_chain phase_oscillator_ensemble lorenz_parameters relaxation 35 | -------------------------------------------------------------------------------- /examples/ublas/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Mario Mulansky 2 | # Copyright 2012 Karsten Ahnert 3 | # Distributed under the Boost Software License, Version 1.0. (See 4 | # accompanying file LICENSE_1_0.txt or copy at 5 | # http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | 8 | project 9 | : requirements 10 | BOOST_ALL_NO_LIB=1 11 | ; 12 | 13 | exe lorenz_ublas : lorenz_ublas.cpp ; 14 | -------------------------------------------------------------------------------- /examples/ublas/lorenz_ublas.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2013 Mario Mulansky 3 | * Copyright 2012 Karsten Ahnert 4 | * 5 | * Distributed under the Boost Software License, Version 1.0. 6 | * (See accompanying file LICENSE_1_0.txt or 7 | * copy at http://www.boost.org/LICENSE_1_0.txt) 8 | */ 9 | 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | typedef boost::numeric::ublas::vector< double > state_type; 17 | 18 | void lorenz( const state_type &x , state_type &dxdt , const double t ) 19 | { 20 | const double sigma( 10.0 ); 21 | const double R( 28.0 ); 22 | const double b( 8.0 / 3.0 ); 23 | 24 | dxdt[0] = sigma * ( x[1] - x[0] ); 25 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; 26 | dxdt[2] = -b * x[2] + x[0] * x[1]; 27 | } 28 | 29 | using namespace boost::numeric::odeint; 30 | 31 | //[ublas_main 32 | int main() 33 | { 34 | state_type x(3); 35 | x[0] = 10.0; x[1] = 5.0 ; x[2] = 0.0; 36 | typedef runge_kutta_dopri5< state_type > stepper; 37 | integrate_const( make_dense_output< stepper >( 1E-6 , 1E-6 ) , lorenz , x , 38 | 0.0 , 10.0 , 0.1 ); 39 | } 40 | //] 41 | -------------------------------------------------------------------------------- /examples/vexcl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2013 Mario Mulansky 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or 6 | # copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | 9 | import boost ; 10 | import os ; 11 | 12 | boost.use-project ; 13 | 14 | 15 | # change these lines to fit you configuration 16 | local HOME = [ os.environ HOME ] ; 17 | local VEXCL_INCLUDE = [ os.environ VEXCL_ROOT ] ; 18 | OPENCL_INCLUDE = /usr/local/cuda/include ; 19 | 20 | 21 | 22 | lib opencl : : OpenCL ; 23 | 24 | project : requirements 25 | /boost//headers 26 | $(VEXCL_INCLUDE) 27 | $(OPENCL_INCLUDE) 28 | gcc:-std=c++0x 29 | /boost//system/ 30 | ; 31 | 32 | exe lorenz_ensemble : lorenz_ensemble.cpp opencl ; -------------------------------------------------------------------------------- /include/boost/numeric/odeint/algebra/detail/extract_value_type.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/algebra/detail/extract_value_type.hpp 4 | 5 | [begin_description] 6 | Extract true value type from complex types (eg. std::complex) 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_EXTRACT_VALUE_TYPE_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_EXTRACT_VALUE_TYPE_HPP_INCLUDED 19 | 20 | #include 21 | #include 22 | 23 | BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) 24 | 25 | namespace boost { 26 | namespace numeric { 27 | namespace odeint { 28 | namespace detail { 29 | 30 | template< typename S , typename Enabler = void > 31 | struct extract_value_type {}; 32 | 33 | // as long as value_types are defined we go down the value_type chain 34 | // e.g. returning S::value_type::value_type::value_type 35 | 36 | template< typename S > 37 | struct extract_value_type >::type > 38 | { 39 | // no value_type defined, return S 40 | typedef S type; 41 | }; 42 | 43 | template< typename S > 44 | struct extract_value_type< S , typename boost::enable_if< has_value_type >::type > 45 | { 46 | // go down the value_type 47 | typedef typename extract_value_type< typename S::value_type >::type type; 48 | }; 49 | 50 | } } } } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/algebra/detail/macros.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/algebra/detail/macros.hpp 4 | 5 | [begin_description] 6 | Some macros for type checking. 7 | [end_description] 8 | 9 | Copyright 2010-2012 Karsten Ahnert 10 | Copyright 2010 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED 20 | 21 | 22 | //type traits aren't working with nvcc 23 | #ifndef __CUDACC__ 24 | #include 25 | #include 26 | 27 | #define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 ) \ 28 | BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< Type1 >::type , Type2 >::value )) 29 | 30 | #else 31 | //empty macro for nvcc 32 | #define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 ) 33 | 34 | #endif // __CUDACC__ 35 | 36 | 37 | 38 | /* 39 | #define BOOST_ODEINT_CHECK_OPERATION_ARITY( Operation , Arity ) \ 40 | BOOST_STATIC_ASSERT(( boost::function_traits< Operation >::arity == Arity )) 41 | */ 42 | 43 | #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED 44 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/algebra/detail/norm_inf.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/algebra/detail/norm_inf.hpp 4 | 5 | [begin_description] 6 | Default reduce implementation. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED 20 | 21 | #include 22 | 23 | namespace boost { 24 | namespace numeric { 25 | namespace odeint { 26 | namespace detail { 27 | 28 | template< typename Value , class Iterator1 > 29 | inline Value norm_inf( Iterator1 first1 , Iterator1 last1 , Value init ) 30 | { 31 | using std::max; 32 | using std::abs; 33 | for( ; first1 != last1 ; ) 34 | init = max( init , abs( *first1++ ) ); 35 | return init; 36 | } 37 | 38 | 39 | } // detail 40 | } // odeint 41 | } // numeric 42 | } // boost 43 | 44 | 45 | #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED 46 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_DISPATCHER_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_DISPATCHER_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | 28 | 29 | namespace boost { 30 | namespace numeric { 31 | namespace odeint { 32 | 33 | // specialization for fusion sequences 34 | template< class FusionSequence > 35 | struct algebra_dispatcher_sfinae< FusionSequence , 36 | typename boost::enable_if< 37 | typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type > 38 | { 39 | typedef fusion_algebra algebra_type; 40 | }; 41 | 42 | 43 | } // namespace odeint 44 | } // namespace numeric 45 | } // namespace boost 46 | 47 | 48 | #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_DISPATCHER_HPP_DEFINED 49 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/algebra/norm_result_type.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/algebra/norm_result_type.hpp 4 | 5 | [begin_description] 6 | Calculates the type of the norm_inf operation for container types 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_NORM_RESULT_TYPE_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_ALGEBRA_NORM_RESULT_TYPE_HPP_INCLUDED 19 | 20 | #include 21 | 22 | namespace boost { 23 | namespace numeric { 24 | namespace odeint { 25 | 26 | template< typename S , typename Enabler = void > 27 | struct norm_result_type { 28 | typedef typename detail::extract_value_type< S >::type type; 29 | }; 30 | 31 | } } } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/algebra/operations_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/algebra/operations_dispatcher.hpp 4 | 5 | [begin_description] 6 | Operations dispatcher to automatically chose suitable operations. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_OPERATIONS_DISPATCHER_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_ALGEBRA_OPERATIONS_DISPATCHER_HPP_INCLUDED 19 | 20 | #include 21 | 22 | namespace boost { 23 | namespace numeric { 24 | namespace odeint { 25 | 26 | template< class StateType , class Enabler = void > 27 | struct operations_dispatcher_sfinae 28 | { 29 | typedef default_operations operations_type; 30 | }; 31 | 32 | template< class StateType > 33 | struct operations_dispatcher : operations_dispatcher_sfinae< StateType > {}; 34 | 35 | // no further specializations required 36 | 37 | } 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/config.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/config.hpp 4 | 5 | [begin_description] 6 | Sets configurations for odeint and used libraries. Should be included before any other odeint library 7 | [end_description] 8 | 9 | Copyright 2011-2012 Mario Mulansky 10 | Copyright 2011-2012 Karsten Ahnert 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED 19 | 20 | 21 | //increase macro variable to allow rk78 scheme 22 | #ifndef FUSION_MAX_VECTOR_SIZE 23 | #define FUSION_MAX_VECTOR_SIZE 15 24 | #endif 25 | 26 | 27 | /* 28 | * the following definitions are only required if fusion vectors are used as state types 29 | * in the rk78 scheme 30 | * they should be defined by the user if required, see e.g. libs/numeric/examples/harmonic_oscillator_units.cpp 31 | */ 32 | #ifndef BOOST_FUSION_INVOKE_MAX_ARITY 33 | #define BOOST_FUSION_INVOKE_MAX_ARITY 15 34 | #endif 35 | 36 | #ifndef BOOST_RESULT_OF_NUM_ARGS 37 | #define BOOST_RESULT_OF_NUM_ARGS 15 38 | #endif 39 | 40 | 41 | 42 | 43 | 44 | #include 45 | 46 | #if __cplusplus >= 201103L 47 | #define BOOST_NUMERIC_ODEINT_CXX11 1 48 | #endif 49 | 50 | 51 | 52 | 53 | #endif // BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED 54 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | 27 | 28 | 29 | 30 | namespace boost { 31 | namespace numeric { 32 | namespace odeint { 33 | 34 | template< typename T , size_t N , bool TF > 35 | struct algebra_dispatcher< blaze::StaticVector< T , N , TF > > 36 | { 37 | typedef vector_space_algebra algebra_type; 38 | }; 39 | 40 | template< typename T , bool TF > 41 | struct algebra_dispatcher< blaze::DynamicVector< T , TF > > 42 | { 43 | typedef vector_space_algebra algebra_type; 44 | }; 45 | 46 | 47 | 48 | 49 | 50 | } 51 | } 52 | } 53 | 54 | 55 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED 56 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/blaze/blaze_resize.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/blaze/blaze_resize.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_RESIZE_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_RESIZE_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | namespace boost { 28 | namespace numeric { 29 | namespace odeint { 30 | 31 | template< typename T , bool TF > 32 | struct is_resizeable< blaze::DynamicVector< T , TF > > 33 | { 34 | typedef boost::true_type type; 35 | const static bool value = type::value; 36 | }; 37 | 38 | template< typename T1 , bool TF1, typename T2 , bool TF2 > 39 | struct same_size_impl< blaze::DynamicVector< T1 , TF1 > , blaze::DynamicVector< T2 , TF2 > > 40 | { 41 | static bool same_size( const blaze::DynamicVector< T1 , TF1 > &x1 , const blaze::DynamicVector< T2 , TF2 > &x2 ) 42 | { 43 | return x1.size() == x2.size(); 44 | } 45 | }; 46 | 47 | template< typename T1 , bool TF1, typename T2 , bool TF2 > 48 | struct resize_impl< blaze::DynamicVector< T1 , TF1 > , blaze::DynamicVector< T2 , TF2 > > 49 | { 50 | static void resize( blaze::DynamicVector< T1 , TF1 > &x1 , const blaze::DynamicVector< T2 , TF2 > &x2 ) 51 | { 52 | x1.resize( x2.size() ); 53 | } 54 | }; 55 | 56 | 57 | } // namespace odeint 58 | } // namespace numeric 59 | } // namespace boost 60 | 61 | 62 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_RESIZE_HPP_INCLUDED 63 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/compute/compute.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/compute/compute.hpp 4 | 5 | [begin_description] 6 | includes all headers required for using odeint with Boost.Compute 7 | [end_description] 8 | 9 | Copyright 2009-2013 Karsten Ahnert 10 | Copyright 2009-2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_HPP_DEFINED 28 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp 4 | 5 | [begin_description] 6 | algebra_dispatcher specialization for Boost.Compute 7 | [end_description] 8 | 9 | Copyright 2009-2013 Karsten Ahnert 10 | Copyright 2009-2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_DISPATCHER_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_DISPATCHER_HPP_DEFINED 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace boost { 27 | namespace numeric { 28 | namespace odeint { 29 | 30 | // specialization for Boost.Compute vector 31 | template< class T , class A > 32 | struct algebra_dispatcher< boost::compute::vector< T , A > > 33 | { 34 | typedef compute_algebra algebra_type; 35 | }; 36 | 37 | } // namespace odeint 38 | } // namespace numeric 39 | } // namespace boost 40 | 41 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_DISPATCHER_HPP_DEFINED 42 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp 4 | 5 | [begin_description] 6 | operations_dispatcher specialization for Boost.Compute 7 | [end_description] 8 | 9 | Copyright 2009-2013 Karsten Ahnert 10 | Copyright 2009-2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_DISPATCHER_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_DISPATCHER_HPP_DEFINED 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | namespace boost { 27 | namespace numeric { 28 | namespace odeint { 29 | 30 | // specialization for Boost.Compute vector 31 | template< class T , class A > 32 | struct operations_dispatcher< boost::compute::vector< T , A > > 33 | { 34 | typedef compute_operations operations_type; 35 | }; 36 | 37 | } // namespace odeint 38 | } // namespace numeric 39 | } // namespace boost 40 | 41 | 42 | 43 | 44 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_DISPATCHER_HPP_DEFINED 45 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/eigen/eigen.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/eigen/eigen.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED 20 | 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED 28 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED 20 | 21 | 22 | namespace boost { 23 | namespace numeric { 24 | namespace odeint { 25 | 26 | 27 | template< class Derived > 28 | struct algebra_dispatcher_sfinae< Derived , 29 | typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > 30 | { 31 | typedef vector_space_algebra algebra_type; 32 | }; 33 | 34 | 35 | template < class Derived > 36 | struct algebra_dispatcher_sfinae< Derived , 37 | typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > 38 | { 39 | typedef vector_space_algebra algebra_type; 40 | }; 41 | 42 | 43 | 44 | } // namespace odeint 45 | } // namespace numeric 46 | } // namespace boost 47 | 48 | 49 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED 50 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/mpi/mpi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/mpi/mpi.hpp 4 | 5 | [begin_description] 6 | Wrappers for MPI. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | Copyright 2013 Pascal Germroth 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_HPP_INCLUDED 21 | 22 | #include 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp 4 | 5 | [begin_description] 6 | Nested parallelized algebra for MPI. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | Copyright 2013 Pascal Germroth 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_NESTED_ALGEBRA_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_NESTED_ALGEBRA_HPP_INCLUDED 21 | 22 | #include 23 | #include 24 | 25 | namespace boost { 26 | namespace numeric { 27 | namespace odeint { 28 | 29 | /** \brief MPI-parallelized algebra, wrapping another algebra. 30 | */ 31 | template< class InnerAlgebra > 32 | struct mpi_nested_algebra 33 | { 34 | 35 | // execute the InnerAlgebra on each node's local data. 36 | #define BOOST_ODEINT_GEN_BODY(n) \ 37 | InnerAlgebra::for_each##n( \ 38 | BOOST_PP_ENUM_BINARY_PARAMS(n, s, () BOOST_PP_INTERCEPT) , \ 39 | op \ 40 | ); 41 | BOOST_ODEINT_GEN_FOR_EACH(BOOST_ODEINT_GEN_BODY) 42 | #undef BOOST_ODEINT_GEN_BODY 43 | 44 | 45 | template< class NestedState > 46 | static typename norm_result_type< typename NestedState::value_type >::type norm_inf( const NestedState &s ) 47 | { 48 | typedef typename norm_result_type< typename NestedState::value_type >::type result_type; 49 | // local maximum 50 | result_type value = InnerAlgebra::norm_inf( s() ); 51 | // global maximum 52 | return boost::mpi::all_reduce(s.world, value, boost::mpi::maximum()); 53 | } 54 | 55 | }; 56 | 57 | 58 | } 59 | } 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/mtl4/mtl4.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | /boost/numeric/odeint/external/mtl4/mtl4.hpp 4 | 5 | [begin_description] 6 | includes all headers required for using mtl4 with odeint 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_MTL4_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_MTL4_HPP_INCLUDED 19 | 20 | #include 21 | #include 22 | 23 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_MTL4_INCLUDED 24 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/nt2/nt2_algebra_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_ALGEBRA_DISPATCHER_HPP_INCLUDED 10 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_ALGEBRA_DISPATCHER_HPP_INCLUDED 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | namespace boost { namespace numeric { namespace odeint { 18 | template 19 | struct algebra_dispatcher > 20 | { 21 | typedef vector_space_algebra algebra_type; 22 | }; 23 | } } } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/nt2/nt2_copy.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LASMEA UMR 6602 CNRS/Univ. Clermont II 3 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 4 | // Copyright 2014 MetaScale SAS 5 | // 6 | // Distributed under the Boost Software License, Version 1.0. 7 | // See accompanying file LICENSE.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt 9 | //============================================================================== 10 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_COPY_HPP_INCLUDED 11 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_COPY_HPP_INCLUDED 12 | 13 | #include 14 | 15 | #include 16 | 17 | namespace boost { namespace numeric { namespace odeint { 18 | 19 | template 20 | struct copy_impl< nt2::container::table 21 | , nt2::container::table 22 | > 23 | { 24 | static void copy ( const nt2::container::table &v1 25 | , nt2::container::table &v2 26 | ) 27 | { 28 | v2 = v1; 29 | } 30 | }; 31 | } } } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED 10 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | namespace boost { namespace numeric { namespace odeint 19 | { 20 | template 21 | struct vector_space_norm_inf > 22 | { 23 | typedef T result_type; 24 | result_type operator()(const nt2::container::table &v1) const 25 | { 26 | return nt2::globalmax(nt2::abs(v1)); 27 | } 28 | }; 29 | } } } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/nt2/nt2_resize.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED 10 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED 11 | 12 | #include 13 | 14 | #include 15 | 16 | namespace boost { namespace numeric { namespace odeint { 17 | 18 | template 19 | struct is_resizeable< nt2::container::table > 20 | { 21 | typedef boost::true_type type; 22 | static const bool value = type::value; 23 | }; 24 | 25 | template 26 | struct same_size_impl< nt2::container::table 27 | , nt2::container::table 28 | > 29 | { 30 | static bool same_size ( const nt2::container::table &v1 31 | , const nt2::container::table &v2 32 | ) 33 | { 34 | return v1.extent() == v2.extent(); 35 | } 36 | }; 37 | 38 | template 39 | struct resize_impl< nt2::container::table 40 | , nt2::container::table 41 | > 42 | { 43 | static void resize ( nt2::container::table &v1 44 | , const nt2::container::table &v2 45 | ) 46 | { 47 | v1.resize( v2.extent() ); 48 | } 49 | }; 50 | } } } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/openmp/openmp.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/openmp/openmp.hpp 4 | 5 | [begin_description] 6 | Wrappers for OpenMP. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | Copyright 2013 Pascal Germroth 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_HPP_INCLUDED 21 | 22 | // level 1: parallel iteration over random access container 23 | #include 24 | 25 | // level 2: split range state 26 | #include 27 | 28 | // level 3: process a random access container of sub-states in parallel 29 | #include 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/thrust/thrust.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/thrust/thrust.hpp 4 | 5 | [begin_description] 6 | includes all headers required for using odeint with thrust 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED 28 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/vexcl/vexcl.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/vexcl/vexcl.hpp 4 | 5 | [begin_description] 6 | includes all headers required for using vexcl in odeint 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_HPP_DEFINED 29 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/vexcl/vexcl_abs.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/vexcl/vexcl_abs.hpp 4 | 5 | [begin_description] 6 | abs() specialization for vexcl 7 | [end_description] 8 | 9 | Copyright 2009-2013 Karsten Ahnert 10 | Copyright 2009-2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace vex { 26 | 27 | template 28 | typename std::enable_if< 29 | std::is_integral::value, 30 | typename boost::proto::result_of::make_expr< 31 | boost::proto::tag::function, 32 | abs_func, 33 | const vex::multivector& 34 | >::type const 35 | >::type 36 | abs(const multivector &arg) { 37 | return boost::proto::make_expr( 38 | abs_func(), 39 | boost::ref(arg) 40 | ); 41 | } 42 | 43 | template 44 | typename std::enable_if< 45 | !std::is_integral::value, 46 | typename boost::proto::result_of::make_expr< 47 | boost::proto::tag::function, 48 | fabs_func, 49 | const vex::multivector& 50 | >::type const 51 | >::type 52 | abs(const multivector &arg) { 53 | return boost::proto::make_expr( 54 | fabs_func(), 55 | boost::ref(arg) 56 | ); 57 | } 58 | 59 | } // namespace vex 60 | 61 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED 62 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp 4 | 5 | [begin_description] 6 | algebra_dispatcher specialization for vexcl 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ALGEBRA_DISPATCHER_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ALGEBRA_DISPATCHER_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | 28 | namespace boost { 29 | namespace numeric { 30 | namespace odeint { 31 | 32 | // specialization for vexcl vector 33 | template< typename T > 34 | struct algebra_dispatcher< vex::vector< T > > 35 | { 36 | typedef vector_space_algebra algebra_type; 37 | }; 38 | 39 | // specialization for vexcl multivector 40 | template< typename T , size_t N > 41 | struct algebra_dispatcher< vex::multivector< T , N > > 42 | { 43 | typedef vector_space_algebra algebra_type; 44 | }; 45 | 46 | } // namespace odeint 47 | } // namespace numeric 48 | } // namespace boost 49 | 50 | 51 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ALGEBRA_DISPATCHER_HPP_DEFINED 52 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/vexcl/vexcl_copy.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/vexcl/vexcl_copy.hpp 4 | 5 | [begin_description] 6 | copy_impl specializations for vexcl 7 | [end_description] 8 | 9 | Copyright 2009-2011 Karsten Ahnert 10 | Copyright 2009-2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_COPY_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_COPY_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace boost { 27 | namespace numeric { 28 | namespace odeint { 29 | 30 | template< typename T1, typename T2 > 31 | struct copy_impl< vex::vector, vex::vector > 32 | { 33 | static void copy( const vex::vector &from , vex::vector &to ) 34 | { 35 | to = from; 36 | } 37 | }; 38 | 39 | template< typename T1, typename T2, size_t N > 40 | struct copy_impl< vex::multivector, vex::multivector > 41 | { 42 | static void copy( const vex::multivector &from , vex::multivector &to ) 43 | { 44 | to = from; 45 | } 46 | }; 47 | 48 | 49 | } // namespace odeint 50 | } // namespace numeric 51 | } // namespace boost 52 | 53 | 54 | 55 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_COPY_HPP_INCLUDED 56 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp 4 | 5 | [begin_description] 6 | Check if two VexCL containers are the same instance. 7 | [end_description] 8 | 9 | Copyright 2009-2011 Karsten Ahnert 10 | Copyright 2009-2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace boost { 27 | namespace numeric { 28 | namespace odeint { 29 | 30 | template 31 | struct same_instance_impl< vex::vector , vex::vector > 32 | { 33 | static bool same_instance( const vex::vector &x1 , const vex::vector &x2 ) 34 | { 35 | return 36 | static_cast*>(&x1) == 37 | static_cast*>(&x2); 38 | } 39 | }; 40 | 41 | template 42 | struct same_instance_impl< vex::multivector , vex::multivector > 43 | { 44 | static bool same_instance( const vex::multivector &x1 , const vex::multivector &x2 ) 45 | { 46 | return 47 | static_cast*>(&x1) == 48 | static_cast*>(&x2); 49 | } 50 | }; 51 | 52 | } // namespace odeint 53 | } // namespace numeric 54 | } // namespace boost 55 | 56 | 57 | 58 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED 59 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/external/viennacl/viennacl_resize.hpp 4 | 5 | [begin_description] 6 | Enable resizing for viennacl vector. 7 | [end_description] 8 | 9 | Copyright 2012 Denis Demidov 10 | Copyright 2012 Karsten Ahnert 11 | Copyright 2012 Mario Mulansky 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace boost { 29 | namespace numeric { 30 | namespace odeint { 31 | 32 | 33 | 34 | /* 35 | * specializations for viennacl::vector< T > 36 | */ 37 | template< typename T > 38 | struct is_resizeable< viennacl::vector< T > > : boost::true_type { }; 39 | 40 | template< typename T > 41 | struct resize_impl< viennacl::vector< T > , viennacl::vector< T > > 42 | { 43 | static void resize( viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 ) 44 | { 45 | x1.resize( x2.size() , false ); 46 | } 47 | }; 48 | 49 | template< typename T > 50 | struct same_size_impl< viennacl::vector< T > , viennacl::vector< T > > 51 | { 52 | static bool same_size( const viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 ) 53 | { 54 | return x1.size() == x2.size(); 55 | } 56 | }; 57 | 58 | 59 | 60 | } // namespace odeint 61 | } // namespace numeric 62 | } // namespace boost 63 | 64 | 65 | 66 | #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED 67 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/integrate/null_observer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/integrate/null_observer.hpp 4 | 5 | [begin_description] 6 | null_observer 7 | [end_description] 8 | 9 | Copyright 2011-2012 Karsten Ahnert 10 | Copyright 2011-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED 20 | 21 | namespace boost { 22 | namespace numeric { 23 | namespace odeint { 24 | 25 | struct null_observer 26 | { 27 | template< class State , class Time > 28 | void operator()( const State& /* x */ , Time /* t */ ) const 29 | { 30 | 31 | } 32 | }; 33 | 34 | } // namespace odeint 35 | } // namespace numeric 36 | } // namespace boost 37 | 38 | #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED 39 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/integrate/observer_collection.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/integrate/observer_collection.hpp 4 | 5 | [begin_description] 6 | Collection of observers, which are all called during the evolution of the ODE. 7 | [end_description] 8 | 9 | Copyright 2011-2012 Karsten Ahnert 10 | Copyright 2011-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace boost { 26 | namespace numeric { 27 | namespace odeint { 28 | 29 | template< class State , class Time > 30 | class observer_collection 31 | { 32 | public: 33 | 34 | typedef boost::function< void( const State& , const Time& ) > observer_type; 35 | typedef std::vector< observer_type > collection_type; 36 | 37 | void operator()( const State& x , Time t ) 38 | { 39 | for( size_t i=0 ; i 28 | void operator()( const State& /* x */ , Time /* t */ ) const 29 | { 30 | 31 | } 32 | }; 33 | 34 | } // namespace odeint 35 | } // namespace numeric 36 | } // namespace boost 37 | 38 | #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED 39 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/iterator/integrate/observer_collection.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/integrate/observer_collection.hpp 4 | 5 | [begin_description] 6 | Collection of observers, which are all called during the evolution of the ODE. 7 | [end_description] 8 | 9 | Copyright 2009-2011 Karsten Ahnert 10 | Copyright 2009-2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace boost { 26 | namespace numeric { 27 | namespace odeint { 28 | 29 | template< class State , class Time > 30 | class observer_collection 31 | { 32 | public: 33 | 34 | typedef boost::function< void( const State& , const Time& ) > observer_type; 35 | typedef std::vector< observer_type > collection_type; 36 | 37 | void operator()( const State& x , Time t ) 38 | { 39 | for( size_t i=0 ; i 22 | 23 | namespace boost { 24 | namespace numeric { 25 | namespace odeint { 26 | namespace detail { 27 | 28 | template< class T , size_t N > 29 | class rotating_buffer 30 | { 31 | public: 32 | 33 | typedef T value_type; 34 | const static size_t dim = N; 35 | 36 | rotating_buffer( void ) : m_first( 0 ) 37 | { } 38 | 39 | size_t size( void ) const 40 | { 41 | return dim; 42 | } 43 | 44 | value_type& operator[]( size_t i ) 45 | { 46 | return m_data[ get_index( i ) ]; 47 | } 48 | 49 | const value_type& operator[]( size_t i ) const 50 | { 51 | return m_data[ get_index( i ) ]; 52 | } 53 | 54 | void rotate( void ) 55 | { 56 | if( m_first == 0 ) 57 | m_first = dim-1; 58 | else 59 | --m_first; 60 | } 61 | 62 | protected: 63 | 64 | value_type m_data[N]; 65 | 66 | private: 67 | 68 | size_t get_index( size_t i ) const 69 | { 70 | return ( ( i + m_first ) % dim ); 71 | } 72 | 73 | size_t m_first; 74 | 75 | }; 76 | 77 | 78 | } // detail 79 | } // odeint 80 | } // numeric 81 | } // boost 82 | 83 | 84 | #endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED 85 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/stepper/generation.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/stepper/generation.hpp 4 | 5 | [begin_description] 6 | Forward header for the factory functions. Includes all files from the generation directory. 7 | [end_description] 8 | 9 | Copyright 2011 Karsten Ahnert 10 | Copyright 2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #include 35 | 36 | 37 | #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED 38 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp 4 | 5 | [begin_description] 6 | Enable the factory functions for the controller and the dense output of the Runge-Kutta-Cash-Karp 54 method. 7 | [end_description] 8 | 9 | Copyright 2011 Karsten Ahnert 10 | Copyright 2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | namespace boost { 27 | namespace numeric { 28 | namespace odeint { 29 | 30 | // Specializations for runge_kutta_cash_karp54 31 | template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > 32 | struct get_controller< runge_kutta_cash_karp54< State , Value , Deriv , Time , Algebra , Operations , Resize > > 33 | { 34 | typedef runge_kutta_cash_karp54< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; 35 | typedef controlled_runge_kutta< stepper_type > type; 36 | }; 37 | 38 | 39 | 40 | 41 | 42 | } // odeint 43 | } // numeric 44 | } // boost 45 | 46 | 47 | #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED 48 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp 4 | 5 | [begin_description] 6 | Enable the factory functions for the controller and the dense output of the 7 | Runge-Kutta-Cash-Karp 54 method with the classical implementation. 8 | [end_description] 9 | 10 | Copyright 2011 Karsten Ahnert 11 | Copyright 2011 Mario Mulansky 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | namespace boost { 28 | namespace numeric { 29 | namespace odeint { 30 | 31 | 32 | // Specializations for runge_kutta_cash_karp54 33 | template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > 34 | struct get_controller< runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resize > > 35 | { 36 | typedef runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; 37 | typedef controlled_runge_kutta< stepper_type > type; 38 | }; 39 | 40 | 41 | 42 | 43 | } // odeint 44 | } // numeric 45 | } // boost 46 | 47 | 48 | #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED 49 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp 4 | 5 | [begin_description] 6 | Enable the factory functions for the controller and the dense output of the Runge-Kutta-Fehlberg 78 method. 7 | [end_description] 8 | 9 | Copyright 2011 Karsten Ahnert 10 | Copyright 2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace boost { 26 | namespace numeric { 27 | namespace odeint { 28 | 29 | 30 | template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > 31 | struct get_controller< runge_kutta_fehlberg78< State , Value , Deriv , Time , Algebra , Operations , Resize > > 32 | { 33 | typedef runge_kutta_fehlberg78< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; 34 | typedef controlled_runge_kutta< stepper_type > type; 35 | }; 36 | 37 | 38 | 39 | 40 | 41 | } // odeint 42 | } // numeric 43 | } // boost 44 | 45 | 46 | #endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED 47 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/is_pair.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/util/is_pair.hpp 4 | 5 | [begin_description] 6 | Metafunction to determine if a type is a std::pair<>. 7 | [end_description] 8 | 9 | Copyright 2011 Karsten Ahnert 10 | Copyright 2011 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED 20 | 21 | 22 | #include 23 | #include 24 | 25 | 26 | namespace boost { 27 | namespace numeric { 28 | namespace odeint { 29 | 30 | template< class T > 31 | struct is_pair : public boost::mpl::false_ 32 | { 33 | }; 34 | 35 | template< class T1 , class T2 > 36 | struct is_pair< std::pair< T1 , T2 > > : public boost::mpl::true_ 37 | { 38 | }; 39 | 40 | } // namespace odeint 41 | } // namespace numeric 42 | } // namespace boost 43 | 44 | 45 | #endif // BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED 46 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/odeint_error.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/util/odeint_error.hpp 4 | 5 | [begin_description] 6 | Runtime Exceptions thrown by odeint 7 | [end_description] 8 | 9 | Copyright 2015 Mario Mulansky 10 | 11 | Distributed under the Boost Software License, Version 1.0. 12 | (See accompanying file LICENSE_1_0.txt or 13 | copy at http://www.boost.org/LICENSE_1_0.txt) 14 | */ 15 | 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED 19 | 20 | #include 21 | #include 22 | 23 | 24 | namespace boost { 25 | namespace numeric { 26 | namespace odeint { 27 | 28 | 29 | /** 30 | * \brief Runtime error thrown by odeint 31 | */ 32 | class odeint_error : public std::runtime_error 33 | { 34 | public: 35 | odeint_error(const std::string &s) 36 | : std::runtime_error(s) 37 | { } 38 | }; 39 | 40 | 41 | /** 42 | * \brief Runtime error thrown from integrate routines 43 | * 44 | * This Error occures when too many iterations are performed in between two 45 | * observer calls in the integrate routines. 46 | */ 47 | class no_progress_error : public odeint_error 48 | { 49 | public: 50 | no_progress_error(const std::string &s) 51 | : odeint_error(s) 52 | { } 53 | }; 54 | 55 | 56 | /** 57 | * \brief Runtime error thrown during stepsize adjustment 58 | * 59 | * This Error occures when too many iterations are performed without finding 60 | * an appropriate new step size. This usually indicates non-continuous points 61 | * in the ODE. 62 | */ 63 | class step_adjustment_error : public odeint_error 64 | { 65 | public: 66 | step_adjustment_error(const std::string &s) 67 | : odeint_error(s) 68 | { } 69 | }; 70 | 71 | } 72 | } 73 | } 74 | 75 | 76 | 77 | #endif // BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED 78 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/same_instance.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/util/same_instance.hpp 4 | 5 | [begin_description] 6 | Basic check if two variables are the same instance 7 | [end_description] 8 | 9 | Copyright 2012 Karsten Ahnert 10 | Copyright 2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED 19 | #define BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED 20 | 21 | namespace boost { 22 | namespace numeric { 23 | namespace odeint { 24 | 25 | template< class T1 , class T2 , class Enabler=void > 26 | struct same_instance_impl 27 | { 28 | static bool same_instance( const T1& /* x1 */ , const T2& /* x2 */ ) 29 | { 30 | return false; 31 | } 32 | }; 33 | 34 | template< class T > 35 | struct same_instance_impl< T , T > 36 | { 37 | static bool same_instance( const T &x1 , const T &x2 ) 38 | { 39 | // check pointers 40 | return (&x1 == &x2); 41 | } 42 | }; 43 | 44 | 45 | template< class T1 , class T2 > 46 | bool same_instance( const T1 &x1 , const T2 &x2 ) 47 | { 48 | return same_instance_impl< T1 , T2 >::same_instance( x1 , x2 ); 49 | } 50 | 51 | 52 | } // namespace odeint 53 | } // namespace numeric 54 | } // namespace boost 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/split.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/util/split.hpp 4 | 5 | [begin_description] 6 | Split abstraction for parallel backends. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | Copyright 2013 Pascal Germroth 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_UTIL_SPLIT_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_UTIL_SPLIT_HPP_INCLUDED 21 | 22 | namespace boost { 23 | namespace numeric { 24 | namespace odeint { 25 | 26 | /* 27 | * No default implementation of the split operation 28 | */ 29 | template< class Container1, class Container2 , class Enabler = void > 30 | struct split_impl 31 | { 32 | static void split( const Container1 &from , Container2 &to ); 33 | }; 34 | 35 | template< class Container1 , class Container2 > 36 | void split( const Container1 &from , Container2 &to ) 37 | { 38 | split_impl< Container1 , Container2 >::split( from , to ); 39 | } 40 | 41 | 42 | /* 43 | * No default implementation of the unsplit operation 44 | */ 45 | template< class Container1, class Container2 , class Enabler = void > 46 | struct unsplit_impl 47 | { 48 | static void unsplit( const Container1 &from , Container2 &to ); 49 | }; 50 | 51 | template< class Container1 , class Container2 > 52 | void unsplit( const Container1 &from , Container2 &to ) 53 | { 54 | unsplit_impl< Container1 , Container2 >::unsplit( from , to ); 55 | } 56 | 57 | 58 | } // namespace odeint 59 | } // namespace numeric 60 | } // namespace boost 61 | 62 | 63 | #endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED 64 | 65 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/state_wrapper.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/util/state_wrapper.hpp 4 | 5 | [begin_description] 6 | State wrapper for the state type in all stepper. The state wrappers are responsible for construction, 7 | destruction, copying construction, assignment and resizing. 8 | [end_description] 9 | 10 | Copyright 2011-2012 Mario Mulansky 11 | Copyright 2011-2013 Karsten Ahnert 12 | 13 | Distributed under the Boost Software License, Version 1.0. 14 | (See accompanying file LICENSE_1_0.txt or 15 | copy at http://www.boost.org/LICENSE_1_0.txt) 16 | */ 17 | 18 | 19 | #ifndef BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED 20 | #define BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED 21 | 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | namespace boost { 31 | namespace numeric { 32 | namespace odeint { 33 | 34 | 35 | template< class V , class Enabler = void > 36 | struct state_wrapper 37 | { 38 | typedef state_wrapper< V > state_wrapper_type; 39 | 40 | V m_v; 41 | }; 42 | 43 | 44 | } 45 | } 46 | } 47 | 48 | 49 | 50 | #endif // BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED 51 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/stepper_traits.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/util/stepper_traits.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED 19 | #define BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED 20 | 21 | #include 22 | 23 | 24 | namespace boost { 25 | namespace numeric { 26 | namespace odeint { 27 | namespace traits { 28 | 29 | template< class Stepper > 30 | struct state_type 31 | { 32 | typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; 33 | typedef typename stepper_type::state_type type; 34 | }; 35 | 36 | template< class Stepper > 37 | struct time_type 38 | { 39 | typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; 40 | typedef typename stepper_type::time_type type; 41 | }; 42 | 43 | template< class Stepper > 44 | struct stepper_category 45 | { 46 | typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; 47 | typedef typename stepper_type::stepper_category type; 48 | }; 49 | 50 | template< class Stepper > 51 | struct value_type 52 | { 53 | typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; 54 | typedef typename stepper_type::value_type type; 55 | }; 56 | 57 | } // namespace traits 58 | } // namespace odeint 59 | } // namespace numeric 60 | } // namespace boost 61 | 62 | 63 | #endif // BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED 64 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/util/ublas_matrix_expression.patch: -------------------------------------------------------------------------------- 1 | 3390,3392c3390 2 | < typename enable_if< is_convertible, 3 | < typename matrix_binary_scalar2_traits >::result_type 4 | < > ::result_type 5 | --- 6 | > typename matrix_binary_scalar2_traits >::result_type 7 | -------------------------------------------------------------------------------- /include/boost/numeric/odeint/version.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | boost/numeric/odeint/version.hpp 4 | 5 | [begin_description] 6 | Defines the current version of odeint. 7 | [end_description] 8 | 9 | Copyright 2011-2012 Karsten Ahnert 10 | Copyright 2011-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #ifndef BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED 18 | #define BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED 19 | 20 | #include 21 | #include 22 | 23 | 24 | #define ODEINT_MAJOR_VERSION 2 25 | #define ODEINT_MINOR_VERSION 2 26 | #define ODEINT_PATCH_LEVEL 0 27 | #define ODEINT_VERSION ( ODEINT_MAJOR_VERSION * 100000 + ODEINT_MINOR_VERSION * 100 + ODEINT_PATCH_LEVEL ) 28 | 29 | 30 | namespace boost { 31 | namespace numeric { 32 | namespace odeint { 33 | 34 | namespace version { 35 | 36 | const int major = ODEINT_MAJOR_VERSION ; 37 | const int minor = ODEINT_MINOR_VERSION ; 38 | const int patch_level = ODEINT_PATCH_LEVEL ; 39 | 40 | } 41 | 42 | inline std::string get_version_string( void ) 43 | { 44 | std::ostringstream str; 45 | str << "v" << version::major << "." << version::minor; 46 | if( version::patch_level != 0 ) str << "_" << version::patch_level; 47 | return str.str(); 48 | } 49 | 50 | 51 | } 52 | } 53 | } 54 | 55 | #endif // BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED 56 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | Automatic redirection failed, please go to 13 | doc/html/index.html 14 |
15 |

© Copyright Beman Dawes, 2001

16 |

Distributed under the Boost Software 17 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 18 | www.boost.org/LICENSE_1_0.txt)

19 | 20 | 21 | -------------------------------------------------------------------------------- /performance/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | import os ; 7 | import modules ; 8 | import path ; 9 | 10 | project 11 | : requirements 12 | BOOST_ALL_NO_LIB=1 13 | ../../../.. 14 | -std=c++11 15 | gcc:-ffast-math 16 | intel:"-fast -inline-forceinline" 17 | : default-build release 18 | ; 19 | 20 | 21 | lib libgsl : : gsl ; 22 | lib libgslcblas : : gslcblas ; 23 | 24 | lib libmkl : : mkl_intel_lp64 shared ; 25 | lib libmkl_core : : mkl_core shared ; 26 | lib libmkl_intel_thread : : mkl_intel_thread ; 27 | lib libiomp5 : : iomp5 ; 28 | lib libpthread : : pthread ; 29 | 30 | exe odeint_rk4_array 31 | : odeint_rk4_array.cpp 32 | ; 33 | -------------------------------------------------------------------------------- /performance/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2014 Mario Mulansky 2 | # Copyright 2011-2014 Karsten Ahnert 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or 6 | # copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | # make sure BOOST_ROOT is pointing to your boost directory 9 | # otherwise, set it here: 10 | # BOOST_ROOT = /path/to/boost 11 | 12 | INCLUDES += -I../../include/ -I$(BOOST_ROOT) 13 | GCCFLAGS = -O3 -ffast-math -DNDEBUG 14 | # disabling -ffast-math might give slightly better performance 15 | ICCFLAGS = -Ofast -xHost -ip -inline-forceinline -DNDEBUG 16 | # Possible options: -fp-model source -no-fma 17 | GFORTFLAGS = -Ofast 18 | 19 | bin/gcc: 20 | mkdir -p bin/gcc 21 | 22 | bin/intel: 23 | mkdir -p bin/intel 24 | 25 | bin/gfort: 26 | mkdir -p bin/gfort 27 | 28 | bin/gcc/odeint_rk4_array: odeint_rk4_array.cpp bin/gcc 29 | g++ ${GCCFLAGS} ${INCLUDES} -o bin/gcc/odeint_rk4_array odeint_rk4_array.cpp 30 | 31 | bin/gcc/c_lorenz: c_lorenz.c bin/gcc 32 | gcc -std=c99 -Ofast -mtune=corei7-avx c_lorenz.c -o bin/gcc/c_lorenz 33 | 34 | bin/intel/odeint_rk4_array: odeint_rk4_array.cpp bin/intel 35 | icpc ${ICCFLAGS} ${INCLUDES} -o bin/intel/odeint_rk4_array odeint_rk4_array.cpp 36 | 37 | bin/intel/c_lorenz: c_lorenz.c bin/intel 38 | icc -std=c99 -Ofast -xHost -ansi-alias -o bin/intel/c_lorenz c_lorenz.c 39 | 40 | bin/gfort/fortran_lorenz: fortran_lorenz.f90 bin/gfort 41 | gfortran ${GFORTFLAGS} fortran_lorenz.f90 -o bin/gfort/fortran_lorenz 42 | 43 | all: bin/gcc/odeint_rk4_array bin/intel/odeint_rk4_array bin/gcc/c_lorenz bin/intel/c_lorenz bin/gfort/fortran_lorenz 44 | -------------------------------------------------------------------------------- /performance/SIMD/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Mario Mulansky 2 | # 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or 5 | # copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | # make sure BOOST_ROOT is pointing to your boost directory 8 | # otherwise, set it here: 9 | # BOOST_ROOT = /path/to/boost 10 | # you also need NT2s SIMD libary available set the include path here: 11 | # SIMD_INCLUDE = /path/to/simd/include 12 | 13 | INCLUDES = -I$(BOOST_ROOT) -I${SIMD_INCLUDE} 14 | 15 | # INTEL COMPILER 16 | # change this if you want to cross-compile 17 | ARCH = Host 18 | # ARCH = AVX 19 | # ARCH = SSE4.2 20 | 21 | CXX = icpc 22 | CC = icpc 23 | CXXFLAGS = -O3 -x${ARCH} -std=c++0x -fno-alias -inline-forceinline -DNDEBUG ${INCLUDES} 24 | # -ip 25 | 26 | # GCC COMPILER 27 | # change this if you want to cross-compile 28 | # ARCH = native 29 | # # ARCH = core-avx-i 30 | 31 | # CXX = g++ 32 | # CC = g++ 33 | # CXXFLAGS = -O3 -ffast-math -mtune=${ARCH} -march=${ARCH} -std=c++0x -DNDEBUG ${INCLUDES} 34 | -------------------------------------------------------------------------------- /performance/SIMD/perf_roessler.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Running on ${HOSTNAME}" 3 | 4 | out_dir=perf_${HOSTNAME} 5 | mkdir -p ${out_dir} 6 | 7 | for N in 256 1024 4096 16384 65536 262144 1048576 4194304 16777216 67108864 8 | do 9 | steps=`expr 4 \* 67108864 / ${N}` 10 | for exe in "roessler" "roessler_simd" 11 | do 12 | rm -f ${out_dir}/${exe}_N${N}.times 13 | for i in {0..4} 14 | do 15 | likwid-pin -cS0:0 ./${exe} ${N} ${steps} >> ${out_dir}/${exe}_N${N}.times 16 | done 17 | for perf_ctr in "FLOPS_DP" "FLOPS_AVX" "L2" "L3" "MEM" 18 | do 19 | likwid-perfctr -CS0:0 -g ${perf_ctr} ./${exe} ${N} ${steps} > ${out_dir}/${exe}_N${N}_${perf_ctr}.perf 20 | done 21 | done 22 | done 23 | -------------------------------------------------------------------------------- /performance/c_lorenz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void lorenz(const double *x, double *restrict y) { 6 | y[0] = 10.0 * (x[1] - x[0]); 7 | y[1] = 28.0 * x[0] - x[1] - x[0] * x[2]; 8 | y[2] = x[0] * x[1] - (8.0 / 3.0) * x[2]; 9 | } 10 | 11 | int main(int argc, const char *argv[]) 12 | { 13 | const int nb_steps = 20000000; 14 | const double h = 1.0e-10; 15 | const double h2 = 0.5 * h; 16 | const double nb_loops = 21; 17 | double x[3]; 18 | double y[3]; 19 | double f1[3]; 20 | double f2[3]; 21 | double f3[3]; 22 | double f4[3]; 23 | double min_time = 1E6; 24 | clock_t begin, end; 25 | double time_spent; 26 | 27 | for (int j = 0; j < nb_loops; j++) { 28 | x[0] = 8.5; 29 | x[1] = 3.1; 30 | x[2] = 1.2; 31 | begin = clock(); 32 | for (int k = 0; k < nb_steps; k++) { 33 | lorenz(x, f1); 34 | for (int i = 0; i < 3; i++) { 35 | y[i] = x[i] + h2 * f1[i]; 36 | } 37 | lorenz(y, f2); 38 | for (int i = 0; i < 3; i++) { 39 | y[i] = x[i] + h2 * f2[i]; 40 | } 41 | lorenz(y, f3); 42 | for (int i = 0; i < 3; i++) { 43 | y[i] = x[i] + h * f3[i]; 44 | } 45 | lorenz(y, f4); 46 | for (int i = 0; i < 3; i++) { 47 | x[i] = x[i] + h * (f1[i] + 2 * (f2[i] + f3[i]) + f4[i]) / 6.0; 48 | } 49 | } 50 | end = clock(); 51 | min_time = fmin(min_time, (double)(end-begin)/CLOCKS_PER_SEC); 52 | printf("Result: %f\t runtime: %f\n", x[0], (double)(end-begin)/CLOCKS_PER_SEC); 53 | } 54 | printf("Minimal Runtime: %f\n", min_time); 55 | 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /performance/lorenz.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * lorenz.hpp 3 | * 4 | * Copyright 2011 Mario Mulansky 5 | * Copyright 2012 Karsten Ahnert 6 | * 7 | * Distributed under the Boost Software License, Version 1.0. 8 | * (See accompanying file LICENSE_1_0.txt or 9 | * copy at http://www.boost.org/LICENSE_1_0.txt) 10 | */ 11 | 12 | 13 | #ifndef LORENZ_HPP_ 14 | #define LORENZ_HPP_ 15 | 16 | #include 17 | 18 | struct lorenz 19 | { 20 | template< class state_type > 21 | void inline operator()( const state_type &x , state_type &dxdt , const double t ) const 22 | { 23 | const double sigma = 10.0; 24 | const double R = 28.0; 25 | const double b = 8.0 / 3.0; 26 | dxdt[0] = sigma * ( x[1] - x[0] ); 27 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; 28 | dxdt[2] = x[0]*x[1] - b * x[2]; 29 | } 30 | }; 31 | 32 | 33 | #endif /* LORENZ_HPP_ */ 34 | -------------------------------------------------------------------------------- /test/const_range.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/const_range.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2012 Karsten Ahnert 10 | Copyright 2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef LIBS_NUMERIC_ODEINT_TEST_CONST_RANGE_HPP_DEFINED 19 | #define LIBS_NUMERIC_ODEINT_TEST_CONST_RANGE_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | namespace mpl = boost::mpl; 31 | 32 | 33 | 34 | template< class N , class T > 35 | struct const_range 36 | { 37 | typedef typename mpl::copy< 38 | mpl::range_c< typename N::value_type , 0 , N::value > , 39 | mpl::inserter< 40 | mpl::vector0<> , 41 | mpl::insert< 42 | mpl::_1 , 43 | mpl::end< mpl::_1 > , 44 | T 45 | > 46 | > 47 | >::type type; 48 | }; 49 | 50 | #endif // LIBS_NUMERIC_ODEINT_TEST_CONST_RANGE_HPP_DEFINED 51 | -------------------------------------------------------------------------------- /test/dummy_observers.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/dummy_observers.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef LIBS_NUMERIC_ODEINT_TEST_DUMMY_OBSERVERS_HPP_DEFINED 19 | #define LIBS_NUMERIC_ODEINT_TEST_DUMMY_OBSERVERS_HPP_DEFINED 20 | 21 | 22 | namespace boost { 23 | namespace numeric { 24 | namespace odeint { 25 | 26 | 27 | struct dummy_observer 28 | { 29 | template< class State > 30 | void operator()( const State &s ) const 31 | { 32 | } 33 | }; 34 | 35 | 36 | } // namespace odeint 37 | } // namespace numeric 38 | } // namespace boost 39 | 40 | 41 | #endif // LIBS_NUMERIC_ODEINT_TEST_DUMMY_OBSERVERS_HPP_DEFINED 42 | -------------------------------------------------------------------------------- /test/is_pair.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/is_pair.cpp 4 | 5 | [begin_description] 6 | This file tests the is_pair meta-function. 7 | [end_description] 8 | 9 | Copyright 2011-2012 Karsten Ahnert 10 | Copyright 2011-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #define BOOST_TEST_MODULE odeint_is_pair 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | using namespace boost::numeric::odeint; 27 | 28 | 29 | 30 | BOOST_AUTO_TEST_SUITE( is_pair_test ) 31 | 32 | BOOST_AUTO_TEST_CASE( test_is_pair ) 33 | { 34 | typedef std::pair< int , int > type1; 35 | typedef std::pair< int& , int > type2; 36 | typedef std::pair< int , int& > type3; 37 | typedef std::pair< int& , int& > type4; 38 | typedef std::pair< const int , int > type5; 39 | typedef std::pair< const int& , int > type6; 40 | 41 | BOOST_STATIC_ASSERT(( is_pair< type1 >::value )); 42 | BOOST_STATIC_ASSERT(( is_pair< type2 >::value )); 43 | BOOST_STATIC_ASSERT(( is_pair< type3 >::value )); 44 | BOOST_STATIC_ASSERT(( is_pair< type4 >::value )); 45 | BOOST_STATIC_ASSERT(( is_pair< type5 >::value )); 46 | BOOST_STATIC_ASSERT(( is_pair< type6 >::value )); 47 | } 48 | 49 | BOOST_AUTO_TEST_SUITE_END() 50 | -------------------------------------------------------------------------------- /test/numeric/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | 9 | import testing ; 10 | 11 | use-project boost : $(BOOST_ROOT) ; 12 | 13 | project 14 | : requirements 15 | /boost/test//boost_unit_test_framework 16 | BOOST_ALL_NO_LIB=1 17 | ../../include 18 | static 19 | clang:-Wno-unused-variable 20 | 21 | # -D_SCL_SECURE_NO_WARNINGS 22 | ; 23 | 24 | test-suite "odeint" 25 | : 26 | [ run runge_kutta.cpp ] 27 | [ run symplectic.cpp ] 28 | [ run rosenbrock.cpp ] 29 | [ run adams_bashforth.cpp ] 30 | [ run adams_bashforth_moulton.cpp ] 31 | [ run adaptive_adams_bashforth_moulton.cpp ] 32 | [ run abm_time_dependent.cpp ] 33 | [ run order_quadrature_formula.cpp ] 34 | [ run velocity_verlet.cpp ] 35 | : valgrind 36 | ; 37 | -------------------------------------------------------------------------------- /test/regression/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | 9 | import testing ; 10 | 11 | use-project boost : $(BOOST_ROOT) ; 12 | 13 | project 14 | : requirements 15 | /boost/test//boost_unit_test_framework 16 | BOOST_ALL_NO_LIB=1 17 | ../../include 18 | static 19 | clang:-Wno-unused-variable 20 | 21 | # -D_SCL_SECURE_NO_WARNINGS 22 | ; 23 | 24 | test-suite "odeint" 25 | : 26 | [ run regression_147.cpp ] 27 | [ compile regression_149.cpp : -std=c++0x ] 28 | [ run regression_168.cpp ] 29 | [ run regression_189.cpp ] 30 | : valgrind 31 | ; 32 | -------------------------------------------------------------------------------- /test/resizing_test_state_type.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/resizing_test_state_type.hpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #ifndef LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED 19 | #define LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | 28 | 29 | // Mario: velocity verlet tests need arrays of size 2 30 | // some ugly detailed dependency, maybe this can be improved? 31 | class test_array_type : public boost::array< double , 2 > { }; 32 | 33 | size_t adjust_size_count; 34 | 35 | namespace boost { 36 | namespace numeric { 37 | namespace odeint { 38 | 39 | template<> 40 | struct is_resizeable< test_array_type > 41 | { 42 | typedef boost::true_type type; 43 | const static bool value = type::value; 44 | }; 45 | 46 | template<> 47 | struct same_size_impl< test_array_type , test_array_type > 48 | { 49 | static bool same_size( const test_array_type &x1 , const test_array_type &x2 ) 50 | { 51 | return false; 52 | } 53 | }; 54 | 55 | template<> 56 | struct resize_impl< test_array_type , test_array_type > 57 | { 58 | static void resize( test_array_type &x1 , const test_array_type &x2 ) 59 | { 60 | adjust_size_count++; 61 | } 62 | }; 63 | 64 | } // namespace odeint 65 | } // namespace numeric 66 | } // namespace boost 67 | 68 | 69 | #endif // LIBS_NUMERIC_ODEINT_TEST_RESIZING_TEST_STATE_TYPE_HPP_DEFINED 70 | -------------------------------------------------------------------------------- /test/same_size.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/same_size.cpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2012 Karsten Ahnert 10 | Copyright 2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #include 18 | #ifdef BOOST_MSVC 19 | #pragma warning(disable:4996) 20 | #endif 21 | 22 | #define BOOST_TEST_MODULE odeint_dummy 23 | 24 | #include 25 | 26 | #include 27 | 28 | using namespace boost::unit_test; 29 | using namespace boost::numeric::odeint; 30 | 31 | 32 | BOOST_AUTO_TEST_SUITE( same_size_test ) 33 | 34 | BOOST_AUTO_TEST_CASE( test_vector_true ) 35 | { 36 | std::vector< double > v1( 10 ) , v2( 10 ); 37 | BOOST_CHECK_EQUAL( true , same_size( v1 , v2 ) ); 38 | } 39 | 40 | 41 | BOOST_AUTO_TEST_CASE( test_vector_false ) 42 | { 43 | std::vector< double > v1( 10 ) , v2( 20 ); 44 | BOOST_CHECK_EQUAL( false , same_size( v1 , v2 ) ); 45 | } 46 | 47 | BOOST_AUTO_TEST_CASE( test_fusion_true ) 48 | { 49 | boost::fusion::vector< double , std::vector< double > > v1 , v2; 50 | boost::fusion::at_c< 1 >( v1 ).resize( 10 ); 51 | boost::fusion::at_c< 1 >( v2 ).resize( 10 ); 52 | BOOST_CHECK_EQUAL( true , same_size( v1 , v2 ) ); 53 | } 54 | 55 | BOOST_AUTO_TEST_CASE( test_fusion_false ) 56 | { 57 | boost::fusion::vector< double , std::vector< double > > v1 , v2; 58 | boost::fusion::at_c< 1 >( v1 ).resize( 10 ); 59 | boost::fusion::at_c< 1 >( v2 ).resize( 20 ); 60 | BOOST_CHECK_EQUAL( false , same_size( v1 , v2 ) ); 61 | } 62 | 63 | 64 | 65 | BOOST_AUTO_TEST_SUITE_END() 66 | -------------------------------------------------------------------------------- /test/std_array.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | test/std_array.cpp 4 | 5 | [begin_description] 6 | Checks if odeint compiles fine with the std::array using the array algebra 7 | [end_description] 8 | 9 | Copyright 2009-2014 Karsten Ahnert 10 | Copyright 2009-2014 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #define BOOST_TEST_MODULE odeint_std_array 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | using namespace boost::unit_test; 27 | 28 | typedef std::array state_type; 29 | 30 | void rhs(const state_type &x, state_type &dxdt, const double t) 31 | { 32 | } 33 | 34 | BOOST_AUTO_TEST_SUITE( unwrap_reference_test ) 35 | 36 | BOOST_AUTO_TEST_CASE( test_case ) 37 | { 38 | state_type x = {0.0, 0.0, 0.0}; 39 | 40 | typedef boost::numeric::odeint::runge_kutta4 stepper_type; 41 | // check if array algebra is selected, but only if odeint detects c++11 42 | #ifdef BOOST_NUMERIC_ODEINT_CXX11 43 | BOOST_STATIC_ASSERT(( boost::is_same< stepper_type::algebra_type , 44 | boost::numeric::odeint::array_algebra >::value )); 45 | #endif 46 | stepper_type stepper1; 47 | stepper1.do_step(rhs, x, 0.0, 0.1); 48 | 49 | boost::numeric::odeint::runge_kutta4< 50 | state_type, double, state_type, double, 51 | boost::numeric::odeint::array_algebra > stepper; 52 | stepper.do_step(rhs, x, 0.0, 0.1); 53 | 54 | } 55 | 56 | 57 | BOOST_AUTO_TEST_SUITE_END() 58 | -------------------------------------------------------------------------------- /test/unwrap_boost_reference.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/unwrap_boost_reference.cpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #define BOOST_TEST_MODULE odeint_unwrap_boost_reference 18 | 19 | #include 20 | #include 21 | 22 | using namespace boost::unit_test; 23 | 24 | template< typename T > 25 | void func( T t ) 26 | { 27 | typedef typename boost::numeric::odeint::unwrap_reference< T >::type type; 28 | } 29 | 30 | BOOST_AUTO_TEST_SUITE( unwrap_boost_reference_test ) 31 | 32 | BOOST_AUTO_TEST_CASE( test_case ) 33 | { 34 | int a; 35 | func( boost::ref( a ) ); 36 | func( a ); 37 | } 38 | 39 | 40 | BOOST_AUTO_TEST_SUITE_END() 41 | -------------------------------------------------------------------------------- /test/unwrap_reference.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test/unwrap_reference.cpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | 18 | #define BOOST_TEST_MODULE odeint_unwrap_reference 19 | 20 | #include 21 | 22 | #include 23 | 24 | using namespace boost::unit_test; 25 | 26 | template< typename T > 27 | void func( T t ) 28 | { 29 | typedef typename boost::numeric::odeint::unwrap_reference< T >::type type; 30 | } 31 | 32 | BOOST_AUTO_TEST_SUITE( unwrap_reference_test ) 33 | 34 | BOOST_AUTO_TEST_CASE( test_case ) 35 | { 36 | int a; 37 | func( std::ref( a ) ); 38 | func( a ); 39 | } 40 | 41 | 42 | BOOST_AUTO_TEST_SUITE_END() 43 | -------------------------------------------------------------------------------- /test_external/eigen/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012-2013 Karsten Ahnert 2 | # Copyright 2012-2013 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | 9 | import testing ; 10 | import os ; 11 | 12 | use-project boost : $(BOOST_ROOT) ; 13 | 14 | local EIGEN_ROOT = [ os.environ EIGEN_ROOT ] ; 15 | 16 | project 17 | : requirements 18 | /boost/test//boost_unit_test_framework 19 | BOOST_ALL_NO_LIB=1 20 | $(EIGEN_ROOT) 21 | ../../test 22 | static 23 | # -D_SCL_SECURE_NO_WARNINGS 24 | ; 25 | 26 | test-suite "odeint" 27 | : 28 | [ compile is_resizeable.cpp ] 29 | [ run same_size.cpp ] 30 | [ run resize.cpp ] 31 | [ run runge_kutta4.cpp ] 32 | [ run runge_kutta_dopri5.cpp ] 33 | [ run integrate.cpp ] 34 | : valgrind 35 | ; 36 | -------------------------------------------------------------------------------- /test_external/eigen/integrate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | integrate.cpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2009-2012 Karsten Ahnert 10 | Copyright 2009-2012 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #include 18 | #ifdef BOOST_MSVC 19 | #pragma warning(disable:4996) 20 | #endif 21 | 22 | #define BOOST_TEST_MODULE odeint_eigen_integrate 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include "dummy_odes.hpp" 30 | 31 | 32 | using namespace boost::unit_test; 33 | using namespace boost::numeric::odeint; 34 | 35 | 36 | BOOST_AUTO_TEST_SUITE( eigen_integrate ) 37 | 38 | BOOST_AUTO_TEST_CASE( test_const_sys ) 39 | { 40 | typedef Eigen::Matrix< double , 1 , 1 > state_type; 41 | state_type x; 42 | x[0] = 10.0; 43 | double t_start = 0.0 , t_end = 1.0 , dt = 0.1; 44 | integrate< double >( constant_system_functor_standard() , x , t_start , t_end , dt ); 45 | BOOST_CHECK_CLOSE( x[0] , 11.0 , 1.0e-13 ); 46 | } 47 | 48 | BOOST_AUTO_TEST_CASE( test_lorenz ) 49 | { 50 | typedef Eigen::Matrix< double , 3 , 1 > state_type; 51 | state_type x; 52 | x[0] = 10.0; 53 | x[1] = 10.0; 54 | x[2] = 10.0; 55 | double t_start = 0.0 , t_end = 1000.0 , dt = 0.1; 56 | integrate< double >( lorenz() , x , t_start , t_end , dt ); 57 | 58 | std::vector< double > x2( 3 ); 59 | x2[0] = 10.0; 60 | x2[1] = 10.0; 61 | x2[2] = 10.0; 62 | integrate( lorenz() , x2 , t_start , t_end , dt ); 63 | 64 | BOOST_CHECK_CLOSE( x[0] , x2[0] , 1.0e-13 ); 65 | BOOST_CHECK_CLOSE( x[1] , x2[1] , 1.0e-13 ); 66 | BOOST_CHECK_CLOSE( x[2] , x2[2] , 1.0e-13 ); 67 | } 68 | 69 | BOOST_AUTO_TEST_SUITE_END() 70 | -------------------------------------------------------------------------------- /test_external/eigen/is_resizeable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | [auto_generated] 3 | libs/numeric/odeint/test_external/eigen/is_resizeable.cpp 4 | 5 | [begin_description] 6 | tba. 7 | [end_description] 8 | 9 | Copyright 2013 Karsten Ahnert 10 | Copyright 2013 Mario Mulansky 11 | 12 | Distributed under the Boost Software License, Version 1.0. 13 | (See accompanying file LICENSE_1_0.txt or 14 | copy at http://www.boost.org/LICENSE_1_0.txt) 15 | */ 16 | 17 | #include 18 | #ifdef BOOST_MSVC 19 | #pragma warning(disable:4996) 20 | #endif 21 | 22 | #define BOOST_TEST_MODULE odeint_eigen_is_resizeable 23 | 24 | #include 25 | 26 | #include 27 | 28 | using namespace boost::unit_test; 29 | using namespace boost::numeric::odeint; 30 | 31 | 32 | BOOST_AUTO_TEST_SUITE( is_resizeable ) 33 | 34 | BOOST_AUTO_TEST_CASE( test_compile_time_matrix ) 35 | { 36 | typedef Eigen::Matrix< double , 1 , 1 > matrix_type; 37 | BOOST_STATIC_ASSERT(( boost::numeric::odeint::is_resizeable< matrix_type >::value )); 38 | } 39 | 40 | BOOST_AUTO_TEST_CASE( test_compile_time_array ) 41 | { 42 | typedef Eigen::Array< double , 1 , 1 > array_type; 43 | BOOST_STATIC_ASSERT(( boost::numeric::odeint::is_resizeable< array_type >::value )); 44 | } 45 | 46 | 47 | BOOST_AUTO_TEST_SUITE_END() 48 | -------------------------------------------------------------------------------- /test_external/gmp/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | import testing ; 9 | use-project boost : $(BOOST_ROOT) ; 10 | 11 | project gmp 12 | : requirements 13 | /boost/test//boost_unit_test_framework 14 | ; 15 | 16 | 17 | lib libgmp : : gmp shared ; 18 | lib libgmpxx : : gmpxx shared ; 19 | 20 | test-suite "gmp" 21 | : 22 | [ run check_gmp.cpp libgmpxx libgmp : : : shared:BOOST_TEST_DYN_LINK=1 ] 23 | [ run gmp_integrate.cpp libgmpxx libgmp : : : shared:BOOST_TEST_DYN_LINK=1 ] 24 | ; 25 | 26 | 27 | -------------------------------------------------------------------------------- /test_external/gsl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | import testing ; 9 | use-project boost : $(BOOST_ROOT) ; 10 | 11 | project 12 | : requirements 13 | /boost/test//boost_unit_test_framework 14 | ; 15 | 16 | 17 | lib libgsl : : gsl shared ; 18 | lib libgslcblas : : gslcblas shared ; 19 | 20 | test-suite "gsl" 21 | : 22 | [ run check_gsl.cpp libgslcblas libgsl 23 | : 24 | : 25 | : shared:BOOST_TEST_DYN_LINK=1 26 | ] 27 | ; 28 | 29 | -------------------------------------------------------------------------------- /test_external/gsl/check_gsl.cpp: -------------------------------------------------------------------------------- 1 | /* Boost check_gmp.cpp test file 2 | 3 | Copyright 2010-2011 Karsten Ahnert 4 | Copyright 2011 Mario Mulansky 5 | 6 | This file tests the odeint library with the gmp arbitrary precision types 7 | 8 | Distributed under the Boost Software License, Version 1.0. 9 | (See accompanying file LICENSE_1_0.txt or 10 | copy at http://www.boost.org/LICENSE_1_0.txt) 11 | */ 12 | 13 | #define BOOST_TEST_MODULE odeint_gsl 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | using namespace boost::unit_test; 22 | using namespace boost::numeric::odeint; 23 | 24 | typedef gsl_vector *state_type; 25 | 26 | const double sigma = 10.0; 27 | const double R = 28.0; 28 | const double b = 8.0 / 3.0; 29 | 30 | void lorenz( const state_type x , state_type dxdt , double t ) 31 | { 32 | gsl_vector_set( dxdt , 0 , sigma * ( gsl_vector_get(x , 1 ) - gsl_vector_get( x , 0 ) ) ); 33 | 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) ); 34 | gsl_vector_set( dxdt , 2 , gsl_vector_get( x , 0 ) * gsl_vector_get( x , 1 ) - b * gsl_vector_get( x , 2) ); 35 | } 36 | 37 | BOOST_AUTO_TEST_CASE( gsl ) 38 | { 39 | euler< state_type > euler; 40 | 41 | state_type x = gsl_vector_alloc( 3 ); 42 | 43 | // check resizing 44 | state_type y = 0; 45 | boost::numeric::odeint::resize( y , x ); 46 | BOOST_CHECK( 0 != y ); 47 | 48 | gsl_vector_set( x , 0 , 1.0); 49 | gsl_vector_set( x , 1 , 1.0); 50 | gsl_vector_set( x , 2 , 2.0); 51 | 52 | euler.do_step( lorenz , x , 0.0 , 0.1 ); 53 | 54 | //cout << gsl_vector_get( x , 0 ) << " " << gsl_vector_get( x , 1 ) << " " << gsl_vector_get( x , 2 ) << endl; 55 | 56 | gsl_vector_free( x ); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /test_external/mkl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | import testing ; 9 | use-project boost : $(BOOST_ROOT) ; 10 | 11 | project 12 | : requirements 13 | /boost/test//boost_unit_test_framework 14 | ; 15 | 16 | 17 | lib libmkl : : mkl_intel_lp64 shared ; 18 | lib libmkl_core : : mkl_core shared ; 19 | lib libmkl_intel_thread : : mkl_intel_thread ; 20 | lib libiomp5 : : iomp5 ; 21 | lib libpthread : : pthread ; 22 | 23 | test-suite "mkl" 24 | : 25 | [ run check_mkl.cpp libpthread libiomp5 libmkl_core libmkl_intel_thread libmkl 26 | : 27 | : 28 | : shared:BOOST_TEST_DYN_LINK=1 29 | ] 30 | ; 31 | -------------------------------------------------------------------------------- /test_external/mkl/check_mkl.cpp: -------------------------------------------------------------------------------- 1 | /* Boost check_mkl.cpp test file 2 | 3 | Copyright 2010-2011 Mario Mulansky 4 | Copyright 2011 Karsten Ahnert 5 | 6 | This file tests the odeint library with the intel mkl blas1 routines 7 | 8 | Distributed under the Boost Software License, Version 1.0. 9 | (See accompanying file LICENSE_1_0.txt or 10 | copy at http://www.boost.org/LICENSE_1_0.txt) 11 | */ 12 | 13 | #define BOOST_TEST_MODULE test_mkl 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | using namespace boost::numeric::odeint; 23 | 24 | typedef double value_type; 25 | typedef boost::array< value_type , 1 > state_type; 26 | 27 | 28 | void constant_system( state_type &x , state_type &dxdt , value_type t ) 29 | { 30 | dxdt[0] = 1.0; 31 | } 32 | 33 | const double eps = 1E-14; 34 | 35 | 36 | BOOST_AUTO_TEST_CASE( test_mkl ) 37 | { 38 | 39 | //to use mkl routines we have to use the vector_space_algebra and the mkl_operations 40 | runge_kutta4< state_type , value_type , state_type , value_type , vector_space_algebra , mkl_operations > stepper; 41 | state_type x; 42 | x[0] = 0.0; 43 | 44 | stepper.do_step( constant_system , x , 0.0 , 0.1 ); 45 | 46 | using std::abs; 47 | 48 | std::cout << x[0] << " ?= " << 0.1 << std::endl; 49 | BOOST_CHECK_SMALL( abs( x[0] - 0.1 ) , eps ); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /test_external/mpi/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2012-2013 Mario Mulansky 3 | # Copyright 2013 Pascal Germroth 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | import testing ; 8 | import mpi : mpi-test ; 9 | 10 | use-project boost : $(BOOST_ROOT) ; 11 | 12 | project 13 | : requirements 14 | /boost/test//boost_unit_test_framework 15 | /boost//mpi 16 | static 17 | BOOST_ALL_NO_LIB=1 18 | ; 19 | 20 | # mpi-test name : source : req : np=1 2 3 4 7 8 13 17 21 | test-suite "odeint-mpi" 22 | : 23 | [ mpi-test split_test ] 24 | [ mpi-test state_test ] 25 | [ mpi-test norm_test ] 26 | ; 27 | 28 | -------------------------------------------------------------------------------- /test_external/mpi/norm_test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Karsten Ahnert 3 | Copyright 2013 Mario Mulansky 4 | Copyright 2013 Pascal Germroth 5 | 6 | Distributed under the Boost Software License, Version 1.0. 7 | (See accompanying file LICENSE_1_0.txt or 8 | copy at http://www.boost.org/LICENSE_1_0.txt) 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #define BOOST_TEST_MODULE odeint_mpi 16 | #include 17 | 18 | #include 19 | 20 | using namespace boost::numeric::odeint; 21 | 22 | boost::mpi::environment env; 23 | 24 | BOOST_AUTO_TEST_SUITE( norm_test_suite ) 25 | 26 | BOOST_AUTO_TEST_CASE( norm_test ) 27 | { 28 | boost::mpi::communicator world; 29 | 30 | int ref_value = 0; 31 | std::vector in_data; 32 | mpi_state< std::vector > state(world); 33 | 34 | // generate data and reference value on master 35 | if(world.rank() == 0) { 36 | for(size_t i = 0 ; i < 400 ; i++) 37 | in_data.push_back( rand() % 10000 ); 38 | ref_value = *std::max_element(in_data.begin(), in_data.end()); 39 | } 40 | boost::mpi::broadcast(world, ref_value, 0); 41 | 42 | // copy to nodes 43 | split( in_data, state ); 44 | 45 | int value = mpi_nested_algebra< range_algebra >::norm_inf( state ); 46 | 47 | { 48 | std::ostringstream ss; 49 | ss << "state[" << world.rank() << "]" 50 | << " local:" << range_algebra::norm_inf( state() ) 51 | << " global:" << value 52 | << " ref:" << ref_value << "\n"; 53 | std::clog << ss.str() << std::flush; 54 | } 55 | 56 | BOOST_REQUIRE_EQUAL( value, ref_value ); 57 | } 58 | 59 | 60 | BOOST_AUTO_TEST_SUITE_END() 61 | 62 | 63 | -------------------------------------------------------------------------------- /test_external/mpi/split_test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Karsten Ahnert 3 | Copyright 2013 Mario Mulansky 4 | Copyright 2013 Pascal Germroth 5 | 6 | Distributed under the Boost Software License, Version 1.0. 7 | (See accompanying file LICENSE_1_0.txt or 8 | copy at http://www.boost.org/LICENSE_1_0.txt) 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #define BOOST_TEST_MODULE odeint_mpi 15 | #include 16 | 17 | #include 18 | 19 | using namespace boost::numeric::odeint; 20 | 21 | boost::mpi::environment env; 22 | 23 | BOOST_AUTO_TEST_SUITE( split_test_suite ) 24 | 25 | BOOST_AUTO_TEST_CASE( split_test ) 26 | { 27 | boost::mpi::communicator world; 28 | 29 | const size_t total_size = 31; 30 | 31 | std::vector in_data, out_data; 32 | mpi_state< std::vector > state(world); 33 | 34 | // generate data on master 35 | if(world.rank() == 0) 36 | for(size_t i = 0 ; i < total_size ; i++) in_data.push_back(i); 37 | 38 | // copy to nodes 39 | split( in_data, state ); 40 | 41 | BOOST_REQUIRE((state().size() == total_size / world.size()) 42 | || (state().size() == total_size / world.size() + 1)); 43 | 44 | { 45 | std::ostringstream ss; 46 | ss << "state[" << world.rank() << "].data = {"; 47 | std::copy(state().begin(), state().end(), std::ostream_iterator(ss, ", ")); 48 | ss << "}\n"; 49 | std::clog << ss.str() << std::flush; 50 | } 51 | 52 | // copy back to master 53 | if(world.rank() == 0) out_data.resize(in_data.size()); 54 | unsplit( state, out_data ); 55 | 56 | if(world.rank() == 0) 57 | BOOST_REQUIRE_EQUAL_COLLECTIONS(in_data.begin(), in_data.end(), out_data.begin(), out_data.end()); 58 | } 59 | 60 | 61 | BOOST_AUTO_TEST_SUITE_END() 62 | -------------------------------------------------------------------------------- /test_external/mtl4/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2013 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. (See 4 | # accompanying file LICENSE_1_0.txt or copy at 5 | # http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | import testing ; 8 | import boost ; 9 | 10 | # boost.use-project ; 11 | use-project boost : $(BOOST_ROOT) ; 12 | 13 | # set your MTL4 directory here 14 | MTL4_INCLUDE = /home/mario/MTL4/usr/include ; 15 | 16 | project 17 | : requirements 18 | /boost/test//boost_unit_test_framework 19 | $(MTL4_INCLUDE) 20 | BOOST_ALL_NO_LIB=1 21 | static 22 | : 23 | : default-build release 24 | ; 25 | 26 | test-suite "odeint-mtl4" 27 | : 28 | [ run mtl4_resize.cpp ] 29 | : valgrind 30 | ; 31 | -------------------------------------------------------------------------------- /test_external/nt2/Jamfile.v2: -------------------------------------------------------------------------------- 1 | #============================================================================== 2 | # Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | # Copyright 2014 NumScale SAS 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. 6 | # See accompanying file LICENSE.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt 8 | #============================================================================== 9 | 10 | import testing ; 11 | import os ; 12 | 13 | # This must be built using an NT2 installation. 14 | # NT2_ROOT_PATH should point to the build directory. 15 | # Currently, cxxflags needs to be set to the required architecture 16 | # if using avx/avx2, set the environemnt variable NT2_SIMD_FLAGS to the 17 | # required value for your compiler (i.e. -mavx2 on g++) 18 | # If using sse2/3/4 in 64 bits, this is set automatically. 19 | 20 | local NT2_ROOT_PATH = [ os.environ NT2_ROOT_PATH ] ; 21 | local NT2_SIMD_FLAGS = [ os.environ NT2_SIMD_FLAGS ] ; 22 | 23 | use-project boost : $(BOOST_ROOT) ; 24 | 25 | project 26 | : requirements 27 | $(BOOST_ROOT)/boost/test/included/unit_test_framework.hpp 28 | BOOST_ALL_NO_LIB=1 29 | $(NT2_ROOT_PATH)/include/ 30 | static 31 | gcc:-DBOOST_SIMD_NO_STRICT_ALIASING 32 | gcc:-fno-strict-aliasing 33 | $(NT2_SIMD_FLAGS) 34 | ; 35 | 36 | test-suite "odeint" 37 | : 38 | [ run copy.cpp ] 39 | [ run norm_inf.cpp ] 40 | [ run resize.cpp ] 41 | [ run is_resizeable.cpp ] 42 | [ run algebra_dispatcher.cpp ] 43 | : valgrind 44 | ; 45 | -------------------------------------------------------------------------------- /test_external/nt2/copy.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #ifdef BOOST_MSVC 15 | #pragma warning(disable:4996) 16 | #endif 17 | 18 | #define BOOST_TEST_MODULE odeint_nt2_copy 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | using namespace boost::unit_test; 26 | using namespace boost::numeric::odeint; 27 | 28 | typedef boost::mpl::list< float , double > fp_types; 29 | 30 | BOOST_AUTO_TEST_SUITE( nt2_copy ) 31 | 32 | BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy, T, fp_types ) 33 | { 34 | nt2::table x = nt2::linspace(T(1),T(0),7); 35 | 36 | nt2::table y; 37 | 38 | copy(y,x); 39 | 40 | for (std::size_t ii=1; ii<=x.size();ii++) 41 | BOOST_CHECK_EQUAL(x(ii),y(ii)); 42 | } 43 | 44 | BOOST_AUTO_TEST_SUITE_END() 45 | -------------------------------------------------------------------------------- /test_external/nt2/is_resizeable.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #include 10 | #include 11 | 12 | #include 13 | #ifdef BOOST_MSVC 14 | #pragma warning(disable:4996) 15 | #endif 16 | 17 | #define BOOST_TEST_MODULE odeint_nt2_resize 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | using namespace boost::unit_test; 25 | using namespace boost::numeric::odeint; 26 | 27 | typedef boost::mpl::list< float , double > fp_types; 28 | 29 | BOOST_AUTO_TEST_SUITE( nt2_is_resizeable ) 30 | 31 | BOOST_AUTO_TEST_CASE_TEMPLATE( is_resizeable, T, fp_types ) 32 | { 33 | BOOST_STATIC_ASSERT(( boost::numeric::odeint::is_resizeable< nt2::table >::value )); 34 | } 35 | 36 | BOOST_AUTO_TEST_SUITE_END() 37 | -------------------------------------------------------------------------------- /test_external/nt2/norm_inf.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | #ifdef BOOST_MSVC 16 | #pragma warning(disable:4996) 17 | #endif 18 | 19 | #define BOOST_TEST_MODULE odeint_nt2_copy 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | using namespace boost::unit_test; 28 | using namespace boost::numeric::odeint; 29 | 30 | typedef boost::mpl::list< float , double > fp_types; 31 | 32 | BOOST_AUTO_TEST_SUITE( nt2_norm_inf ) 33 | 34 | BOOST_AUTO_TEST_CASE_TEMPLATE( test_norm_inf, T, fp_types ) 35 | { 36 | nt2::table x = nt2::ones(10,1, nt2::meta::as_() ); 37 | x(4) = 55; 38 | 39 | nt2::table y = nt2::zeros(8,8, nt2::meta::as_() ); 40 | y(6,4) = -42; 41 | 42 | BOOST_CHECK_SMALL(vector_space_norm_inf >()(x) - T(55), T(1e-10)); 43 | BOOST_CHECK_SMALL(vector_space_norm_inf >()(y) - T(42), T(1e-10)); 44 | } 45 | 46 | BOOST_AUTO_TEST_SUITE_END() 47 | -------------------------------------------------------------------------------- /test_external/nt2/resize.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI 3 | // Copyright 2014 NumScale SAS 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See accompanying file LICENSE.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt 8 | //============================================================================== 9 | #include 10 | #include 11 | 12 | #include 13 | #ifdef BOOST_MSVC 14 | #pragma warning(disable:4996) 15 | #endif 16 | 17 | #define BOOST_TEST_MODULE odeint_nt2_resize 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | using namespace boost::unit_test; 25 | using namespace boost::numeric::odeint; 26 | 27 | typedef boost::mpl::list< float , double > fp_types; 28 | 29 | BOOST_AUTO_TEST_SUITE( nt2_resize ) 30 | 31 | BOOST_AUTO_TEST_CASE_TEMPLATE( test_resize, T, fp_types ) 32 | { 33 | nt2::table x; 34 | x.resize(nt2::of_size(10,10)); 35 | 36 | nt2::table y; 37 | 38 | BOOST_CHECK_EQUAL(same_size(x,y),false); 39 | 40 | resize(y,x); 41 | 42 | BOOST_CHECK_EQUAL(same_size(x,y),true); 43 | } 44 | 45 | BOOST_AUTO_TEST_SUITE_END() 46 | -------------------------------------------------------------------------------- /test_external/thrust/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2010-2014 Mario Mulansky 2 | # Copyright 2010-2012 Karsten Ahnert 3 | # 4 | # Distributed under the Boost Software License, Version 1.0. 5 | # (See accompanying file LICENSE_1_0.txt or 6 | # copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | # make sure BOOST_ROOT is pointing to your boost directory 9 | # otherwise, set it here: 10 | # BOOST_ROOT = /path/to/boost 11 | 12 | # path to the cuda installation 13 | CUDA_ROOT = /usr/local/cuda 14 | # target architecture 15 | ARCH = sm_13 16 | 17 | NVCC = $(CUDA_ROOT)/bin/nvcc 18 | 19 | INCLUDES += -I../../include/ -I$(BOOST_ROOT) 20 | 21 | NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) 22 | 23 | %.o : %.cu 24 | $(NVCC) $(NVCCFLAGS) -c $< -o $@ 25 | 26 | % : %.o 27 | $(NVCC) $(NVCCFLAGS) -o $@ $< 28 | 29 | 30 | all : check_thrust 31 | 32 | 33 | clean : 34 | -rm *~ *.o check_thrust 35 | -------------------------------------------------------------------------------- /test_external/vexcl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Karsten Ahnert 2 | # Copyright 2013 Mario Mulansky 3 | # Distributed under the Boost Software License, Version 1.0. 4 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # bring in rules for testing 7 | 8 | 9 | import testing ; 10 | 11 | use-project boost : $(BOOST_ROOT) ; 12 | VEXCL_INCLUDE = /home/karsten/boost/testing/vexcl ; 13 | OPENCL_INCLUDE = /usr/local/cuda/include ; 14 | #OPENCL_INCLUDE = /usr/include ; 15 | 16 | project 17 | : requirements 18 | /boost/test//boost_unit_test_framework 19 | BOOST_ALL_NO_LIB=1 20 | $(VEXCL_INCLUDE) 21 | $(OPENCL_INCLUDE) 22 | -std=c++0x 23 | /boost//system/ 24 | ; 25 | 26 | lib OpenCL : : OpenCL shared ; 27 | 28 | test-suite "odeint" 29 | : 30 | [ run lorenz.cpp OpenCL ] 31 | [ run norm_inf.cpp OpenCL ] 32 | : valgrind 33 | : 34 | : shared:BOOST_TEST_DYN_LINK=1 35 | ; -------------------------------------------------------------------------------- /test_external/vexcl/norm_inf.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MODULE odeint_vexcl_norm_inf 2 | 3 | #include 4 | #include 5 | 6 | template 7 | double norm(const T &x) { 8 | return boost::numeric::odeint::vector_space_norm_inf()(x); 9 | } 10 | 11 | BOOST_AUTO_TEST_CASE( norm_inf ) 12 | { 13 | vex::Context ctx(vex::Filter::Env); 14 | std::cout << ctx << std::endl; 15 | 16 | vex::vector x(ctx, 1024); 17 | x = 41; 18 | 19 | vex::multivector y(ctx, 1024); 20 | y = 42; 21 | 22 | BOOST_CHECK_EQUAL( norm(x), 41 ); 23 | BOOST_CHECK_EQUAL( norm(y), 42 ); 24 | } 25 | 26 | --------------------------------------------------------------------------------