@@ -50,10 +50,11 @@ namespace math {
5050 * @return Solution to ODE at times \p ts
5151 */
5252template <typename F, typename T_initial, typename T_t0, typename T_ts,
53- typename ... Args>
54- std::vector<Eigen::Matrix<stan::return_type_t <T_initial, Args...>, Eigen::Dynamic, 1 >>
55- ode_rk45 (const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1 >& y0, double t0,
56- const std::vector<double >& ts, std::ostream* msgs,
53+ typename ... Args>
54+ std::vector<
55+ Eigen::Matrix<stan::return_type_t <T_initial, Args...>, Eigen::Dynamic, 1 >>
56+ ode_rk45 (const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1 >& y0,
57+ double t0, const std::vector<double >& ts, std::ostream* msgs,
5758 const Args&... args) {
5859 double relative_tolerance = 1e-10 ;
5960 double absolute_tolerance = 1e-10 ;
@@ -101,10 +102,11 @@ ode_rk45(const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1>& y0, doub
101102 * @return Solution to ODE at times \p ts
102103 */
103104template <typename F, typename T_initial, typename T_t0, typename T_ts,
104- typename ... Args>
105- std::vector<Eigen::Matrix<stan::return_type_t <T_initial, T_t0, T_ts, Args...>, Eigen::Dynamic, 1 >>
106- ode_rk45_tol (const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1 >& y0_arg,
107- T_t0 t0,
105+ typename ... Args>
106+ std::vector<Eigen::Matrix<stan::return_type_t <T_initial, T_t0, T_ts, Args...>,
107+ Eigen::Dynamic, 1 >>
108+ ode_rk45_tol (const F& f,
109+ const Eigen::Matrix<T_initial, Eigen::Dynamic, 1 >& y0_arg, T_t0 t0,
108110 const std::vector<T_ts>& ts, double relative_tolerance,
109111 double absolute_tolerance, long int max_num_steps,
110112 std::ostream* msgs, const Args&... args) {
@@ -115,10 +117,9 @@ ode_rk45_tol(const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1>& y0_a
115117 using boost::numeric::odeint::vector_space_algebra;
116118
117119 using T_initial_or_t0 = return_type_t <T_initial, T_t0>;
118-
119- Eigen::Matrix<T_initial_or_t0, Eigen::Dynamic, 1 > y0 = y0_arg.unaryExpr ([](const T_initial& val) {
120- return T_initial_or_t0 (val);
121- });
120+
121+ Eigen::Matrix<T_initial_or_t0, Eigen::Dynamic, 1 > y0 = y0_arg.unaryExpr (
122+ [](const T_initial& val) { return T_initial_or_t0 (val); });
122123 const std::vector<double > ts_dbl = value_of (ts);
123124
124125 check_finite (" integrate_ode_rk45" , " initial state" , y0);
@@ -151,7 +152,7 @@ ode_rk45_tol(const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1>& y0_a
151152 using return_t = return_type_t <T_initial, T_t0, T_ts, Args...>;
152153 // creates basic or coupled system by template specializations
153154 coupled_ode_system<F, T_initial_or_t0, Args...> coupled_system (f, y0, msgs,
154- args...);
155+ args...);
155156
156157 // first time in the vector must be time of initial state
157158 std::vector<double > ts_vec (ts.size () + 1 );
@@ -167,7 +168,7 @@ ode_rk45_tol(const F& f, const Eigen::Matrix<T_initial, Eigen::Dynamic, 1>& y0_a
167168 // avoid recording of the initial state which is included by the
168169 // conventions of odeint in the output
169170 auto filtered_observer
170- = [&](const Eigen::VectorXd& coupled_state, double t) -> void {
171+ = [&](const Eigen::VectorXd& coupled_state, double t) -> void {
171172 if (!observer_initial_recorded) {
172173 observer_initial_recorded = true ;
173174 return ;
0 commit comments