1#ifndef STAN_MATH_REV_FUNCTOR_ODE_ADAMS_HPP
2#define STAN_MATH_REV_FUNCTOR_ODE_ADAMS_HPP
48template <
typename F,
typename T_y0,
typename T_t0,
typename T_ts,
49 typename... T_Args, require_eigen_col_vector_t<T_y0>* =
nullptr>
53 const T_t0& t0,
const std::vector<T_ts>& ts,
54 double relative_tolerance,
double absolute_tolerance,
55 long int max_num_steps,
56 std::ostream* msgs,
const T_Args&... args) {
57 const auto& args_ref_tuple = std::make_tuple(
to_ref(args)...);
59 [&](
const auto&... args_refs) {
61 integrator(function_name, f, y0, t0, ts, relative_tolerance,
62 absolute_tolerance, max_num_steps, msgs, args_refs...);
102template <
typename F,
typename T_y0,
typename T_t0,
typename T_ts,
107 const std::vector<T_ts>& ts,
double relative_tolerance,
108 double absolute_tolerance,
109 long int max_num_steps,
110 std::ostream* msgs,
const T_Args&... args) {
112 absolute_tolerance, max_num_steps, msgs, args...);
145template <
typename F,
typename T_y0,
typename T_t0,
typename T_ts,
150 const std::vector<T_ts>& ts, std::ostream* msgs,
151 const T_Args&... args) {
152 double relative_tolerance = 1
e-10;
153 double absolute_tolerance = 1
e-10;
154 long int max_num_steps = 1e8;
157 absolute_tolerance, max_num_steps, msgs, args...);
Integrator interface for CVODES' ODE solvers (Adams & BDF methods).
require_t< is_eigen_col_vector< std::decay_t< T > > > require_eigen_col_vector_t
Require type satisfies is_eigen_col_vector.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > ode_adams_tol_impl(const char *function_name, const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const T_Args &... args)
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1,...
static constexpr double e()
Return the base of the natural logarithm.
std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > ode_adams_tol(const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const T_Args &... args)
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1,...
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
constexpr decltype(auto) apply(F &&f, Tuple &&t, PreArgs &&... pre_args)
std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > ode_adams(const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, std::ostream *msgs, const T_Args &... args)
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1,...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...