Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 08:21:32

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/integrate/observer_collection.hpp
0004 
0005  [begin_description]
0006  Collection of observers, which are all called during the evolution of the ODE.
0007  [end_description]
0008 
0009  Copyright 2011-2012 Karsten Ahnert
0010  Copyright 2011-2012 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
0015  */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
0020 
0021 #include <vector>
0022 #include <functional>
0023 
0024 namespace boost {
0025 namespace numeric {
0026 namespace odeint {
0027 
0028 template< class State , class Time >
0029 class observer_collection
0030 {
0031 public:
0032 
0033     typedef std::function< void( const State& , const Time& ) > observer_type;
0034     typedef std::vector< observer_type > collection_type;
0035 
0036     void operator()( const State& x , Time t )
0037     {
0038         for( size_t i=0 ; i<m_observers.size() ; ++i )
0039             m_observers[i]( x , t );
0040     }
0041 
0042     collection_type& observers( void ) { return m_observers; }
0043     const collection_type& observers( void ) const { return m_observers; }
0044 
0045 private:
0046 
0047     collection_type m_observers;
0048 };
0049 
0050 } // namespace odeint
0051 } // namespace numeric
0052 } // namespace boost
0053 
0054 
0055 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED