CSRT-NTUA / AlgoPlus

AlgoPlus is a C++17 library for complex data structures and algorithms
https://csrt-ntua.github.io/AlgoPlus
Apache License 2.0
159 stars 20 forks source link

Changing the RNG in kmeans.h to platform agnostic. #68

Closed R-Goc closed 2 months ago

R-Goc commented 2 months ago

Also changes the type of the values to double to match the array type. Implemented with mt19937_64 from std::random seeded with std::random_device which uses hardware entropy where available. Changes the range of the values to be the whole range of double. I don't know if the limit to data.size() was intentional or not. Changing it back just needs changing the values passed to std::uniform_real_distribution. If for whatever reason this rng is too slow (shouldn't be) the PRNG would need to be changed to a different algorithm. Can't get the indentation to be fixed, so sadly the whole file changed.

spirosmaggioros commented 2 months ago

Looks like the clang-tidy warning is resolved with this PR. Merged!