Skip to content
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

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

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

R-Goc
Copy link
Contributor

@R-Goc R-Goc commented Jul 8, 2024

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.

Also changes the type of the values to double.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your interest in AlgoPlus, a maintainer will see your PR soon!

@spirosmaggioros
Copy link
Member

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

@spirosmaggioros spirosmaggioros merged commit fb62936 into CSRT-NTUA:main Jul 8, 2024
2 checks passed
@R-Goc R-Goc deleted the change-RNG-in-kmeans.h branch July 8, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants