File indexing completed on 2025-01-18 09:42:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED
0020
0021 #include <utility>
0022
0023 namespace boost {
0024 namespace numeric {
0025 namespace odeint {
0026 namespace detail {
0027
0028
0029 template< class Observer >
0030 struct obs_caller {
0031
0032 size_t &m_n;
0033 Observer m_obs;
0034
0035 obs_caller( size_t &m , Observer &obs ) : m_n(m) , m_obs( obs ) {}
0036
0037 template< class State , class Time >
0038 void operator()( std::pair< const State & , const Time & > x )
0039 {
0040 typedef typename odeint::unwrap_reference< Observer >::type observer_type;
0041 observer_type &obs = m_obs;
0042 obs( x.first , x.second );
0043 m_n++;
0044 }
0045 };
0046
0047 template< class Observer , class Time >
0048 struct obs_caller_time {
0049
0050 Time &m_t;
0051 Observer m_obs;
0052
0053 obs_caller_time( Time &t , Observer &obs ) : m_t(t) , m_obs( obs ) {}
0054
0055 template< class State >
0056 void operator()( std::pair< const State & , const Time & > x )
0057 {
0058 typedef typename odeint::unwrap_reference< Observer >::type observer_type;
0059 observer_type &obs = m_obs;
0060 obs( x.first , x.second );
0061 m_t = x.second;
0062 }
0063 };
0064
0065 }
0066 }
0067 }
0068 }
0069
0070 #endif