Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
WSPD.h
Go to the documentation of this file.
1
32#pragma once
33
36
37namespace ogdf {
38namespace fast_multipole_embedder {
39
41class WSPD {
42public:
44
47
50
52 inline uint32_t maxNumNodes() const { return m_maxNumNodes; }
53
55 inline uint32_t numWSNodes(NodeID a) const { return m_nodeInfo[a].degree; }
56
58 inline uint32_t numPairs() const { return m_numPairs; }
59
61 inline uint32_t maxNumPairs() const { return m_maxNumPairs; }
62
64 void clear();
65
67 void addWSP(NodeID a, NodeID b);
68
71
73 inline NodeAdjInfo& nodeInfo(NodeID nodeID) const { return m_nodeInfo[nodeID]; }
74
79
84
86 inline uint32_t firstPairEntry(NodeID nodeID) const { return m_nodeInfo[nodeID].firstEntry; }
87
88 // Returns the size excluding small member vars (for profiling only).
89 unsigned long sizeInBytes() const;
90
91private:
93 void allocate();
94
96 void deallocate();
97
103};
104
105}
106}
Datastructures for edge chains itself and the edge chains of nodes.
Declaration of class LinearQuadtree.
Information about an edge (16 bytes).
Definition EdgeChain.h:52
uint32_t nextEdgeAdjIndex(uint32_t index) const
Returns the index of the next pair of index.
Definition EdgeChain.h:66
uint32_t twinNode(uint32_t index) const
Returns the other node (not index).
Definition EdgeChain.h:60
Information about incident edges (16 bytes).
Definition EdgeChain.h:43
uint32_t firstEntry
The first pair in the edges chain.
Definition EdgeChain.h:46
uint32_t degree
Total count of pairs where is either the first or second node.
Definition EdgeChain.h:45
Class for the Well-Separated-Pairs-Decomposition (WSPD)
Definition WSPD.h:41
uint32_t maxNumNodes() const
Returns the maximum number of nodes. Equals the maximum number of nodes in the LinearQuadtree.
Definition WSPD.h:52
NodeAdjInfo * m_nodeInfo
Array which holds the wspd information for one quadtree node.
Definition WSPD.h:99
uint32_t nextPair(uint32_t currPairIndex, NodeID a) const
Returns the index of the next pair of currPairIndex of the node with index a.
Definition WSPD.h:76
void deallocate()
Releases all memory.
uint32_t m_numPairs
Total number of pairs.
Definition WSPD.h:101
~WSPD()
Destructor. Deallocates via OGDF_FREE_16.
uint32_t maxNumPairs() const
Returns the maximum number of pairs.
Definition WSPD.h:61
EdgeAdjInfo * m_pairs
Array containing all pairs.
Definition WSPD.h:100
uint32_t m_maxNumNodes
Maximum number of nodes.
Definition WSPD.h:98
unsigned long sizeInBytes() const
uint32_t m_maxNumPairs
Upper bound for the number of pairs.
Definition WSPD.h:102
void clear()
Resets the array m_nodeInfo.
LinearQuadtree::NodeID NodeID
Definition WSPD.h:43
void addWSP(NodeID a, NodeID b)
Adds a well separated pair (a, b)
uint32_t firstPairEntry(NodeID nodeID) const
Returns the index of the first pair of node nodeID.
Definition WSPD.h:86
WSPD(uint32_t maxNumNodes)
Constructor. Allocates the memory via OGDF_MALLOC_16.
NodeAdjInfo & nodeInfo(NodeID nodeID) const
Returns the node info for index nodeID.
Definition WSPD.h:73
EdgeAdjInfo & pairInfo(uint32_t pairIndex) const
Returns the pair info for index pairIndex.
Definition WSPD.h:70
uint32_t numWSNodes(NodeID a) const
Returns the number of well separated nodes for node a.
Definition WSPD.h:55
void allocate()
Allocates all memory.
uint32_t wsNodeOfPair(uint32_t currPairIndex, NodeID a) const
Returns the other node (not a) of the pair with index currPairIndex.
Definition WSPD.h:81
uint32_t numPairs() const
Returns the total number of pairs.
Definition WSPD.h:58
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.