Code Monkey home page Code Monkey logo

odeint-v2's Introduction

Build Status

odeint is a highly flexible library for solving ordinary differential equations.

odeint-v2's People

Contributors

alankelly avatar arash-codedev avatar astrodroid avatar bjodah avatar danieljames avatar ddemidov avatar ds283 avatar gregordecillia avatar headmyshoulder avatar kylelutz avatar mariomulansky avatar mmlanger avatar slayoo avatar thecount2a avatar thk686 avatar wschreyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

odeint-v2's Issues

integrate_const and integrate_n_steps

I'm still not happy with the current implementation of integrate_const. It uses integrate_n_steps by calculating the number of steps from (end-start)/dt. This involves a cast from time_type to int which might not be possible (multiprecision) and is not nice in general. I think the best way is to just write a detail/integrate_const which does what it should in a straight forward way.

Speeding up the Implicit Solver method

Hi,

I was trying to test odeint for large systems ODE systems. When I tried running extending the stiff equation example (rosenbrock4) with a 100's of equations I got very slow results.

Instead of attempting to optimise the matrix inversion, I wanted to try to use the mtl4 linear solvers instead.

My plan is to create another implicit euler solver that uses one of the mtl4 linear solvers to start with, if that goes well I could extend that at some point.

Is this something that might be useful if I were to push it in the main branch? Or where you perhaps looking into different options?

Odeint and Thrust/Cuda on Visual Studio 2010

Hello.

We are considering incorporating Odeint into our SPH solver which already uses Thrust and CUDA.

However, when we try to compile a minimal .cu file which just includes odeint.hpp, the result is that nvcc triggers an error in
boost/typeof/msvc/typeof_impl.hpp (see belov for the the full error message).

This happens both with Boost 1.46 and 1.48 as well as with Cuda 4.0 and Cuda 4.1RC2

I can successfully use Odeint in regular cl.exe compiled source files in VS2010.

Has anyone else seen this?

Full error message:
boost/typeof/msvc/typeof_impl.hpp(125): error : argument list for template "boost::type_of::msvc_extract_type<ID, T>::id2type_impl [with ID=ID, T=boost::type_of::msvc_extract_type_default_param]" is missing

New stepper type for the Taylor series method.

The Taylor series methods needs an another stepper type. The main difference is that it can adjusts the step size without an trial step. Support for the integrate functions is needed.

Maybe a special stepper type with specialized integrate functions is suitable, such that the other integrate functions must not be made customizable.

Cleanup: bind, unwrap_reference, and config

A small cleanup of recent changes:

  • use a MACRO from Boost.Config in odeint/config.hpp to check if C+11 is used
  • put odeint::detail::bind in the namespace odeint or even use boost::phoenix
  • put odeint::detail::unwrap_reference in namespace odeint, simply for convenience.

a patch to support modified_midpoint with Thrust operations

diff --git a/boost/numeric/odeint/external/thrust/thrust_operations.hpp b/boost/numeric/odeint/external/thrust/thrust_operations.hpp
index be79f17..710657a 100644
--- a/boost/numeric/odeint/external/thrust/thrust_operations.hpp
+++ b/boost/numeric/odeint/external/thrust/thrust_operations.hpp
@@ -46,6 +46,25 @@ struct thrust_operations
         }
     };

+    template< class Fac1 = double , class Fac2 = Fac1 >
+    struct scale_sum_swap2
+    {
+        const Fac1 m_alpha1;
+        const Fac2 m_alpha2;
+
+        scale_sum_swap2( const Fac1 alpha1 , const Fac2 alpha2 )
+        : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { }
+
+        template< class Tuple >
+        __host__ __device__
+        void operator()( Tuple t ) const
+        {
+            typename thrust::tuple_element<0,Tuple>::type tmp = thrust::get<0>(t);
+            thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + m_alpha2 * thrust::get<2>(t);
+            thrust::get<1>(t) = tmp;
+        }
+    };
+
     template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 >
     struct scale_sum3
     {

Documentation: Extend odeint section

The extend odeint section needs to be completed: own steppers and own operations.

For the steppers the Heun solver would be a good example showing the use of the generic Runge-Kutta algorithm. Another example might be the stochastic euler, where the system function also includes the noise.

For the operations the usage of gmp could be interesting.

behavior of integrate_const

the current implementation of integrate_const shows some weaknesses mainly due to the finite precision calculation of the time iteration.
as we now have integrate_n_steps function for all stepper types i propose to implement integrate_const by calling the integrate_n_steps with the following calculation of the the number of steps:

num_of_steps = static_cast< size_t >( floor( (t_end-t_start) / dt ) );

with such an implementation integrate_const will have the following properties:

  • the observer is called at times 0 , dt , 2dt , 3dt , ... , n_dt with t_end-dt < n_dt <= t_end
  • the final state is calculated at time n*dt ( which might be < t_end)

i think this is a reasonable behavior and can be implemented quickly from what is there already. some quick tests showed that floor( (t_end-t_start) / dt ) behaves definitely better than the current time+=dt implementation.

Introduce operations in the controllers

The operations need to be introduced in the controllers. This is necessary since types with arbitrary precision and/or units might be used. Currently, the classical operators +-*/ are used in the controllers.

EDIT: Maybe this is not necessary, the operations work only on dt.

Large error with integrate_times and controlled steppers

I've been using the RKFehlberg for high-accuracy, fast integration. However, I now want to capture the states at some intermediate points, and I'm finding that with integrate_times, the accuracy of the controlled steppers is horrible.

The nominal case:

typedef odeint::controlled_runge_kutta< odeint::runge_kutta_fehlberg78< std::vector<double> > > stepper_RK78;
typedef odeint::controlled_runge_kutta< odeint::runge_kutta_dopri5< std::vector<double> > > stepper_RKDOPRI5;
typedef odeint::runge_kutta4< std::vector<double> > stepper_RK4;

odeint::integrate_adaptive( stepper_RK78( odeint::default_error_checker<double>(1.0E-12, 1.0E-12)), interface, x, t0, tf, 1.0,
                                                  obs );

Final value of first state: 43929.7

Using integrate_times with an RK4 stepper gives relatively accurate results in a reasonable time:

odeint::integrate_times( stepper_RK4(), interface, x, cn.begin(), cn.end(), 0.5, obs );

Final value of first state: 43930.7

However, when I try to invoke integrate_times with RK78 the integrated results are off by an extremely large amount:

odeint::integrate_times( stepper_RK78( odeint::default_error_checker<double>(1.0E-12, 1.0E-12)), interface, x, cn.begin(), cn.end(), 0.5,obs);

Final value of first state: 14037.5

The errors in the other states are off by similar magnitudes. Is this user-error on my part, or is there a fundamental issue with using controlled steppers with integrate_times? The docs seem to indicate that there shouldn't be.

check if negative time steps are working

siehe Mail:

"
Abschließend noch eine kurze Frage: Gibt es eine einfache Möglichkeit, die Integration "rückwärts in der Zeit" zu starten, oder muss ich dafür einen Stepper bemühen oder gar schreiben? Der naive Versuch schlug fehl – es bricht nach einem Schritt ab.

numeric::odeint::integrate( stepper , boost::ref( *this ) , y0 , 0. , -4. , -0.01 , boost::ref( *this ) );
"

Odeint and Cuda/Thrust examples compiling problem

Having just updated my Odeint version on a Linux Ubuntu 12.04 running Cuda 4.2 and gcc/g++ (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)_, I have tried to compile the CUDA/Thrust examples files in odeint-v2/libs/numeric/odeint/examples/thrust using a slightly modified version of the included Makefile:

CUDA_ROOT = /usr/local/cuda
ARCH = sm_20
CC = gcc
CXX = gcc
NVCC = $(CUDA_ROOT)/bin/nvcc

INCLUDES += -I$(BOOST_ROOT) -I$(THRUST_ROOT) -I$(CUDA_ROOT)/include -I../../../../..
NVCCFLAGS = -O3 $(INCLUDES) -arch $(ARCH) --compiler-bindir=/usr/bin/gcc

but unfortunately, I obtained the error messages below which I do not understand. Could any one help me to solve this ?

Thanks a lot for any help.

~/local/odeint-v2/libs/numeric/odeint/examples/thrust$ make all
/usr/local/cuda/bin/nvcc -O3 -I -I -I/usr/local/cuda/include -I../../../../.. -arch sm_20 --compiler-bindir=/usr/bin/gcc -c phase_oscillator_chain.cu -o phase_oscillator_chain.co
../../../../../boost/numeric/odeint/algebra/default_operations.hpp(93): warning: missing return statement at end of non-void function "boost::numeric::odeint::default_operations::scale_sum2<Fac1, Fac2>::operator="

gcc -o phase_oscillator_chain -L/usr/local/cuda/lib64 -lcudart -lgomp phase_oscillator_chain.co
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function std::vector<double, std::allocator >::vector(unsigned long, double const&, std::allocator const&) [clone .isra.177] [clone .constprop.473]: error: undefined reference to 'operator new(unsigned long)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_vector<unsigned long, thrust::device_malloc_allocator >::~device_vector() [clone .constprop.478]: error: undefined reference to '__cxa_allocate_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_vector<unsigned long, thrust::device_malloc_allocator >::~device_vector() [clone .constprop.478]: error: undefined reference to '__cxa_throw'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_vector<unsigned long, thrust::device_malloc_allocator >::~device_vector() [clone .constprop.478]: error: undefined reference to '__cxa_free_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function phase_oscillators::~phase_oscillators() [clone .constprop.474]: error: undefined reference to '__cxa_allocate_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function phase_oscillators::~phase_oscillators() [clone .constprop.474]: error: undefined reference to '__cxa_throw'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function phase_oscillators::~phase_oscillators() [clone .constprop.474]: error: undefined reference to '__cxa_allocate_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function phase_oscillators::~phase_oscillators() [clone .constprop.474]: error: undefined reference to '__cxa_throw'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function phase_oscillators::~phase_oscillators() [clone .constprop.474]: error: undefined reference to '__cxa_free_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function phase_oscillators::~phase_oscillators() [clone .constprop.474]: error: undefined reference to '__cxa_free_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to '__cxa_allocate_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to '_cxa_throw'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const
, std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'std::length_error::length_error(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::~basic_string()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'std::length_error::~length_error()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'typeinfo for std::length_error'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to '__cxa_begin_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to '__cxa_rethrow'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'cxa_free_exception'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::~basic_string()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<unsigned long, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >&) [clone .constprop.493]: error: undefined reference to 'cxa_end_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::~cuda_error_category(): error: undefined reference to 'operator delete(void
)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::system_error_category::~system_error_category(): error: undefined reference to 'operator delete(void
)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::~generic_error_category(): error: undefined reference to 'operator delete(void
)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::error_category::~error_category(): error: undefined reference to 'operator delete(void
)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to 'cxa_guard_acquire'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const
, std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const
, std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to '__cxa_guard_release'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::~basic_string()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::message(int) const: error: undefined reference to '__cxa_guard_abort'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::message(int) const: error: undefined reference to '_cxa_guard_acquire'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const
, std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::basic_string(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::message(int) const: error: undefined reference to '__cxa_guard_release'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::message(int) const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::~basic_string()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::generic_error_category::message(int) const: error: undefined reference to '__cxa_guard_abort'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >::allocate(unsigned long) [clone .part.152]: error: undefined reference to 'std::bad_alloc::~bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >::allocate(unsigned long) [clone .part.152]: error: undefined reference to 'vtable for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::contiguous_storage<unsigned long, thrust::device_malloc_allocator >::allocate(unsigned long) [clone .part.152]: error: undefined reference to 'typeinfo for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >::allocate(unsigned long) [clone .part.179]: error: undefined reference to 'std::bad_alloc::~bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >::allocate(unsigned long) [clone .part.179]: error: undefined reference to 'vtable for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >::allocate(unsigned long) [clone .part.179]: error: undefined reference to 'typeinfo for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::~system_error(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_S_empty_rep_storage'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::~system_error(): error: undefined reference to 'std::runtime_error::~runtime_error()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::~system_error(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_M_destroy(std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::bad_alloc::~bad_alloc(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_S_empty_rep_storage'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::bad_alloc::~bad_alloc(): error: undefined reference to 'std::bad_alloc::~bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::bad_alloc::~bad_alloc(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_M_destroy(std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::~system_error(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_S_empty_rep_storage'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::~system_error(): error: undefined reference to 'std::runtime_error::~runtime_error()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::~system_error(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_M_destroy(std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::bad_alloc::~bad_alloc(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::_Rep::_S_empty_rep_storage'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::bad_alloc::~bad_alloc(): error: undefined reference to 'std::bad_alloc::~bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::bad_alloc::~bad_alloc(): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::Rep::M_destroy(std::allocator const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to 'std::runtime_error::what() const'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::assign(char const
, unsigned long)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::append(char const
, unsigned long)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::append(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to '__cxa_begin_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to 'std::runtime_error::what() const'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to '__cxa_end_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::what() const: error: undefined reference to '__cxa_call_unexpected'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::default_error_condition(int) const: error: undefined reference to '__cxa_guard_acquire'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::default_error_condition(int) const: error: undefined reference to '__cxa_guard_release'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::default_error_condition(int) const: error: undefined reference to '__cxa_guard_acquire'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::detail::cuda_error_category::default_error_condition(int) const: error: undefined reference to '__cxa_guard_release'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::system::system_error::system_error(int, thrust::system::error_category const&): error: undefined reference to 'std::runtime_error::runtime_error(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function main: error: undefined reference to 'std::cout'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function main: error: undefined reference to 'std::cout'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function main: error: undefined reference to 'std::basic_ostream<char, std::char_traits >& std::endl<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function main: error: undefined reference to 'std::cout'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function GLOBAL__sub_I__ZN77_GLOBAL__N__57_tmpxft_00001c78_00000000_9_phase_oscillator_chain_cpp4_ii_main2_1E: error: undefined reference to 'std::ios_base::Init::Init()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function GLOBAL__sub_I__ZN77_GLOBAL__N__57_tmpxft_00001c78_00000000_9_phase_oscillator_chain_cpp4_ii_main2_1E: error: undefined reference to 'std::ios_base::Init::~Init()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_ptr thrust::detail::backend::cuda::malloc<0u>(unsigned long): error: undefined reference to 'std::bad_alloc::what() const'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_ptr thrust::detail::backend::cuda::malloc<0u>(unsigned long): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::assign(char const
)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_ptr thrust::detail::backend::cuda::malloc<0u>(unsigned long): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::append(char const
)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_ptr thrust::detail::backend::cuda::malloc<0u>(unsigned long): error: undefined reference to 'std::basic_string<char, std::char_traits, std::allocator >::append(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::device_ptr thrust::detail::backend::cuda::malloc<0u>(unsigned long): error: undefined reference to 'std::bad_alloc::~bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::backend::cuda::no_throw_free<0u>(thrust::device_ptr): error: undefined reference to '__cxa_begin_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::backend::cuda::no_throw_free<0u>(thrust::device_ptr): error: undefined reference to '__cxa_end_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::backend::cuda::no_throw_free<0u>(thrust::device_ptr): error: undefined reference to '__cxa_call_unexpected'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<__gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > > >(unsigned long, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to 'std::length_error::length_error(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<__gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > > >(unsigned long, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to 'std::length_error::~length_error()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<__gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > > >(unsigned long, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to 'typeinfo for std::length_error'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<__gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > > >(unsigned long, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to '__cxa_begin_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<__gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > > >(unsigned long, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to '__cxa_rethrow'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<__gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > > >(unsigned long, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator > >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to '__cxa_end_catch'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to 'std::length_error::length_error(std::basic_string<char, std::char_traits, std::allocator > const&)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to 'std::length_error::~length_error()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to 'typeinfo for std::length_error'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function void thrust::detail::vector_base<double, thrust::device_malloc_allocator >::allocate_and_copy<thrust::detail::normal_iterator<thrust::device_ptr > >(unsigned long, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::normal_iterator<thrust::device_ptr >, thrust::detail::contiguous_storage<double, thrust::device_malloc_allocator >&): error: undefined reference to '__cxa_rethrow'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function std::ostream_iterator<double, char, std::char_traits > thrust::detail::backend::cuda::copy_cross_spacethrust::detail::normal_iterator<thrust::device_ptr, std::ostream_iterator<double, char, std::char_traits > >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, std::ostream_iterator<double, char, std::char_traits >, thrust::random_access_traversal_tag, thrust::incrementable_traversal_tag): error: undefined reference to 'operator new(unsigned long)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function std::ostream_iterator<double, char, std::char_traits > thrust::detail::backend::cuda::copy_cross_spacethrust::detail::normal_iterator<thrust::device_ptr, std::ostream_iterator<double, char, std::char_traits > >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, std::ostream_iterator<double, char, std::char_traits >, thrust::random_access_traversal_tag, thrust::incrementable_traversal_tag): error: undefined reference to 'std::basic_ostream<char, std::char_traits >& std::basic_ostream<char, std::char_traits >::_M_insert(double)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function std::ostream_iterator<double, char, std::char_traits > thrust::detail::backend::cuda::copy_cross_spacethrust::detail::normal_iterator<thrust::device_ptr, std::ostream_iterator<double, char, std::char_traits > >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, std::ostream_iterator<double, char, std::char_traits >, thrust::random_access_traversal_tag, thrust::incrementable_traversal_tag): error: undefined reference to 'std::basic_ostream<char, std::char_traits >& std::_ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const, long)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function std::ostream_iterator<double, char, std::char_traits > thrust::detail::backend::cuda::copy_cross_spacethrust::detail::normal_iterator<thrust::device_ptr, std::ostream_iterator<double, char, std::char_traits > >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, std::ostream_iterator<double, char, std::char_traits >, thrust::random_access_traversal_tag, thrust::incrementable_traversal_tag): error: undefined reference to 'std::basic_ostream<char, std::char_traits >& std::basic_ostream<char, std::char_traits >::M_insert(double)'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function std::ostream_iterator<double, char, std::char_traits > thrust::detail::backend::cuda::copy_cross_spacethrust::detail::normal_iterator<thrust::device_ptr, std::ostream_iterator<double, char, std::char_traits > >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, std::ostream_iterator<double, char, std::char_traits >, thrust::random_access_traversal_tag, thrust::incrementable_traversal_tag): error: undefined reference to 'std::__throw_bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::normal_iteratorthrust::device_ptr thrust::detail::overlapped_copythrust::detail::normal_iterator<thrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr): error: undefined reference to 'std::bad_alloc::~bad_alloc()'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::normal_iteratorthrust::device_ptr thrust::detail::overlapped_copythrust::detail::normal_iterator<thrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr): error: undefined reference to 'vtable for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::normal_iteratorthrust::device_ptr thrust::detail::overlapped_copythrust::detail::normal_iterator<thrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr): error: undefined reference to 'typeinfo for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::normal_iteratorthrust::device_ptr thrust::detail::overlapped_copythrust::detail::normal_iterator<thrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr >(thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr, thrust::detail::normal_iteratorthrust::device_ptr): error: undefined reference to '__cxa_call_unexpected'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function thrust::detail::vector_base<double, thrust::device_malloc_allocator >::fill_insert(thrust::detail::normal_iteratorthrust::device_ptr, unsigned long, double const&): error: undefined reference to '__cxa_rethrow'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::system_error: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::system_error: error: undefined reference to 'typeinfo for std::runtime_error'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function vtable for thrust::system::error_category: error: undefined reference to '__cxa_pure_virtual'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function vtable for thrust::system::error_category: error: undefined reference to '__cxa_pure_virtual'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::detail::bad_alloc: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::detail::bad_alloc: error: undefined reference to 'typeinfo for std::bad_alloc'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::error_category: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::detail::cuda_error_category: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
phase_oscillator_chain.co:tmpxft_00001c78_00000000-1_phase_oscillator_chain.cudafe1.cpp:function typeinfo for thrust::system::detail::system_error_category: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
phase_oscillator_chain.co(.eh_frame+0x8f3): error: undefined reference to '__gxx_personality_v0'
collect2: ld a retourné 1 code d'état d'exécution
make: *
* [phase_oscillator_chain] Erreur 1

Definition of parameters

Check how parameters are passed, for example

  • time and time step in stepper.do_step
  • parameters to scale_sumX in operations
  • etc...

integrate_const with dense output stepper misses final observer call

Hi,

In integrate/detail/integrate_const.hpp, the dense output integrator misses the observer call at the final timestep. I fixed the problem by handling the end point interpolation explicitly:

for(;;) {
  Time zm = stepper.current_time();

  // Advance interpolated time up to zm:
  while(start_time <= zm) {
    stepper.calc_state(start_time, start_state);
    obs(start_state, start_time);
    start_time += dt;
  }

  // Advance zm up to end_time:
  if(zm + stepper.current_time_step() < end_time) {
    stepper.do_step( system );
    ++ count;
  }

  // Now handle end_time:
  else break;
}

// Step exactly to end_time:
stepper.initialize(stepper.current_state(),
    stepper.current_time(), end_time - stepper.current_time());
stepper.do_step( system );
++count;

// Step interpolated time as close to end_time as possible without
// crossing it:
while(start_time <= end_time) {
  stepper.calc_state(start_time, start_state);
  obs(start_state, start_time);
  start_time += dt;
}

// Finally, interpolate at end_time if we're far enough away:
if(start_time - end_time < dt/2) {
  stepper.calc_state(end_time, start_state);
  obs(start_state, end_time);
}

// Done:
return count;

I tested this with t=[0,1], and dt=1/4 (no roundoff), dt=.1 (final start_time is less than 1 due to roundoff), and dt=.01 (final start_time is more than 1 due to roundoff). Without the last if(...), and if dt is far from a multiple of the time span, the last two timesteps can be separated by nearly 2*dt. For example, for t=[0,1] and dt=.011, the last two timesteps are separated by a difference of .021. That last if(...) reduces the max difference to dt. Without additional knowledge of the Time type (e.g. via std::numeric_limits()), there doesn't seem to be much more we can do to ensure a reasonable separation between the last two timesteps.

Hopefully you find this code useful.

Cheers,
Demian

Problem in integrate_const

integrate_const might have a small bug. The following code does not compile.

#include <iostream>
#include <random>
#include <array>

#include <boost/numeric/odeint.hpp>


struct sys
{
    template< class State >
    void operator()( const State &x , State &dxdt )
    {
        dxdt[0] = -x[0];
    }
};

class stochastic_euler
{
public:

    typedef boost::numeric::odeint::stepper_tag stepper_category;



    template< class System , class State , class Time >
    void do_step( System system , State &x , Time t , Time dt ) const
    {
        State dxdt;
        system.first( x , dxdt );
        for( size_t i=0 ; i<x.size() ; ++i )
            x[i] += dt * dxdt[i] + sqrt( dt ) * system.second();
    }
};

template< class Rng , class Dist >
struct gen
{
    Rng &rng;
    Dist &dist;
    gen( Rng &rng_ , Dist &dist_ ) : rng( rng_ ) , dist( dist_ ) { }
    double operator()( void ) { return dist( rng ); }
};

template< class Rng , class Dist >
gen< Rng , Dist > make_gen( Rng &rng , Dist &dist )
{
    return gen< Rng , Dist >( rng , dist );
}


struct streaming_observer
{
    template< class State >
    void operator()( const State &x , double t ) const
    {
        std::cout << t << "\t" << x[0] << "\n";
    }
};

using namespace std;
using namespace boost::numeric::odeint;

typedef std::array< double , 1 > state_type;

int main( int argc , char **argv )
{

    mt19937 rng;
    normal_distribution<> dist( 0.0 , 1.0 );  


    double dt = 0.1;
    state_type x = {{ 1.0 }};
    streaming_observer obs;
    cout << boost::is_same< streaming_observer , boost::numeric::odeint::null_observer >::value << endl;
    integrate_const( stochastic_euler() , make_pair( sys() , make_gen( rng , dist ) ) , x , 0.0 , 10.0 , dt , obs );

    return 0;
}

check responsibility of is_resizable

is_resizable should be the only method to signal that some container can change its size. I think the usage of is_resizeable in state_wrapper is not needed and should be removed. state_wrapper should take about construction, copying, and destruction.

ODE System exceptions

Hi!
I just found your greate lib and I am just figuring out, if I can use it for my project. I'm doing flow visualization of dataset with a finite domain. The odeint lib could be used to integrate stream / path-lines in this domains. However, since the domains are only finite it will always be possible that a streamline integration leaves the domain. This is easily determined in a FlowField class that samples the field. However, I don't know how to communicate this event to the odeint integrators. I think the best way would be to integrate some kind of exception system to the odeint lib, for example for out of bounds sampling, critical point detection or simply for generic errors related to ODE system evaluation. Would it be hard to implement support for this
in a generic way or is the library not designed to handle this kind of ODE systems?

Greets Janick

Implement initialize Method

All steppers with an internal state must have an initialize Method, initializing this state. The mechanism how the stepper automatically initializes this state must be unique for all steppers.

ambiguous overloads if state_type = deriv_type = time_type

When using the same type as state_type, deriv_type and time_type some try_step version have the same signature leading to ambiguous overloads, e.g. this happens for runge_kutta_cash_karp54 in controlled_runge_kutta.hpp where the try_steps at lines 190 and 207 have identical parameter signatures.
There might be other points in the code where this creates problems.

(Non-critical) Compilation Warnings by VS2008 with /W4

Just a heads-up, compiling odeint with the /W4 option under VS2008 generates some 30 warnings related to unused variables. This generates a lot of chatter compiling from the command line (which I do almost exclusively), but is otherwise harmless.

Thanks!
Demian

multiprecision enabled symplectic stepper

The current high-order symplectic stepper is not suitable for high-precision types as it constructs parameters from double. A symplectic stepper with arguments constructed from integers should be added, i think such a stepper can be found e.g. in R. McLachlan: "ON THE NUMERICAL INTEGRATION OF ORDINARY DIFFERENTIAL EQUATIONS BY SYMMETRIC COMPOSITION METHODS" , 1995

ODEInt headers has `using namespace std` etc

For example boost/odeint/iterator/adaptive_iterator.hpp has a line using namespace std

In general I think we can agree that this is a really really bad practice.

In specific, here is an example that this practice cause compilation error

#include <cmath>
#include <boost/numeric/odeint.hpp>

int main ()
{
    isfinite(0.0);

    return 0;
}

When compiled with icpc -std=c++11 on Ubuntu 12.04, GCC 4.6.3, the following errors happens,

foo.cpp(5): error: more than one instance of overloaded function "isfinite" matches the argument list:
        function "isfinite(double)"
        function "std::isfinite(double)"
        argument types are: (doubleº
...

I think I don't need to explain why this is invalid C++ code.

The reason for the error is quite obvious. In C++11 standard, isfinite is a member of std. However, whether or not this is also available in the global namespace is up to the implementation. In this case, the implementation has it in the global namespace, as part of math.h or C99. Even the implementation does not have it in the global namespace, the user shall be free to define one themselves (even this is hardly useful)

The above code, shall either compiles without any problems, or emit an "isfinite not declared" type error. But not shall be overload resolution problem unless std::isfinite is imported to the global namesapce and it happens to be not the same as the global one. Here, std::isfinite is defined inside namespace std by libstdc++, while ::isfinite is defined in Intel's version of math.h. Unlike some other math functions, like say erf, the std::erf is simply using ::erf, and thus import it to global namespace does not cause overload problem.

ODEInt is a pretty nice library, I don't know why there are such lines of code which no one shall write in a header file intended for general use.

quadmath adaptive stepper pow abs overloading not working

  #include <complex>
 #include <stdlib.h>
 #include <math.h>

 extern "C" {
 #include <quadmath.h>
 }



#include <boost/array.hpp>


 using namespace std;

  typedef __float128  my_float;
 typedef std::vector<std::complex < my_float > > state_type;

 const my_float zero =strtoflt128 ("0.0", NULL);

  inline __float128 abs(__float128 x){return fabsq(x);}
 inline __float128 pow(__float128 x, __float128 y){return powq(x,y);}
 inline __float128 abs( std::complex< __float128 > x){return    sqrtq(fabsq(x.real())*fabsq(x.real())+fabsq(x.imag())*fabsq(x.imag()));}
 inline std::complex< __float128 > pow( std::complex< __float128> x , __float128 y){
 return complex< __float128 >( pow(abs(x),y)*cosq( y*atanq(x.imag()/x.real())) , pow(abs(x),y)* sinq(  y*atanq(x.imag()/x.real())));}

  #include <iostream>
 #include <iterator>
  #include <utility>
  #include <algorithm>
  #include <cassert>
  #include <boost/range/algorithm.hpp>
 #include <boost/range/adaptor/filtered.hpp>
 #include <boost/range/numeric.hpp>
 #include <boost/numeric/odeint.hpp>
 using namespace boost::numeric::odeint;



      //[ radMod_system_function
       struct radMod
       {
      my_float m_om;
      my_float m_l;

      radMod( my_float om  , my_float l )
       : m_om( om ) , m_l( l ) { }

   void operator()( const state_type &x , state_type &dxdt , my_float r ) const
     {      

      dxdt[0] = x[1];
    dxdt[1] = -(2*(r-1)/(r*(r-2)))*x[1]-((m_om*m_om*r*r/((r-2)*(r-2)))-(m_l*(m_l+1)/(r*(r-2))))*x[0];
     }
     };
     //]





  inline ostream& operator<< (ostream& os, const __float128& f) {

 char* y = new char[1000];
 quadmath_snprintf(y, 1000, "%.30Qg", f) ;
 os.precision(30); 
 os<<y;
 delete[] y;
 return os;
 }




struct streaming_observer
{
std::ostream& m_out;

streaming_observer( std::ostream &out ) : m_out( out ) { }

template < class State >
void operator()( const State &x , my_float t ) const
{

    m_out << t <<", ("<< x[0].real() <<", "<< x[0].imag()<<"I )"<<endl;



}
};




    struct push_back_state_and_time
   {
   std::vector< state_type > & m_states;
   std::vector< my_float >   & m_times;

   push_back_state_and_time( std::vector< state_type > &states , std::vector< my_float > &times )
   : m_states( states ) , m_times( times ) { }

    void operator()( const state_type &x , my_float t )
   {
    m_states.push_back( x );
    m_times.push_back( t );
   }
   };





   int main( int argc , char **argv )
  {


 //[inline overloads really work;
 __float128 x1=8.0; __float128 x2=9.0;__float128 x3=-9.0;
 __float128 x4=pow(x1,x2); 
 __float128 x5=abs(x3); 

  cout<< x1 <<endl;
  cout<< x2 <<endl;
  cout<< x3 <<endl;
  cout<< x4 <<endl;
  cout<< x5 <<endl;
  //]




//[set ICs and parameters of integration
state_type x(2);

my_float re0 = strtoflt128 ("-0.00008944230755601224204687038354994353820468", NULL);
my_float im0 = strtoflt128 ("0.00004472229441850588228136889483397204368247", NULL);
my_float re1 = strtoflt128 ("-4.464175354293244250869336196695966076150E-6 ", NULL);
my_float im1 = strtoflt128 ("-8.950483248390306670770345406051469584488E-6", NULL);

x[0] = complex< my_float >( re0 ,im0 );
x[1] = complex< my_float >( re1 ,im1 );

//[are complex overloads working
__float128 x6=abs(x[0]);
complex< my_float > x7=pow(x[0],1);
cout<<x6<<endl;
cout<<x7.real()<<", "<<x7.imag()<<endl;
//]


const my_float dt =strtoflt128 ("-0.001", NULL);
const my_float start =strtoflt128 ("10000.0", NULL);
const my_float end =strtoflt128 ("9990.0", NULL);
const my_float omega =strtoflt128 ("2.0", NULL);
const my_float ell =strtoflt128 ("1.0", NULL);
//]

//[***************basic RK4 with float128 with streaming***************
//typedef runge_kutta4< state_type , my_float > stepper_type;
//integrate_const( stepper_type() , radMod(omega, ell ) , x , start , end, dt  , streaming_observer(cout) );
//]

//[***************basic RK4 with float128 with pushback***************
//std:: vector<state_type> x_vec;   
//std:: vector<my_float> times;    
//typedef runge_kutta4< state_type , my_float > stepper_type;
//size_t steps=integrate_const( stepper_type() , radMod(omega, ell ) , x , start , end, dt  , push_back_state_and_time( x_vec , times ) );
//for( size_t i=0; i<=steps; i++ )
// {
//  cout << times[i] << '\t' <<" ("<< x_vec[i][0].real() << ", " << x_vec[i][0].imag()<<"I) " << endl;     
// }
//]

//[*************testing iteration of these objects****************************
//std::vector<std::complex < my_float > > myFloatVector;
//std::vector<std::complex < my_float > >::iterator myFloatIterator;    
//myFloatVector.push_back(complex<my_float>(re0,im0));
//myFloatVector.push_back(complex<my_float>(re1,im1));
// myFloatVector.push_back(complex<my_float>(start,end));
//for(myFloatIterator = myFloatVector.begin(); 
//   myFloatIterator != myFloatVector.end();
//   myFloatIterator++)
//  {
// cout<<"( "<<(*myFloatIterator).real()<<" , "<<(*myFloatIterator).imag()<<" I)"<<endl;
//   }
//]

//[*************basic RK4 with accumulator(doesn't work because it can't match accumulate call************
/*
 runge_kutta4< state_type, my_float > stepper;
 my_float res = std::accumulate( make_const_step_iterator_begin( stepper , radMod(omega , ell) , x , start , end , dt ) ,
                          make_const_step_iterator_end( stepper , radMod(omega , ell) , x ) ,
                          zero ,
                          []( my_float sum , const state_type &x ) {
                              return sum + x[0].real(); } );    
 cout << res << endl;
 */

 //]

//[**************adaptive stepper float128*********************************
/*
 my_float abs_err=strtoflt128("1.0E-15", NULL), rel_err=strtoflt128("1.0E-10", NULL);
 my_float  a_x=strtoflt128("1.0", NULL) ,a_dxdt = strtoflt128("1.0", NULL);  
 typedef runge_kutta_dopri5< state_type, my_float > dopri5_type;
 typedef controlled_runge_kutta< dopri5_type > controlled_dopri5_type;
 typedef dense_output_runge_kutta< controlled_dopri5_type > dense_output_dopri5_type;

 dense_output_dopri5_type dopri5( controlled_dopri5_type( default_error_checker< my_float >( abs_err , rel_err , a_x , a_dxdt )  ) );


 std::for_each( make_adaptive_time_iterator_begin(dopri5 , radMod(omega , ell) , x , start , end , dt) ,
          make_adaptive_time_iterator_end(dopri5 , radMod(omega , ell) , x ) , []( const std::pair< state_type&, my_float > &x ) {
                       std::cout << x.second << ", " << x.first[0].real() << "\n"; }
          );         
*/
//]

//[***************Boost::const_step_iterator_accumulate_range(exactly same issues it seems-no matching call)***********
 /*
 runge_kutta4< state_type > stepper;

  my_float res = boost::accumulate( make_const_step_range( stepper , radMod(omega , ell) , x , start , end , dt ) , zero ,
                                  []( my_float sum , const state_type &x ) {
                                      return sum + x[0]; } );
  cout << res << endl;
   */
 //]







return 0;
 }

constants in rosenbrock4 and mclachlan

In the steppers rosenbrock4 and mclachlan some constants are defined from doubles which makes these steppers unusable with high-precision types. If possible, these should be replaced with definitions from integers.

Generic controllers

Finish the implementation of the generic controllers and move them into main trunk.

Bulirsch-Stoer adaptive step size with negative deltaT

I'm using "odeint-v2" pulled from the repo on July 30, 2012, but looking at the current code, the issue appears to remain:

I believe that line 312 of bulirsch_stoer.hpp is not correct for "backward" stepping. In particular, it reads

if( !m_last_step_rejected || (new_h < dt) )

and I believe it should be

if( !m_last_step_rejected ||  boost::numeric::odeint::detail::less_with_sign(new_h, dt, dt) )

As I don't know this algorithm as well as others I have tried (and have worked with negative dt), I don't know if there are other changes that should be made too.

-Christian

Add a Boost-like version macro to version.hpp?

It would be helpful to have a Boost-like version macro defined in version.hpp, especially while odeint is separate from Boost.

My particular use case is to allow automatic detection of the odeint version from a CMake build system that installs development software into versioned directories automatically.

Cheers,
Demian

Check: simplify error_checker

The error_checker iterates over error and rescales it. Afterwards the global error is calculated by applying reduce on the rescaled error. Check if this is necessary or if the reduction might by applied directly on the unscaled error. This might also result in faster code.

Bulirsch Stoer with multiprecision types

In BS code a lot of static cast from value_type to int are present. These cast make problems when used with multiprecision types like

mpreal a;
int b = static_cast< int >( a );

Furthermore, there are lots of constants with appropriate casting to value_type.

integrate_adaptive wrong behaviour

It seems that calling integrate_adaptive with the final time equal to the time-step makes it nonadaptive.
That is, the method is applied for a single time step regardless of the error.

I tried this with both methods:
runge_kutta_cash_karp54
runge_kutta_dopri5

Documentation: Details

The details sections needs to be completed: generation functions, algebras and operations, boost::ref and boost::range.

composite_algebra

As discussed in the emails we should add a composite_algebra that works on tuples (or fusion::vectors) of different state types. A possible definition of such an algebra could look as follows:

typedef tuple< vector<complex> , double > state_type;
typedef composite_algebra< tuple< range_algebra , vector_space_algebra > > algebra;

Runge Kutta Dopri causing build failures with g++ 4.2 on OS X

Commit cd443dd changed the literal constants from floating point to long integer, which is causing build errors on OS X with g++ 4.2

        value_type X1 = static_cast< value_type >( 5 ) * ( static_cast< value_type >( 2558722523 ) - static_cast< value_type >( 31403016 ) * theta ) / static_cast< value_type >( 11282082432 );
        value_type X3 = static_cast< value_type >( 100 ) * ( static_cast< value_type >( 882725551 ) - static_cast< value_type >( 15701508 ) * theta ) / static_cast< value_type >( 32700410799 );
        value_type X4 = static_cast< value_type >( 25 ) * ( static_cast< value_type >( 443332067 ) - static_cast< value_type >( 31403016 ) * theta ) / static_cast< value_type >( 1880347072 ) ;
        value_type X5 = static_cast< value_type >( 32805 ) * ( static_cast< value_type >( 23143187 ) - static_cast< value_type >( 3489224 ) * theta ) / static_cast< value_type >( 199316789632 );
        value_type X6 = static_cast< value_type >( 55 ) * ( static_cast< value_type >( 29972135 ) - static_cast< value_type >( 7076736 ) * theta ) / static_cast< value_type >( 822651844 );
        value_type X7 = static_cast< value_type >( 10 ) * ( static_cast< value_type >( 7414447 ) - static_cast< value_type >( 829305 ) * theta ) / static_cast< value_type >( 29380423 );

Causing the errors:

external/odeint-v2/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp:196: warning: this decimal constant is unsigned only in ISO C90
external/odeint-v2/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp:196: error: integer constant is too large for 'long' type
external/odeint-v2/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp:197: error: integer constant is too large for 'long' type
external/odeint-v2/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp:199: error: integer constant is too large for 'long' type

I didn't seem to be having issues with it previously, so for now I'm going to revert back to the previous commit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.