Skip to content
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

Calculate stop to subshape mapping during import #136

Merged

Conversation

MichaelKutzner
Copy link
Contributor

This extends the shape support, implemented with #127.
Clients may now request the shape of a trip segment. These will be calculated during import, to reduce runtime costs. The corresponding mapping will be stored to a memory map.

As the calculation will take some time, especially for frequent trips using the same stops and shape, results will be cached during import.

template <typename DoubleRange>
requires std::ranges::range<DoubleRange> &&
std::is_same_v<std::ranges::range_value_t<DoubleRange>, double>
inline bool valid_distances(DoubleRange distances) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inline bool valid_distances(DoubleRange distances) {
bool valid_distances(DoubleRange distances) {

Templates do not need inline and usually the compiler does a better job at deciding what should be really inlined. So inline is mostly a instruction to the linker, which is not needed in this case (as it's a template).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the reminder.
Due to some changes, the function has been removed entirely.

@felixguendling felixguendling merged commit 164480a into motis-project:master Oct 9, 2024
10 checks passed
@felixguendling
Copy link
Member

Amazing job!! 🤩 🚀 🎉

@MichaelKutzner MichaelKutzner deleted the subshape_preparation branch October 9, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants