-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RNG issue #276
Labels
bug
Something isn't working
Comments
Thanks! |
shimat
added a commit
that referenced
this issue
Dec 4, 2016
shimat
added a commit
that referenced
this issue
Feb 17, 2017
shimat
added a commit
that referenced
this issue
Feb 17, 2017
shimat
added a commit
that referenced
this issue
Feb 18, 2017
shimat
added a commit
that referenced
this issue
Feb 19, 2017
shimat
added a commit
that referenced
this issue
Feb 19, 2017
shimat
added a commit
that referenced
this issue
Feb 19, 2017
shimat
added a commit
that referenced
this issue
Feb 19, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 20, 2017
shimat
added a commit
that referenced
this issue
Feb 21, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using VS2013, 64 bit and Nuget release with my opencv_world310.dll
If I do
I get r1 == r2 == r3 == 4
But if I use the c-code, using the same opencv_world310.dll
I get r1 == 4, r2 == 6, r3 == 9
However, randu behaves correctly in C# and C++
More information. The State value of RNG in C# never changes from the seed 1234 while in the C++ code it changes.
So I looked at your code. The issue appears to be, for example, RNG.schar call core_RNG_operator_schar passing a state variable but that is not by reference anywhere. Thus the state never changes. I think if you just put in ref it would work. I don't know very much about OpenCV but there appears maybe an efficiency issue. Each time you do a RNG.uniform etc, you recreate a c++ RNG with that seed. I don't know the cost of that but it could be much more expensive than the Multiply with Carry of a single random generator.
That said, I really don't care about efficiency! Thanks for all your work
The text was updated successfully, but these errors were encountered: