From efb2801eeb5380439f8c7ff29d63f6e9623ccf15 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 14 Jun 2018 20:29:54 -0400 Subject: [PATCH] Internals: Add orderPreRanked. No functional change. --- src/V3Graph.h | 5 +++++ src/V3GraphAlg.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/V3Graph.h b/src/V3Graph.h index 1cfac53e9..fd7d0d962 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -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); diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp index 6c8f1f1e3..ac9b41b27 100644 --- a/src/V3GraphAlg.cpp +++ b/src/V3GraphAlg.cpp @@ -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();