Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Romain Francois
Le 12/05/10 01:44, Davor Cubranic a écrit : I think x, y, and weights are in my case not necessarily SEXPs, but can be (i.e., some of them are pure Armadillo colvecs, while others are created from a NumericVector without copying its contents). Davor sure, but wrap makes SEXP, when you do _

Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Dirk Eddelbuettel
On 11 May 2010 at 16:41, Davor Cubranic wrote: | No, sadly. I still get a segfault if any of the variables 'x', 'y', or 'weights' below are 'wrap'ped. Now that we've come this far -- do you want to try 0.8.0 will should hit CRAN tomorrow? Early bird versions are at http://dirk.eddelbuettel/co

Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Davor Cubranic
I think x, y, and weights are in my case not necessarily SEXPs, but can be (i.e., some of them are pure Armadillo colvecs, while others are created from a NumericVector without copying its contents). Davor On 2010-05-11, at 1:25 PM, Romain Francois wrote: > > Thanks for letting us know of th

Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Davor Cubranic
No, sadly. I still get a segfault if any of the variables 'x', 'y', or 'weights' below are 'wrap'ped. Davor On 2010-05-11, at 1:30 PM, Dirk Eddelbuettel wrote: > > On 11 May 2010 at 13:17, Davor Cubranic wrote: > | Hmm, once I stopped using 'wrap' and just passed Armadillo objects using > 'N

Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Dirk Eddelbuettel
On 11 May 2010 at 13:17, Davor Cubranic wrote: | Hmm, once I stopped using 'wrap' and just passed Armadillo objects using 'Named', I'm able to run unit tests with no errors. | | I.e., I now use: | | List data = List::create(_["x"] = x, | _["y"] = y); | const Numeric

Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Romain Francois
Thanks for letting us know of the problem ... and the solution Not sure what the problem is. The _["x"] = is intended for implicit calls to wrap, but it should not trouble you if you make them explicit. maybe we did not handle properly the special case where the rhs is already a SEXP. Will

Re: [Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Davor Cubranic
Hmm, once I stopped using 'wrap' and just passed Armadillo objects using 'Named', I'm able to run unit tests with no errors. I.e., I now use: List data = List::create(_["x"] = x, _["y"] = y); const NumericVector out_r = predict_fn(loess_fn(formula_fn("y~x"),

[Rcpp-devel] Using Armadillo objects as arguments in calls to R

2010-05-11 Thread Davor Cubranic
Can anyone tell me about issues I have to look out for when dealing with Rcpp Functions and passing Armadillo objects as arguments? I'm getting "not compatible with INTSXP" and segfault errors when calling the following Rcpp equivalent of R's 'predict(loess(y~x, weights=w, span=span))'. The erro