-
Notifications
You must be signed in to change notification settings - Fork 175
Add PCG32 random number generator #2882
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
Conversation
This random generator produces very high quality random numbers. It also has the major advantage that it's initialisation and state are both very small and simple, meaning it is very low cost to create many instances of this generator
| fi; | ||
| end); | ||
|
|
||
| InstallMethod(Random, [IsRandomSource, IsInt, IsInt], FALLBACK_GENERATE_RANDOM_INT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seperate this out into a named function, so I can choose to call it to help generate large integers.
Codecov Report
@@ Coverage Diff @@
## master #2882 +/- ##
==========================================
- Coverage 83.66% 83.65% -0.01%
==========================================
Files 681 681
Lines 346558 346651 +93
==========================================
+ Hits 289939 289997 +58
- Misses 56619 56654 +35
|
| ** | ||
| ** The following three functions are under the following original license | ||
| ** *Really* minimal PCG32 code / (c) 2014 M.E. O'Neill / pcg-random.org | ||
| ** Licensed under Apache License 2.0 (NO WARRANTY, etc. see website) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like http://www.pcg-random.org , saw it before. On a technical level, I have no issues with this PR.
However, I note that the Apache License 2.0 is deemed incompatible with GPLv2 by the FSF and others. Of course GAP is licenses under "GPL 2 or later", and indeed, the Apache License 2.0 is compatible with GPLv3. But this change then kinda would make GAP "GPLv3" only "through the backdoor", which seems unfortunate. It'd be different if we changed the license explicitly. But then there are also reasons to dislike GPLv3 compared to GPLv2... sigh
Anyway, of course we could also ignore this. But I am pretty sure there are people (e.g. on Debian) who'd really dislike this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to email the author and see if they would be happy to dual license the code GPL v2. Have marked do not merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any news on this?
|
@ChrisJefferson did you resolve the copyright / licensing issues? If not, is there any point in keeping this PR open? |
|
I never had any response. I will keep the branch privately just in case I ever get a reply. |
This random generator produces very high quality random numbers.
It also has the major advantage that it's initialisation and
state are both very small and simple, meaning it is very low cost
to create many instances of this generator.
I've been using this code in many of my own (non-GAP) projects, and found it works very well. It is extremely small, and I hope to use this in cases like #2878 , to create a quick random source in place, so we don't effect, or are not effected by, the global random source.