genbattle / dkm

A generic C++11 k-means clustering implementation
MIT License
209 stars 47 forks source link

Fixes get_random_seed() function to return randor seed, not _has_rand_seed #13

Closed adevaykin closed 5 years ago

adevaykin commented 5 years ago

get_random_seed() returned bool _has_rand_seed casted to uint64_t, which led to STL assertion with "invalid random seed" when compiled with MSVC in debug mode.

genbattle commented 5 years ago

Good catch, I'd assumed it was working in my tests because I never test changing the seed, seems like a good test to add to prevent a regression. It looks like some of the unit tests are affected by this change since it (correctly) changes the random number seed. If you could fix the tests on your fork that would be great, otherwise I'll pull your changes into a branch here and fix up the tests myself.

adevaykin commented 5 years ago

Should be fixed now.

genbattle commented 5 years ago

Thanks! I've merged your changes to master.