38 namespace fast_multipole_embedder {
47 ArrayGraph(uint32_t maxNumNodes, uint32_t maxNumEdges);
82 template<
typename CoordinateType,
typename LengthType,
typename SizeType>
128 template<
typename CoordinateType>
204 inline uint32_t
twinNodeIndex(uint32_t currEdgeAdjIndex, uint32_t nodeIndex)
const 210 void for_all_nodes(uint32_t begin, uint32_t end, std::function<
void(uint32_t)> func)
212 for(uint32_t i=begin; i <=end; i++)
223 void transform(
float translate,
float scale);
node target() const
Returns the target node of the edge.
double m_desiredAvgEdgeLength
Avg.
float * m_nodeMoveRadius
Maximum node movement lengths.
uint32_t numEdges() const
Returns the number of edges.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
float * desiredEdgeLength()
Returns the edge length array for all edges.
uint32_t twinNodeIndex(uint32_t currEdgeAdjIndex, uint32_t nodeIndex) const
Returns the other node (not nodeIndex) of the pair with index currEdgeAdjIndex.
Data type for general directed graphs (adjacency list representation).
EdgeAdjInfo * m_edgeAdj
Information about adjacent nodes.
uint32_t firstEdgeAdjIndex(uint32_t nodeIndex) const
Returns the index of the first pair of the node with index nodeIndex in m_nodeAdj.
void transform(float translate, float scale)
Transforms all positions via shifting them by translate and afterwards scaling by scale...
void clear()
Clear the arrays.
~ArrayGraph()
Destructor. Deallocates the memory via OGDF_FREE_16 if needed.
Information about incident edges (16 bytes).
uint32_t twinNode(uint32_t index) const
Returns the other node (not index).
NodeAdjInfo * m_nodeAdj
Information about adjacent edges.
void deallocate()
Deallocate all arrays.
NodeAdjInfo * nodeInfo()
Returns the NodeAdjInfo array for all nodes.
const float * nodeYPos() const
Returns the y coord array for all nodes.
uint32_t firstEntry
The first pair in the edges chain.
EdgeAdjInfo * edgeInfo()
Returns the EdgeAdjInfo array for all edges.
ArrayGraph()
Constructor. Does not allocate memory for the members.
const NodeAdjInfo * nodeInfo() const
Returns the NodeAdjInfo array for all nodes.
void writeTo(GraphAttributes &GA)
Store the data back in GraphAttributes.
float * m_nodeYPos
The y coordinates.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
float * m_nodeSize
Sizes of the nodes.
NodeAdjInfo & nodeInfo(uint32_t i)
Returns the adjacency information for the node at index i in m_nodeAdj.
float * nodeXPos()
Returns the x coord array for all nodes.
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...
Information about an edge (16 bytes).
uint32_t m_numNodes
Number of nodes in the graph.
uint32_t numNodes() const
Returns the number of nodes.
Stores additional attributes of a graph (like layout information).
const float * desiredEdgeLength() const
Returns the edge length array for all edges.
const float * nodeXPos() const
Returns the x coord array for all nodes.
void writeTo(const Graph &G, NodeArray< CoordinateType > &xPos, NodeArray< CoordinateType > &yPos)
Store the data back to NodeArray arrays with the given coordinate type.
const EdgeAdjInfo * edgeInfo() const
Returns the EdgeAdjInfo array for all edges.
uint32_t degree
Total count of pairs where is either the first or second node.
float avgNodeSize() const
Average node size.
Datastructures for edge chains itself and the edge chains of nodes.
Class for the representation of edges.
const NodeAdjInfo & nodeInfo(uint32_t i) const
Returns the adjacency information for the node at index i in m_nodeAdj.
void allocate(uint32_t numNodes, uint32_t numEdges)
Allocate all arrays.
float * nodeSize()
Returns the node size array for all nodes.
const float * nodeSize() const
Returns the node size array for all nodes.
Class for the representation of nodes.
EdgeAdjInfo & edgeInfo(uint32_t i)
Returns the adjacency information for the edge at index i in m_edgeAdj.
float * m_nodeXPos
The x coordinates.
uint32_t m_numEdges
Number of edges in the graph.
uint32_t nextEdgeAdjIndex(uint32_t index) const
Returns the index of the next pair of index.
void centerGraph()
Transforming all positions such that the new center is at (0,0).
float * m_desiredEdgeLength
Edge lengths.
void pushBackEdge(uint32_t a, uint32_t b, float desiredEdgeLength)
Internal function used by readFrom.
node source() const
Returns the source node of the edge.
The namespace for all OGDF objects.
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.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
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...
float * nodeYPos()
Returns the y coord array for all nodes.
float * nodeMoveRadius()
Returns the node movement radius array for all nodes.
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.
float avgDesiredEdgeLength() const
Average edge length.
const EdgeAdjInfo & edgeInfo(uint32_t i) const
Returns the adjacency information for the edge at index i in m_edgeAdj.