Ticket #2753 (closed enhancement: fixed)
[with patch, positive review pending] new "randstate" framework for a global Sage random number seed
| Reported by: | cwitty | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | sage-3.0 |
| Component: | basic arithmetic | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
The attached patch keeps track of the random number seed used on Sage startup, and lets you set a single random number seed, which gets propagated on demand into random number generators for GMP (+ MPFR), Python, NTL, Pari, gp, GAP, and libc (so far).
Also, it moves away from libc's random() in favor of the other generators mentioned above, which are portable across operating systems and architectures; this means that doctest results using random numbers are now reproducible, so I've removed many "# random" from the doctests.
Passes testall on the platforms I have access to (32-bit x86 Linux, 64-bit x86 Linux, and 32-bit x86 OSX).
Attachments
Change History
comment:1 Changed 5 years ago by rlm
- Summary changed from [with patch, needs review] new "randstate" framework for a global Sage random number seed to [with patch, positive review] new "randstate" framework for a global Sage random number seed
Applies cleanly to Sage 2.11. I am taking cwitty's word on doctests- I haven't run any of my own. IMO, this greatly improves the robustness of our doctesting infrastructure.
comment:2 Changed 5 years ago by rlm
- Summary changed from [with patch, positive review] new "randstate" framework for a global Sage random number seed to [with patch, positive review pending] new "randstate" framework for a global Sage random number seed
Patch should be rebased on 3.0.alpha0.
Changed 5 years ago by mabshoff
-
attachment
trac_2753-reject-merges.patch
added
manula merges of the rejected hunks against my 3.0.alpha1 merge tree
