[Rcpp-devel] Rcpp vector classes vs std::vector for custom class member variables
jon.clayden at gmail.com
Tue Oct 8 13:04:24 CEST 2013
I'm new to Rcpp and this mailing list. I did look for a previous answer to
this question, but it's hard to summarise succinctly so I may have missed
something. Apologies if so.
I'm defining a custom class, an object of which will need to survive across
various calls back and forth between R and C++, so I plan to use the XPtr
class to wrap a pointer. My question is, what are the advantages and
disadvantages of using Rcpp vector classes (vs std::vector) for member
variables? To be more concrete, I mean
Are there garbage collection issues when these live inside an XPtr<Foo>?
Are there speed advantages of std::vector<double> over Rcpp::NumericVector
for general use? Any input would be welcome. Thanks in advance.
Great work on Rcpp, by the way. I've been hearing very good things for
quite some time, but wasn't sure if it was worth dusting off my slightly
rusty C++ for. Suffice to say I think it was. The API is very clean and
returning to the standard R API will be painful...!
All the best,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel