Add optional --seed
parameter to Rho8Pointer
#420
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to the stochastic nature of the Rho8 algorithm in its current implementation, it is not possible to get the same output two times from Rho8Pointer which could be an issue in research and development as it doesn't allow reproducible results. This PR adds an optional
-seed
parameter for cases where a result must be replicated.It must be noted that I changed the original random number generator
rand::thread_rng()
byStdRng::from_entropy()
in order to make it compatible with the seeded generatorStdRng::seed_from_u64()
. I don't think it will have any impact on the randomness of the original method, but I don't know enough about theses functions to be sure.As, there is currently no check to make sure that a positive integer was provided to
--seed
, the current code will panic if a negative integer is provided.