Skip to content

Commit 9831634

Browse files
committed
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)
1 parent 36a15e2 commit 9831634

File tree

4 files changed

+31
-35
lines changed

4 files changed

+31
-35
lines changed

stan/math/prim/functor/ode_rk45.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ode_rk45_tol(const F& f,
164164
size_t time_index = 0;
165165

166166
max_step_checker step_checker(max_num_steps);
167-
167+
168168
// avoid recording of the initial state which is included by the
169169
// conventions of odeint in the output
170170
auto filtered_observer
@@ -173,9 +173,8 @@ ode_rk45_tol(const F& f,
173173
observer_initial_recorded = true;
174174
return;
175175
}
176-
y.emplace_back(ode_store_sensitivities(f, coupled_state, y0,
177-
t0, ts[time_index],
178-
msgs, args...));
176+
y.emplace_back(ode_store_sensitivities(f, coupled_state, y0, t0,
177+
ts[time_index], msgs, args...));
179178
step_checker.reset();
180179
time_index++;
181180
};
@@ -185,13 +184,12 @@ ode_rk45_tol(const F& f,
185184

186185
const double step_size = 0.1;
187186
integrate_times(
188-
make_dense_output(absolute_tolerance, relative_tolerance,
189-
runge_kutta_dopri5<Eigen::VectorXd, double,
190-
Eigen::VectorXd, double,
191-
vector_space_algebra>()),
192-
std::ref(coupled_system), initial_coupled_state,
193-
std::begin(ts_vec), std::end(ts_vec), step_size, filtered_observer,
194-
step_checker);
187+
make_dense_output(
188+
absolute_tolerance, relative_tolerance,
189+
runge_kutta_dopri5<Eigen::VectorXd, double, Eigen::VectorXd, double,
190+
vector_space_algebra>()),
191+
std::ref(coupled_system), initial_coupled_state, std::begin(ts_vec),
192+
std::end(ts_vec), step_size, filtered_observer, step_checker);
195193

196194
return y;
197195
}

stan/math/prim/functor/ode_store_sensitivities.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace math {
1111
/**
1212
* Build output for state of ODE solve from the current coupled_state when
1313
* all arguments are arithmetic.
14-
*
14+
*
1515
* @tparam F Type of ODE right hand side
1616
*
1717
* @param f Right hand side of the ODE
@@ -26,12 +26,10 @@ namespace math {
2626
template <typename F, typename... Args,
2727
typename = require_all_arithmetic_t<scalar_type_t<Args>...>>
2828
Eigen::VectorXd ode_store_sensitivities(const F& f,
29-
const Eigen::VectorXd& coupled_state,
30-
const Eigen::VectorXd& y0,
31-
double t0,
32-
double t,
33-
std::ostream* msgs,
34-
const Args&... args) {
29+
const Eigen::VectorXd& coupled_state,
30+
const Eigen::VectorXd& y0, double t0,
31+
double t, std::ostream* msgs,
32+
const Args&... args) {
3533
return coupled_state.head(y0.size());
3634
}
3735

stan/math/rev/functor/cvodes_integrator.hpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace math {
2727
* @tparam T_t0 Type of scalar of initial time point
2828
* @tparam T_ts Type of time-points where ODE solution is returned
2929
*/
30-
template <int Lmm, typename F, typename T_y0, typename T_t0, typename T_ts, typename... T_Args>
30+
template <int Lmm, typename F, typename T_y0, typename T_t0, typename T_ts,
31+
typename... T_Args>
3132
class cvodes_integrator {
3233
using T_Return = return_type_t<T_y0, T_t0, T_ts, T_Args...>;
3334
using T_y0_t0 = return_type_t<T_y0, T_t0>;
@@ -169,19 +170,20 @@ class cvodes_integrator {
169170
* @param max_num_steps Upper limit on the number of integration steps to
170171
* take between each output (error if exceeded)
171172
* @param[in, out] msgs the print stream for warning messages
172-
* @param args Extra arguments passed unmodified through to ODE right hand side
173-
* function
173+
* @param args Extra arguments passed unmodified through to ODE right hand
174+
* side function
174175
* @return Solution to ODE at times \p ts
175176
* @return a vector of states, each state being a vector of the
176177
* same size as the state variable, corresponding to a time in ts.
177178
*/
178-
cvodes_integrator(const F& f, const Eigen::Matrix<T_y0, Eigen::Dynamic, 1>& y0,
179-
const T_t0& t0, const std::vector<T_ts>& ts,
180-
double relative_tolerance, double absolute_tolerance,
181-
long int max_num_steps,
182-
std::ostream* msgs, const T_Args&... args)
179+
cvodes_integrator(const F& f,
180+
const Eigen::Matrix<T_y0, Eigen::Dynamic, 1>& y0,
181+
const T_t0& t0, const std::vector<T_ts>& ts,
182+
double relative_tolerance, double absolute_tolerance,
183+
long int max_num_steps, std::ostream* msgs,
184+
const T_Args&... args)
183185
: f_(f),
184-
y0_(y0.unaryExpr([](const T_y0& val) { return T_y0_t0(val); })),
186+
y0_(y0.unaryExpr([](const T_y0& val) { return T_y0_t0(val); })),
185187
t0_(t0),
186188
ts_(ts),
187189
args_tuple_(args...),

stan/math/rev/functor/ode_store_sensitivities.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ namespace math {
3030
* @param args Extra arguments passed unmodified through to ODE right hand side
3131
* @return ODE state with scalar type var
3232
*/
33-
template <typename F, typename T_y0_t0, typename T_t0, typename T_t, typename... Args>
34-
Eigen::Matrix<var, Eigen::Dynamic, 1> ode_store_sensitivities(const F& f,
35-
const Eigen::VectorXd& coupled_state,
36-
const Eigen::Matrix<T_y0_t0, Eigen::Dynamic, 1>& y0,
37-
const T_t0& t0,
38-
const T_t& t,
39-
std::ostream* msgs,
40-
const Args&... args) {
33+
template <typename F, typename T_y0_t0, typename T_t0, typename T_t,
34+
typename... Args>
35+
Eigen::Matrix<var, Eigen::Dynamic, 1> ode_store_sensitivities(
36+
const F& f, const Eigen::VectorXd& coupled_state,
37+
const Eigen::Matrix<T_y0_t0, Eigen::Dynamic, 1>& y0, const T_t0& t0,
38+
const T_t& t, std::ostream* msgs, const Args&... args) {
4139
const size_t N = y0.size();
4240
const size_t y0_vars = count_vars(y0);
4341
const size_t args_vars = count_vars(args...);

0 commit comments

Comments
 (0)