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

Improve lamdba usage

This commit is contained in:
Carles Fernandez 2020-06-21 11:57:59 +02:00
parent 87989ead0a
commit 4f4ccccf9b
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -47,8 +47,7 @@ TEST(PreambleCorrelationTest, TestMethods)
std::uniform_real_distribution<> dist(-1.0, 1.0); std::uniform_real_distribution<> dist(-1.0, 1.0);
std::generate(d_symbol_history.begin(), d_symbol_history.end(), [&dist, &e2]() { return dist(e2); }); std::generate(d_symbol_history.begin(), d_symbol_history.end(), [&dist, &e2]() { return dist(e2); });
std::string preamble = GPS_CA_PREAMBLE; std::generate(d_preamble_samples.begin(), d_preamble_samples.end(), [n = 0]() mutable { return (GPS_CA_PREAMBLE[n++] == '1' ? 1 : -1); });
std::generate(d_preamble_samples.begin(), d_preamble_samples.end(), [preamble, n = 0]() mutable { return (preamble[n++] == '1' ? 1 : -1); });
// Compute correlation, method 1 // Compute correlation, method 1
start = std::chrono::system_clock::now(); start = std::chrono::system_clock::now();