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 <br>
<br> I am using the class for which constructor has 11 parameters, some of which are pointers to doubles.<br><p>Strategy s(double *, double *, double *, double *, double *, int, int, int, double, double, double)</p><p>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</p><p style="margin-left:2em">RcppExport void helper(SEXP, SEXP, ...., SEXP){</p><p style="margin-left:2em">//convert input parameters</p><p style="margin-left:2em"><br>
</p><p style="margin-left:4em">Strategy s(....);</p><p style="margin-left:4em">//do whatever needs to be done in Strategy<br></p><p style="margin-left:2em">}</p><p>and call constructor within
C++ code and then return to R. Is this the best way to use Rcpp things
in my circumstance?</p><p><br></p>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.