-
Notifications
You must be signed in to change notification settings - Fork 23
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
✨ Added additional distance functions and distance maps #250
Conversation
…cache distance values for faster access. This is particularly useful for complex distance functions that must be queried many times. Additionally, `distance_map_functor` and `sparse_distance_map_functor` are introduced, which are `distance_functors` that query a distance map type instead of a distance function. They can be used in path-finding algorithms that require `distance_functor` arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
…e on-the-fly. Tests are still missing.
Signed-off-by: ClangFormat <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #250 +/- ##
==========================================
- Coverage 94.51% 94.49% -0.02%
==========================================
Files 84 85 +1
Lines 7616 7662 +46
==========================================
+ Hits 7198 7240 +42
- Misses 418 422 +4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
…urns correct results
Description
This PR adds several features to the distance functions used for path-finding:
distance_map
andsparse_distance_map
data types, that can cache distance values for faster access. This is particularly useful for complex distance functions that must be frequently queried.distance_map_functor
andsparse_distance_map_functor
, which aredistance_functor
s that query a distance map object instead of a distance function. These can be used in path-finding algorithms that requiredistance_functor
arguments. Thereby, these algorithms don't need to recompute complex distance functions.smart_distance_cache_functor
which is a drop-in replacement for otherdistance_functor
s and uses asparse_distance_map
internally to cache distance function values.Furthermore, a convenient playground for
Catch2
's micro-benchmarking feature is added. Via the CMake flag-DFICTION_BENCHMARK
, all.cpp
files placed intotest/benchmark
are linked againstlibfiction
and compiled as stand-alone binaries. Micro-benchmarks are helpful to evaluate the performance of certain code constructs.Checklist: