Re: [Rcpp-devel] strange code problem

2012-02-15 Thread Dirk Eddelbuettel
Hi David, I didn't have time to study this in detail but it smells like a tricky issue one which has been discussed here. It has to do with whether -- your argument vector is integer (x <- 1:20 or even x <- 1L:20L) or numeric (seq(1.0, 20.0., by=1.0) -- because you use a NumericVector

Re: [Rcpp-devel] strange code problem

2012-02-15 Thread Steve Lianoglou
Hi David, Interesting problem. You'll find that if you change how you initialize your `res` vector, you will sidestep this problem, eg. from this: NumericVector res(x); to: NumericVector res(A.size()); Why? Because in your original instantiation, as you "save" your results in `res`, y