| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
14 struct coupled_ode_observer {
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 const double t) {
37 y_coupled_[n_] = coupled_state;
38 n_++;
39 }
40 };
41
42 }
43
44 }
45
46 #endif
stan
Definition: log_sum_exp.hpp:8
stan::math::coupled_ode_observer::y_coupled_
std::vector< std::vector< double > > & y_coupled_
Definition: coupled_ode_observer.hpp:15
stan::math::coupled_ode_observer::n_
int n_
Definition: coupled_ode_observer.hpp:16
stan::math::coupled_ode_observer
Observer for the coupled states.
Definition: coupled_ode_observer.hpp:14
stan::math::coupled_ode_observer::operator()
void operator()(const std::vector< double > &coupled_state, const double t)
Callback function for Boost's ODE solver to record values.
Definition: coupled_ode_observer.hpp:35
stan::math::coupled_ode_observer::coupled_ode_observer
coupled_ode_observer(std::vector< std::vector< double > > &y_coupled)
Construct a coupled ODE observer from the specified coupled vector.
Definition: coupled_ode_observer.hpp:24

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