Skip to content

Commit

Permalink
[benchmark] simplify random generation (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisCarouge authored Oct 30, 2022
1 parent 82cafab commit 1180997
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions benchmark/eigen_predict_x1x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void eigen_predict(::benchmark::State &state) {

kalman filter;
std::random_device random_device;
std::mt19937 random_generator(random_device());
std::uniform_real_distribution uniformly_distributed(0.f, 1.f);
std::mt19937 random_generator{random_device()};
std::uniform_real_distribution<float> uniformly_distributed;

for (auto _ : state) {

Expand Down
4 changes: 2 additions & 2 deletions benchmark/eigen_update_xx0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ void eigen_update(::benchmark::State &state) {

kalman filter;
std::random_device random_device;
std::mt19937 random_generator(random_device());
std::uniform_real_distribution uniformly_distributed(0.f, 1.f);
std::mt19937 random_generator{random_device()};
std::uniform_real_distribution<float> uniformly_distributed;

for (auto _ : state) {

Expand Down
4 changes: 2 additions & 2 deletions benchmark/predict_1x1x1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void predict_1x1x1(::benchmark::State &state) {

kalman filter;
std::random_device random_device;
std::mt19937 random_generator(random_device());
std::uniform_real_distribution uniformly_distributed(0.f, 1.f);
std::mt19937 random_generator{random_device()};
std::uniform_real_distribution<float> uniformly_distributed;

for (auto _ : state) {

Expand Down
4 changes: 2 additions & 2 deletions benchmark/update_1x1x0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void update_1x1x0(::benchmark::State &state) {

kalman filter;
std::random_device random_device;
std::mt19937 random_generator(random_device());
std::uniform_real_distribution uniformly_distributed(0.f, 1.f);
std::mt19937 random_generator{random_device()};
std::uniform_real_distribution<float> uniformly_distributed;

for (auto _ : state) {

Expand Down
4 changes: 2 additions & 2 deletions benchmark/update_1x1x1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void update_1x1x1(::benchmark::State &state) {

kalman filter;
std::random_device random_device;
std::mt19937 random_generator(random_device());
std::uniform_real_distribution uniformly_distributed(0.f, 1.f);
std::mt19937 random_generator{random_device()};
std::uniform_real_distribution<float> uniformly_distributed;

for (auto _ : state) {

Expand Down

0 comments on commit 1180997

Please sign in to comment.