Re: [Rcpp-devel] Forcing a shallow versus deep copy

2013-07-12 Thread Gabor Grothendieck
On Fri, Jul 12, 2013 at 1:42 AM, Dirk Eddelbuettel wrote: > > On 11 July 2013 at 19:21, Gabor Grothendieck wrote: > | 1. Just to be clear what we have been discussing here is not just how to > | avoid copying but how to avoid copying while using as and wrap > | or approaches that automatically gen

Re: [Rcpp-devel] Forcing a shallow versus deep copy

2013-07-12 Thread Changi Han
I apologize if my emails were badly phrased, or disrespectful. No intention of saying anything was broken, suspicious or wrong. I second Gabor. His described use case matches mine. The outer loop is an optimization routine coming from other libraries. Rcpp is used to speed up the objective, gradie

[Rcpp-devel] Difference between runif and unif_rand?

2013-07-12 Thread Neal Fultz
I've been updating the C in an r package to use Rcpp and started seeing so odd results from a function that samples from a discrete distribution. I think I've narrowed it down to the sugar runif. The two programs below are identical except f_works uses unif_rand and f_broke goes through runif.

Re: [Rcpp-devel] Difference between runif and unif_rand?

2013-07-12 Thread Dirk Eddelbuettel
On 12 July 2013 at 12:28, Neal Fultz wrote: | I've been updating the C in an r package to use Rcpp and started seeing | so odd results from a function that samples from a discrete | distribution. | | I think I've narrowed it down to the sugar runif. The two programs below | are identical except

Re: [Rcpp-devel] Difference between runif and unif_rand?

2013-07-12 Thread Krzysztof Sakrejda
On Fri, Jul 12, 2013 at 8:50 PM, Dirk Eddelbuettel wrote: > > On 12 July 2013 at 12:28, Neal Fultz wrote: > | I've been updating the C in an r package to use Rcpp and started seeing > | so odd results from a function that samples from a discrete > | distribution. For what it's worth, I can't repr

Re: [Rcpp-devel] Difference between runif and unif_rand?

2013-07-12 Thread Neal Fultz
I use the debian packages. Upgrading r-cran-rcpp from testing to unstable seems to have fixed this for me, so good call. On Fri, Jul 12, 2013 at 10:25:17PM -0400, Krzysztof Sakrejda wrote: > On Fri, Jul 12, 2013 at 8:50 PM, Dirk Eddelbuettel wrote: > > > > On 12 July 2013 at 12:28, Neal Fultz w

Re: [Rcpp-devel] Unable to load shared object

2013-07-12 Thread Jules Archer
Krzysztof, Thank you very much for your helpful reply. Along with your suggestions, I was finally able to track down the problem. As it turned out, I was (incorrectly) re-defining PKG_LIBS instead of adding to the already existing  PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` in th

Re: [Rcpp-devel] Difference between runif and unif_rand?

2013-07-12 Thread Dirk Eddelbuettel
On 12 July 2013 at 21:04, Neal Fultz wrote: | I use the debian packages. Upgrading r-cran-rcpp from testing to unstable | seems to have fixed this for me, so good call. It is so easy to install from source so that I usually recommend that. And yes, I am the maintainer of r-cran-rcpp :) I played

Re: [Rcpp-devel] Unable to load shared object

2013-07-12 Thread Dirk Eddelbuettel
On 12 July 2013 at 21:35, Jules Archer wrote: | Krzysztof, | | Thank you very much for your helpful reply. | | Along with your suggestions, I was finally able to track down the problem. As | it turned out, I was (incorrectly) re-defining PKG_LIBS instead of adding to | the already existing | PK