-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added random number generator unit tests (closes #28) #514
Conversation
Adds unit test for random generation for the R:: namespace where Rmath is kept. Added section breaks in C++ code for each distribution
That's nice. Setting the seed 'on both sides' makes sure we didn't spill the milk. |
I'll resync with main branch and then reload this commit. |
Weird, works fine under the local check. I'll look into the failure. I have a funny feeling it is due to the RNG seed generation difference. https://travis-ci.org/RcppCore/Rcpp/builds/146754299#L4243-L4292 |
But Travis 'just' running Ubuntu Linux too. I think we can mod this part of
and look into what the shell script for dump_logs and add to that. |
…seene-Twister" and "Inversion" (the defaults). Switched from = to <- in file.
@coatless and I took this off-line and found that the concatenation of two subvectors, ie |
# Conflicts: # ChangeLog
@eddelbuettel : Modified the test bit to avoid having to Cpp now generates under a R now generates under the vectorized Though, this exercise did reveal something interesting: The concatenation order differs between R & Cpp. I'm still trying to repo this on my end. Might be a bigger bug. |
Not sure it is a bug or a just a, well, hesitating, err, feature. The way you had lined up your expression, these were actually not yet evaluated. So we are racing against both concatenation and whether evaluation happens a certain way. Could be a tricky corner to play in. |
There is one thing that this now lacks (but which we can add): vectorised, ie sugar, accessors. Ie when you do NumericVector o(5);
for(int i = 0; i < o.size(); i++)
o[i] = R::rnorm(a, b); you are testing the (scalar) accessor from Rmath via the
but that can be added. |
I started to add some more in this new branch via this first commit. |
@eddelbuettel I have no write access on that branch =( |
It's ok -- I'm already done. |
Need to also do sugar testing for p/d/q * functions as well. |
Maybe, maybe not. The the very highest priority but we should keep it in mind. It is really just looping over scalar version. The 'r' variants are equally close but do have the RNG draw business so are potentially more easily breakable. |
Adds unit test for random generation for the R:: namespace where Rmath
is kept.
Added section breaks in C++ code for each distribution