thk686 / odeintr

An R package for integrating differential equations in C++
18 stars 2 forks source link

Which math functions are actually accessible in the C++ code? #9

Open stouffer opened 4 months ago

stouffer commented 4 months ago

I'm struggling a bit to figure out precisely which math operations are and are not available for us in the C++ code that defines a model. It seems like it's just whatever is in the usual math.h. But given that Rcpp is also being used, is might there be a way to expand the toolbox a bit and include things like Rmath.h too? This would seem to be a big boon based on the additional operations that can be found therein: https://teuder.github.io/rcpp4everyone_en/300_Rmath.html

thk686 commented 4 months ago

All of the R C-functions should be available in Rcpp. Its been awhile so I don't recall the syntax. Something like R::rnorm(...) or Rf_rnorm(...).

stouffer commented 4 months ago

You're absolutely right. Thanks!