Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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