#include <ogdf/energybased/fast_multipole_embedder/ArrayGraph.h>
Public Member Functions | |
ArrayGraph () | |
Constructor. Does not allocate memory for the members. More... | |
ArrayGraph (const GraphAttributes &GA, const EdgeArray< float > &edgeLength, const NodeArray< float > &nodeSize) | |
Constructor. More... | |
ArrayGraph (uint32_t maxNumNodes, uint32_t maxNumEdges) | |
Constructor. Allocates memory via OGDF_MALLOC_16. More... | |
~ArrayGraph () | |
Destructor. Deallocates the memory via OGDF_FREE_16 if needed. More... | |
float | avgDesiredEdgeLength () const |
Average edge length. More... | |
float | avgNodeSize () const |
Average node size. More... | |
void | centerGraph () |
Transforming all positions such that the new center is at (0,0). More... | |
float * | desiredEdgeLength () |
Returns the edge length array for all edges. More... | |
const float * | desiredEdgeLength () const |
Returns the edge length array for all edges. More... | |
EdgeAdjInfo * | edgeInfo () |
Returns the EdgeAdjInfo array for all edges. More... | |
const EdgeAdjInfo * | edgeInfo () const |
Returns the EdgeAdjInfo array for all edges. More... | |
EdgeAdjInfo & | edgeInfo (uint32_t i) |
Returns the adjacency information for the edge at index i in m_edgeAdj. More... | |
const EdgeAdjInfo & | edgeInfo (uint32_t i) const |
Returns the adjacency information for the edge at index i in m_edgeAdj. More... | |
uint32_t | firstEdgeAdjIndex (uint32_t nodeIndex) const |
Returns the index of the first pair of the node with index nodeIndex in m_nodeAdj. More... | |
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 . More... | |
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 . More... | |
NodeAdjInfo * | nodeInfo () |
Returns the NodeAdjInfo array for all nodes. More... | |
const NodeAdjInfo * | nodeInfo () const |
Returns the NodeAdjInfo array for all nodes. More... | |
NodeAdjInfo & | nodeInfo (uint32_t i) |
Returns the adjacency information for the node at index i in m_nodeAdj. More... | |
const NodeAdjInfo & | nodeInfo (uint32_t i) const |
Returns the adjacency information for the node at index i in m_nodeAdj. More... | |
float * | nodeMoveRadius () |
Returns the node movement radius array for all nodes. More... | |
float * | nodeSize () |
Returns the node size array for all nodes. More... | |
const float * | nodeSize () const |
Returns the node size array for all nodes. More... | |
float * | nodeXPos () |
Returns the x coord array for all nodes. More... | |
const float * | nodeXPos () const |
Returns the x coord array for all nodes. More... | |
float * | nodeYPos () |
Returns the y coord array for all nodes. More... | |
const float * | nodeYPos () const |
Returns the y coord array for all nodes. More... | |
uint32_t | numEdges () const |
Returns the number of edges. More... | |
uint32_t | numNodes () const |
Returns the number of nodes. More... | |
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. More... | |
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. More... | |
void | transform (float translate, float scale) |
Transforms all positions via shifting them by translate and afterwards scaling by scale . More... | |
uint32_t | twinNodeIndex (uint32_t currEdgeAdjIndex, uint32_t nodeIndex) const |
Returns the other node (not nodeIndex ) of the pair with index currEdgeAdjIndex . More... | |
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. More... | |
void | writeTo (GraphAttributes &GA) |
Store the data back in GraphAttributes. More... | |
Private Member Functions | |
void | allocate (uint32_t numNodes, uint32_t numEdges) |
Allocate all arrays. More... | |
void | clear () |
Clear the arrays. More... | |
void | deallocate () |
Deallocate all arrays. More... | |
void | pushBackEdge (uint32_t a, uint32_t b, float desiredEdgeLength) |
Internal function used by readFrom. More... | |
Private Attributes | |
double | m_avgNodeSize |
Avg. More... | |
double | m_desiredAvgEdgeLength |
Avg. More... | |
float * | m_desiredEdgeLength |
Edge lengths. More... | |
EdgeAdjInfo * | m_edgeAdj |
Information about adjacent nodes. More... | |
NodeAdjInfo * | m_nodeAdj |
Information about adjacent edges. More... | |
float * | m_nodeMoveRadius |
Maximum node movement lengths. More... | |
float * | m_nodeSize |
Sizes of the nodes. More... | |
float * | m_nodeXPos |
The x coordinates. More... | |
float * | m_nodeYPos |
The y coordinates. More... | |
uint32_t | m_numEdges |
Number of edges in the graph. More... | |
uint32_t | m_numNodes |
Number of nodes in the graph. More... | |
Definition at line 46 of file ArrayGraph.h.
ogdf::fast_multipole_embedder::ArrayGraph::ArrayGraph | ( | ) |
Constructor. Does not allocate memory for the members.
ogdf::fast_multipole_embedder::ArrayGraph::ArrayGraph | ( | uint32_t | maxNumNodes, |
uint32_t | maxNumEdges | ||
) |
Constructor. Allocates memory via OGDF_MALLOC_16.
ogdf::fast_multipole_embedder::ArrayGraph::ArrayGraph | ( | const GraphAttributes & | GA, |
const EdgeArray< float > & | edgeLength, | ||
const NodeArray< float > & | nodeSize | ||
) |
Constructor.
ogdf::fast_multipole_embedder::ArrayGraph::~ArrayGraph | ( | ) |
Destructor. Deallocates the memory via OGDF_FREE_16 if needed.
|
private |
Allocate all arrays.
|
inline |
Average edge length.
Definition at line 217 of file ArrayGraph.h.
|
inline |
Average node size.
Definition at line 220 of file ArrayGraph.h.
void ogdf::fast_multipole_embedder::ArrayGraph::centerGraph | ( | ) |
Transforming all positions such that the new center is at (0,0).
|
inlineprivate |
Clear the arrays.
Definition at line 239 of file ArrayGraph.h.
|
private |
Deallocate all arrays.
|
inline |
Returns the edge length array for all edges.
Definition at line 189 of file ArrayGraph.h.
|
inline |
Returns the edge length array for all edges.
Definition at line 192 of file ArrayGraph.h.
|
inline |
Returns the EdgeAdjInfo array for all edges.
Definition at line 162 of file ArrayGraph.h.
|
inline |
Returns the EdgeAdjInfo array for all edges.
Definition at line 165 of file ArrayGraph.h.
|
inline |
Returns the adjacency information for the edge at index i
in m_edgeAdj.
Definition at line 150 of file ArrayGraph.h.
|
inline |
Returns the adjacency information for the edge at index i
in m_edgeAdj.
Definition at line 153 of file ArrayGraph.h.
|
inline |
Returns the index of the first pair of the node with index nodeIndex
in m_nodeAdj.
Definition at line 195 of file ArrayGraph.h.
|
inline |
Calls func
on all nodes with indices from begin
to end
.
Definition at line 210 of file ArrayGraph.h.
|
inline |
Returns the index of the next pair of currEdgeAdjIndex
of the node with index nodeIndex
.
Definition at line 200 of file ArrayGraph.h.
|
inline |
Returns the NodeAdjInfo array for all nodes.
Definition at line 156 of file ArrayGraph.h.
|
inline |
Returns the NodeAdjInfo array for all nodes.
Definition at line 159 of file ArrayGraph.h.
|
inline |
Returns the adjacency information for the node at index i
in m_nodeAdj.
Definition at line 144 of file ArrayGraph.h.
|
inline |
Returns the adjacency information for the node at index i
in m_nodeAdj.
Definition at line 147 of file ArrayGraph.h.
|
inline |
Returns the node movement radius array for all nodes.
Definition at line 186 of file ArrayGraph.h.
|
inline |
Returns the node size array for all nodes.
Definition at line 180 of file ArrayGraph.h.
|
inline |
Returns the node size array for all nodes.
Definition at line 183 of file ArrayGraph.h.
|
inline |
Returns the x coord array for all nodes.
Definition at line 168 of file ArrayGraph.h.
|
inline |
Returns the x coord array for all nodes.
Definition at line 171 of file ArrayGraph.h.
|
inline |
Returns the y coord array for all nodes.
Definition at line 174 of file ArrayGraph.h.
|
inline |
Returns the y coord array for all nodes.
Definition at line 177 of file ArrayGraph.h.
|
inline |
Returns the number of edges.
Definition at line 65 of file ArrayGraph.h.
|
inline |
Returns the number of nodes.
Definition at line 62 of file ArrayGraph.h.
|
private |
Internal function used by readFrom.
|
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.
G | the Graph to traverse |
xPos | the x coordinate for each node |
yPos | the y coordinate for each node |
nodeSize | the x coordinate for each node in G |
edgeLength | the desired edge length for each edge |
CoordinateType | type of the x and y positions |
LengthType | type of the edge lengths |
SizeType | type of the node sizes |
Definition at line 90 of file ArrayGraph.h.
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.
GA | the GraphAttributes to read from |
edgeLength | the desired edge length |
nodeSize | the size of the nodes |
void ogdf::fast_multipole_embedder::ArrayGraph::transform | ( | float | translate, |
float | scale | ||
) |
Transforms all positions via shifting them by translate
and afterwards scaling by scale
.
|
inline |
Returns the other node (not nodeIndex
) of the pair with index currEdgeAdjIndex
.
Definition at line 205 of file ArrayGraph.h.
|
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
G | the graph containing all nodes |
xPos | the x coordinate array to update |
yPos | the y coordinate array to update |
CoordinateType | type of the x and y positions |
Definition at line 134 of file ArrayGraph.h.
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
GA | the GraphAttributes to update |
|
private |
|
private |
|
private |
Edge lengths.
Definition at line 259 of file ArrayGraph.h.
|
private |
Information about adjacent nodes.
Definition at line 263 of file ArrayGraph.h.
|
private |
Information about adjacent edges.
Definition at line 262 of file ArrayGraph.h.
|
private |
Maximum node movement lengths.
Definition at line 257 of file ArrayGraph.h.
|
private |
Sizes of the nodes.
Definition at line 254 of file ArrayGraph.h.
|
private |
The x coordinates.
Definition at line 251 of file ArrayGraph.h.
|
private |
The y coordinates.
Definition at line 252 of file ArrayGraph.h.
|
private |
Number of edges in the graph.
Definition at line 249 of file ArrayGraph.h.
|
private |
Number of nodes in the graph.
Definition at line 248 of file ArrayGraph.h.