Dear all
I want to use MT as a random number generator in my simulation which is consisted a sensor with a limit memory.
I want to convert the output of RNG of 32 bits to 16 bits. Dose anybody know how can I do it in MT.
Any help would be appreciated.
Thank you for your reply.
Is 16bits also has a uniform distribution?
sorry for these questions :
1) If so, then why normal distribution here and what means?
1 2
std::normal_distribution<double> normal( 100.0, 25.0 ) ;
for( int i = 0 ; i < 10 ; ++i ) std::cout << normal(twister16) << '\n' ;
2) mt19937_16 means generate uniform random number (16 bits)?
3) Is it possible for you to give me a rough idea behind this code?
Thanks
std::uniform_int_distribution<> is a template, parameterised on a standard integer type.
> If so, then why normal distribution here and what means?
The normal normal distribution was put in for testing purposes; to verify that mt19937_16 could be used as a conforming uniform random number generator.
> mt19937_16 means generate uniform random number (16 bits)?
Yes.
> Is it possible for you to give me a rough idea behind this code?