[Rcpp-devel] What's the most efficient way to convert a NumericVector to an array of doubles
anwar.ludin at riskcetera.com
Sat Jun 29 12:08:10 CEST 2013
I need to interface some R code with a numerical library containing functions taking as input double*
What is the most efficient way to create an array of doubles from a NumericVector.
I was thinking of something like:
// input is of type Rcpp::NumericVector and passed from R
std::copy(input.begin(), input.end(), std::back_inserter(vec));
double* values = &vec;
// now call function taking a double*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel