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
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
>> 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
>> 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
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