1#ifndef STAN_MATH_REV_FUNCTOR_ODE_BDF_HPP
2#define STAN_MATH_REV_FUNCTOR_ODE_BDF_HPP
49template <
typename F,
typename T_y0,
typename T_t0,
typename T_ts,
50 typename... T_Args, require_eigen_col_vector_t<T_y0>* =
nullptr>
54 const T_t0& t0,
const std::vector<T_ts>& ts,
55 double relative_tolerance,
double absolute_tolerance,
56 long int max_num_steps,
57 std::ostream* msgs,
const T_Args&... args) {
58 const auto& args_ref_tuple = std::make_tuple(
to_ref(args)...);
60 [&](
const auto&... args_refs) {
62 integrator(function_name, f, y0, t0, ts, relative_tolerance,
63 absolute_tolerance, max_num_steps, msgs, args_refs...);
103template <
typename F,
typename T_y0,
typename T_t0,
typename T_ts,
108 const std::vector<T_ts>& ts,
double relative_tolerance,
109 double absolute_tolerance,
110 long int max_num_steps,
111 std::ostream* msgs,
const T_Args&... args) {
113 absolute_tolerance, max_num_steps, msgs, args...);
146template <
typename F,
typename T_y0,
typename T_t0,
typename T_ts,
150ode_bdf(
const F& f,
const T_y0& y0,
const T_t0& t0,
const std::vector<T_ts>& ts,
151 std::ostream* msgs,
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.
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_bdf_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,...
std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > ode_bdf(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,...
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > ode_bdf_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,...
constexpr decltype(auto) apply(F &&f, Tuple &&t, PreArgs &&... pre_args)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...