Skip to content

Conversation

Metabolix
Copy link
Contributor

This PR proposes a new function mt_srand_array, as requested in bug 32145. This function will seed the MT19937 PRNG with more than 32 bits, which some people think necessary for statistic calculations. The implementation is compatible with the one provided by the MT authors in their example code.

@tom--
Copy link

tom-- commented Aug 19, 2016

Cool!

Can you add a tests with negative integers in the seed array as well as positive? It doesn't need to be a long seed array since it's just a portability test.

@Metabolix
Copy link
Contributor Author

Modified patch to include negative seed tests.

The new function mt_srand_array is used to seed the MT19937 PRNG
with more than 32 bits. The function takes an array of integers
and seeds the PRNG. The seeding procedure is compatible with
init_by_array() in mt19937ar.c by MT19937 authors.
If an input value cannot be converted to 32-bit integers,
a warning will be generated and the PRNG will not be seeded.
@Metabolix
Copy link
Contributor Author

... and now also fixed that portability. ;)

@cmb69
Copy link
Member

cmb69 commented Sep 7, 2016

Thanks for the PR!

Supporting "init_by_array()" should be done, IMO, but have you considered to pass the array to mt_srand()?

@krakjoe
Copy link
Member

krakjoe commented Jan 3, 2017

@Metabolix can we know the status of this PR please ?

@spinitron
Copy link

Fwiw, I recall the corresponding internals discussion was drawn to a close here.

@krakjoe
Copy link
Member

krakjoe commented Jan 3, 2017

Ok then, since the author seems to agree with the consensus on internals, that this is not the best solution, I'm closing this PR.

Please take this action as encouragement to pursue the solution agreed upon on internals.

@krakjoe krakjoe closed this Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants