Mersenne Twister RNG init_by_array
Mostrar comentarios más antiguos
Hi,
Can I init Mersenne Twister with array as a seed? (The C mt19937ar implementation support it: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html)
Thanks
Respuesta aceptada
Más respuestas (1)
Peter Perkins
el 28 de Jun. de 2017
The "array" you are talking about is typically a state vector, right? You can set the generator state:
>> r = RandStream.getGlobalStream
r =
mt19937ar random stream (current global stream)
Seed: 0
NormalTransform: Ziggurat
>> s = r.State;
>> rand(1,5)
ans =
0.09754 0.2785 0.54688 0.95751 0.96489
>> r.State = s;
>> rand(1,5)
ans =
0.09754 0.2785 0.54688 0.95751 0.96489
1 comentario
Noam Mazor
el 28 de Jun. de 2017
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!