Xoshiro-cpp icon indicating copy to clipboard operation
Xoshiro-cpp copied to clipboard

Simplify code

Open denniskb opened this issue 4 years ago • 2 comments

I'm a fond user of xoroshiro myself and a C++ programmer. Thank you for this great work!

There is a lot of common, redundant code between the ~~simulators~~ generators. Have you ever considered writing a generic, templated master class and then defining individual RNGs as parameterizations of it?

using XoroShrio256PlusPlus = XoroShiro<256, 64, variant::pp>;

denniskb avatar Sep 10 '21 10:09 denniskb

Would be happy to do the refactoring if you think it's worthwhile..

denniskb avatar Sep 12 '21 17:09 denniskb

I think making generator classes templatized could bring unnecessary complexity for maintainers and misuse of API. Instead of templatization, identical jump functions can call a common function to remove redundant code. It will reduce LoC by 10~20%. I will try this in the next update.

Reputeless avatar Sep 13 '21 04:09 Reputeless