finmath / finmath-lib

Mathematical Finance Library: Algorithms and methodologies related to mathematical finance.
Apache License 2.0
488 stars 168 forks source link

Added CSRNG functionality. #89

Closed luca-bressan closed 1 year ago

luca-bressan commented 1 year ago

What is this PR for?

Added a new random number gernerator class that wraps SecureRandom. It is meant to help users in squashing bugs related to very rare edge cases where multithreaded operations may alter the correct functioning of normal PRNG.

What type of PR is it?

Improvement

Todos

N/A

What is the related issue?

N/A

How should this be tested?

Two tests pertaining to the desired new features have been added: one tests statistical properties of the RNG and the other is a multithreading stress-test.

Screenshots

N/A

Questions:

Does the licenses files need update?

No.

Are there breaking changes for older versions?

No.

Does the change require additional documentation?

The new functionality has already been documented.

cfries commented 1 year ago

Nice code. Thank you!

cfries commented 1 year ago

I was wondering: maybe it should be convenient to specify a seed without giving the SecureRandom object