?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/odeint.zip
???????
PK 䄟[RV�]� � config.hppnu �[��� /* [auto_generated] boost/numeric/odeint/config.hpp [begin_description] Sets configurations for odeint and used libraries. Should be included before any other odeint library [end_description] Copyright 2011-2012 Mario Mulansky Copyright 2011-2012 Karsten Ahnert Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED //increase macro variable to allow rk78 scheme #ifndef FUSION_MAX_VECTOR_SIZE #define FUSION_MAX_VECTOR_SIZE 15 #endif /* * the following definitions are only required if fusion vectors are used as state types * in the rk78 scheme * they should be defined by the user if required, see e.g. libs/numeric/examples/harmonic_oscillator_units.cpp */ #ifndef BOOST_FUSION_INVOKE_MAX_ARITY #define BOOST_FUSION_INVOKE_MAX_ARITY 15 #endif #ifndef BOOST_RESULT_OF_NUM_ARGS #define BOOST_RESULT_OF_NUM_ARGS 15 #endif #include <boost/config.hpp> #if __cplusplus >= 201103L #define BOOST_NUMERIC_ODEINT_CXX11 1 #endif #endif // BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED PK 䄟[43�� � util/split.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/split.hpp [begin_description] Split abstraction for parallel backends. [end_description] Copyright 2013 Karsten Ahnert Copyright 2013 Mario Mulansky Copyright 2013 Pascal Germroth Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_SPLIT_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_SPLIT_HPP_INCLUDED namespace boost { namespace numeric { namespace odeint { /* * No default implementation of the split operation */ template< class Container1, class Container2 , class Enabler = void > struct split_impl { static void split( const Container1 &from , Container2 &to ); }; template< class Container1 , class Container2 > void split( const Container1 &from , Container2 &to ) { split_impl< Container1 , Container2 >::split( from , to ); } /* * No default implementation of the unsplit operation */ template< class Container1, class Container2 , class Enabler = void > struct unsplit_impl { static void unsplit( const Container1 &from , Container2 &to ); }; template< class Container1 , class Container2 > void unsplit( const Container1 &from , Container2 &to ) { unsplit_impl< Container1 , Container2 >::unsplit( from , to ); } } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED PK 䄟[���� util/resize.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/state_wrapper.hpp [begin_description] State wrapper for the state type in all stepper. The state wrappers are responsible for construction, destruction, copying construction, assignment and resizing. [end_description] Copyright 2011-2013 Karsten Ahnert Copyright 2011 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED #include <boost/range.hpp> #include <boost/utility/enable_if.hpp> #include <boost/fusion/include/is_sequence.hpp> #include <boost/fusion/include/zip_view.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/include/make_fused.hpp> #include <boost/fusion/include/for_each.hpp> #include <boost/numeric/odeint/util/is_resizeable.hpp> namespace boost { namespace numeric { namespace odeint { template< class StateOut , class StateIn , class Enabler = void > struct resize_impl_sfinae { static void resize( StateOut &x1 , const StateIn &x2 ) { x1.resize( boost::size( x2 ) ); } }; // resize function // standard implementation relies on boost.range and resize member function template< class StateOut , class StateIn > struct resize_impl { static void resize( StateOut &x1 , const StateIn &x2 ) { resize_impl_sfinae< StateOut , StateIn >::resize( x1 , x2 ); } }; // do not overload or specialize this function, specialize resize_impl<> instead template< class StateOut , class StateIn > void resize( StateOut &x1 , const StateIn &x2 ) { resize_impl< StateOut , StateIn >::resize( x1 , x2 ); } namespace detail { struct resizer { typedef void result_type; template< class StateOut , class StateIn > void operator()( StateOut &x1 , const StateIn &x2 ) const { resize_op( x1 , x2 , typename is_resizeable< StateOut >::type() ); } template< class StateOut , class StateIn > void resize_op( StateOut &x1 , const StateIn &x2 , boost::true_type ) const { resize( x1 , x2 ); } template< class StateOut , class StateIn > void resize_op( StateOut &/*x1*/ , const StateIn &/*x2*/ , boost::false_type ) const { } }; } // namespace detail /* * specialization for fusion sequences */ template< class FusionSeq > struct resize_impl_sfinae< FusionSeq , FusionSeq , typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSeq >::type >::type > { static void resize( FusionSeq &x1 , const FusionSeq &x2 ) { typedef boost::fusion::vector< FusionSeq& , const FusionSeq& > Sequences; Sequences sequences( x1 , x2 ); boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( detail::resizer() ) ); } }; } } } #endif // BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED PK 䄟[��B# util/split_adaptor.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/split_adaptor.hpp [begin_description] A range adaptor which returns even-sized slices. [end_description] Copyright 2013 Karsten Ahnert Copyright 2013 Mario Mulansky Copyright 2013 Pascal Germroth Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_SPLIT_ADAPTOR_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_SPLIT_ADAPTOR_INCLUDED #include <boost/range/adaptor/argument_fwd.hpp> #include <boost/range/size_type.hpp> #include <boost/range/iterator_range.hpp> #include <algorithm> namespace boost { namespace numeric { namespace odeint { namespace detail { /** \brief Returns the begin and end offset for a sub-range */ inline std::pair<std::size_t, std::size_t> split_offsets( std::size_t total_length, std::size_t index, std::size_t parts ) { BOOST_ASSERT( parts > 0 ); BOOST_ASSERT( index < parts ); const std::size_t slice = total_length / parts, partial = total_length % parts, lo = (std::min)(index, partial), hi = (std::max<std::ptrdiff_t>)(0, index - partial), begin_offset = lo * (slice + 1) + hi * slice, length = slice + (index < partial ? 1 : 0), end_offset = begin_offset + length; return std::make_pair( begin_offset, end_offset ); } /** \brief Return the sub-range `index` from a range which is split into `parts`. * * For example, splitting a range into three about equal-sized sub-ranges: * \code * sub0 = make_split_range(rng, 0, 3); * sub1 = rng | split(1, 3); * sub2 = rng | split(2, 3); * \endcode */ template< class RandomAccessRange > inline iterator_range< typename range_iterator<RandomAccessRange>::type > make_split_range( RandomAccessRange& rng, std::size_t index, std::size_t parts ) { const std::pair<std::size_t, std::size_t> off = split_offsets(boost::size(rng), index, parts); return make_iterator_range( boost::begin(rng) + off.first, boost::begin(rng) + off.second ); } template< class RandomAccessRange > inline iterator_range< typename range_iterator<const RandomAccessRange>::type > make_split_range( const RandomAccessRange& rng, std::size_t index, std::size_t parts ) { const std::pair<std::size_t, std::size_t> off = split_offsets(boost::size(rng), index, parts); return make_iterator_range( boost::begin(rng) + off.first, boost::begin(rng) + off.second ); } struct split { split(std::size_t index, std::size_t parts) : index(index), parts(parts) {} std::size_t index, parts; }; template< class RandomAccessRange > inline iterator_range< typename range_iterator<RandomAccessRange>::type > operator|( RandomAccessRange& rng, const split& f ) { return make_split_range( rng, f.index, f.parts ); } template< class RandomAccessRange > inline iterator_range< typename range_iterator<const RandomAccessRange>::type > operator|( const RandomAccessRange& rng, const split& f ) { return make_split_range( rng, f.index, f.parts ); } } } } } #endif PK 䄟[�١� util/is_pair.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/is_pair.hpp [begin_description] Metafunction to determine if a type is a std::pair<>. [end_description] Copyright 2011 Karsten Ahnert Copyright 2011 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED #include <boost/mpl/bool.hpp> #include <utility> namespace boost { namespace numeric { namespace odeint { template< class T > struct is_pair : public boost::mpl::false_ { }; template< class T1 , class T2 > struct is_pair< std::pair< T1 , T2 > > : public boost::mpl::true_ { }; } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED PK 䄟[=+[n n util/copy.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/copy.hpp [begin_description] Copy abstraction for the usage in the steppers. [end_description] Copyright 2011-2012 Karsten Ahnert Copyright 2011-2012 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED #include <boost/range/algorithm/copy.hpp> #include <boost/utility/enable_if.hpp> #include <boost/numeric/odeint/util/detail/is_range.hpp> namespace boost { namespace numeric { namespace odeint { namespace detail { template< class Container1 , class Container2 > void do_copying( const Container1 &from , Container2 &to , boost::mpl::true_ ) { boost::range::copy( from , boost::begin( to ) ); } template< class Container1 , class Container2 > void do_copying( const Container1 &from , Container2 &to , boost::mpl::false_ ) { to = from; } } // namespace detail /* * Default implementation of the copy operation used the assign operator * gsl_vector must copied differently */ template< class Container1 , class Container2 , class Enabler = void > struct copy_impl_sfinae { static void copy( const Container1 &from , Container2 &to ) { typedef typename boost::numeric::odeint::detail::is_range< Container1 >::type is_range_type; detail::do_copying( from , to , is_range_type() ); } }; template< class Container1, class Container2 > struct copy_impl { static void copy( const Container1 &from , Container2 &to ) { copy_impl_sfinae< Container1 , Container2 >::copy( from , to ); } }; // ToDo: allow also to copy INTO a range, not only from a range! Needs "const Container2 &to" template< class Container1 , class Container2 > void copy( const Container1 &from , Container2 &to ) { copy_impl< Container1 , Container2 >::copy( from , to ); } } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED PK 䄟[4E_$ util/stepper_traits.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/stepper_traits.hpp [begin_description] tba. [end_description] Copyright 2013 Karsten Ahnert Copyright 2013 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED #define BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED #include <boost/numeric/odeint/util/unwrap_reference.hpp> namespace boost { namespace numeric { namespace odeint { namespace traits { template< class Stepper > struct state_type { typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; typedef typename stepper_type::state_type type; }; template< class Stepper > struct time_type { typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; typedef typename stepper_type::time_type type; }; template< class Stepper > struct stepper_category { typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; typedef typename stepper_type::stepper_category type; }; template< class Stepper > struct value_type { typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; typedef typename stepper_type::value_type type; }; } // namespace traits } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED PK 䄟[p�ط� � util/resizer.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/resizer.hpp [begin_description] Implementation of the resizers. [end_description] Copyright 2011-2012 Mario Mulansky Copyright 2011 Karsten Ahnert Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED #include <boost/numeric/odeint/util/is_resizeable.hpp> #include <boost/numeric/odeint/util/same_size.hpp> #include <boost/numeric/odeint/util/resize.hpp> namespace boost { namespace numeric { namespace odeint { template< class ResizeWrappedState , class State > bool adjust_size_by_resizeability( ResizeWrappedState &x , const State &y , boost::true_type ) { if ( !same_size( x.m_v , y ) ) { resize( x.m_v , y ); return true; } else return false; } template< class ResizeWrappedState , class State > bool adjust_size_by_resizeability( ResizeWrappedState & /* x */ , const State & /* y */ , boost::false_type ) { return false; } struct always_resizer { template< class State , class ResizeFunction > bool adjust_size( const State &x , ResizeFunction f ) { return f( x ); } }; struct initially_resizer { bool m_initialized; initially_resizer() : m_initialized( false ) { } template< class State , class ResizeFunction > bool adjust_size( const State &x , ResizeFunction f ) { if( !m_initialized ) { m_initialized = true; return f( x ); } else return false; } }; struct never_resizer { template< class State , class ResizeFunction > bool adjust_size( const State &/*x*/ , ResizeFunction /*f*/ ) { return false; } }; } } } #endif // BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED PK 䄟[��Z?� � util/bind.hppnu �[��� /* * [begin_description] * Boost bind pull the placeholders, _1, _2, ... into global * namespace. This can conflict with the C++03 TR1 and C++11 * std::placeholders. This header provides a workaround for * this problem. * [end_description] * * Copyright 2012 Christoph Koke * Copyright 2012 Karsten Ahnert * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or * copy at http://www.boost.org/LICENSE_1_0.txt) * */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED #include <boost/numeric/odeint/config.hpp> #if BOOST_NUMERIC_ODEINT_CXX11 #include <functional> #else #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/bind.hpp> #endif namespace boost { namespace numeric { namespace odeint { namespace detail { #if BOOST_NUMERIC_ODEINT_CXX11 using ::std::bind; using namespace ::std::placeholders; #else // unnamed namespace to avoid multiple declarations (#138) namespace { using ::boost::bind; boost::arg<1> _1; boost::arg<2> _2; } // using ::boost::bind; // using ::_1; // using ::_2; #endif } } } } /* // the following is the suggested way. Unfortunately it does not work with all compilers. #ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL #include <boost/bind.hpp> #else #include <functional> #endif namespace boost { namespace numeric { namespace odeint { namespace detail { #ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL using ::boost::bind; using ::_1; using ::_2; #else using ::std::bind; using namespace ::std::placeholders; #endif } } } }*/ #endif // BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED PK 䄟[�oť � util/multi_array_adaption.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/multi_array_adaption.hpp [begin_description] tba. [end_description] Copyright 2009-2012 Karsten Ahnert Copyright 2009-2012 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_MULTI_ARRAY_ADAPTION_HPP_DEFINED #define BOOST_NUMERIC_ODEINT_UTIL_MULTI_ARRAY_ADAPTION_HPP_DEFINED #include <boost/numeric/odeint/util/is_resizeable.hpp> #include <boost/numeric/odeint/util/resize.hpp> #include <boost/numeric/odeint/util/same_size.hpp> #include <boost/mpl/and.hpp> #include <boost/mpl/bool.hpp> #include <boost/multi_array.hpp> namespace boost { namespace numeric { namespace odeint { template< typename T > struct is_multi_array { typedef boost::false_type type; const static bool value = type::value; }; template< typename T > struct is_resizeable_multi_array { typedef boost::false_type type; const static bool value = type::value; }; template< typename V , size_t Dim , typename A > struct is_multi_array< boost::multi_array< V , Dim , A > > { typedef boost::true_type type; const static bool value = type::value; }; template< typename V , size_t Dim , typename A > struct is_resizeable_multi_array< boost::multi_array< V , Dim , A > > { typedef boost::true_type type; const static bool value = type::value; }; template< typename T > struct is_resizeable_sfinae< T , typename boost::enable_if< typename is_resizeable_multi_array< T >::type >::type > { typedef boost::true_type type; const static bool value = type::value; }; template< typename T1 , typename T2 > struct same_size_impl_sfinae< T1 , T2 , typename boost::enable_if< typename boost::mpl::and_< is_multi_array< T1 > , is_multi_array< T2 > , boost::mpl::bool_< T1::dimensionality == T2::dimensionality > >::type >::type > { static bool same_size( T1 const &x1 , T2 const &x2 ) { for( size_t i=0 ; i<T1::dimensionality ; ++i ) { if( x1.shape()[i] != x2.shape()[i] ) return false; if( x1.index_bases()[i] != x2.index_bases()[i] ) return false; } return true; } }; template< typename T1 , typename T2 > struct resize_impl_sfinae< T1 , T2 , typename boost::enable_if< typename boost::mpl::and_< is_resizeable_multi_array< T1 > , is_multi_array< T2 > , boost::mpl::bool_< T1::dimensionality == T2::dimensionality > >::type >::type > { static void resize( T1 &x1 , const T2 &x2 ) { boost::array< int , T1::dimensionality > extents; for( size_t i=0 ; i<T1::dimensionality ; ++i ) extents[i] = x2.shape()[i]; x1.resize( extents ); boost::array< int , T1::dimensionality > origins; for( size_t i=0 ; i<T1::dimensionality ; ++i ) origins[i] = x2.index_bases()[i]; x1.reindex( origins ); } }; } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_MULTI_ARRAY_ADAPTION_HPP_DEFINED PK 䄟[b�q util/odeint_error.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/odeint_error.hpp [begin_description] Runtime Exceptions thrown by odeint [end_description] Copyright 2015 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED #include <stdexcept> #include <string> namespace boost { namespace numeric { namespace odeint { /** * \brief Runtime error thrown by odeint */ class odeint_error : public std::runtime_error { public: odeint_error(const std::string &s) : std::runtime_error(s) { } }; /** * \brief Runtime error thrown from integrate routines * * This Error occures when too many iterations are performed in between two * observer calls in the integrate routines. */ class no_progress_error : public odeint_error { public: no_progress_error(const std::string &s) : odeint_error(s) { } }; /** * \brief Runtime error thrown during stepsize adjustment * * This Error occures when too many iterations are performed without finding * an appropriate new step size. This usually indicates non-continuous points * in the ODE. */ class step_adjustment_error : public odeint_error { public: step_adjustment_error(const std::string &s) : odeint_error(s) { } }; } } } #endif // BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED PK 䄟[x�C�� � util/unit_helper.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/unit_helper.hpp [begin_description] Get and set the value of a unit. [end_description] Copyright 2012-2013 Karsten Ahnert Copyright 2012-2013 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED #ifndef __CUDACC__ #include <boost/units/quantity.hpp> #include <boost/units/get_dimension.hpp> #include <boost/units/get_system.hpp> #endif namespace boost { namespace numeric { namespace odeint { namespace detail { template<class T , class Enabler = void > struct get_unit_value_impl { static T value(const T &t) { return t; } typedef T result_type; }; #ifndef __CUDACC__ template<class Unit , class T> struct get_unit_value_impl< boost::units::quantity< Unit , T> > { static T value( const boost::units::quantity< Unit , T> &t ) { return t.value(); } typedef T result_type; }; #endif template<class T , class V , class Enabler = void > struct set_unit_value_impl { static void set_value(T &t , const V &v) { t = v; } }; #ifndef __CUDACC__ template<class Unit , class T , class V> struct set_unit_value_impl<boost::units::quantity<Unit , T> , V> { static void set_value(boost::units::quantity<Unit , T> &t , const V &v) { t = boost::units::quantity<Unit , T>::from_value(v); } }; #endif } // namespace detail template<class T> typename detail::get_unit_value_impl<T>::result_type get_unit_value(const T &t) { return detail::get_unit_value_impl<T>::value(t); } template<class T , class V> void set_unit_value(T &t , const V &v) { return detail::set_unit_value_impl<T , V>::set_value(t , v); } template< class T > struct unit_value_type { typedef T type; }; #ifndef __CUDACC__ template< class Unit , class Y > struct unit_value_type< boost::units::quantity< Unit , Y > > { typedef Y type; }; #endif template< typename Time > struct inverse_time { typedef Time type; }; #ifndef __CUDACC__ template< typename Unit , typename Value > struct inverse_time< boost::units::quantity< Unit , Value > > { typedef boost::units::quantity< Unit , Value > time_type; typedef typename boost::units::get_dimension< time_type >::type dimension; typedef typename boost::units::get_system< time_type >::type system; typedef typename boost::mpl::divides< boost::units::dimensionless_type , dimension >::type inv_dimension; typedef boost::units::unit< inv_dimension , system > inv_unit; typedef boost::units::quantity< inv_unit , Value > type; }; #endif } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED PK 䄟[h� � � util/same_instance.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/same_instance.hpp [begin_description] Basic check if two variables are the same instance [end_description] Copyright 2012 Karsten Ahnert Copyright 2012 Mario Mulansky Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED namespace boost { namespace numeric { namespace odeint { template< class T1 , class T2 , class Enabler=void > struct same_instance_impl { static bool same_instance( const T1& /* x1 */ , const T2& /* x2 */ ) { return false; } }; template< class T > struct same_instance_impl< T , T > { static bool same_instance( const T &x1 , const T &x2 ) { // check pointers return (&x1 == &x2); } }; template< class T1 , class T2 > bool same_instance( const T1 &x1 , const T2 &x2 ) { return same_instance_impl< T1 , T2 >::same_instance( x1 , x2 ); } } // namespace odeint } // namespace numeric } // namespace boost #endif PK 䄟[@ɽ�� � util/detail/less_with_sign.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/detail/less_with_sign.hpp [begin_description] Helper function to compare times taking into account the sign of dt [end_description] Copyright 2012-2015 Mario Mulansky Copyright 2012 Karsten Ahnert Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_LESS_WITH_SIGN_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_LESS_WITH_SIGN_HPP_INCLUDED #include <limits> #include <boost/numeric/odeint/util/unit_helper.hpp> namespace boost { namespace numeric { namespace odeint { namespace detail { /** * return t1 < t2 if dt > 0 and t1 > t2 if dt < 0 with epsilon accuracy */ template< typename T > bool less_with_sign( T t1 , T t2 , T dt ) { if( get_unit_value(dt) > 0 ) //return t1 < t2; return t2-t1 > std::numeric_limits<T>::epsilon(); else //return t1 > t2; return t1-t2 > std::numeric_limits<T>::epsilon(); } /** * return t1 <= t2 if dt > 0 and t1 => t2 if dt < 0 with epsilon accuracy */ template< typename T > bool less_eq_with_sign( T t1 , T t2 , T dt ) { if( get_unit_value(dt) > 0 ) return t1-t2 <= std::numeric_limits<T>::epsilon(); else return t2-t1 <= std::numeric_limits<T>::epsilon(); } template< typename T > T min_abs( T t1 , T t2 ) { BOOST_USING_STD_MIN(); BOOST_USING_STD_MAX(); if( get_unit_value(t1)>0 ) return min BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); else return max BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); } template< typename T > T max_abs( T t1 , T t2 ) { BOOST_USING_STD_MIN(); BOOST_USING_STD_MAX(); if( get_unit_value(t1)>0 ) return max BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); else return min BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); } } } } } #endif PK 䄟[�O�� � util/detail/is_range.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/detail/is_range.hpp [begin_description] is_range implementation. Taken from the boost::range library. [end_description] Copyright 2011-2013 Karsten Ahnert Copyright 2011-2013 Thorsten Ottosen Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif #include <cstddef> #include <boost/range/config.hpp> #include <boost/mpl/has_xxx.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/and.hpp> namespace boost { namespace numeric { namespace odeint { namespace range_detail { BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator) BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator) } namespace detail { template< typename Range > struct is_range : boost::mpl::and_<range_detail::has_iterator<Range>, range_detail::has_const_iterator<Range> > { }; ////////////////////////////////////////////////////////////////////////// // pair ////////////////////////////////////////////////////////////////////////// template< typename iteratorT > struct is_range< std::pair<iteratorT,iteratorT> > : boost::mpl::true_ { }; template< typename iteratorT > struct is_range< const std::pair<iteratorT,iteratorT> > : boost::mpl::true_ { }; ////////////////////////////////////////////////////////////////////////// // array ////////////////////////////////////////////////////////////////////////// template< typename elementT, std::size_t sz > struct is_range< elementT[sz] > : boost::mpl::true_ { }; template< typename elementT, std::size_t sz > struct is_range< const elementT[sz] > : boost::mpl::true_ { }; ////////////////////////////////////////////////////////////////////////// // string ////////////////////////////////////////////////////////////////////////// template<> struct is_range< char* > : boost::mpl::true_ { }; template<> struct is_range< wchar_t* > : boost::mpl::true_ { }; template<> struct is_range< const char* > : boost::mpl::true_ { }; template<> struct is_range< const wchar_t* > : boost::mpl::true_ { }; template<> struct is_range< char* const > : boost::mpl::true_ { }; template<> struct is_range< wchar_t* const > : boost::mpl::true_ { }; template<> struct is_range< const char* const > : boost::mpl::true_ { }; template<> struct is_range< const wchar_t* const > : boost::mpl::true_ { }; } // namespace detail } // namespace odeint } // namespace numeric } // namespace boost #endif // BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED PK 䄟[��I!� � util/n_ary_helper.hppnu �[��� /* [auto_generated] boost/numeric/odeint/util/n_ary_helper.hpp Macros to generate scale_sumN and for_eachN functors. Copyright 2013 Karsten Ahnert Copyright 2013 Mario Mulansky Copyright 2013 Pascal Germroth Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_N_ARY_HELPER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_N_ARY_HELPER_HPP_INCLUDED #include <boost/preprocessor/repetition.hpp> // like BOOST_PP_ENUM_SHIFTED but with a comma in front like _TRAILING #define BOOST_ODEINT_ENUM_TRAILING_SHIFTED_PARAMS(count, param) \ BOOST_PP_COMMA_IF(BOOST_PP_DEC(count)) \ BOOST_PP_ENUM_SHIFTED_PARAMS(count, param) #define BOOST_ODEINT_ENUM_TRAILING_SHIFTED_BINARY_PARAMS(count, p1, p2) \ BOOST_PP_COMMA_IF(BOOST_PP_DEC(count)) \ BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) // like BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(n, p1, p2) but p2 is shifted left. // generate "p1 ## 0 = p2, p1 ## 1 = p3 ## 0, p1 ## 2 = p3 ## 1" #define BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS(count, p1, p2, p3) \ BOOST_PP_ENUM(count, BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS_, (p1, p2, p3)) #define BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS_(z, n, data) \ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, data), n) \ BOOST_PP_IF(n, \ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 2, data), BOOST_PP_DEC(n)), \ BOOST_PP_TUPLE_ELEM(3, 1, data)) // like BOOST_PP_ENUM_BINARY_PARAMS(n, p1, p2) but with statements. // "p1 ## 0 p2 ## 0 ; p1 ## 1 p2 ## 1 ; ..." #define BOOST_ODEINT_ENUM_BINARY_STATEMENTS(count, p1, p2) \ BOOST_PP_REPEAT(count, BOOST_ODEINT_ENUM_BINARY_STATEMENTS_, (p1, p2)) #define BOOST_ODEINT_ENUM_BINARY_STATEMENTS_(z, n, data) \ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, data), n) \ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, data), n) ; // like BOOST_PP_ENUM_BINARY_PARAMS(n, p1, p2) but p2 is in parens. // "p1 ## 0 (p2 ## 0) , p1 ## 1 (p2 ## 1) , ..." #define BOOST_ODEINT_ENUM_UNARY_CALLS(count, p1, p2) \ BOOST_PP_ENUM(count, BOOST_ODEINT_ENUM_UNARY_CALLS_, (p1, p2)) #define BOOST_ODEINT_ENUM_SHIFTED_UNARY_CALLS(count, p1, p2) \ BOOST_PP_ENUM_SHIFTED(count, BOOST_ODEINT_ENUM_UNARY_CALLS_, (p1, p2)) #define BOOST_ODEINT_ENUM_TRAILING_SHIFTED_UNARY_CALLS(count, p1, p2) \ BOOST_PP_COMMA_IF(BOOST_PP_DEC(count)) \ BOOST_PP_ENUM_SHIFTED(count, BOOST_ODEINT_ENUM_UNARY_CALLS_, (p1, p2)) #define BOOST_ODEINT_ENUM_UNARY_CALLS_(z, n, data) \ BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, data), n) \ ( BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, data), n) ) // maximum arity + 1 for scale_sum and for_each #define BOOST_ODEINT_N_ARY_MAX 16 // generate scale_sum1 to scale_sumN, operator body generated by macro(N) #define BOOST_ODEINT_GEN_SCALE_SUM(macro) \ BOOST_PP_REPEAT_FROM_TO(1, BOOST_ODEINT_N_ARY_MAX, BOOST_ODEINT_GEN_SCALE_SUM_, macro) #define BOOST_ODEINT_GEN_SCALE_SUM_(z, n, macro) \ template< BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS(n, class Fac, = double, = Fac) > \ struct BOOST_PP_CAT(scale_sum, n) \ { \ BOOST_ODEINT_ENUM_BINARY_STATEMENTS(n, const Fac, m_alpha) \ \ BOOST_PP_CAT(scale_sum, n) \ ( BOOST_PP_ENUM_BINARY_PARAMS(n, Fac, alpha) ) \ : BOOST_ODEINT_ENUM_UNARY_CALLS(n, m_alpha, alpha) {} \ \ template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), class T) > \ void operator()( T0 &t0 \ BOOST_ODEINT_ENUM_TRAILING_SHIFTED_BINARY_PARAMS(BOOST_PP_INC(n), const T, &t) \ ) const \ { macro(n) } \ typedef void result_type; \ }; // generate for_each1 to for_eachN, body generated by macro(N) #define BOOST_ODEINT_GEN_FOR_EACH(macro) \ BOOST_PP_REPEAT_FROM_TO(1, BOOST_ODEINT_N_ARY_MAX, BOOST_ODEINT_GEN_FOR_EACH_, macro) #define BOOST_ODEINT_GEN_FOR_EACH_(z, n, macro) \ template< BOOST_PP_ENUM_PARAMS(n, class S) , class Op > \ static void for_each##n ( BOOST_PP_ENUM_BINARY_PARAMS(n, S, &s) , Op op ) \ { macro(n) } #endif PK 䄟[� R�&