Alternatively, one could use the code for Brent_fmin() from the stats
library (e.g.
https://github.com/lgautier/R-3-0-branch-alt/blob/master/src/library/stats/src/optimize.c).
I have done this for the rstpm2 library
(https://github.com/mclements/rstpm2/blob/develop/src/c_optim.cpp).
This does use
My two cents worth:
For the microsimulation package, we needed uniform random number streams
and sub-streams at the C++ level, while supporting R's non-uniform
random number distributions[*]. For this, we used the C++ RngStreams
library and provided "double *user_unif_rand ()" for user-defined RNG
This can be done more generally.
Following an earlier suggestion from Romain, we can use boost::tuple from the
BH package - for a row of fixed size with general types. Then we can use a
template to read in the data-frame and work with the set of rows.
Variadic templates would be nice here, rat
By my understanding, Rcpp is better suited to working with data-frames as
columns rather than working with data-frames as a set of rows. However,
occasionally it may be useful to work with the set of rows. How have others
considered this use case?
[As a motivating example based on simulations i