-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small modification of the constructor in ranvec1.h #6
Comments
It is not efficient to make a thread-local static object. It is more efficient to construct the object in the thread function as explained in the manual (ranvec1_manual.pdf example 2.2). Your BernoulliVecFloat function can have a reference to the ran object as a parameter, or BernoulliVecFloat could be member of a class that inherits from ran. Your solution is OK if the performance is satisfactory. My design does not have initialization in the constructor because there are three different initialization methods, and it may be convenient for the programmer to calculate the seed after constructing the ran object. I can add an extra constructor with a seed parameter in the next version. |
Thank you very much for your reply and sorry for the long wait! |
done |
Hi,
I was forced to make a small addition to the default constructor of the Ranvec1 class. I couldn't use the provided init(int seed,...) ... functions to initialize with the desired seeds because I used it as a static thread_local object. So the seed initialization must happen in this case in the constructor. Is this something that could be changed in your repository and can be of any use in other projects?
thanks
small addition to the default constructor (ranvec1.h beginning at line 290) :
The text was updated successfully, but these errors were encountered: