Hello,
The approach here is to use a callback to the new function of R, to
mimic the call :
b <- new( B, 0L )
which you can do for example using the Language class:
namespace Rcpp {
template <>
SEXP wrap( const B& object ){
Language call( "new", Symbol( "B" ), object.get_i()
Now, for Rcpp classes to be aware of a custom wrap, you need some
gymnatics, as described in the Rcpp-extending vignette.
You need to include RcppCommon.h first, define you class and declare the
custom wrap, then include Rcpp.h, then define you wrap.
I'm pasting a full pass at it below.
Thanks a
Le 21/04/11 11:01, schattenpfla...@arcor.de a écrit :
Now, for Rcpp classes to be aware of a custom wrap, you need some
gymnatics, as described in the Rcpp-extending vignette.
You need to include RcppCommon.h first, define you class and declare the
custom wrap, then include Rcpp.h, then define yo
Finishing up slides for next week's one-day workshop on Rcpp [1], and I am
still looking for more good / simple examples and illustrations of Rcpp.
Does anybody have any favourites to share? I'd welcome replies both on-list
or off-list.
Thanks, Dirk
[1] http://dirk.eddelbuettel.com/blog/201
Chris,
Please use the rcpp-devel list for question. I am CCing the list now, please
follow up there. You need to subscribe to post.
Otherwise, nice post with all relevant details incl a Makefile, very nice.
On 22 April 2011 at 04:17, chris wrote:
| Hi Dirk,
|
| Thanks for RInside. I hope this