Internal: V3Graph style cleanup. No functional change
This commit is contained in:
parent
5bda901146
commit
bcbe5059a9
|
|
@ -300,6 +300,7 @@ public:
|
||||||
std::ostream& operator<<(std::ostream& os, V3GraphVertex* vertexp) VL_MT_DISABLED;
|
std::ostream& operator<<(std::ostream& os, V3GraphVertex* vertexp) VL_MT_DISABLED;
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
// TODO should we have a smaller edge structure when we don't need weight etc?
|
||||||
|
|
||||||
class V3GraphEdge VL_NOT_FINAL {
|
class V3GraphEdge VL_NOT_FINAL {
|
||||||
VL_RTTI_IMPL_BASE(V3GraphEdge)
|
VL_RTTI_IMPL_BASE(V3GraphEdge)
|
||||||
|
|
@ -313,8 +314,8 @@ protected:
|
||||||
friend class GraphAcyc;
|
friend class GraphAcyc;
|
||||||
friend class GraphAcycEdge;
|
friend class GraphAcycEdge;
|
||||||
|
|
||||||
V3ListEnt<V3GraphEdge*> m_outs; // Next Outbound edge for same vertex (linked list)
|
V3ListEnt<V3GraphEdge*> m_outs; // Next outbound edge for same vertex (linked list)
|
||||||
V3ListEnt<V3GraphEdge*> m_ins; // Next Inbound edge for same vertex (linked list)
|
V3ListEnt<V3GraphEdge*> m_ins; // Next inbound edge for same vertex (linked list)
|
||||||
//
|
//
|
||||||
V3GraphVertex* m_fromp; // Vertices pointing to this edge
|
V3GraphVertex* m_fromp; // Vertices pointing to this edge
|
||||||
V3GraphVertex* m_top; // Vertices this edge points to
|
V3GraphVertex* m_top; // Vertices this edge points to
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ VL_DEFINE_DEBUG_FUNCTIONS;
|
||||||
|
|
||||||
//######################################################################
|
//######################################################################
|
||||||
//######################################################################
|
//######################################################################
|
||||||
// Algorithms - weakly connected components
|
// Algorithms - Remove redundancies
|
||||||
|
|
||||||
class GraphRemoveRedundant final : GraphAlg<> {
|
class GraphRemoveRedundant final : GraphAlg<> {
|
||||||
const bool m_sumWeights; ///< Sum, rather then maximize weights
|
const bool m_sumWeights; ///< Sum, rather then maximize weights
|
||||||
|
|
@ -176,7 +176,7 @@ void V3Graph::weaklyConnected(V3EdgeFuncP edgeFuncp) { GraphAlgWeakly{this, edge
|
||||||
|
|
||||||
class GraphAlgStrongly final : GraphAlg<> {
|
class GraphAlgStrongly final : GraphAlg<> {
|
||||||
private:
|
private:
|
||||||
uint32_t m_currentDfs; // DFS count
|
uint32_t m_currentDfs = 0; // DFS count
|
||||||
std::vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
|
std::vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
@ -253,7 +253,6 @@ private:
|
||||||
public:
|
public:
|
||||||
GraphAlgStrongly(V3Graph* graphp, V3EdgeFuncP edgeFuncp)
|
GraphAlgStrongly(V3Graph* graphp, V3EdgeFuncP edgeFuncp)
|
||||||
: GraphAlg<>{graphp, edgeFuncp} {
|
: GraphAlg<>{graphp, edgeFuncp} {
|
||||||
m_currentDfs = 0;
|
|
||||||
main();
|
main();
|
||||||
}
|
}
|
||||||
~GraphAlgStrongly() = default;
|
~GraphAlgStrongly() = default;
|
||||||
|
|
@ -323,7 +322,7 @@ void V3Graph::rank(V3EdgeFuncP edgeFuncp) { GraphAlgRank{this, edgeFuncp}; }
|
||||||
class GraphAlgRLoops final : GraphAlg<> {
|
class GraphAlgRLoops final : GraphAlg<> {
|
||||||
private:
|
private:
|
||||||
std::vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
|
std::vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
|
||||||
bool m_done; // Exit algorithm
|
bool m_done = false; // Exit algorithm
|
||||||
|
|
||||||
void main(V3GraphVertex* vertexp) {
|
void main(V3GraphVertex* vertexp) {
|
||||||
// Vertex::m_user begin: 1 indicates processing, 2 indicates completed
|
// Vertex::m_user begin: 1 indicates processing, 2 indicates completed
|
||||||
|
|
@ -360,7 +359,6 @@ private:
|
||||||
public:
|
public:
|
||||||
GraphAlgRLoops(V3Graph* graphp, V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp)
|
GraphAlgRLoops(V3Graph* graphp, V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp)
|
||||||
: GraphAlg<>{graphp, edgeFuncp} {
|
: GraphAlg<>{graphp, edgeFuncp} {
|
||||||
m_done = false;
|
|
||||||
main(vertexp);
|
main(vertexp);
|
||||||
}
|
}
|
||||||
~GraphAlgRLoops() = default;
|
~GraphAlgRLoops() = default;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue