 |
Open Graph Drawing Framework |
v. 2022.02 (Dogwood)
|
|
|
Go to the documentation of this file.
40 #define forall_adj_elements(adj,ge) for((adj)=(v)->firstAdj();(adj);(adj)=(adj)->succ())
43 #define forall_hypernodes(v,H) for((v)=(H).firstHypernode(); (v); (v)=(v)->succ())
46 #define forall_rev_hypernodes(v,H) for((v)=(H).lastHypernode(); (v); (v)=(v)->pred())
49 #define forall_hyperedges(e,H) for((e)=(H).firstHyperedge(); (e); (e)=(e)->succ())
52 #define forall_rev_hyperedges(e,H) for((e)=(H).lastHyperedge(); (e); (e)=(e)->pred())
78 friend class GraphListBase;
100 : m_element(pElement), m_twin(nullptr), m_index(0)
105 : m_element(pElement), m_twin(nullptr), m_index(pIndex)
158 friend class GraphListBase;
180 : m_index(pIndex), m_cardinality(0), m_hypergraph(nullptr) { }
193 return m_cardinality;
205 return m_adjHypernodes.
head();
211 return m_adjHypernodes.
tail();
217 return m_adjHypernodes;
225 hypernodes.pushBack(
reinterpret_cast<hypernode>(adj->element()));
232 if (
reinterpret_cast<hypernode>(adj->element()) == v) {
266 friend class GraphListBase;
306 : m_index(pIndex), m_degree(0), m_type(
Type::normal), m_hypergraph(nullptr)
312 : m_index(pIndex), m_degree(0), m_type(pType), m_hypergraph(nullptr)
351 return m_adjHyperedges.
head();
357 return m_adjHyperedges.
tail();
365 hyperedges.pushBack(
reinterpret_cast<hyperedge>(adj->element()));
450 return m_nHypernodes == 0;
468 return m_nHypernodes;
474 return m_nHyperedges;
480 return m_hypernodeIdCount - 1;
486 return m_hyperedgeIdCount - 1;
492 return m_hypernodes.
head();
498 return m_hypernodes.
tail();
504 return m_hyperedges.
head();
510 return m_hyperedges.
tail();
516 return m_hypernodeArrayTableSize;
522 return m_hyperedgeArrayTableSize;
576 hypernodeList.clear();
578 hypernodeList.pushBack(v);
584 hyperedgeList.clear();
586 hyperedgeList.pushBack(e);
590 void readBenchHypergraph(std::istream &is);
593 void readBenchHypergraph(
const char *filename);
596 void readPlaHypergraph(std::istream &is);
599 void loadPlaHypergraph(
const char *fileName);
602 bool consistency()
const;
636 void initObservers();
638 int nextEntry(
char *buffer,
int from,
string stop);
int numberOfHyperedges() const
Returns the number of hyperedges in the hypergraph.
int maxHyperedgeIndex() const
Returns the largest used hyperedge index.
The namespace for all OGDF objects.
Dynamic arrays indexed with nodes.
ListPure< HypergraphArrayBase * > m_hypernodeArrays
The registered hypergraph arrays & observers.
GraphElement * element() const
Returns the element associated with this adjacency entry.
T * tail() const
Returns the last element in the list.
void allHyperedges(LIST &hyperedgeList) const
Returns a list with all hyperedges of the hypergraph.
void allHypernodes(LIST &hypernodeList) const
Returns a list with all hypernodes of the hypergraph.
int cardinality() const
Returns the number of incident hypernodes.
adjHypergraphEntry pred() const
Returns the predecessor in the adjacency list.
Dynamic arrays indexed with hypernodes.
The base class for objects used by (hyper)graphs.
int m_nHyperedges
The number of hyperedges in the hypergraph.
HypernodeElement(int pIndex, Type pType)
Constructor.
internal::GraphList< HypernodeElement > hypernodes() const
Returns the list of all hypernodes.
bool incident(hypernode v) const
Returns true iff v is incident to the hyperedge.
internal::GraphList< HyperedgeElement > m_hyperedges
The list of all hyperedges.
int m_index
The (unique) index of the adjacency entry.
HyperedgeElement(int pIndex)
Constructs an hyperedge element between hypernodes.
int m_hyperedgeArrayTableSize
The current table size of hyperedge arrays within the hypergraph.
GraphElement * m_element
The associated hyperedge or hypernode.
Class for the representation of hyperedges.
adjHypergraphEntry firstAdj() const
Returns the first entry in the adjaceny list.
int m_degree
The number of incident hyperedges.
adjHypergraphEntry succ() const
Returns the successor in the adjacency list.
hypernode pred() const
Returns the predecessor in the list of all hypernodes.
int hyperedgeArrayTableSize() const
Returns the table size of hyperedge arrays within the hypergraph.
ListPure< HypergraphArrayBase * > m_hyperedgeArrays
Abstract base class for hypergraph arrays.
internal::GraphList< AdjHypergraphElement > incidentHypernodes() const
Returns the incident hypernodes of the hyperedge.
hyperedge lastHyperEdge() const
Returns the last hyperedge in the list of all hyperedges.
void type(Type pType)
Sets the type of hypernode.
int index() const
Returns the index of a hyperedge.
int maxHypernodeIndex() const
Returns the largest used hypernode index.
int m_nHypernodes
The number of hypernodes in the hypergraph.
Class for adjacency list elements.
Type
The type of hypernodes.
int m_cardinality
The number of incidend hypernodes.
Hypergraph * m_hypergraph
The hypergraph containing the hypernode (if any).
Decralation of GraphElement and GraphList classes.
hyperedge firstHyperedge() const
Returns the first hyperedge in the list of all hyperedges.
int m_hyperedgeIdCount
The Index that will be assigned to the next created hyperedge.
Hypergraph * hypergraph() const
Returns the hypergraph containing the hypernode.
adjHypergraphEntry twin() const
Returns the pointer to a twin adjacency list.
AdjHypergraphElement(GraphElement *pElement, int pIndex)
Constructs an adjacency entry for a given hyper{node,edge} and index.
internal::GraphList< AdjHypergraphElement > m_adjHyperedges
The adjacency list of the hypernode.
internal::GraphList< HypernodeElement > m_hypernodes
The list of all hypernodes.
ListPure< HypergraphObserver * > m_observers
Hypergraph * hypergraph() const
Returns the hypergraph containing the hyperedge.
hyperedge pred() const
Returns the predecessor in the list of all hyperedges.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
bool empty() const
Returns true iff the hypergraph is empty (ie. contains no hypernodes).
int numberOfHypernodes() const
Returns the number of hypernodes in the hypergraph.
int m_index
The (unique) index of the hypernode.
int m_hypernodeArrayTableSize
The current table size of hypernode arrays within the hypergraph.
int index() const
Returns the (unique) hypernode index.
Doubly linked lists (maintaining the length of the list).
Lists of graph objects (like nodes, edges, etc.).
Hypergraph * m_hypergraph
The hypergraph containing the hyperedge (if any).
adjHypergraphEntry firstAdj() const
Returns the first entry in the adjaceny list.
adjHypergraphEntry m_twin
The corresponding adjacency entry.
bool adjacent(hypernode v) const
Returns true iff v is adjacent to the hypernode.
hyperedge succ() const
Returns the successor in the list of all hyperedges.
void allHyperedges(NODELIST &hyperedges) const
Returns a list with all incident hyperedges of the hypernode.
int index() const
Returns the index of this adjacency element.
bool operator==(const hyperedge e) const
Equality operator.
hypernode firstHypernode() const
Returns the first hypernode in the list of all hypernodes.
hypernode lastHypernode() const
Returns the last hypernode in the list of all hypernodes.
internal::GraphList< AdjHypergraphElement > m_adjHypernodes
The adjacency list of the hyperedge.
T * head() const
Returns the first element in the list.
bool operator==(const hypernode v) const
Equality operator.
int degree() const
Returns the hypernode degree.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
internal::GraphList< HyperedgeElement > hyperedges() const
Returns the list of all hyperedges.
int hypernodeArrayTableSize() const
Returns the table size of hypernode arrays with the hypergraph.
hypernode succ() const
Returns the successor in the list of all hypernodes.
void allHypernodes(NODELIST &hypernodes) const
Returns a list with all incident hypernodes of the hyperedge.
adjHypergraphEntry lastAdj() const
Returns the last entry in the adjacency list.
Declaration of doubly linked lists and iterators.
HypernodeElement(int pIndex)
Constructor.
std::istream & operator>>(std::istream &is, TokenIgnorer token)
Type type() const
Returns the type of hypernode.
Encapsulates a pointer to a list element.
adjHypergraphEntry lastAdj() const
Returns the last entry in the adjacency list.
Type m_type
The type of the hypernode.
AdjHypergraphElement(GraphElement *pElement)
Constructs an adjacency element for a given hyper{node,edge}.
int m_index
The (unique) index of the hyperedge.
Class for the representation of hypernodes.
int m_hypernodeIdCount
The Index that will be assigned to the next created hypernode.