API Breaking change. Location of nodes can be specified by a hint.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user