[Rcpp-devel] What are RcppExport, BEGIN_RCPP and END_RCPP?

2011-10-24 Thread Slava Razbash
Hello, What are RcppExport, BEGIN_RCPP and END_RCPP? For example: RccpExport SEXP myFunction( SEXP myVar_s) { BEGIN_RCPP END_RCPP } Are they related to extern "C" { } ? Further, suppose that I am writing a function that uses both Rcpp and direct access to the inside the SEXP objects, do I need t

Re: [Rcpp-devel] Initialization through constructor or through assignment?

2011-10-24 Thread Davor Cubranic
On October 21, 2011 01:12:11 PM Douglas Bates wrote: > Perhaps this is an indication that I should read some sections of "C++ > Annotations" again. I am trying to remember the pros and cons of > initializing a class instance in C++ through assignment or through the > copy constructor. I remember

Re: [Rcpp-devel] Picking off a matrix-valued list element inside a class constructor?

2011-10-24 Thread Darren Cook
>> i would advise using this as the ctor of CCC : >> >> CCC(Rcpp::List l) : m( l["m"] ) {} > > Thanks, Romain. Pardon my ignorance, but did you mean that I should use that > declaration literally, or was it merely intended to suggest the approach? This is the preferred way in C++ to initializ

Re: [Rcpp-devel] Picking off a matrix-valued list element inside a class constructor?

2011-10-24 Thread Michael Hannon
>> the seemingly equivalent statement in the body of a class constructor fails >> with a compilation error: >>  >>   includes = ' >>   class CCC{ >>   public: >>     CCC(Rcpp::List l){ >>       m = l["m"]; >>     } >>   [...] >>   private: >>     Rcpp::IntegerMatrix m; >>   } >>   ' > Here you are

Re: [Rcpp-devel] Picking off a matrix-valued list element inside a class constructor?

2011-10-24 Thread Michael Hannon
Thanks, Darren.  That worked well. -- Mike > >From: Darren Cook >To: rcpp-de...@r-forge.wu-wien.ac.at >Sent: Sunday, October 23, 2011 1:20 AM >Subject: Re: [Rcpp-devel] Picking off a matrix-valued list element inside a >class constructor? > >>        Rcpp::Int