Automatic Differentiation
 
Loading...
Searching...
No Matches
cvodes_utils.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_FUNCTOR_CVODES_UTILS_HPP
2#define STAN_MATH_REV_FUNCTOR_CVODES_UTILS_HPP
3
6#include <cvodes/cvodes.h>
7#include <sstream>
8#include <stdexcept>
9
10namespace stan {
11namespace math {
12
13inline void cvodes_set_options(void* cvodes_mem,
14 // NOLINTNEXTLINE(runtime/int)
15 long int max_num_steps) {
16 // Initialize solver parameters
17 CHECK_CVODES_CALL(CVodeSetMaxNumSteps(cvodes_mem, max_num_steps));
18
19 double init_step = 0;
20 CHECK_CVODES_CALL(CVodeSetInitStep(cvodes_mem, init_step));
21
22 long int max_err_test_fails = 20; // NOLINT(runtime/int)
23 CHECK_CVODES_CALL(CVodeSetMaxErrTestFails(cvodes_mem, max_err_test_fails));
24
25 long int max_conv_fails = 50; // NOLINT(runtime/int)
26 CHECK_CVODES_CALL(CVodeSetMaxConvFails(cvodes_mem, max_conv_fails));
27}
28
29} // namespace math
30} // namespace stan
31#endif
#define CHECK_CVODES_CALL(call)
void cvodes_set_options(void *cvodes_mem, long int max_num_steps)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...