I have a member function that I want to generate a lot of Gaussian distributed random numbers, but I don't want to initialize the random number generator on every call to that function, thinking it would be slower. I was thinking I could declare the random number generator in the .h file and initialize it in the constructor, but I am unsure of the syntax to do this, or even if it will work. Also, I am not sure if this is indeed necessary to save computation time. Any help would be appreciated!
Aucun commentaire:
Enregistrer un commentaire