-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Refactor update routines #3809
Refactor update routines #3809
Changes from all commits
2122ef1
eae9689
374213b
79ddd71
3fcb356
fff1a3b
7554683
488f4c5
444d2bf
3a9d750
6909dcb
13693c3
a63068e
65b505c
f301eac
83af82d
8e57c9a
0d33e3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,9 +152,9 @@ module.exports = function () { | |
let a_type = k.slice(2); | ||
if (whitelist.indexOf(a_type) == -1) | ||
return cb(new Error('Unrecognized annotation field', a_type)); | ||
if (!annotation[a_type]) | ||
if (annotation && !annotation[a_type]) | ||
return cb(new Error('Annotation not found in response', a_type)); | ||
got[k] = annotation[a_type]; | ||
got[k] = annotation && annotation[a_type] || ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm unrelated changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noticed this while debugging a failing test. Cucumber crashes instead of just failing the test case. |
||
} | ||
}); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ std::vector<ContractorEdge> adaptToContractorInput(InputEdgeContainer input_edge | |
|
||
for (const auto &input_edge : input_edge_list) | ||
{ | ||
if (input_edge.data.weight == INVALID_EDGE_WEIGHT) | ||
continue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait this is a bug in master? Should this be backported to the 5.6 branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No previously we filtered these edges out the edge loading routine. We were loading one struct at a time, so we could just skip them. |
||
|
||
#ifndef NDEBUG | ||
const unsigned int constexpr DAY_IN_DECI_SECONDS = 24 * 60 * 60 * 10; | ||
if (static_cast<unsigned int>(std::max(input_edge.data.weight, 1)) > DAY_IN_DECI_SECONDS) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,36 +63,71 @@ template <bool UseShareMemory> class SegmentDataContainerImpl | |
{ | ||
} | ||
|
||
// TODO these random access functions can be removed after we implemented #3737 | ||
auto &ForwardDuration(const DirectionalGeometryID id, const SegmentOffset offset) | ||
auto GetForwardGeometry(const DirectionalGeometryID id) | ||
{ | ||
return fwd_durations[index[id] + 1 + offset]; | ||
const auto begin = nodes.begin() + index[id]; | ||
const auto end = nodes.begin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
auto &ReverseDuration(const DirectionalGeometryID id, const SegmentOffset offset) | ||
|
||
auto GetReverseGeometry(const DirectionalGeometryID id) | ||
{ | ||
return boost::adaptors::reverse(GetForwardGeometry(id)); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Beautiful. |
||
|
||
auto GetForwardDurations(const DirectionalGeometryID id) | ||
{ | ||
return rev_durations[index[id] + offset]; | ||
const auto begin = fwd_durations.begin() + index[id] + 1; | ||
const auto end = fwd_durations.begin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
|
||
auto GetReverseDurations(const DirectionalGeometryID id) | ||
{ | ||
const auto begin = rev_durations.begin() + index[id]; | ||
const auto end = rev_durations.begin() + index[id + 1] - 1; | ||
|
||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); | ||
} | ||
auto &ForwardWeight(const DirectionalGeometryID id, const SegmentOffset offset) | ||
|
||
auto GetForwardWeights(const DirectionalGeometryID id) | ||
{ | ||
return fwd_weights[index[id] + 1 + offset]; | ||
const auto begin = fwd_weights.begin() + index[id] + 1; | ||
const auto end = fwd_weights.begin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
auto &ReverseWeight(const DirectionalGeometryID id, const SegmentOffset offset) | ||
|
||
auto GetReverseWeights(const DirectionalGeometryID id) | ||
{ | ||
return rev_weights[index[id] + offset]; | ||
const auto begin = rev_weights.begin() + index[id]; | ||
const auto end = rev_weights.begin() + index[id + 1] - 1; | ||
|
||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); | ||
} | ||
auto &ForwardDatasource(const DirectionalGeometryID id, const SegmentOffset offset) | ||
|
||
auto GetForwardDatasources(const DirectionalGeometryID id) | ||
{ | ||
return datasources[index[id] + 1 + offset]; | ||
const auto begin = datasources.begin() + index[id] + 1; | ||
const auto end = datasources.begin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
auto &ReverseDatasource(const DirectionalGeometryID id, const SegmentOffset offset) | ||
|
||
auto GetReverseDatasources(const DirectionalGeometryID id) | ||
{ | ||
return datasources[index[id] + offset]; | ||
const auto begin = datasources.begin() + index[id]; | ||
const auto end = datasources.begin() + index[id + 1] - 1; | ||
|
||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); | ||
} | ||
|
||
auto GetForwardGeometry(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = nodes.cbegin() + index.at(id); | ||
const auto end = nodes.cbegin() + index.at(id + 1); | ||
const auto begin = nodes.cbegin() + index[id]; | ||
const auto end = nodes.cbegin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
|
@@ -104,52 +139,53 @@ template <bool UseShareMemory> class SegmentDataContainerImpl | |
|
||
auto GetForwardDurations(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = fwd_durations.cbegin() + index.at(id) + 1; | ||
const auto end = fwd_durations.cbegin() + index.at(id + 1); | ||
const auto begin = fwd_durations.cbegin() + index[id] + 1; | ||
const auto end = fwd_durations.cbegin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
|
||
auto GetReverseDurations(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = rev_durations.cbegin() + index.at(id); | ||
const auto end = rev_durations.cbegin() + index.at(id + 1) - 1; | ||
const auto begin = rev_durations.cbegin() + index[id]; | ||
const auto end = rev_durations.cbegin() + index[id + 1] - 1; | ||
|
||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); | ||
} | ||
|
||
auto GetForwardWeights(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = fwd_weights.cbegin() + index.at(id) + 1; | ||
const auto end = fwd_weights.cbegin() + index.at(id + 1); | ||
const auto begin = fwd_weights.cbegin() + index[id] + 1; | ||
const auto end = fwd_weights.cbegin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
|
||
auto GetReverseWeights(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = rev_weights.cbegin() + index.at(id); | ||
const auto end = rev_weights.cbegin() + index.at(id + 1) - 1; | ||
const auto begin = rev_weights.cbegin() + index[id]; | ||
const auto end = rev_weights.cbegin() + index[id + 1] - 1; | ||
|
||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); | ||
} | ||
|
||
auto GetForwardDatasources(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = datasources.cbegin() + index.at(id) + 1; | ||
const auto end = datasources.cbegin() + index.at(id + 1); | ||
const auto begin = datasources.cbegin() + index[id] + 1; | ||
const auto end = datasources.cbegin() + index[id + 1]; | ||
|
||
return boost::make_iterator_range(begin, end); | ||
} | ||
|
||
auto GetReverseDatasources(const DirectionalGeometryID id) const | ||
{ | ||
const auto begin = datasources.cbegin() + index.at(id); | ||
const auto end = datasources.cbegin() + index.at(id + 1) - 1; | ||
const auto begin = datasources.cbegin() + index[id]; | ||
const auto end = datasources.cbegin() + index[id + 1] - 1; | ||
|
||
return boost::adaptors::reverse(boost::make_iterator_range(begin, end)); | ||
} | ||
|
||
auto GetNumberOfGeometries() const { return index.size() - 1; } | ||
auto GetNumberOfSegments() const { return fwd_weights.size(); } | ||
|
||
friend void | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ splitBidirectionalEdges(const std::vector<extractor::EdgeBasedEdge> &edges) | |
|
||
for (const auto &edge : edges) | ||
{ | ||
if (edge.data.weight == INVALID_EDGE_WEIGHT) | ||
continue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Urgh same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
|
||
directed.emplace_back(edge.source, | ||
edge.target, | ||
edge.data.edge_id, | ||
|
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.
Can you update the wiki for these changes