set seed for random number generator
1 import mir.ndslice : each; 2 import mir.random.variable: NormalVariable; 3 auto rv = NormalVariable!double(0, 1); 4 setSeed(0); 5 auto a = rv(rng); 6 auto b = rv(rng); 7 assert(a != b); 8 setSeed(0); 9 auto a2 = rv(rng); 10 assert(a == a2);
See Implementation
set seed for random number generator