Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:19:51

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 
0023 #include <boost/function.hpp>
0024 
0025 namespace boost {
0026 namespace numeric {
0027 namespace odeint {
0028 
0029 template< class State , class Time >
0030 class observer_collection
0031 {
0032 public:
0033 
0034     typedef boost::function< void( const State& , const Time& ) > observer_type;
0035     typedef std::vector< observer_type > collection_type;
0036 
0037     void operator()( const State& x , Time t )
0038     {
0039         for( size_t i=0 ; i<m_observers.size() ; ++i )
0040             m_observers[i]( x , t );
0041     }
0042 
0043     collection_type& observers( void ) { return m_observers; }
0044     const collection_type& observers( void ) const { return m_observers; }
0045 
0046 private:
0047 
0048     collection_type m_observers;
0049 };
0050 
0051 } // namespace odeint
0052 } // namespace numeric
0053 } // namespace boost
0054 
0055 
0056 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED