-
Notifications
You must be signed in to change notification settings - Fork 4
Bugfix: increase performances of filter function
#372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -91,17 +91,21 @@ | |||||
| tbb::concurrent_set<Id> to_split; | ||||||
|
|
||||||
| // Returns true if speed between two points is below max_speed_kph | ||||||
| auto check_max_speed = [](PointsCluster const& currentCluster, | ||||||
| PointsCluster const& previousCluster, | ||||||
| double const max_speed_kph) { | ||||||
| auto check_max_speed = [&max_speed_kph](PointsCluster const& currentCluster, | ||||||
| PointsCluster const& previousCluster) { | ||||||
Check noticeCode scanning / Cppcheck (reported by Codacy) MISRA 13.1 rule Note
MISRA 13.1 rule
|
||||||
| auto const distance_km = dsf::geometry::haversine_km(currentCluster.centroid(), | ||||||
| previousCluster.centroid()); | ||||||
| auto const current_time = | ||||||
| (currentCluster.lastTimestamp() + currentCluster.firstTimestamp()) * 0.5; | ||||||
| auto const previous_time = | ||||||
| (previousCluster.lastTimestamp() + previousCluster.firstTimestamp()) * 0.5; | ||||||
| if (current_time <= previous_time) { | ||||||
| spdlog::warn( | ||||||
| if (current_time < previous_time) { | ||||||
| // Should never happen if data is clean | ||||||
| throw std::runtime_error( | ||||||
| "Timestamps are not in increasing order within the trajectory."); | ||||||
|
Comment on lines
+102
to
+105
|
||||||
| } | ||||||
| if (current_time == previous_time) { | ||||||
| spdlog::debug( | ||||||
|
||||||
| spdlog::debug( | |
| spdlog::warn( |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note