Internals: Add orderPreRanked. No functional change.

This commit is contained in:
Wilson Snyder 2018-06-14 20:29:54 -04:00
parent 9f5a4c9b22
commit efb2801eeb
2 changed files with 8 additions and 0 deletions

View File

@ -102,8 +102,13 @@ public:
/// Order all vertices by rank and fanout, lowest first
/// Sort all vertices by rank and fanout, lowest first
/// Sort all edges by weight, lowest first
/// Side-effect: assigns ranks to every node.
void order();
// Similar to order() but does not assign ranks. Caller must
// ensure that the graph has been ranked ahead of the call.
void orderPreRanked();
/// Make acyclical (into a tree) by breaking a minimal subset of cutable edges.
void acyclic(V3EdgeFuncP edgeFuncp);

View File

@ -507,7 +507,10 @@ void V3Graph::order() {
// Compute rankings again
rank(&V3GraphEdge::followAlwaysTrue);
orderPreRanked();
}
void V3Graph::orderPreRanked() {
// Compute fanouts
// Vertex::m_user begin: 1 indicates processing, 2 indicates completed
userClearVertices();