API Breaking change. Location of nodes can be specified by a hint.

This commit is contained in:
DennisOSRM
2012-03-05 19:08:10 +01:00
parent 91c9cb2114
commit e83891b4fc
7 changed files with 132 additions and 109 deletions
+3
View File
@@ -42,6 +42,9 @@ struct PhantomNode {
bool isBidirected() const {
return weight2 != INT_MAX;
}
bool isValid(const unsigned numberOfNodes) const {
return location.isValid() && (edgeBasedNode < numberOfNodes) && (weight1 != INT_MAX) && (ratio >= 0.) && (ratio <= 1.) && (nodeBasedEdgeNameID != UINT_MAX);
}
};
struct PhantomNodes {
+17
View File
@@ -91,6 +91,23 @@ public:
_nodes.swap(nodes);
_edges.swap(edges);
#ifndef NDEBUG
Percent p(GetNumberOfNodes());
for(unsigned u = 0; u < GetNumberOfNodes(); ++u) {
for(unsigned eid = BeginEdges(u); eid < EndEdges(u); ++eid) {
unsigned v = GetTarget(eid);
EdgeData & data = GetEdgeData(eid);
if(data.shortcut) {
unsigned eid2 = FindEdgeInEitherDirection(u, data.via);
assert(eid2 != UINT_MAX);
eid2 = FindEdgeInEitherDirection(data.via, v);
assert(eid2 != UINT_MAX);
}
}
p.printIncrement();
}
#endif
}
unsigned GetNumberOfNodes() const {