-
Notifications
You must be signed in to change notification settings - Fork 160
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
Documentation of random sources #4403
Comments
Actually, I don't understand why I wonder why not instead Regarding your last point, I am not sure we make promises that different seeds lead to different outputs, so one could just use |
Concerning the question why What I wrote down in this issue arose from the experience with implementing a new kind of random sources: |
Thomas and me discussed this orally and we agreed that it's not worth the effort to radically change the interface; instead we'll try to improve the documentation and tweak some minor details; Thomas will submit a PR for that. |
Since the pull request #4438 is now merged, the issue can be closed. |
When trying to provide a new kind of random sources (see oscar-system/GAP.jl/pull/642), I noticed that the documentation of GAP's random sources leaves some open questions.
State
,Reset
, andInit
. It should say that in the case ofReset
andInit
, methods for the two argument versions must be provided, and that the second argument may be an integer or aState
value.In fact, the unary version of
Init
is documented but GAP does not provide any such method. I think the documentation should be adjusted to the code.Init( rs, state )
makes a copy ofstate
. In fact, I would like to state that this is not the case in the implementation mentioned above. That is, the user must copystate
before callingInit( rs, state )
if changingstate
in later callsRandom( rs, ... )
is not wanted. I think the documentation should be adjusted to the code.lib/random.gi
shows thatInit( rs, seed )
orInit( rs, state )
is admissible also ifrs
is an already initialized random source, and then has the same effect asReset
with the same arguments (except of course thatInit
returnsrs
butReset
returns a copy of the oldState
value). I think the documentation should be adjusted to the code.The text was updated successfully, but these errors were encountered: