Stan Math Library  2.14.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  namespace math {
8 
15  std::vector<std::vector<double> >& y_coupled_;
16  int n_;
17 
24  explicit coupled_ode_observer(std::vector<std::vector<double> >&
25  y_coupled)
26  : y_coupled_(y_coupled), n_(0) {
27  }
28 
35  void operator()(const std::vector<double>& coupled_state,
36  double t) {
37  y_coupled_[n_] = coupled_state;
38  n_++;
39  }
40  };
41 
42  }
43 
44 }
45 
46 #endif
std::vector< std::vector< double > > & y_coupled_
Observer for the coupled states.
coupled_ode_observer(std::vector< std::vector< double > > &y_coupled)
Construct a coupled ODE observer from the specified coupled vector.
void operator()(const std::vector< double > &coupled_state, double t)
Callback function for Boost&#39;s ODE solver to record values.

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