diff options
author | Thomas Habets <thomas@habets.se> | 2020-04-10 11:19:50 +0100 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-04-10 16:27:57 +0200 |
commit | 55b6b2724ae872b36dd93c1479a829bb4054bdda (patch) | |
tree | 3c1413dc20cbd28220e8c6b9ec0f5e5e207eb914 /gnuradio-runtime/lib/math | |
parent | 8e777117e10a70a57e138ddbe2144732a3469cfc (diff) |
runtime: Make random seed default to current time, as documented
This is what gnuradio currently documents seeding will do, but it's
not what C++ defaults to.
See C++11 26.5.3.2, paragraph 3. Default for mersenne twister is
constexpr 5489.
Or easier, the bottom of
https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
Diffstat (limited to 'gnuradio-runtime/lib/math')
-rw-r--r-- | gnuradio-runtime/lib/math/random.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc index dc24dbab6f..a25cc1c72e 100644 --- a/gnuradio-runtime/lib/math/random.cc +++ b/gnuradio-runtime/lib/math/random.cc @@ -54,7 +54,7 @@ void random::reseed(unsigned int seed) { d_seed = seed; if (d_seed == 0) { - d_rng.seed(); + d_rng.seed(time(nullptr)); } else { d_rng.seed(d_seed); } |