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

Avoid usage of std::rand()

This commit is contained in:
Carles Fernandez 2019-06-16 11:40:58 +02:00
parent 75d51ab837
commit d6887488f3
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 6 additions and 4 deletions

View File

@ -97,14 +97,15 @@ TEST(CubatureFilterComputationTest, CubatureFilterTest)
std::default_random_engine e1(r());
std::normal_distribution<float> normal_dist(0, 5);
std::uniform_real_distribution<float> uniform_dist(0.1, 5.0);
std::uniform_int_distribution<> uniform_dist_int(1, 5);
uint8_t nx = 0;
uint8_t ny = 0;
for (uint16_t k = 0; k < CUBATURE_TEST_N_TRIALS; k++)
{
nx = std::rand() % 5 + 1;
ny = std::rand() % 5 + 1;
nx = static_cast<uint8_t>(uniform_dist_int(e1));
ny = static_cast<uint8_t>(uniform_dist_int(e1));
kf_x = arma::randn<arma::vec>(nx, 1);

View File

@ -97,14 +97,15 @@ TEST(UnscentedFilterComputationTest, UnscentedFilterTest)
std::default_random_engine e1(r());
std::normal_distribution<float> normal_dist(0, 5);
std::uniform_real_distribution<float> uniform_dist(0.1, 5.0);
std::uniform_int_distribution<> uniform_dist_int(1, 5);
uint8_t nx = 0;
uint8_t ny = 0;
for (uint16_t k = 0; k < UNSCENTED_TEST_N_TRIALS; k++)
{
nx = std::rand() % 5 + 1;
ny = std::rand() % 5 + 1;
nx = static_cast<uint8_t>(uniform_dist_int(e1));
ny = static_cast<uint8_t>(uniform_dist_int(e1));
kf_x = arma::randn<arma::vec>(nx, 1);