Use std::shuffle instead of std::random_shuffle in igl/randperm#1062
Use std::shuffle instead of std::random_shuffle in igl/randperm#1062jdumas merged 6 commits intolibigl:devfrom
Conversation
The reason behind this change is UniformRandomBitGenerator that std::shuffle takes require max() and min() to be accessible in compile-time. Therefore, template specializations for igl::randperm will require max() and min() values as template variables, which is not desirable. Instead, we declare template specializations for pre-defined UniformRandomBitGenerator specified in c++11 standard.
|
Thanks. Well have to wait until dev is passing again. Meanwhile, there are some style issues with this PR. For example if urbg is an input it should be const. |
|
Technically, the random number generator |
|
@alecjacobson Thanks for reviewing. Yes. I guess I'll have to wait until the issue with CGAL is resolved. About the style, I forgot to make |
|
@jdumas True... If std::shuffle takes rvalue reference, may be a good idea to follow it. However, I have a feelling that EDIT : I guess it depends on what kind of interaction we want to get. If we want the urbg to produce different values after the call to EDIT 2: standard rng engines does not have rvalue constructors (i.e. |
|
I guess |
|
Yes, let's not try to be smart and follow the signature of the stdlib function :D |
This pull request addresses #1025 and #1026
Check all that apply (change to
[x])