mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 10:34:25 +03:00
violet: initial implementation
This commit is contained in:
@@ -209,6 +209,15 @@ bool isAnchored(const NGHolder &g) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isFloating(const NGHolder &g) {
|
||||
for (auto v : adjacent_vertices_range(g.start, g)) {
|
||||
if (v != g.startDs && !edge(g.startDs, v, g).second) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isAcyclic(const NGHolder &g) {
|
||||
try {
|
||||
depth_first_search(
|
||||
@@ -657,7 +666,8 @@ bool hasCorrectlyNumberedVertices(const NGHolder &g) {
|
||||
}
|
||||
ids[id] = true;
|
||||
}
|
||||
return find(ids.begin(), ids.end(), false) == ids.end();
|
||||
return find(ids.begin(), ids.end(), false) == ids.end()
|
||||
&& num_vertices(g) == num_vertices(g.g);
|
||||
}
|
||||
|
||||
/** Assertion: returns true if the edges in this graph are contiguously (and
|
||||
@@ -672,8 +682,10 @@ bool hasCorrectlyNumberedEdges(const NGHolder &g) {
|
||||
}
|
||||
ids[id] = true;
|
||||
}
|
||||
return find(ids.begin(), ids.end(), false) == ids.end();
|
||||
return find(ids.begin(), ids.end(), false) == ids.end()
|
||||
&& num_edges(g) == num_edges(g.g);
|
||||
}
|
||||
|
||||
#endif // NDEBUG
|
||||
|
||||
} // namespace ue2
|
||||
|
||||
Reference in New Issue
Block a user