From: Heiko Klein <Heiko.Klein@me...> - 2012-11-29 16:39:03
I've been successfully using SWIG Perl for interfacing my libraries. Now
I'm starting using SWIG R, and this seems to be a bit more complicated.
Does somebody has some examples on how to move R-vectors to C-pointers
and vice versa?
I manage currently to move std::vector to R, and, since the std::vector
are still not completely transpartent as R-vectors, I copy them to a
rvector <- std_vector[1:size]
(I need the 1:size, just using the R-typical [:] does not work.)
I'm also wondering a bit about deletion / GarbageCollection. It is
mentioned under BUGS: Garbage collection of created objects
Does this mean I have to call delete_OBJECT(obj) for all objects created
via C++, e.g. vectors?