]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/numeric/odeint/include/boost/numeric/odeint/iterator/integrate/observer_collection.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / numeric / odeint / include / boost / numeric / odeint / iterator / integrate / observer_collection.hpp
CommitLineData
7c673cae
FG
1/*
2 [auto_generated]
3 boost/numeric/odeint/integrate/observer_collection.hpp
4
5 [begin_description]
6 Collection of observers, which are all called during the evolution of the ODE.
7 [end_description]
8
9 Copyright 2009-2011 Karsten Ahnert
10 Copyright 2009-2011 Mario Mulansky
11
12 Distributed under the Boost Software License, Version 1.0.
13 (See accompanying file LICENSE_1_0.txt or
14 copy at http://www.boost.org/LICENSE_1_0.txt)
15 */
16
17
18#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
19#define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
20
21#include <vector>
22
23#include <boost/function.hpp>
24
25namespace boost {
26namespace numeric {
27namespace odeint {
28
29template< class State , class Time >
30class observer_collection
31{
32public:
33
34 typedef boost::function< void( const State& , const Time& ) > observer_type;
35 typedef std::vector< observer_type > collection_type;
36
37 void operator()( const State& x , Time t )
38 {
39 for( size_t i=0 ; i<m_observers.size() ; ++i )
40 m_observers[i]( x , t );
41 }
42
43 collection_type& observers( void ) { return m_observers; }
44 const collection_type& observers( void ) const { return m_observers; }
45
46private:
47
48 collection_type m_observers;
49};
50
51} // namespace odeint
52} // namespace numeric
53} // namespace boost
54
55
56#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED