mercredi 18 février 2015

How to create the same random numbers on different computers with Armadillo?

I am using the Armadillo c++ library, that allows high-perfomance computation of matrices and vectors. This library has built-in functions to populate its objects with random numbers. I use it in the context of a procedurial random generation of an object. The object creation is random, but no matter how often I recreate the object, it remains the same as long as the seed remains the same.


The issue is that, although I can set the seed to a determined value, and thus recreate the same run on my machine... I lose the coherence of the randomness when going to a different computer. I come from the enchanted land of Matlab where I can specify the function used for the generation of pseudo-random numbers. So, this generation can be cross platform if one chooses the function well. But how do I specify the RNG function for Armadillo?


My research has led me to this source documentation, that "detail" the process of random number generation:


http://ift.tt/1G4Wnwl http://ift.tt/17VRdHV


But i have no clue on what to do here: this code is much more advanced than what I can write. I would appreciate any help!


Thank you guys!


Remarks: - I do not care how good the random function used is. I just want a fast cross-platform cross-architecture generator. Deterministic randomness is my goal anyway. - In details, in case it matters, the machines to consider should be intel processors, windows or mac, 32b or 64b. - I have read the several posts mentionning the use of seeds for randomness but it seems that the problem here is the cross-platform context and the fact that the random generator is buried (to my untrained eyes at least) within Armadillo's code.





Aucun commentaire:

Enregistrer un commentaire