-
Notifications
You must be signed in to change notification settings - Fork 5
Add functional variant of threefry #15
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
|
@sunoru any thoughts on having a side effect-free low-level API? |
|
Sorry for replying late! Having such low-level APIs sounds useful. Can you also help add them to other RNGs? |
|
@sunoru I added the other rngs. Currently |
|
Sure I guess we can just also have a version of |
|
I added such |
|
OK! BTW, I think it's OK to export these functions. |
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
+ Coverage 98.57% 98.63% +0.05%
==========================================
Files 7 7
Lines 842 879 +37
==========================================
+ Hits 830 867 +37
Misses 12 12
Help us with your feedback. Take ten seconds to tell us how you rate us. |
|
Looks good to me. Thanks very much! |
In some contexts, mutable structs are problematic (for instance on GPU). This adds a low-level purely functional way to use threefry.
If there is interest in this, I will add functional variants of the other rngs as well.
I can also add a convenience function for functional counter increment if desired.