// Code generated by stanc v2.31.0 #include namespace minimalODEExampleExternal_model_namespace { struct odefunc_functor__ { template , stan::is_col_vector, stan::is_vt_not_complex, stan::is_stan_scalar>* = nullptr> Eigen::Matrix, T2__>, -1, 1> operator()(const T0__& t, const T1__& y, const T2__& theta, std::ostream* pstream__) const; }; template , stan::is_vt_not_complex>* = nullptr> Eigen::Matrix odefunc( const double& t, const T1__& y, const double& theta, std::ostream* pstream__ ) { Eigen::Matrix dydt = Eigen::Matrix::Constant(2, 0.0); dydt[0] = y[1].val(); dydt[1] = -theta * y[0].val(); Eigen::Matrix jacobian = Eigen::Matrix::Constant(2, 2, 0.0); jacobian(0,1) = 1.0; jacobian(1,0) = -theta; stan::arena_t y_arena = y; stan::math::make_callback_var(dydt, [y_arena, jacobian](auto& res){ y_arena.adj() += jacobian.transpose() * res.adj(); }); return dydt; } Eigen::Matrix odefunc( const double& t, const Eigen::Matrix& y, const double& theta, std::ostream* pstream__ ) { Eigen::Matrix dydt = Eigen::Matrix::Constant(2, 0.0); dydt[0] = y[1]; dydt[1] = -theta * y[0]; return dydt; } template , stan::is_col_vector, stan::is_vt_not_complex, stan::is_stan_scalar>*> Eigen::Matrix, T2__>, -1, 1> odefunc_functor__::operator()(const T0__& t, const T1__& y, const T2__& theta, std::ostream* pstream__) const { return odefunc(t, y, theta, pstream__); } } //namespace