lundi 16 mars 2015

is there a way to set independent random streams in c++ using the armadillo c++ library?

I want two independent random streams from the armadillo rand library. it seems like they both use the same global random stream.


I can generate random numbers using the armadillo library via the following:



arma::arma_rng::set_seed(13)
double r = arma::randu()


but I am not sure how to get two random streams. In python I know I can do it by the following using the random library from numpy:



rn = random.RandomState(13)
rn2 = random.RandomState(11)


Now if I run rn.rand() and rn2.rand() they are independent and don't effect one another. Any ideas?


Thanks!


Aucun commentaire:

Enregistrer un commentaire