Timeline for Seed std::mt19937 from std::random_device
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 24, 2020 at 9:29 | history | edited | Brett Hale | CC BY-SA 4.0 |
deleted 49 characters in body
|
Mar 20, 2020 at 9:32 | comment | added | Brett Hale | @KonradRudolph - Now I understand your point. You're right. My code looks 'generic', but it is not; and it could be a source of confusion. It might be an 'example', but I don't want anyone using it for 'cargo cult' coding. | |
Mar 20, 2020 at 8:42 | comment | added | Konrad Rudolph | That said, I should make it clear that I’m not actually taking issue with your code, my comment was really just a question to confirm my understanding that a 64-bit MT19937 would need to be seeded differently (i.e. with more random bits). | |
Mar 20, 2020 at 8:37 | comment | added | Konrad Rudolph | My point is that your code is intentionally keeping the random engine generic (though short of making it a template parameter) but your seeding code is specific to mt19937. If the specificity is intentional (which is fine), it’s dangerous to hide the connection to a specific RNG behind a generically named typedef. | |
Mar 17, 2020 at 10:28 | comment | added | Konrad Rudolph |
I think your code assumes that std::seed_seq::result_type == random_engine::result_type . This isn’t generally true (e.g. for std::mt19937_64 ). In this code your seed sequence will be generated using 64 unsigned int s (= std::random_device::value_type ), which isn’t sufficient entropy. Am I wrong?
|
|
Feb 4, 2019 at 9:41 | history | edited | Toby Speight | CC BY-SA 4.0 |
Formatting
|
Feb 2, 2019 at 13:20 | history | edited | Brett Hale | CC BY-SA 4.0 |
deleted 16 characters in body
|
Feb 2, 2019 at 12:57 | history | edited | Brett Hale | CC BY-SA 4.0 |
added 47 characters in body
|
Feb 2, 2019 at 12:50 | review | First posts | |||
Feb 2, 2019 at 13:41 | |||||
Feb 2, 2019 at 12:49 | history | answered | Brett Hale | CC BY-SA 4.0 |