Random number generators discussion

Random number generators | www.agner.org

Repeat sequence of random number
Author: Agner Date: 2007-08-28 10:47
Manojit Roy wrote:
for(int i=0;i<10;i++){
seed = 123456789;
StochasticLib1 sto(seed);
}

does not work.

This should work if you generate random numbers inside the i loop after creating the instance.

If your compiler cannot generate a new instance inside the loop then use sto.RandomInit(seed);

 
thread Repeat sequence of random number new - Manojit Roy - 2007-08-21
last reply Repeat sequence of random number - Agner - 2007-08-28