<div dir="ltr">Ok, I'll do exactly this and I'll report if I still encounter this<div>problem in simpler programs. Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 7:39 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 6 May 2013 at 19:03, Matteo Fasiolo wrote:<br>
| Sorry for the silly question, but since I'm using sourceCpp() too I should't<br>
| call <br>
| getRNGstate/putRNGstate, right?<br>
<br>
</div>If you use any of the random number generators provided by R via Rcpp, then<br>
you __MUST__ also instantiate an RNGScope() object (which does this for you).<br>
<br>
We documented this *very* clearly in a number of places in the documentation.<br>
<br>
(And yes, sourceCpp() adds one as a courtesy but you should still add<br>
one. The extra few nanoseconds in execution speed won't matter.)<br>
<br>
You report is otherwise still unreproducible at my end.<br>
<br>
Your program is also complex in that it does a few things.  Try writing<br>
smaller and smaller programs still exhibiting the error at your end.  And do<br>
report back if you find something, or have questions.<br>
<div class="HOEnZb"><div class="h5"><br>
Dirk<br>
<br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div></blockquote></div><br></div>