Skip to content

Conversation

@ChrisJefferson
Copy link
Contributor

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.

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);
Copy link
Contributor Author

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
Copy link

codecov bot commented Sep 28, 2018

Codecov Report

Merging #2882 into master will decrease coverage by <.01%.
The diff coverage is 63.82%.

@@            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
Impacted Files Coverage Δ
lib/random.gd 100% <100%> (ø) ⬆️
src/intfuncs.c 90.27% <54.38%> (-6.54%) ⬇️
lib/random.gi 87.19% <77.77%> (-1.7%) ⬇️
hpcgap/lib/hpc/stdtasks.g 71.57% <0%> (-0.21%) ⬇️
src/stats.c 95.27% <0%> (-0.2%) ⬇️
lib/read3.g 100% <0%> (ø) ⬆️
lib/read1.g 99.27% <0%> (ø) ⬆️
src/objset.c 84.71% <0%> (+0.22%) ⬆️

**
** 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)
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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 ChrisJefferson added the do not merge PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results) label Sep 28, 2018
@fingolfin
Copy link
Member

@ChrisJefferson did you resolve the copyright / licensing issues? If not, is there any point in keeping this PR open?

@ChrisJefferson
Copy link
Contributor Author

I never had any response. I will keep the branch privately just in case I ever get a reply.

@ChrisJefferson ChrisJefferson deleted the random-pcg32 branch July 1, 2019 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants