Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
coupled_ode_observer.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__ODE__COUPLED_ODE_OBSERVER_HPP
2 #define STAN__MATH__ODE__COUPLED_ODE_OBSERVER_HPP
3 
4 #include <vector>
5 
6 namespace stan {
7 
8  namespace math {
9 
16 
17  std::vector<std::vector<double> >& y_coupled_;
18  int n_;
19 
26  coupled_ode_observer(std::vector<std::vector<double> >& y_coupled)
27  : y_coupled_(y_coupled), n_(0) {
28  }
29 
36  void operator()(const std::vector<double>& coupled_state,
37  const double t) {
38  y_coupled_[n_] = coupled_state;
39  n_++;
40  }
41 
42  };
43 
44  }
45 
46 }
47 
48 #endif
std::vector< std::vector< double > > & y_coupled_
Observer for the coupled states.
void operator()(const std::vector< double > &coupled_state, const double t)
Callback function for Boost's ODE solver to record values.
coupled_ode_observer(std::vector< std::vector< double > > &y_coupled)
Construct a coupled ODE observer from the specified coupled vector.

     [ Stan Home Page ] © 2011–2014, Stan Development Team.