Hi everybody, my apologies in advance if i missed something obvious in documentation or misinterpreted things. I started experimenting with Rcpp modules and it seems to do in simpler cases exactly what i need. However, I am stuck on something that is probably very common
I am using the class for which constructor has 11 parameters, some of which are pointers to doubles. Strategy s(double *, double *, double *, double *, double *, int, int, int, double, double, double) Pointers point to memory containing matrices that armadillo code inside the class Strategy works works with. According to what i read in rcpp module docs, a class could be defined in rcpp module only if constructor has six or less parameters. So it seems that the only way for me to use the class from R is to write a Rcpp function that would get called from R with a signature RcppExport void helper(SEXP, SEXP, ...., SEXP){ //convert input parameters Strategy s(....); //do whatever needs to be done in Strategy } and call constructor within C++ code and then return to R. Is this the best way to use Rcpp things in my circumstance? Also, if i take this approach, how would I pass pointers to double to a C++ constructor? It seems i need to convert SEXP that i receive from R to double * in Rcpp framework -- it seems that as<>() template wouldn't convert to a pointer. I could use of course .C interface, but i wanted to use Rcpp for a number of C++ classes in a uniform way, regardless of the number of parameters in the constructor.
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel