May I use MersenneTwister as I want ?
#1
Hi.

I can see you are using a very specific random function, that is not thread-safe, and maybe heavy to load.

I didn't read the whole class, just the comments, and they are frightening.

Question are :
1. may I instanciate one where and when I want ?
2. may I instanciate a static one ?

If this is touchy (aka I cannot instantiate one where I want), I'll suggest to refactor it's usage, for example through something like a std::map<thread,MTRand> that would be accessed statically. What would you think about it ?

Basically : it would not be coder-friendly to have to think twice for getting a random number.

But maybe it's all in my head.

Thanks
Reply
Thanks given by:


Messages In This Thread
May I use MersenneTwister as I want ? - by mgueydan - 07-04-2013, 01:47 AM



Users browsing this thread: 1 Guest(s)