[Rcpp-devel] Data Persistence when using inline

Noah Silverman noahsilverman at ucla.edu
Wed Sep 7 23:46:36 CEST 2011


I'm writing a function using Rcpp through inline.  This function will be a filter on an incoming data stream.  

I need to keep the past several data values so that they are accessible to the function each time it is called.   This is easy to do with a data structure in R (and then passing subsequent structure to the C++ function) but that seems rather slow.  Is there some way to define a persistent object that is accessible to an Inline function using Rcpp?

If the code was in pure C++, it would be trivial to have an object and then just pass a pointer to that object.  I can't figure out how to do the same thing with R+Rcpp+inline.


Noah Silverman
UCLA Department of Statistics
8117 Math Sciences Building #8208
Los Angeles, CA 90095

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110907/0601c6bc/attachment.htm>

More information about the Rcpp-devel mailing list