1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Improve initialization of random engines

This commit is contained in:
Carles Fernandez 2019-08-14 11:56:55 +02:00
parent 668869ee85
commit 3c92d6a7c6
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 4 additions and 4 deletions

View File

@ -144,8 +144,8 @@ void signal_generator_c::init()
}
}
}
std::default_random_engine e1(r());
std::default_random_engine e2(r());
//std::default_random_engine e1(r());
//std::default_random_engine e2(r());
std::uniform_int_distribution<int> uniform_dist(0, RAND_MAX);
}
@ -277,6 +277,8 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)),
work_counter_++;
std::default_random_engine e1(r());
std::default_random_engine e2(r());
unsigned int out_idx = 0;
unsigned int i = 0;
unsigned int k = 0;

View File

@ -150,8 +150,6 @@ private:
std::vector<gr_complex> complex_phase_;
unsigned int work_counter_{};
std::random_device r;
std::default_random_engine e1;
std::default_random_engine e2;
std::uniform_int_distribution<int> uniform_dist;
std::normal_distribution<float> normal_dist;
};