Changed the integrate interface to use std::array instead of C-style

This commit is contained in:
Yohai Meiron 2020-05-09 23:29:42 -04:00
parent 1eeab159cc
commit b86625ea13
2 changed files with 12 additions and 87 deletions

View file

@ -17,8 +17,7 @@ using Generator = std::default_random_engine;
// Our units are {kiloparsec, solar mass, gigayear}
constexpr double G = 4.498317481097514e-06;
extern "C"
void integrate(const double y0[], const double t_max, const double stride_size, double y[]);
void integrate(const std::array<double,6> y0, const double t_max, const double stride_size, double y[]);
std::string git_version()
{
@ -236,7 +235,7 @@ public:
auto ic = initial_conditions(generator);
double y[12];
integrate(ic.data(), t_max, t_max, y);
integrate(ic, t_max, t_max, y);
if (accept(y+6)) {
std::lock_guard<std::mutex> lock(mtx);