[Rcpp-devel] passing a bit64 vector to C++ and returning it

David Bellot david.bellot at gmail.com
Wed Jul 12 00:44:16 CEST 2017


Hi,

it looks like I couldn't find a proper solution, even after googling every
where. The question is simple:

I have a bit64 vector of integers (timestamps of financial tick data, you
bet ?) and I want to pass it to a C++ function. The good ol' method is to
convert it to strings, pass it and cast strings back to 64 bits integers in
C++. And vice and versa when I pass my result back. But the size of my
vectors are in the range of millions of items, so the method is just a bit
slow.

Since Rcpp 0.9.8, there is no more support for the LongVector class. Papers
like http://www.sciencedirect.com/science/article/pii/S0098300416307415,
despite very interesting, were not very useful to solve my simple problem,
so I was wondering if there is a better solution ?

reinterpret_cast ?
GenericVector or RawVector ?
Anything so obvious that I just missed it ?

And of course, same questions in the other direction: how to return my
vector back to R and have a bit64 at the end ?

Thanks for your help,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170711/9488dbd2/attachment.html>


More information about the Rcpp-devel mailing list