Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::HyperGraph Class Reference

#include <ogdf/basic/HyperGraph.h>

List of all members.

Classes

class  AdjArray
 AdjArray implementation. More...
class  AdjElement
 class for an adjacency element More...
class  ArrayController
 The ArrayController manages the GraphArrays of an Element. More...
class  EdgeArray
 EdgeArray implementation. More...
class  EdgeElement
 Class for a hyper edge. More...
class  GraphArray
class  GraphArrayBase
class  NodeArray
 NodeArray implementation. More...
class  NodeElement
 Class for a node element. More...

Public Types

typedef NodeElementnode
typedef EdgeElementedge
typedef EList< HyperGraph,
NodeElement,&HyperGraph::m_numNodes,&HyperGraph::m_pFirstNode,&HyperGraph::m_pLastNode,&NodeElement::m_pPrev,&NodeElement::m_pNext
NodeList
typedef EList< HyperGraph,
EdgeElement,&HyperGraph::m_numEdges,&HyperGraph::m_pFirstEdge,&HyperGraph::m_pLastEdge,&EdgeElement::m_pPrev,&EdgeElement::m_pNext
EdgeList
 typedef for the embedded list of edges
typedef EList< NodeElement,
AdjElement,&NodeElement::m_numAdj,&NodeElement::m_pFirstAdj,&NodeElement::m_pLastAdj,&AdjElement::m_pPrev_nodeAdj,&AdjElement::m_pNext_nodeAdj
NodeAdjList
 typedef for the embedded list of AdjElement at a node
typedef EList< EdgeElement,
AdjElement,&EdgeElement::m_numAdj,&EdgeElement::m_pFirstAdj,&EdgeElement::m_pLastAdj,&AdjElement::m_pPrev_edgeAdj,&AdjElement::m_pNext_edgeAdj
EdgeAdjList
 typedef for the embedded list of AdjElement at an edge

Public Member Functions

 HyperGraph ()
 Constructor for an empty hyper graph.
NodeElementnewNode ()
 Creates a new node.
EdgeElementnewEdge ()
 Creates a new edge which is not incident to any nodes.
EdgeElementnewEdge (NodeElement *pNode1, NodeElement *pNode2)
 Creates a new edge which is incident to the two nodes pNode1, pNode2.
AdjElementnewAdjElement (NodeElement *pNode, EdgeElement *pEdge)
 Creates a new AdjElement which makes pNode and pEdge incident.
void delAdjElement (AdjElement *pAdj)
 Deletes pAdj.
void delAdjElement (NodeElement *pNode, EdgeElement *pEdge)
 Deletes pAdj.
AdjElementaddNode (NodeElement *pNode, EdgeElement *pEdge, bool checkIfAlreadyExists=false)
 Makes pNode and pEdge incident and the corresponding AdjElement is returned.
void removeNode (NodeElement *pNode, EdgeElement *pEdge, bool removeDuplicates=false)
 If pNode and pEdge are incident, the corresponding AdjElement is removed.
AdjElementfindAdjElement (NodeElement *pNode, EdgeElement *pEdge) const
 Returns the AdjElement for pNode and pEdge.
void delEdge (EdgeElement *pEdge)
 Deletes an edge.
void delNode (NodeElement *pNode)
 Deletes a node.
int numberOfNodes () const
int numberOfEdges () const
void clear ()
 Clears the graph.
void toCliqueGraph (Graph *pG, ogdf::NodeArray< NodeElement * > *pNodeMap=0, ogdf::EdgeArray< EdgeElement * > *pEdgeMap=0)
void toStarGraph (Graph *pG, ogdf::NodeArray< NodeElement * > *pNodeMap=0, ogdf::EdgeArray< EdgeElement * > *pEdgeMap=0)

Protected Member Functions

void registerArray (GraphArrayBase< NodeElement > *pArray)
void registerArray (GraphArrayBase< EdgeElement > *pArray)
void registerArray (GraphArrayBase< AdjElement > *pArray)
void unregisterArray (GraphArrayBase< NodeElement > *pArray)
void unregisterArray (GraphArrayBase< EdgeElement > *pArray)
void unregisterArray (GraphArrayBase< AdjElement > *pArray)
NodeElementallocateNodeElement ()
 Allocates a new NodeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.
EdgeElementallocateEdgeElement ()
 Allocates a new EdgeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.
AdjElementallocateAdjElement ()
 Allocates a new AdjElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.
void freeNodeElement (NodeElement *pNode)
 Frees a used NodeElement.
void freeEdgeElement (EdgeElement *pEdge)
 Frees a used EdgeElement.
void freeAdjElement (AdjElement *pAdj)
 Frees a used AdjElement.

Protected Attributes

NodeElementm_pFirstNode
NodeElementm_pLastNode
int m_numNodes
EdgeElementm_pFirstEdge
EdgeElementm_pLastEdge
int m_numEdges
EFreeListIndexPool
< NodeElement,&NodeElement::m_pNext,&NodeElement::m_index
m_nodeAllocator
EFreeListIndexPool
< EdgeElement,&EdgeElement::m_pNext,&EdgeElement::m_index
m_edgeAllocator
EFreeListIndexPool< AdjElement,&AdjElement::m_pNext_nodeAdj,&AdjElement::m_indexm_adjAllocator
ArrayController< NodeElementm_nodeArrayController
 controller for node arrays
ArrayController< EdgeElementm_edgeArrayController
 controller for edge arrays
ArrayController< AdjElementm_adjArrayController
 controller for adj arrays

Detailed Description

Definition at line 56 of file HyperGraph.h.


Member Typedef Documentation

Definition at line 142 of file HyperGraph.h.

Definition at line 141 of file HyperGraph.h.


Constructor & Destructor Documentation

Constructor for an empty hyper graph.

Definition at line 457 of file HyperGraph.h.


Member Function Documentation

AdjElement* ogdf::HyperGraph::addNode ( NodeElement pNode,
EdgeElement pEdge,
bool  checkIfAlreadyExists = false 
) [inline]

Makes pNode and pEdge incident and the corresponding AdjElement is returned.

Definition at line 525 of file HyperGraph.h.

Allocates a new AdjElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 401 of file HyperGraph.h.

Allocates a new EdgeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 393 of file HyperGraph.h.

Allocates a new NodeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 385 of file HyperGraph.h.

void ogdf::HyperGraph::clear ( ) [inline]

Clears the graph.

Definition at line 618 of file HyperGraph.h.

void ogdf::HyperGraph::delAdjElement ( AdjElement pAdj) [inline]

Deletes pAdj.

Definition at line 510 of file HyperGraph.h.

void ogdf::HyperGraph::delAdjElement ( NodeElement pNode,
EdgeElement pEdge 
) [inline]

Deletes pAdj.

Definition at line 518 of file HyperGraph.h.

void ogdf::HyperGraph::delEdge ( EdgeElement pEdge) [inline]

Deletes an edge.

Definition at line 587 of file HyperGraph.h.

void ogdf::HyperGraph::delNode ( NodeElement pNode) [inline]

Deletes a node.

Definition at line 601 of file HyperGraph.h.

AdjElement* ogdf::HyperGraph::findAdjElement ( NodeElement pNode,
EdgeElement pEdge 
) const [inline]

Returns the AdjElement for pNode and pEdge.

In case pNode and pEdge are not incident the function returns 0. Note: The function requires time O(min(degree(pNode), cardinality(pEdge))).

Parameters:
pNodeis the node.
pEdgeis the hyper edge.

Definition at line 566 of file HyperGraph.h.

void ogdf::HyperGraph::freeAdjElement ( AdjElement pAdj) [inline, protected]

Frees a used AdjElement.

Definition at line 421 of file HyperGraph.h.

void ogdf::HyperGraph::freeEdgeElement ( EdgeElement pEdge) [inline, protected]

Frees a used EdgeElement.

Definition at line 415 of file HyperGraph.h.

void ogdf::HyperGraph::freeNodeElement ( NodeElement pNode) [inline, protected]

Frees a used NodeElement.

Definition at line 409 of file HyperGraph.h.

AdjElement* ogdf::HyperGraph::newAdjElement ( NodeElement pNode,
EdgeElement pEdge 
) [inline]

Creates a new AdjElement which makes pNode and pEdge incident.

Note: This function does not check if pNode and pEdge are already incident. The HyperGraph can deal with duplicate AdjElements. However, for reasons of clarity it is not a good idea to make use of it.

Parameters:
pNodeis the node.
pEdgeis the hyper edge.

Definition at line 498 of file HyperGraph.h.

Creates a new edge which is not incident to any nodes.

Definition at line 473 of file HyperGraph.h.

EdgeElement* ogdf::HyperGraph::newEdge ( NodeElement pNode1,
NodeElement pNode2 
) [inline]

Creates a new edge which is incident to the two nodes pNode1, pNode2.

Definition at line 482 of file HyperGraph.h.

Creates a new node.

Definition at line 464 of file HyperGraph.h.

int ogdf::HyperGraph::numberOfEdges ( ) const [inline]

Definition at line 615 of file HyperGraph.h.

int ogdf::HyperGraph::numberOfNodes ( ) const [inline]

Definition at line 614 of file HyperGraph.h.

void ogdf::HyperGraph::registerArray ( GraphArrayBase< NodeElement > *  pArray) [inline, protected]

Definition at line 375 of file HyperGraph.h.

void ogdf::HyperGraph::registerArray ( GraphArrayBase< EdgeElement > *  pArray) [inline, protected]

Definition at line 376 of file HyperGraph.h.

void ogdf::HyperGraph::registerArray ( GraphArrayBase< AdjElement > *  pArray) [inline, protected]

Definition at line 377 of file HyperGraph.h.

void ogdf::HyperGraph::removeNode ( NodeElement pNode,
EdgeElement pEdge,
bool  removeDuplicates = false 
) [inline]

If pNode and pEdge are incident, the corresponding AdjElement is removed.

Note: The function requires time O(min(degree(pNode), cardinality(pEdge))).

Parameters:
pNodeis the node.
pEdgeis the hyper edge.
removeDuplicatesis a flag, if it is set the function will remove any existing duplicates too.

Definition at line 543 of file HyperGraph.h.

void ogdf::HyperGraph::toCliqueGraph ( Graph pG,
ogdf::NodeArray< NodeElement * > *  pNodeMap = 0,
ogdf::EdgeArray< EdgeElement * > *  pEdgeMap = 0 
) [inline]

Definition at line 631 of file HyperGraph.h.

void ogdf::HyperGraph::toStarGraph ( Graph pG,
ogdf::NodeArray< NodeElement * > *  pNodeMap = 0,
ogdf::EdgeArray< EdgeElement * > *  pEdgeMap = 0 
) [inline]

Definition at line 665 of file HyperGraph.h.

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< NodeElement > *  pArray) [inline, protected]

Definition at line 380 of file HyperGraph.h.

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< EdgeElement > *  pArray) [inline, protected]

Definition at line 381 of file HyperGraph.h.

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< AdjElement > *  pArray) [inline, protected]

Definition at line 382 of file HyperGraph.h.


Member Data Documentation

controller for adj arrays

Definition at line 373 of file HyperGraph.h.

controller for edge arrays

Definition at line 372 of file HyperGraph.h.

controller for node arrays

Definition at line 371 of file HyperGraph.h.

Definition at line 151 of file HyperGraph.h.

Definition at line 147 of file HyperGraph.h.

Definition at line 149 of file HyperGraph.h.

Definition at line 145 of file HyperGraph.h.

Definition at line 150 of file HyperGraph.h.

Definition at line 146 of file HyperGraph.h.


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