Re: [Rcpp-devel] questions Rcpp

2018-09-14 Thread Mounia ZAOUCHE
Thank you very much for your answers. Actually, it is really helpful. Best, Mounia De: "edd" À: "Qiang Kou" Cc: "mounia zaouche" , "rcpp-devel" Envoyé: Jeudi 13 Septembre 2018 22:55:58 Objet: Re: [Rcpp-devel] questions Rcpp On 13 Septemb

Re: [Rcpp-devel] questions Rcpp

2018-09-13 Thread Dirk Eddelbuettel
On 13 September 2018 at 08:51, Qiang Kou wrote: | Hi, Mounia, | | In Rcpp, using std::vector is preferred. Building on what Qiang said: If your array is a simple double[] then you can switch to std::vector easily as aligning your array with the internal array. (Ditto for most other arrays of ba

Re: [Rcpp-devel] questions Rcpp

2018-09-13 Thread Qiang Kou
Hi, Mounia, In Rcpp, using std::vector is preferred. It is still possible to use pointers, however, I am afraid you need to write your "as" and "wrap" by yourself. You can find how to develop them in our documents. Best, Qiang Kou On Thu, Sep 13, 2018 at 4:15 AM Mounia ZAOUCHE < mounia.zaou...

[Rcpp-devel] questions Rcpp

2018-09-13 Thread Mounia ZAOUCHE
Dear all. I write C++ programs and I'm currently trying to interface them with R. I have two issues : Is it possible to interface a function which has an argument that is a pointer (standing for an array) ? I also wrote a function whose aim is to allocate (and fill) an array of values. I