41 | post-conditions \42 | remark \ 43 | snippet \ 44 | png 45 | Quickbook 46 | Verhoeff 47 | # version \ 48 | VISA 49 | warning \ 50 | 51 | # Remove leading "A" or "The" prefixes from section titles. 52 | # !rewrite-name "(?:A|An|The)\s+(.*)" "\1" 53 | 54 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/doc/tutorial.qbk: -------------------------------------------------------------------------------- 1 | [/============================================================================ 2 | Boost.odeint 3 | 4 | Copyright (c) 2009-2012 Karsten Ahnert 5 | Copyright (c) 2009-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 Tutorial] 14 | 15 | 16 | [include tutorial_harmonic_oscillator.qbk] 17 | 18 | [include tutorial_solar_system.qbk] 19 | 20 | [include tutorial_chaotic_system.qbk] 21 | 22 | [include tutorial_stiff_systems.qbk] 23 | 24 | [include tutorial_special_topics.qbk] 25 | 26 | [include tutorial_thrust_cuda.qbk] 27 | 28 | [include tutorial_vexcl_opencl.qbk] 29 | 30 | 31 | [section All examples] 32 | 33 | The following table gives an overview over all examples. 34 | 35 | [include examples_table.qbk] 36 | 37 | [endsect] 38 | 39 | 40 | 41 | 42 | 43 | 44 | [endsect] 45 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/2d_lattice/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Karsten Ahnert and Mario Mulansky. 2 | # Distributed under the Boost Software License, Version 1.0. (See 3 | # accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | project 7 | : requirements 8 | ../../../../.. 9 | BOOST_ALL_NO_LIB=1 10 | ; 11 | 12 | exe spreading : spreading.cpp ; -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/2d_lattice/nested_range_algebra.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2009-2012 Karsten Ahnert 3 | Copyright 2009-2012 Mario Mulansky 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Karsten Ahnert and Mario Mulansky. 2 | # Distributed under the Boost Software License, Version 1.0. (See 3 | # accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | 7 | project 8 | : requirements 9 | ../../../.. 10 | BOOST_ALL_NO_LIB=1 11 | : 12 | ; 13 | 14 | 15 | exe harmonic_oscillator : harmonic_oscillator.cpp ; 16 | exe solar_system : solar_system.cpp ; 17 | exe chaotic_system : chaotic_system.cpp ; 18 | exe stiff_system : stiff_system.cpp ; 19 | exe fpu : fpu.cpp ; 20 | exe phase_oscillator_ensemble : phase_oscillator_ensemble.cpp ; 21 | exe harmonic_oscillator_units : harmonic_oscillator_units.cpp ; 22 | exe stuart_landau : stuart_landau.cpp ; 23 | exe two_dimensional_phase_lattice : two_dimensional_phase_lattice.cpp ; 24 | exe bulirsch_stoer : bulirsch_stoer.cpp ; 25 | exe elliptic_functions : elliptic_functions.cpp ; 26 | exe resizing_lattice : resizing_lattice.cpp ; 27 | exe list_lattice : list_lattice.cpp ; 28 | exe stepper_details : stepper_details.cpp ; 29 | exe my_vector : my_vector.cpp ; 30 | exe lorenz_point : lorenz_point.cpp ; 31 | exe van_der_pol_stiff : van_der_pol_stiff.cpp ; 32 | exe simple1d : simple1d.cpp ; 33 | exe stochastic_euler : stochastic_euler.cpp ; 34 | exe generation_functions : generation_functions.cpp ; 35 | exe heun : heun.cpp ; 36 | exe bind_member_functions : bind_member_functions.cpp ; 37 | exe bind_member_functions_cpp11 : bind_member_functions_cpp11.cpp : -std=c++0x ; 38 | 39 | # build-project mtl ; 40 | # build-project ublas ; 41 | # build-project gmpxx ; 42 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/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 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 | #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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/elliptic.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2009-2012 Karsten Ahnert 3 | Copyright 2009-2012 Mario Mulansky 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/mtl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Karsten Ahnert and Mario Mulansky. 2 | # Distributed under the Boost Software License, Version 1.0. (See 3 | # accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | MTL4_INCLUDE = /home/karsten/boost/MTL-4.0.8862-Linux/usr/include ; 7 | 8 | project 9 | : requirements 10 | ../../../../.. 11 | $(MTL4_INCLUDE) 12 | BOOST_ALL_NO_LIB=1 13 | ; 14 | 15 | exe gauss_packet : gauss_packet.cpp ; 16 | exe implicit_euler_mtl : implicit_euler_mtl.cpp ; -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/quadmath/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Karsten Ahnert and Mario Mulansky. 2 | # Distributed under the Boost Software License, Version 1.0. (See 3 | # accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | 7 | project 8 | : requirements 9 | ../../../.. 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 ; -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/simple1d.cpp: -------------------------------------------------------------------------------- 1 | /* Boost libs/numeric/odeint/examples/simple1d.cpp 2 | 3 | Copyright 2009-2012 Karsten Ahnert 4 | Copyright 2009-2012 Mario Mulansky 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 = value_type = deriv_type = time_type = double 37 | typedef runge_kutta_dopri5< double , double , double , double , vector_space_algebra , default_operations , never_resizer > 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/ublas/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Karsten Ahnert and Mario Mulansky. 2 | # Distributed under the Boost Software License, Version 1.0. (See 3 | # accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | 7 | project 8 | : requirements 9 | ../../../../.. 10 | BOOST_ALL_NO_LIB=1 11 | ; 12 | 13 | exe lorenz_ublas : lorenz_ublas.cpp ; 14 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/ublas/lorenz_ublas.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009-2012 Karsten Ahnert 3 | * Copyright 2009-2012 Mario Mulansky 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 | /* define ublas::vector as resizeable 17 | * this is not neccessarily required because this definition already 18 | * exists in util/ublas_wrapper.hpp. 19 | * However, for completeness and educational purpose it is repeated here. 20 | */ 21 | 22 | //[ ublas_resizeable 23 | typedef boost::numeric::ublas::vector< double > state_type; 24 | 25 | namespace boost { namespace numeric { namespace odeint { 26 | 27 | template<> 28 | struct is_resizeable< state_type > 29 | { 30 | typedef boost::true_type type; 31 | const static bool value = type::value; 32 | }; 33 | 34 | } } } 35 | //] 36 | 37 | void lorenz( const state_type &x , state_type &dxdt , const double t ) 38 | { 39 | const double sigma( 10.0 ); 40 | const double R( 28.0 ); 41 | const double b( 8.0 / 3.0 ); 42 | 43 | dxdt[0] = sigma * ( x[1] - x[0] ); 44 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; 45 | dxdt[2] = -b * x[2] + x[0] * x[1]; 46 | } 47 | 48 | using namespace boost::numeric::odeint; 49 | 50 | //[ublas_main 51 | int main() 52 | { 53 | state_type x(3); 54 | x[0] = 10.0; x[1] = 5.0 ; x[2] = 0.0; 55 | typedef runge_kutta4< state_type , double , state_type , double , vector_space_algebra > stepper; 56 | integrate_const( stepper() , lorenz , x , 57 | 0.0 , 10.0 , 0.1 ); 58 | } 59 | //] 60 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/vexcl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2009-2012 Karsten Ahnert 2 | # Copyright 2009-2012 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 | VEXCL_INCLUDE = $(HOME)/boost/vexcl ; 18 | CUDA_INCLUDE = /usr/local/cuda/include ; 19 | 20 | 21 | lib opencl : : OpenCL ; 22 | 23 | project : requirements 24 | /boost//headers 25 | ../../../../.. 26 | $(VEXCL_INCLUDE) 27 | $(CUDA_INCLUDE) 28 | gcc: -std=c++0x 29 | ; 30 | 31 | exe lorenz_ensemble : lorenz_ensemble.cpp opencl ; -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | Automatic redirection failed, please go to 12 | doc/html/index.html 13 |
14 |© Copyright Beman Dawes, 2001
15 |Distributed under the Boost Software 16 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 17 | www.boost.org/LICENSE_1_0.txt)
18 | 19 | 20 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/gsl_rk4_lorenz.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * gsl_rk4_lorenz.cpp 3 | * 4 | * Copyright 2009-2012 Karsten Ahnert 5 | * Copyright 2009-2012 Mario Mulansky 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 | #include14 | 15 | #include "rk_performance_test_case.hpp" 16 | 17 | #include "lorenz_gsl.hpp" 18 | 19 | const size_t dim = 3; 20 | 21 | class gsl_wrapper 22 | { 23 | public: 24 | 25 | gsl_wrapper() 26 | { 27 | m_s = gsl_odeiv_step_alloc( gsl_odeiv_step_rk4 , dim); 28 | m_sys.function = lorenz_gsl; 29 | m_sys.jacobian = 0; 30 | m_sys.dimension = dim; 31 | m_sys.params = 0; 32 | } 33 | 34 | void reset_init_cond() 35 | { 36 | m_x[0] = 10.0 * rand() / RAND_MAX; 37 | m_x[1] = 10.0 * rand() / RAND_MAX; 38 | m_x[2] = 10.0 * rand() / RAND_MAX; 39 | m_t = 0.0; 40 | } 41 | 42 | inline void do_step( const double dt ) 43 | { 44 | gsl_odeiv_step_apply ( m_s , m_t , dt , m_x , m_x_err , 0 , 0 , &m_sys ); 45 | //m_t += dt; 46 | } 47 | 48 | double state( const size_t i ) const 49 | { return m_x[i]; } 50 | 51 | ~gsl_wrapper() 52 | { 53 | gsl_odeiv_step_free( m_s ); 54 | } 55 | 56 | private: 57 | double m_x[dim]; 58 | double m_x_err[dim]; 59 | double m_t; 60 | gsl_odeiv_step *m_s; 61 | gsl_odeiv_system m_sys; 62 | }; 63 | 64 | 65 | 66 | int main() 67 | { 68 | gsl_wrapper stepper; 69 | 70 | run( stepper , 20000000 / 3 , 1E-10 * 3); 71 | } 72 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/lorenz.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * lorenz.hpp 3 | * 4 | * Copyright 2009-2012 Karsten Ahnert 5 | * Copyright 2009-2012 Mario Mulansky 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 | typedef boost::array< double , 3 > state_type; 34 | 35 | 36 | inline void lorenz_func( const state_type &x , state_type &dxdt , const double t ) 37 | { 38 | const double sigma = 10.0; 39 | const double R = 28.0; 40 | const double b = 8.0 / 3.0; 41 | dxdt[0] = sigma * ( x[1] - x[0] ); 42 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; 43 | dxdt[2] = x[0]*x[1] - b * x[2]; 44 | } 45 | 46 | #endif /* LORENZ_HPP_ */ 47 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/lorenz_gsl.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * lorenz_gsl.hpp 3 | * 4 | * Copyright 2009-2012 Karsten Ahnert 5 | * Copyright 2009-2012 Mario Mulansky 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_GSL_HPP_ 14 | #define LORENZ_GSL_HPP_ 15 | 16 | #include 17 | 18 | int lorenz_gsl( const double t , const double y[] , double f[] , void *params) 19 | { 20 | const double sigma = 10.0; 21 | const double R = 28.0; 22 | const double b = 8.0 / 3.0; 23 | 24 | f[0] = sigma * ( y[1] - y[0] ); 25 | f[1] = R * y[0] - y[1] - y[0] * y[2]; 26 | f[2] = y[0]*y[1] - b * y[2]; 27 | return GSL_SUCCESS; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/odeint_rk4_lorenz_range.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * odeint_rk4_lorenz_def_alg.cpp 3 | * 4 | * Copyright 2009-2012 Karsten Ahnert 5 | * Copyright 2009-2012 Mario Mulansky 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 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include "rk_performance_test_case.hpp" 19 | 20 | #include "lorenz.hpp" 21 | 22 | typedef boost::array< double , 3 > state_type; 23 | typedef boost::numeric::odeint::runge_kutta4_classic< state_type > rk4_odeint_type; 24 | 25 | 26 | class odeint_wrapper 27 | { 28 | public: 29 | void reset_init_cond() 30 | { 31 | m_x[0] = 10.0 * rand() / RAND_MAX; 32 | m_x[1] = 10.0 * rand() / RAND_MAX; 33 | m_x[2] = 10.0 * rand() / RAND_MAX; 34 | m_t = 0.0; 35 | } 36 | 37 | inline void do_step( const double dt ) 38 | { 39 | m_stepper.do_step( lorenz() , m_x , m_t , dt ); 40 | //m_t += dt; 41 | } 42 | 43 | double state( const size_t i ) const 44 | { return m_x[i]; } 45 | 46 | private: 47 | state_type m_x; 48 | double m_t; 49 | rk4_odeint_type m_stepper; 50 | }; 51 | 52 | 53 | 54 | int main() 55 | { 56 | odeint_wrapper stepper; 57 | 58 | run( stepper ); 59 | } 60 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/odeint_rk4_phase_lattice.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * odeint_rk4_phase_lattice.cpp 3 | * 4 | * Copyright 2009-2012 Karsten Ahnert 5 | * Copyright 2009-2012 Mario Mulansky 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 | #include 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "rk_performance_test_case.hpp" 22 | 23 | #include "phase_lattice.hpp" 24 | 25 | const size_t N = 1024; 26 | 27 | typedef boost::array< double , N > state_type; 28 | typedef boost::numeric::odeint::runge_kutta4_classic< state_type , double , state_type , double , boost::numeric::odeint::array_algebra> rk4_odeint_type; 29 | 30 | class odeint_wrapper 31 | { 32 | public: 33 | void reset_init_cond() 34 | { 35 | for( size_t i = 0 ; i () , m_x , m_t , dt ); 43 | //m_t += dt; 44 | } 45 | 46 | double state( const size_t i ) const 47 | { return m_x[i]; } 48 | 49 | private: 50 | state_type m_x; 51 | double m_t; 52 | rk4_odeint_type m_stepper; 53 | }; 54 | 55 | 56 | 57 | int main() 58 | { 59 | srand( 12312354 ); 60 | 61 | odeint_wrapper stepper; 62 | 63 | run( stepper , 10000 , 1E-6 ); 64 | } 65 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/phase_lattice.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009-2012 Karsten Ahnert 3 | * Copyright 2009-2012 Mario Mulansky 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 | #include 11 | 12 | #include 13 | 14 | template< size_t N > 15 | struct phase_lattice 16 | { 17 | typedef double value_type; 18 | typedef boost::array< value_type , N > state_type; 19 | 20 | value_type m_epsilon; 21 | state_type m_omega; 22 | 23 | phase_lattice() : m_epsilon( 6.0/(N*N) ) // should be < 8/N^2 to see phase locking 24 | { 25 | for( size_t i=1 ; i 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | template< size_t N > 25 | struct phase_lattice_mkl 26 | { 27 | typedef double value_type; 28 | typedef boost::array< value_type , N > state_type; 29 | 30 | value_type m_epsilon; 31 | state_type m_omega; 32 | state_type m_tmp; 33 | 34 | phase_lattice_mkl() : m_epsilon( 6.0/(N*N) ) // should be < 8/N^2 to see phase locking 35 | { 36 | for( size_t i=1 ; i 12 | 13 | using namespace std; 14 | 15 | struct rt_algebra 16 | { 17 | template< typename T , size_t dim > 18 | inline static void foreach( boost::array< T , dim > & x_tmp , 19 | const boost::array< T , dim > &x , 20 | //const vector< double > &a , 21 | const double* a , 22 | const boost::array< T , dim > *k_vector , 23 | const double dt , const size_t s ) 24 | { 25 | for( size_t i=0 ; i /boost/test//boost_unit_test_framework 15 | BOOST_ALL_NO_LIB=1 16 | ../../../.. 17 | static 18 | clang: -Wno-unused-variable 19 | 20 | # -D_SCL_SECURE_NO_WARNINGS 21 | ; 22 | 23 | test-suite "odeint" 24 | : 25 | [ run euler_stepper.cpp ] 26 | [ run runge_kutta_concepts.cpp ] 27 | [ run runge_kutta_error_concepts.cpp ] 28 | [ run runge_kutta_controlled_concepts.cpp ] 29 | [ run resizing.cpp ] 30 | [ run default_operations.cpp ] 31 | [ run range_algebra.cpp ] 32 | [ run implicit_euler.cpp ] 33 | [ run fusion_algebra.cpp ] 34 | [ run stepper_with_units.cpp ] 35 | [ run stepper_copying.cpp ] 36 | [ run stepper_with_ranges.cpp ] 37 | [ run rosenbrock4.cpp ] 38 | [ run is_pair.cpp ] 39 | [ run adams_bashforth.cpp ] 40 | [ run adams_moulton.cpp ] 41 | [ run adams_bashforth_moulton.cpp ] 42 | [ run generic_stepper.cpp ] 43 | [ run generic_error_stepper.cpp ] 44 | [ run bulirsch_stoer.cpp ] 45 | [ run integrate_times.cpp ] 46 | [ run integrate.cpp ] 47 | [ run integrate_implicit.cpp ] 48 | [ run generation.cpp ] 49 | [ run trivial_state.cpp ] 50 | [ run is_resizeable.cpp ] 51 | [ run resize.cpp ] 52 | [ run same_size.cpp ] 53 | [ run symplectic_steppers.cpp ] 54 | : valgrind 55 | ; 56 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/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 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_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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/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 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_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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test/numeric/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2010 : Karsten Ahnert, Mario Mulansky 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | # bring in rules for testing 6 | 7 | 8 | import testing ; 9 | 10 | use-project boost : $(BOOST_ROOT) ; 11 | 12 | project 13 | : requirements 14 | /boost/test//boost_unit_test_framework 15 | BOOST_ALL_NO_LIB=1 16 | ../../../.. 17 | static 18 | clang: -Wno-unused-variable 19 | 20 | # -D_SCL_SECURE_NO_WARNINGS 21 | ; 22 | 23 | test-suite "odeint" 24 | : 25 | [ run runge_kutta.cpp ] 26 | [ run symplectic.cpp ] 27 | [ run rosenbrock.cpp ] 28 | : valgrind 29 | ; 30 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/gmp/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2010 : Karsten Ahnert, Mario Mulansky 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | # bring in rules for testing 6 | 7 | import testing ; 8 | use-project boost : $(BOOST_ROOT) ; 9 | 10 | project gmp 11 | : requirements 12 | /boost/test//boost_unit_test_framework 13 | ../../../../.. 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/gsl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2010 : Karsten Ahnert, Mario Mulansky 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | # bring in rules for testing 6 | 7 | import testing ; 8 | use-project boost : $(BOOST_ROOT) ; 9 | 10 | project 11 | : requirements 12 | /boost/test//boost_unit_test_framework 13 | ../../../../.. 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/gsl/check_gsl.cpp: -------------------------------------------------------------------------------- 1 | /* Boost check_gmp.cpp test file 2 | 3 | Copyright 2009 Karsten Ahnert 4 | Copyright 2009 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 | gsl_vector_set( x , 0 , 1.0); 43 | gsl_vector_set( x , 1 , 1.0); 44 | gsl_vector_set( x , 2 , 2.0); 45 | 46 | euler.do_step( lorenz , x , 0.0 , 0.1 ); 47 | 48 | //cout << gsl_vector_get( x , 0 ) << " " << gsl_vector_get( x , 1 ) << " " << gsl_vector_get( x , 2 ) << endl; 49 | 50 | gsl_vector_free( x ); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/mkl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2010 : Karsten Ahnert, Mario Mulansky 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | # bring in rules for testing 6 | 7 | import testing ; 8 | use-project boost : $(BOOST_ROOT) ; 9 | 10 | project 11 | : requirements 12 | /boost/test//boost_unit_test_framework 13 | ../../../../.. 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/mkl/check_mkl.cpp: -------------------------------------------------------------------------------- 1 | /* Boost check_mkl.cpp test file 2 | 3 | Copyright 2009 Karsten Ahnert 4 | Copyright 2009 Mario Mulansky 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 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/mtl4/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Karsten Ahnert and Mario Mulansky. 2 | # Distributed under the Boost Software License, Version 1.0. (See 3 | # accompanying file LICENSE_1_0.txt or copy at 4 | # http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | import testing ; 7 | import boost ; 8 | 9 | boost.use-project ; 10 | 11 | MTL4_INCLUDE = /home/karsten/boost/MTL-4.0.8862-Linux/usr/include ; 12 | 13 | project 14 | : requirements 15 | /boost/test//boost_unit_test_framework 16 | ../../../../.. 17 | $(MTL4_INCLUDE) 18 | BOOST_ALL_NO_LIB=1 19 | static 20 | : 21 | : default-build release 22 | ; 23 | 24 | test-suite "odeint-mtl4" 25 | : 26 | [ run mtl4_resize.cpp ] 27 | : valgrind 28 | ; 29 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/thrust/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2009-2012 Karsten Ahnert 2 | # Copyright 2009-2012 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 | 10 | CUDA_ROOT = /usr/local/cuda 11 | 12 | CC = gcc-4.4 13 | CXX = gcc-4.4 14 | NVCC = $(CUDA_ROOT)/bin/nvcc 15 | 16 | INCLUDES += -I$(BOOST_ROOT) -I$(THRUST_ROOT) -I$(CUDA_ROOT)/include -I../../../../.. 17 | 18 | NVCCFLAGS = -O3 $(INCLUDES) --compiler-bindir=/usr/bin/g++-4.4 19 | 20 | LDLIBS = -lcudart 21 | LDFLAGS = -L$(CUDA_ROOT)/lib64 22 | 23 | %.co : %.cu 24 | $(NVCC) $(NVCCFLAGS) -o $@ -c $< 25 | 26 | 27 | all : check_thrust 28 | 29 | 30 | check_thrust : check_thrust.co 31 | $(CC) -o check_thrust $(LDFLAGS) $(LDLIBS) check_thrust.co 32 | check_thrust.co : check_thrust.cu 33 | 34 | clean : 35 | -rm *~ *.o *.co check_thrust 36 | 37 | -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/test_external/vexcl/Jamfile.v2: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2010 : Karsten Ahnert, Mario Mulansky 2 | # Distributed under the Boost Software License, Version 1.0. 3 | # (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | # bring in rules for testing 6 | 7 | 8 | import testing ; 9 | 10 | use-project boost : $(BOOST_ROOT) ; 11 | VEXCL_INCLUDE = /home/karsten/boost/vexcl ; 12 | CUDA_INCLUDE = /usr/local/cuda/include ; 13 | 14 | 15 | project 16 | : requirements 17 | /boost/test//boost_unit_test_framework 18 | BOOST_ALL_NO_LIB=1 19 | ../../../../.. 20 | $(VEXCL_INCLUDE) 21 | $(CUDA_INCLUDE) 22 | -std=c++0x 23 | ; 24 | 25 | lib OpenCL : : OpenCL shared ; 26 | 27 | test-suite "odeint" 28 | : 29 | [ run lorenz.cpp OpenCL ] 30 | : valgrind 31 | : 32 | : shared: BOOST_TEST_DYN_LINK=1 33 | ; -------------------------------------------------------------------------------- /src/uav_simulator/so3_quadrotor_simulator/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | --------------------------------------------------------------------------------0.0.0 3 |so3_quadrotor_simulator 4 |5 | 6 | quadrotor_simulator 7 | 8 | 9 | 10 |Kartik Mohta 11 |BSD 12 |http://ros.org/wiki/quadrotor_simulator 13 | 14 |catkin 15 | 16 |roscpp 17 |quadrotor_msgs 18 |uav_utils 19 |cmake_utils 20 | 21 |roscpp 22 |quadrotor_msgs 23 |uav_utils 24 |cmake_utils 25 | 26 |