| Code-Review | +1 |
mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}Move the init code into a separate function. Then initialize both member variables in the initializer list.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}Move the init code into a separate function. Then initialize both member variables in the initializer list.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}Andy PhanMove the init code into a separate function. Then initialize both member variables in the initializer list.
Made Init(), but does `mt_` need to be the initializer list?
I was thinking Init() can be in the anonymous namespace and return `std::array<uint32_t, kN>`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}Andy PhanMove the init code into a separate function. Then initialize both member variables in the initializer list.
Lei ZhangMade Init(), but does `mt_` need to be the initializer list?
I was thinking Init() can be in the anonymous namespace and return `std::array<uint32_t, kN>`.
Done, although had to make kN public.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
mt_[0] = seed;
for (uint32_t i = 1; i < kN; i++) {
const uint32_t prev = mt_[i - 1];
mt_[i] = (1812433253UL * (prev ^ (prev >> 30)) + i);
}Andy PhanMove the init code into a separate function. Then initialize both member variables in the initializer list.
Lei ZhangMade Init(), but does `mt_` need to be the initializer list?
Andy PhanI was thinking Init() can be in the anonymous namespace and return `std::array<uint32_t, kN>`.
Done, although had to make kN public.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Remove MTContext
MTContext is only used as a member field for FX_Random, so just move the
struct's fields to FX_Random.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |