[Rcpp-devel] returning array from C

Steve Jaffe sjaffe at riskspan.com
Tue Jun 11 20:12:55 CEST 2013


On Jun 11, 2013 1:42 PM, Krzysztof Sakrejda [mailto:krzysztof.sakrejda at gmail.com] wrote:
> On Jun 11, 2013 12:33 PM, "Steve Jaffe" <sjaffe at riskspan.com> wrote:
> >
> > The problem with External Pointer is that R will not be able to use it as a numeric vector (sfaik).
> >
> > What I'm looking for -- and perhaps it is impossible -- would be a way to combine the memory semantics of External Pointer with the value semantics of Numeric Vector. Or something along those lines.

> You can get what you want, but you'll have to use XPtr, then on the R side write a reference class and methods which make the object behave like a numeric vector.  No copying necessary.

Thanks.

This did occur to me, and I looked to 'ff' as an example, but haven't dug into it deeply enough to be clear about the details.

Would you know of a simple example of writing a "reference class" that looks to R like a numeric vector?

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130611/072884ab/attachment-0001.html>


More information about the Rcpp-devel mailing list