-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Random seed Open3D globally #5247
Conversation
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
b912538
to
bcb0386
Compare
df1d313
to
0cbd4b4
Compare
0cbd4b4
to
c0dd3dd
Compare
f94dcd1
to
6187090
Compare
/* = RANSACConvergenceCriteria()*/ | ||
utility::optional<unsigned int> seed /* = utility::nullopt*/) { | ||
&checkers, | ||
const RANSACConvergenceCriteria &criteria) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep comments indicating default values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks very useful!
Summary
This PR allows all of Open3D's random number generator and random samplers to be globally seeded. If you plan to add a new random number or random sampling feature to Open3D, you should always use one of these helper functions/classes, instead of seeding your own random numbers.
Changes
Usage
Known limitations
std::mt19937
is platform-independent.std::uniform_int_distribution
is not platform-independent.uniform_real_distribution
is not platform-independent.Future PR
uniform_int_distribution
anduniform_real_distribution
, such that everything becomes OS/compiler independent.This change is