summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/math
diff options
context:
space:
mode:
authorJohannes Demel <demel@ant.uni-bremen.de>2017-03-13 10:22:58 +0100
committerJohannes Demel <demel@ant.uni-bremen.de>2017-03-13 10:22:58 +0100
commite2f7c77855de488b671438be4fbe5d79a64adfa2 (patch)
tree6ddb51088e7c332cc4366f507d2bcb44e222a69e /gnuradio-runtime/lib/math
parentc987793229874b7345e939c174b21ef2e509aa8c (diff)
fixed gr::random::random::set_integer_limits
Diffstat (limited to 'gnuradio-runtime/lib/math')
-rw-r--r--gnuradio-runtime/lib/math/random.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc
index 0d37884373..59f2f22bd0 100644
--- a/gnuradio-runtime/lib/math/random.cc
+++ b/gnuradio-runtime/lib/math/random.cc
@@ -86,9 +86,10 @@ namespace gr {
void
random::set_integer_limits(const int minimum, const int maximum){
// boost expects integer limits defined as [minimum, maximum] which is unintuitive.
- boost::uniform_int<>::param_type dis_params(minimum, maximum - 1);
- d_integer_dis->param(dis_params);
+ // use the expected half open interval behavior! [minimum, maximum)!
delete d_integer_generator;
+ delete d_integer_dis;
+ d_integer_dis = new boost::uniform_int<>(minimum, maximum - 1);
d_integer_generator = new boost::variate_generator<boost::mt19937&, boost::uniform_int<> >(*d_rng, *d_integer_dis);
}