Skip to content
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

Rethink distribution functions #85

Open
rstub opened this issue Apr 27, 2024 · 0 comments
Open

Rethink distribution functions #85

rstub opened this issue Apr 27, 2024 · 0 comments

Comments

@rstub
Copy link
Member

rstub commented Apr 27, 2024

At the moment I am using distribution functions from boost.random and add some template specialization to the 64bit RNGs provided here. This works well in principle, but has some disadvantages:

At the moment I see three possibilities:

  1. Vendor in the distribution functions from boost.random and remove the general behavior in favor of code making use of the richer interface of random_64bit_generator. License wise this is fine according to https://www.gnu.org/licenses/license-list.en.html#boost.
  2. Go for a function interface normal(rng, n, mean, sd) etc., similar to the already functional sample() interface.
  3. Extend random_64bit_generator further with methods normal(mean, sd) etc. In this case it would make sense to move the implementation of these methods into separate *.ipp files included after the class declaration. Due to the large tables for the Ziggurat method, this would increase the RNG objects size quite a bit.

All three approaches would allow implementing the Ziggurat variant from https://github.com/cd-mcfarland/fast_prng and MT2001 for Gamma (c.f. #22).

@rstub rstub changed the title Rehtink distribution functions Rethink distribution functions Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant