BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.9k stars 129 forks source link

Make computation deterministic if possible. #70

Open jdumas opened 1 year ago

jdumas commented 1 year ago

I see that geogram started using C++11's random number generator in mesh_reorder, which is good! (Even if you don't like the API :p). However, I am not a fan of using std::random_device to initialize the rng, as this automatically makes the function call non-deterministic. For most geometry processing application it is not needed. If anything, at least it should be an option given to the user.

There are also more complicated algorithms that can be made deterministic for a small extra cost, e.g. CVT computation. I did some changes to geogram in that direction when I was at nTopology. See commit 84c58ff and commit 6be641b for my changes at the time.