Stan Math Library  2.9.0
reverse mode automatic differentiation
coupled_ode_observer.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUNCTOR_COUPLED_ODE_OBSERVER_HPP
2 #define STAN_MATH_PRIM_ARR_FUNCTOR_COUPLED_ODE_OBSERVER_HPP
3 
4 #include <vector>
5 
6 namespace stan {
7 
8  namespace math {
9 
16  std::vector<std::vector<double> >& y_coupled_;
17  int n_;
18 
25  explicit coupled_ode_observer(std::vector<std::vector<double> >&
26  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 #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–2015, Stan Development Team.