Skip to content
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

PCG Generator #40

Open
NAThompson opened this issue Jul 3, 2018 · 5 comments
Open

PCG Generator #40

NAThompson opened this issue Jul 3, 2018 · 5 comments

Comments

@NAThompson
Copy link
Contributor

There has been a lot of complaining on the internet recently about how <random> has poor random number generators. I am wondering if there is interest in implementation and addition of the PCG random number generator to boost.random, with an eye towards addition into <random>. The implementation does not look difficult.

http://www.pcg-random.org/download.html

@swatanabe
Copy link
Collaborator

swatanabe commented Jul 4, 2018 via email

@dhardy
Copy link

dhardy commented Jul 3, 2019

FYI, the author's C++ implementation is here (https://github.com/imneme/pcg-cpp), but this includes many RNG variants. For the Rust random library I choose to include only three variants (pcg32, pcg64 and pcg64_fast) which requires much less code and avoids the need for most of the generics.

Worth noting is there is a minor difference between the C and C++ implementations of MCG variants (see here).

@kotika
Copy link
Contributor

kotika commented Jul 5, 2019 via email

@dhardy
Copy link

dhardy commented Jul 5, 2019

And the only item of any substance in your post concerns the period. But you are also incorrect: pcg32 is in fact a 64-bit LCG, and pcg64 is a 128-bit LCG. These are combined with a transition function and only output half the bits at a time, hence the names.

@kotika
Copy link
Contributor

kotika commented Jul 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants