Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::fast_multipole_embedder::ArrayGraph Class Reference

#include <ogdf/energybased/fast_multipole_embedder/ArrayGraph.h>

Public Member Functions

 ArrayGraph ()
 Constructor. Does not allocate memory for the members.
 
 ArrayGraph (const GraphAttributes &GA, const EdgeArray< float > &edgeLength, const NodeArray< float > &nodeSize)
 Constructor.
 
 ArrayGraph (uint32_t maxNumNodes, uint32_t maxNumEdges)
 Constructor. Allocates memory via OGDF_MALLOC_16.
 
 ~ArrayGraph ()
 Destructor. Deallocates the memory via OGDF_FREE_16 if needed.
 
float avgDesiredEdgeLength () const
 Average edge length.
 
float avgNodeSize () const
 Average node size.
 
void centerGraph ()
 Transforming all positions such that the new center is at (0,0).
 
floatdesiredEdgeLength ()
 Returns the edge length array for all edges.
 
const floatdesiredEdgeLength () const
 Returns the edge length array for all edges.
 
EdgeAdjInfoedgeInfo ()
 Returns the EdgeAdjInfo array for all edges.
 
const EdgeAdjInfoedgeInfo () const
 Returns the EdgeAdjInfo array for all edges.
 
EdgeAdjInfoedgeInfo (uint32_t i)
 Returns the adjacency information for the edge at index i in m_edgeAdj.
 
const EdgeAdjInfoedgeInfo (uint32_t i) const
 Returns the adjacency information for the edge at index i in m_edgeAdj.
 
uint32_t firstEdgeAdjIndex (uint32_t nodeIndex) const
 Returns the index of the first pair of the node with index nodeIndex in m_nodeAdj.
 
void for_all_nodes (uint32_t begin, uint32_t end, std::function< void(uint32_t)> func)
 Calls func on all nodes with indices from begin to end.
 
uint32_t nextEdgeAdjIndex (uint32_t currEdgeAdjIndex, uint32_t nodeIndex) const
 Returns the index of the next pair of currEdgeAdjIndex of the node with index nodeIndex.
 
NodeAdjInfonodeInfo ()
 Returns the NodeAdjInfo array for all nodes.
 
const NodeAdjInfonodeInfo () const
 Returns the NodeAdjInfo array for all nodes.
 
NodeAdjInfonodeInfo (uint32_t i)
 Returns the adjacency information for the node at index i in m_nodeAdj.
 
const NodeAdjInfonodeInfo (uint32_t i) const
 Returns the adjacency information for the node at index i in m_nodeAdj.
 
floatnodeMoveRadius ()
 Returns the node movement radius array for all nodes.
 
floatnodeSize ()
 Returns the node size array for all nodes.
 
const floatnodeSize () const
 Returns the node size array for all nodes.
 
floatnodeXPos ()
 Returns the x coord array for all nodes.
 
const floatnodeXPos () const
 Returns the x coord array for all nodes.
 
floatnodeYPos ()
 Returns the y coord array for all nodes.
 
const floatnodeYPos () const
 Returns the y coord array for all nodes.
 
uint32_t numEdges () const
 Returns the number of edges.
 
uint32_t numNodes () const
 Returns the number of nodes.
 
template<typename CoordinateType , typename LengthType , typename SizeType >
void readFrom (const Graph &G, NodeArray< CoordinateType > &xPos, NodeArray< CoordinateType > &yPos, const EdgeArray< LengthType > &edgeLength, const NodeArray< SizeType > &nodeSize)
 Updates an ArrayGraph with the given positions, edge lengths and node sizes and creates the edges.
 
void readFrom (const GraphAttributes &GA, const EdgeArray< float > &edgeLength, const NodeArray< float > &nodeSize)
 Updates an ArrayGraph from GraphAttributes with the given edge lengths and node sizes and creates the edges.
 
void transform (float translate, float scale)
 Transforms all positions via shifting them by translate and afterwards scaling by scale.
 
uint32_t twinNodeIndex (uint32_t currEdgeAdjIndex, uint32_t nodeIndex) const
 Returns the other node (not nodeIndex) of the pair with index currEdgeAdjIndex.
 
template<typename CoordinateType >
void writeTo (const Graph &G, NodeArray< CoordinateType > &xPos, NodeArray< CoordinateType > &yPos)
 Store the data back to NodeArray arrays with the given coordinate type.
 
void writeTo (GraphAttributes &GA)
 Store the data back in GraphAttributes.
 

Private Member Functions

void allocate (uint32_t numNodes, uint32_t numEdges)
 Allocate all arrays.
 
void clear ()
 Clear the arrays.
 
void deallocate ()
 Deallocate all arrays.
 
void pushBackEdge (uint32_t a, uint32_t b, float desiredEdgeLength)
 Internal function used by readFrom.
 

Private Attributes

double m_avgNodeSize
 Avg.
 
double m_desiredAvgEdgeLength
 Avg.
 
floatm_desiredEdgeLength
 Edge lengths.
 
EdgeAdjInfom_edgeAdj
 Information about adjacent nodes.
 
NodeAdjInfom_nodeAdj
 Information about adjacent edges.
 
floatm_nodeMoveRadius
 Maximum node movement lengths.
 
floatm_nodeSize
 Sizes of the nodes.
 
floatm_nodeXPos
 The x coordinates.
 
floatm_nodeYPos
 The y coordinates.
 
uint32_t m_numEdges
 Number of edges in the graph.
 
uint32_t m_numNodes
 Number of nodes in the graph.
 

Detailed Description

Definition at line 40 of file ArrayGraph.h.

Constructor & Destructor Documentation

◆ ArrayGraph() [1/3]

ogdf::fast_multipole_embedder::ArrayGraph::ArrayGraph ( )

Constructor. Does not allocate memory for the members.

◆ ArrayGraph() [2/3]

ogdf::fast_multipole_embedder::ArrayGraph::ArrayGraph ( uint32_t  maxNumNodes,
uint32_t  maxNumEdges 
)

Constructor. Allocates memory via OGDF_MALLOC_16.

◆ ArrayGraph() [3/3]

ogdf::fast_multipole_embedder::ArrayGraph::ArrayGraph ( const GraphAttributes GA,
const EdgeArray< float > &  edgeLength,
const NodeArray< float > &  nodeSize 
)

Constructor.

◆ ~ArrayGraph()

ogdf::fast_multipole_embedder::ArrayGraph::~ArrayGraph ( )

Destructor. Deallocates the memory via OGDF_FREE_16 if needed.

Member Function Documentation

◆ allocate()

void ogdf::fast_multipole_embedder::ArrayGraph::allocate ( uint32_t  numNodes,
uint32_t  numEdges 
)
private

Allocate all arrays.

◆ avgDesiredEdgeLength()

float ogdf::fast_multipole_embedder::ArrayGraph::avgDesiredEdgeLength ( ) const
inline

Average edge length.

Definition at line 211 of file ArrayGraph.h.

◆ avgNodeSize()

float ogdf::fast_multipole_embedder::ArrayGraph::avgNodeSize ( ) const
inline

Average node size.

Definition at line 214 of file ArrayGraph.h.

◆ centerGraph()

void ogdf::fast_multipole_embedder::ArrayGraph::centerGraph ( )

Transforming all positions such that the new center is at (0,0).

◆ clear()

void ogdf::fast_multipole_embedder::ArrayGraph::clear ( )
inlineprivate

Clear the arrays.

Definition at line 233 of file ArrayGraph.h.

◆ deallocate()

void ogdf::fast_multipole_embedder::ArrayGraph::deallocate ( )
private

Deallocate all arrays.

◆ desiredEdgeLength() [1/2]

float * ogdf::fast_multipole_embedder::ArrayGraph::desiredEdgeLength ( )
inline

Returns the edge length array for all edges.

Definition at line 183 of file ArrayGraph.h.

◆ desiredEdgeLength() [2/2]

const float * ogdf::fast_multipole_embedder::ArrayGraph::desiredEdgeLength ( ) const
inline

Returns the edge length array for all edges.

Definition at line 186 of file ArrayGraph.h.

◆ edgeInfo() [1/4]

EdgeAdjInfo * ogdf::fast_multipole_embedder::ArrayGraph::edgeInfo ( )
inline

Returns the EdgeAdjInfo array for all edges.

Definition at line 156 of file ArrayGraph.h.

◆ edgeInfo() [2/4]

const EdgeAdjInfo * ogdf::fast_multipole_embedder::ArrayGraph::edgeInfo ( ) const
inline

Returns the EdgeAdjInfo array for all edges.

Definition at line 159 of file ArrayGraph.h.

◆ edgeInfo() [3/4]

EdgeAdjInfo & ogdf::fast_multipole_embedder::ArrayGraph::edgeInfo ( uint32_t  i)
inline

Returns the adjacency information for the edge at index i in m_edgeAdj.

Definition at line 144 of file ArrayGraph.h.

◆ edgeInfo() [4/4]

const EdgeAdjInfo & ogdf::fast_multipole_embedder::ArrayGraph::edgeInfo ( uint32_t  i) const
inline

Returns the adjacency information for the edge at index i in m_edgeAdj.

Definition at line 147 of file ArrayGraph.h.

◆ firstEdgeAdjIndex()

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::firstEdgeAdjIndex ( uint32_t  nodeIndex) const
inline

Returns the index of the first pair of the node with index nodeIndex in m_nodeAdj.

Definition at line 189 of file ArrayGraph.h.

◆ for_all_nodes()

void ogdf::fast_multipole_embedder::ArrayGraph::for_all_nodes ( uint32_t  begin,
uint32_t  end,
std::function< void(uint32_t)>  func 
)
inline

Calls func on all nodes with indices from begin to end.

Definition at line 204 of file ArrayGraph.h.

◆ nextEdgeAdjIndex()

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::nextEdgeAdjIndex ( uint32_t  currEdgeAdjIndex,
uint32_t  nodeIndex 
) const
inline

Returns the index of the next pair of currEdgeAdjIndex of the node with index nodeIndex.

Definition at line 194 of file ArrayGraph.h.

◆ nodeInfo() [1/4]

NodeAdjInfo * ogdf::fast_multipole_embedder::ArrayGraph::nodeInfo ( )
inline

Returns the NodeAdjInfo array for all nodes.

Definition at line 150 of file ArrayGraph.h.

◆ nodeInfo() [2/4]

const NodeAdjInfo * ogdf::fast_multipole_embedder::ArrayGraph::nodeInfo ( ) const
inline

Returns the NodeAdjInfo array for all nodes.

Definition at line 153 of file ArrayGraph.h.

◆ nodeInfo() [3/4]

NodeAdjInfo & ogdf::fast_multipole_embedder::ArrayGraph::nodeInfo ( uint32_t  i)
inline

Returns the adjacency information for the node at index i in m_nodeAdj.

Definition at line 138 of file ArrayGraph.h.

◆ nodeInfo() [4/4]

const NodeAdjInfo & ogdf::fast_multipole_embedder::ArrayGraph::nodeInfo ( uint32_t  i) const
inline

Returns the adjacency information for the node at index i in m_nodeAdj.

Definition at line 141 of file ArrayGraph.h.

◆ nodeMoveRadius()

float * ogdf::fast_multipole_embedder::ArrayGraph::nodeMoveRadius ( )
inline

Returns the node movement radius array for all nodes.

Definition at line 180 of file ArrayGraph.h.

◆ nodeSize() [1/2]

float * ogdf::fast_multipole_embedder::ArrayGraph::nodeSize ( )
inline

Returns the node size array for all nodes.

Definition at line 174 of file ArrayGraph.h.

◆ nodeSize() [2/2]

const float * ogdf::fast_multipole_embedder::ArrayGraph::nodeSize ( ) const
inline

Returns the node size array for all nodes.

Definition at line 177 of file ArrayGraph.h.

◆ nodeXPos() [1/2]

float * ogdf::fast_multipole_embedder::ArrayGraph::nodeXPos ( )
inline

Returns the x coord array for all nodes.

Definition at line 162 of file ArrayGraph.h.

◆ nodeXPos() [2/2]

const float * ogdf::fast_multipole_embedder::ArrayGraph::nodeXPos ( ) const
inline

Returns the x coord array for all nodes.

Definition at line 165 of file ArrayGraph.h.

◆ nodeYPos() [1/2]

float * ogdf::fast_multipole_embedder::ArrayGraph::nodeYPos ( )
inline

Returns the y coord array for all nodes.

Definition at line 168 of file ArrayGraph.h.

◆ nodeYPos() [2/2]

const float * ogdf::fast_multipole_embedder::ArrayGraph::nodeYPos ( ) const
inline

Returns the y coord array for all nodes.

Definition at line 171 of file ArrayGraph.h.

◆ numEdges()

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::numEdges ( ) const
inline

Returns the number of edges.

Definition at line 59 of file ArrayGraph.h.

◆ numNodes()

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::numNodes ( ) const
inline

Returns the number of nodes.

Definition at line 56 of file ArrayGraph.h.

◆ pushBackEdge()

void ogdf::fast_multipole_embedder::ArrayGraph::pushBackEdge ( uint32_t  a,
uint32_t  b,
float  desiredEdgeLength 
)
private

Internal function used by readFrom.

◆ readFrom() [1/2]

void ogdf::fast_multipole_embedder::ArrayGraph::readFrom ( const Graph G,
NodeArray< CoordinateType > &  xPos,
NodeArray< CoordinateType > &  yPos,
const EdgeArray< LengthType > &  edgeLength,
const NodeArray< SizeType > &  nodeSize 
)
inline

Updates an ArrayGraph with the given positions, edge lengths and node sizes and creates the edges.

The nodes and edges are ordered in the same way like in the Graph instance.

Parameters
Gthe Graph to traverse
xPosthe x coordinate for each node
yPosthe y coordinate for each node
nodeSizethe x coordinate for each node in G
edgeLengththe desired edge length for each edge
Template Parameters
CoordinateTypetype of the x and y positions
LengthTypetype of the edge lengths
SizeTypetype of the node sizes

Definition at line 84 of file ArrayGraph.h.

◆ readFrom() [2/2]

void ogdf::fast_multipole_embedder::ArrayGraph::readFrom ( const GraphAttributes GA,
const EdgeArray< float > &  edgeLength,
const NodeArray< float > &  nodeSize 
)

Updates an ArrayGraph from GraphAttributes with the given edge lengths and node sizes and creates the edges.

The nodes and edges are ordered in the same way like in the Graph instance.

Parameters
GAthe GraphAttributes to read from
edgeLengththe desired edge length
nodeSizethe size of the nodes

◆ transform()

void ogdf::fast_multipole_embedder::ArrayGraph::transform ( float  translate,
float  scale 
)

Transforms all positions via shifting them by translate and afterwards scaling by scale.

◆ twinNodeIndex()

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::twinNodeIndex ( uint32_t  currEdgeAdjIndex,
uint32_t  nodeIndex 
) const
inline

Returns the other node (not nodeIndex) of the pair with index currEdgeAdjIndex.

Definition at line 199 of file ArrayGraph.h.

◆ writeTo() [1/2]

void ogdf::fast_multipole_embedder::ArrayGraph::writeTo ( const Graph G,
NodeArray< CoordinateType > &  xPos,
NodeArray< CoordinateType > &  yPos 
)
inline

Store the data back to NodeArray arrays with the given coordinate type.

The function does not require to be the same Graph, only the order of nodes and edges is important

Parameters
Gthe graph containing all nodes
xPosthe x coordinate array to update
yPosthe y coordinate array to update
Template Parameters
CoordinateTypetype of the x and y positions

Definition at line 128 of file ArrayGraph.h.

◆ writeTo() [2/2]

void ogdf::fast_multipole_embedder::ArrayGraph::writeTo ( GraphAttributes GA)

Store the data back in GraphAttributes.

The function does not require to be the same Graph, only the order of nodes and edges is important

Parameters
GAthe GraphAttributes to update

Member Data Documentation

◆ m_avgNodeSize

double ogdf::fast_multipole_embedder::ArrayGraph::m_avgNodeSize
private

Avg.

node size.

Definition at line 249 of file ArrayGraph.h.

◆ m_desiredAvgEdgeLength

double ogdf::fast_multipole_embedder::ArrayGraph::m_desiredAvgEdgeLength
private

Avg.

edge length.

Definition at line 254 of file ArrayGraph.h.

◆ m_desiredEdgeLength

float* ogdf::fast_multipole_embedder::ArrayGraph::m_desiredEdgeLength
private

Edge lengths.

Definition at line 253 of file ArrayGraph.h.

◆ m_edgeAdj

EdgeAdjInfo* ogdf::fast_multipole_embedder::ArrayGraph::m_edgeAdj
private

Information about adjacent nodes.

Definition at line 257 of file ArrayGraph.h.

◆ m_nodeAdj

NodeAdjInfo* ogdf::fast_multipole_embedder::ArrayGraph::m_nodeAdj
private

Information about adjacent edges.

Definition at line 256 of file ArrayGraph.h.

◆ m_nodeMoveRadius

float* ogdf::fast_multipole_embedder::ArrayGraph::m_nodeMoveRadius
private

Maximum node movement lengths.

Definition at line 251 of file ArrayGraph.h.

◆ m_nodeSize

float* ogdf::fast_multipole_embedder::ArrayGraph::m_nodeSize
private

Sizes of the nodes.

Definition at line 248 of file ArrayGraph.h.

◆ m_nodeXPos

float* ogdf::fast_multipole_embedder::ArrayGraph::m_nodeXPos
private

The x coordinates.

Definition at line 245 of file ArrayGraph.h.

◆ m_nodeYPos

float* ogdf::fast_multipole_embedder::ArrayGraph::m_nodeYPos
private

The y coordinates.

Definition at line 246 of file ArrayGraph.h.

◆ m_numEdges

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::m_numEdges
private

Number of edges in the graph.

Definition at line 243 of file ArrayGraph.h.

◆ m_numNodes

uint32_t ogdf::fast_multipole_embedder::ArrayGraph::m_numNodes
private

Number of nodes in the graph.

Definition at line 242 of file ArrayGraph.h.


The documentation for this class was generated from the following file: