| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
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
15 struct coupled_ode_observer {
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
stan::math::coupled_ode_observer::y_coupled_
std::vector< std::vector< double > > & y_coupled_
Definition: coupled_ode_observer.hpp:16
stan::math::coupled_ode_observer::n_
int n_
Definition: coupled_ode_observer.hpp:17
stan::math::coupled_ode_observer
Observer for the coupled states.
Definition: coupled_ode_observer.hpp:15
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:36
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:25

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