Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Hypergraph.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/GraphList.h>
37 #include <ogdf/basic/Observer.h>
39 #include <ogdf/basic/basic.h>
40 #include <ogdf/basic/memory.h>
41 
42 #include <iosfwd>
43 #include <string>
44 
45 namespace ogdf {
46 template<class E>
47 class List;
48 } // namespace ogdf
49 
51 #define forall_adj_elements(adj, ge) for ((adj) = (v)->firstAdj(); (adj); (adj) = (adj)->succ())
52 
54 #define forall_hypernodes(v, H) for ((v) = (H).firstHypernode(); (v); (v) = (v)->succ())
55 
57 #define forall_rev_hypernodes(v, H) for ((v) = (H).lastHypernode(); (v); (v) = (v)->pred())
58 
60 #define forall_hyperedges(e, H) for ((e) = (H).firstHyperedge(); (e); (e) = (e)->succ())
61 
63 #define forall_rev_hyperedges(e, H) for ((e) = (H).lastHyperedge(); (e); (e) = (e)->pred())
64 
65 namespace ogdf {
66 
67 class OGDF_EXPORT AdjHypergraphElement; // IWYU pragma: keep
68 class OGDF_EXPORT HyperedgeElement; // IWYU pragma: keep
69 class OGDF_EXPORT Hypergraph; // IWYU pragma: keep
70 class OGDF_EXPORT HypernodeElement; // IWYU pragma: keep
71 
74 
77 
80 
82 
87  friend class Hypergraph;
88  friend class GraphListBase;
90 
91 private:
93  GraphElement* m_element;
94 
96 
103 
105  int m_index;
106 
108  explicit AdjHypergraphElement(GraphElement* pElement)
109  : m_element(pElement), m_twin(nullptr), m_index(0) { }
110 
112  AdjHypergraphElement(GraphElement* pElement, int pIndex)
113  : m_element(pElement), m_twin(nullptr), m_index(pIndex) { }
114 
115 public:
117  int index() const { return m_index; }
118 
120 
125  GraphElement* element() const { return m_element; }
126 
128  adjHypergraphEntry twin() const { return m_twin; }
129 
131  adjHypergraphEntry succ() const { return static_cast<adjHypergraphEntry>(m_next); }
132 
134  adjHypergraphEntry pred() const { return static_cast<adjHypergraphEntry>(m_prev); }
135 
137  adjHypergraphEntry cyclicSucc() const;
138 
140  adjHypergraphEntry cyclicPred() const;
141 
143 };
144 
147  friend class Hypergraph;
148  friend class GraphListBase;
150 
151 private:
154 
156  int m_index;
157 
160 
163 
165 
168  explicit HyperedgeElement(int pIndex)
169  : m_index(pIndex), m_cardinality(0), m_hypergraph(nullptr) { }
170 
171 public:
173  int index() const { return m_index; }
174 
176  int cardinality() const { return m_cardinality; }
177 
179  Hypergraph* hypergraph() const { return m_hypergraph; }
180 
182  adjHypergraphEntry firstAdj() const { return m_adjHypernodes.head(); }
183 
185  adjHypergraphEntry lastAdj() const { return m_adjHypernodes.tail(); }
186 
189 
191  template<class NODELIST>
192  void allHypernodes(NODELIST& hypernodes) const {
193  hypernodes.clear();
194  for (adjHypergraphEntry adj = firstAdj(); adj; adj = adj->succ()) {
195  hypernodes.pushBack(reinterpret_cast<hypernode>(adj->element()));
196  }
197  }
198 
200  bool incident(hypernode v) const {
201  for (adjHypergraphEntry adj = firstAdj(); adj; adj = adj->succ()) {
202  if (reinterpret_cast<hypernode>(adj->element()) == v) {
203  return true;
204  }
205  }
206  return false;
207  }
208 
210  hyperedge succ() const { return static_cast<hyperedge>(m_next); }
211 
213  hyperedge pred() const { return static_cast<hyperedge>(m_prev); }
214 
216  bool operator==(const hyperedge e) const {
217  return e->index() == m_index && e->hypergraph() == m_hypergraph;
218  }
219 
220  friend std::ostream& operator<<(std::ostream& os, ogdf::hyperedge e);
221 
223 };
224 
227  friend class Hypergraph;
228  friend class GraphListBase;
230 
231 public:
233  enum class Type {
234  normal = 0x0000001,
235  dummy = 0x0000002,
236  OR = 0x0000003,
237  BUF = 0x0000004,
238  AND = 0x0000005,
239  NOR = 0x0000006,
240  NOT = 0x0000007,
241  XOR = 0x0000008,
242  DFF = 0x0000009,
243  NAND = 0x0000010,
244  INPUT = 0x0000011,
245  OUTPUT = 0x0000012
246  };
247 
248 private:
251 
253  int m_index;
254 
256  int m_degree;
257 
260 
263 
265  explicit HypernodeElement(int pIndex)
266  : m_index(pIndex), m_degree(0), m_type(Type::normal), m_hypergraph(nullptr) { }
267 
269  HypernodeElement(int pIndex, Type pType)
270  : m_index(pIndex), m_degree(0), m_type(pType), m_hypergraph(nullptr) { }
271 
272 public:
274  int index() const { return m_index; }
275 
277  int degree() const { return m_degree; }
278 
280  Hypergraph* hypergraph() const { return m_hypergraph; }
281 
283  Type type() const { return m_type; }
284 
286  void type(Type pType) { m_type = pType; }
287 
289  adjHypergraphEntry firstAdj() const { return m_adjHyperedges.head(); }
290 
292  adjHypergraphEntry lastAdj() const { return m_adjHyperedges.tail(); }
293 
295  template<class NODELIST>
296  void allHyperedges(NODELIST& hyperedges) const {
297  hyperedges.clear();
298  for (adjHypergraphEntry adj = firstAdj(); adj; adj = adj->succ()) {
299  hyperedges.pushBack(reinterpret_cast<hyperedge>(adj->element()));
300  }
301  }
302 
304  bool adjacent(hypernode v) const {
305  for (adjHypergraphEntry adj = firstAdj(); adj; adj = adj->succ()) {
306  if (reinterpret_cast<hyperedge>(adj->element())->incident(v)) {
307  return true;
308  }
309  }
310  return false;
311  }
312 
314  hypernode succ() const { return static_cast<hypernode>(m_next); }
315 
317  hypernode pred() const { return static_cast<hypernode>(m_prev); }
318 
320  bool operator==(const hypernode v) const {
321  return v->index() == m_index && v->hypergraph() == m_hypergraph;
322  }
323 
325 };
326 
328 template<typename Key>
330  : public RegistryBase<Key*, HypergraphRegistry<Key>, internal::GraphIterator<Key*>> {
333 
334 public:
336 
338  HypergraphRegistry(Hypergraph* graph, int* nextKeyIndex)
339  : m_pGraph(graph), m_nextKeyIndex(nextKeyIndex) { }
340 
341  static inline int keyToIndex(Key* key) { return key->index(); }
342 
343  bool isKeyAssociated(Key* key) const {
344  if (key == nullptr) {
345  return false;
346  }
347 #ifdef OGDF_DEBUG
348  if (key->hypergraph() == m_pGraph) {
349  OGDF_ASSERT(keyToIndex(key) < this->getArraySize());
350  return true;
351  } else {
352  return false;
353  }
354 #else
355  return true;
356 #endif
357  }
358 
359  int calculateArraySize(int add) const { return calculateTableSize(*m_nextKeyIndex + add); }
360 
361  int maxKeyIndex() const { return (*m_nextKeyIndex) - 1; }
362 
364  Hypergraph* graphOf() const { return m_pGraph; }
365 };
366 
368  const HypergraphRegistry<HypernodeElement>& self);
369 
371  const HypergraphRegistry<HypernodeElement>& self);
372 
374  const HypergraphRegistry<HyperedgeElement>& self);
375 
377  const HypergraphRegistry<HyperedgeElement>& self);
378 
380 template<typename Key, typename Value, bool WithDefault, typename Registry = HypergraphRegistry<Key>>
381 class HypergraphRegisteredArray : public RegisteredArray<Registry, Value, WithDefault, Hypergraph> {
383 
384 public:
385  using RA::RA;
386 
389  if (RA::registeredAt() == nullptr) {
390  return nullptr;
391  } else {
392  return RA::registeredAt()->graphOf();
393  }
394  }
395 };
396 
397 #define OGDF_DECL_REG_ARRAY_TYPE(v, c) HypergraphRegisteredArray<HypernodeElement, v, c>
400 #undef OGDF_DECL_REG_ARRAY_TYPE
401 
402 #define OGDF_DECL_REG_ARRAY_TYPE(v, c) HypergraphRegisteredArray<HyperedgeElement, v, c>
405 #undef OGDF_DECL_REG_ARRAY_TYPE
406 
407 class OGDF_EXPORT HypergraphObserver;
408 
409 class OGDF_EXPORT Hypergraph : public Observable<HypergraphObserver, Hypergraph> {
412 
415 
418 
421 
424 
427 
430 
433 
434 public:
436  Hypergraph();
437 
439  Hypergraph(const Hypergraph& H);
440 
442  ~Hypergraph();
443 
445  bool empty() const { return m_nHypernodes == 0; }
446 
448  const internal::GraphList<HypernodeElement>& hypernodes() const { return m_hypernodes; }
449 
451  const internal::GraphList<HyperedgeElement>& hyperedges() const { return m_hyperedges; }
452 
454  int numberOfHypernodes() const { return m_nHypernodes; }
455 
457  int numberOfHyperedges() const { return m_nHyperedges; }
458 
460  int maxHypernodeIndex() const { return m_hypernodeIdCount - 1; }
461 
463  int maxHyperedgeIndex() const { return m_hyperedgeIdCount - 1; }
464 
466  hypernode firstHypernode() const { return m_hypernodes.head(); }
467 
469  hypernode lastHypernode() const { return m_hypernodes.tail(); }
470 
472  hyperedge firstHyperedge() const { return m_hyperedges.head(); }
473 
475  hyperedge lastHyperEdge() const { return m_hyperedges.tail(); }
476 
478  hypernode newHypernode();
479 
481  hypernode newHypernode(int pIndex);
482 
484  hypernode newHypernode(HypernodeElement::Type pType);
485 
487  hypernode newHypernode(int pIndex, HypernodeElement::Type pType);
488 
490 
494  hyperedge newHyperedge(List<hypernode>& hypernodes);
495 
497 
502  hyperedge newHyperedge(int pIndex, List<hypernode>& hypernodes);
503 
505 
508  void delHypernode(hypernode v);
509 
511 
514  void delHyperedge(hyperedge e);
515 
517  void clear();
518 
520  hypernode randomHypernode() const;
521 
523  hyperedge randomHyperedge() const;
524 
526  template<class LIST>
527  void allHypernodes(LIST& hypernodeList) const {
528  hypernodeList.clear();
529  for (hypernode v = m_hypernodes.head(); v; v = v->succ()) {
530  hypernodeList.pushBack(v);
531  }
532  }
533 
535  template<class LIST>
536  void allHyperedges(LIST& hyperedgeList) const {
537  hyperedgeList.clear();
538  for (hyperedge e = m_hyperedges.head(); e; e = e->succ()) {
539  hyperedgeList.pushBack(e);
540  }
541  }
542 
544  void readBenchHypergraph(std::istream& is);
545 
547  void readBenchHypergraph(const char* filename);
548 
550  void readPlaHypergraph(std::istream& is);
551 
553  void loadPlaHypergraph(const char* fileName);
554 
556  bool consistency() const;
557 
559  HypergraphRegistry<HypernodeElement>& hypernodeRegistry() { return m_regHypernodeArrays; }
560 
563  return m_regHypernodeArrays;
564  }
565 
566  operator const HypergraphRegistry<HypernodeElement>&() const { return m_regHypernodeArrays; }
567 
569  HypergraphRegistry<HyperedgeElement>& hyperedgeRegistry() { return m_regHyperedgeArrays; }
570 
573  return m_regHyperedgeArrays;
574  }
575 
576  operator const HypergraphRegistry<HyperedgeElement>&() const { return m_regHyperedgeArrays; }
577 
578  Hypergraph& operator=(const Hypergraph& H);
579 
580  friend std::ostream& operator<<(std::ostream& os, ogdf::Hypergraph& H);
581 
582  friend std::istream& operator>>(std::istream& is, ogdf::Hypergraph& H);
583 
585 
586 private:
587  void initArrays();
588 
589  int nextEntry(char* buffer, int from, string stop);
590 
591  HypernodeElement::Type gateType(string gate);
592 };
593 
594 }
ogdf::Hypergraph::numberOfHyperedges
int numberOfHyperedges() const
Returns the number of hyperedges in the hypergraph.
Definition: Hypergraph.h:457
ogdf::Hypergraph::maxHyperedgeIndex
int maxHyperedgeIndex() const
Returns the largest used hyperedge index.
Definition: Hypergraph.h:463
ogdf::RegistryBase
Abstract base class for registries.
Definition: RegisteredArray.h:104
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::RegisteredArray
Dynamic arrays indexed with arbitrary keys.
Definition: RegisteredArray.h:817
OGDF_DECL_REG_ARRAY
#define OGDF_DECL_REG_ARRAY(NAME)
Definition: RegisteredArray.h:969
ogdf::HypergraphRegistry::isKeyAssociated
bool isKeyAssociated(Key *key) const
Definition: Hypergraph.h:343
ogdf::AdjHypergraphElement::element
GraphElement * element() const
Returns the element associated with this adjacency entry.
Definition: Hypergraph.h:125
ogdf::internal::GraphList::tail
T * tail() const
Returns the last element in the list.
Definition: GraphList.h:327
ogdf::HypergraphRegistry::HypergraphRegistry
HypergraphRegistry(Hypergraph *graph, int *nextKeyIndex)
Constructor.
Definition: Hypergraph.h:338
ogdf::Hypergraph::allHyperedges
void allHyperedges(LIST &hyperedgeList) const
Returns a list with all hyperedges of the hypergraph.
Definition: Hypergraph.h:536
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:66
ogdf::internal::GraphIteratorBase
Definition: graph_iterators.h:45
ogdf::Hypergraph::OGDF_MALLOC_NEW_DELETE
OGDF_MALLOC_NEW_DELETE
Definition: Hypergraph.h:584
ogdf::Hypergraph::allHypernodes
void allHypernodes(LIST &hypernodeList) const
Returns a list with all hypernodes of the hypergraph.
Definition: Hypergraph.h:527
ogdf::HyperedgeElement::cardinality
int cardinality() const
Returns the number of incident hypernodes.
Definition: Hypergraph.h:176
ogdf::AdjHypergraphElement::pred
adjHypergraphEntry pred() const
Returns the predecessor in the adjacency list.
Definition: Hypergraph.h:134
ogdf::RegisteredArray< HypergraphRegistry< ogdf::List< ogdf::EdgeElement > >, Value, WithDefault, Hypergraph >::RA
typename std::conditional< WithDefault, internal::RegisteredArrayWithDefault< HypergraphRegistry< ogdf::List< ogdf::EdgeElement > >, Value >, internal::RegisteredArrayWithoutDefault< HypergraphRegistry< ogdf::List< ogdf::EdgeElement > >, Value > >::type RA
Definition: RegisteredArray.h:822
ogdf::begin
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
ogdf::internal::GraphElement
The base class for objects used by (hyper)graphs.
Definition: GraphList.h:60
ogdf::Hypergraph::m_nHyperedges
int m_nHyperedges
The number of hyperedges in the hypergraph.
Definition: Hypergraph.h:426
ogdf::HypernodeElement::HypernodeElement
HypernodeElement(int pIndex, Type pType)
Constructor.
Definition: Hypergraph.h:269
Observer.h
Simple, safe base classes for C++ observables and observers.
ogdf::HypergraphRegistry::keyToIndex
static int keyToIndex(Key *key)
Definition: Hypergraph.h:341
ogdf::HypergraphRegisteredArray
RegisteredArray for nodes and edges of a hypergraph.
Definition: Hypergraph.h:381
ogdf::HyperedgeElement::OGDF_NEW_DELETE
OGDF_NEW_DELETE
Definition: Hypergraph.h:222
ogdf::HyperedgeElement::incident
bool incident(hypernode v) const
Returns true iff v is incident to the hyperedge.
Definition: Hypergraph.h:200
ogdf::Hypergraph::m_hyperedges
internal::GraphList< HyperedgeElement > m_hyperedges
The list of all hyperedges.
Definition: Hypergraph.h:420
ogdf::AdjHypergraphElement::m_index
int m_index
The (unique) index of the adjacency entry.
Definition: Hypergraph.h:105
ogdf::HyperedgeElement::HyperedgeElement
HyperedgeElement(int pIndex)
Constructs an hyperedge element between hypernodes.
Definition: Hypergraph.h:168
ogdf::Hypergraph::hypernodeRegistry
const HypergraphRegistry< HypernodeElement > & hypernodeRegistry() const
Returns a const reference to the registry of hypernode arrays associated with this hypergraph.
Definition: Hypergraph.h:562
ogdf::AdjHypergraphElement::m_element
GraphElement * m_element
The associated hyperedge or hypernode.
Definition: Hypergraph.h:93
ogdf::HyperedgeElement
Class for the representation of hyperedges.
Definition: Hypergraph.h:146
ogdf::Hypergraph::hyperedges
const internal::GraphList< HyperedgeElement > & hyperedges() const
Returns the list of all hyperedges.
Definition: Hypergraph.h:451
ogdf::HypernodeElement::firstAdj
adjHypergraphEntry firstAdj() const
Returns the first entry in the adjaceny list.
Definition: Hypergraph.h:289
ogdf::HypernodeElement::m_degree
int m_degree
The number of incident hyperedges.
Definition: Hypergraph.h:256
ogdf::AdjHypergraphElement::succ
adjHypergraphEntry succ() const
Returns the successor in the adjacency list.
Definition: Hypergraph.h:131
ogdf::Hypergraph::hyperedgeRegistry
const HypergraphRegistry< HyperedgeElement > & hyperedgeRegistry() const
Returns a const reference to the registry of hyperedge arrays associated with this hypergraph.
Definition: Hypergraph.h:572
ogdf::HypergraphRegistry::iterator
internal::GraphIterator< Key * > iterator
Definition: Hypergraph.h:335
ogdf::HypernodeElement::pred
hypernode pred() const
Returns the predecessor in the list of all hypernodes.
Definition: Hypergraph.h:317
ogdf::HypergraphRegistry::maxKeyIndex
int maxKeyIndex() const
Definition: Hypergraph.h:361
ogdf::HyperedgeElement::incidentHypernodes
internal::GraphList< AdjHypergraphElement > incidentHypernodes() const
Returns the incident hypernodes of the hyperedge.
Definition: Hypergraph.h:188
ogdf::HypergraphRegistry
Registry for nodes and edges of a hypergraph.
Definition: Hypergraph.h:329
ogdf::Observable
Base class for an observable object that can be tracked by multiple Observer objects.
Definition: Observer.h:104
ogdf::Hypergraph::lastHyperEdge
hyperedge lastHyperEdge() const
Returns the last hyperedge in the list of all hyperedges.
Definition: Hypergraph.h:475
ogdf::HypernodeElement::type
void type(Type pType)
Sets the type of hypernode.
Definition: Hypergraph.h:286
ogdf::HyperedgeElement::index
int index() const
Returns the index of a hyperedge.
Definition: Hypergraph.h:173
ogdf::Hypergraph::maxHypernodeIndex
int maxHypernodeIndex() const
Returns the largest used hypernode index.
Definition: Hypergraph.h:460
ogdf::Hypergraph::m_nHypernodes
int m_nHypernodes
The number of hypernodes in the hypergraph.
Definition: Hypergraph.h:423
ogdf::HypernodeElement::OGDF_NEW_DELETE
OGDF_NEW_DELETE
Definition: Hypergraph.h:324
ogdf::AdjHypergraphElement
Class for adjacency list elements.
Definition: Hypergraph.h:86
ogdf::HypernodeElement::Type
Type
The type of hypernodes.
Definition: Hypergraph.h:233
ogdf::HyperedgeElement::m_cardinality
int m_cardinality
The number of incidend hypernodes.
Definition: Hypergraph.h:159
ogdf::Hypergraph::m_regHypernodeArrays
HypergraphRegistry< HypernodeElement > m_regHypernodeArrays
The registered hypernode arrays.
Definition: Hypergraph.h:411
ogdf::Hypergraph::hypernodes
const internal::GraphList< HypernodeElement > & hypernodes() const
Returns the list of all hypernodes.
Definition: Hypergraph.h:448
ogdf::HypernodeElement::m_hypergraph
Hypergraph * m_hypergraph
The hypergraph containing the hypernode (if any).
Definition: Hypergraph.h:262
GraphList.h
Decralation of GraphElement and GraphList classes.
ogdf::Hypergraph::firstHyperedge
hyperedge firstHyperedge() const
Returns the first hyperedge in the list of all hyperedges.
Definition: Hypergraph.h:472
ogdf::HyperedgeArray
HypergraphRegisteredArray< HyperedgeElement, Value, WithDefault > HyperedgeArray
Array for labeling the hyperedges in a Hypergraph with an arbitrary Value.
Definition: Hypergraph.h:404
ogdf::Hypergraph::m_hyperedgeIdCount
int m_hyperedgeIdCount
The Index that will be assigned to the next created hyperedge.
Definition: Hypergraph.h:432
ogdf::calculateTableSize
int calculateTableSize(int actualCount)
The default growth function for registered arrays.
Definition: RegisteredArray.h:67
RegisteredArray.h
Declaration and implementation of RegisteredArray class.
ogdf::HypernodeElement::hypergraph
Hypergraph * hypergraph() const
Returns the hypergraph containing the hypernode.
Definition: Hypergraph.h:280
ogdf::AdjHypergraphElement::twin
adjHypergraphEntry twin() const
Returns the pointer to a twin adjacency list.
Definition: Hypergraph.h:128
ogdf::AdjHypergraphElement::AdjHypergraphElement
AdjHypergraphElement(GraphElement *pElement, int pIndex)
Constructs an adjacency entry for a given hyper{node,edge} and index.
Definition: Hypergraph.h:112
ogdf::HypernodeElement::m_adjHyperedges
internal::GraphList< AdjHypergraphElement > m_adjHyperedges
The adjacency list of the hypernode.
Definition: Hypergraph.h:250
ogdf::Hypergraph::m_hypernodes
internal::GraphList< HypernodeElement > m_hypernodes
The list of all hypernodes.
Definition: Hypergraph.h:417
ogdf::HyperedgeElement::hypergraph
Hypergraph * hypergraph() const
Returns the hypergraph containing the hyperedge.
Definition: Hypergraph.h:179
ogdf::HyperedgeElement::pred
hyperedge pred() const
Returns the predecessor in the list of all hyperedges.
Definition: Hypergraph.h:213
ogdf::operator<<
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
Definition: Array.h:983
ogdf::Hypergraph::empty
bool empty() const
Returns true iff the hypergraph is empty (ie. contains no hypernodes).
Definition: Hypergraph.h:445
ogdf::Hypergraph::numberOfHypernodes
int numberOfHypernodes() const
Returns the number of hypernodes in the hypergraph.
Definition: Hypergraph.h:454
ogdf::HypernodeElement::m_index
int m_index
The (unique) index of the hypernode.
Definition: Hypergraph.h:253
ogdf::HypergraphRegistry::m_pGraph
Hypergraph * m_pGraph
Definition: Hypergraph.h:331
ogdf::HypernodeElement::index
int index() const
Returns the (unique) hypernode index.
Definition: Hypergraph.h:274
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphList
Lists of graph objects (like nodes, edges, etc.).
Definition: GraphList.h:301
ogdf::HyperedgeElement::m_hypergraph
Hypergraph * m_hypergraph
The hypergraph containing the hyperedge (if any).
Definition: Hypergraph.h:162
ogdf::HyperedgeElement::firstAdj
adjHypergraphEntry firstAdj() const
Returns the first entry in the adjaceny list.
Definition: Hypergraph.h:182
ogdf::AdjHypergraphElement::m_twin
adjHypergraphEntry m_twin
The corresponding adjacency entry.
Definition: Hypergraph.h:102
ogdf::HypernodeElement::adjacent
bool adjacent(hypernode v) const
Returns true iff v is adjacent to the hypernode.
Definition: Hypergraph.h:304
ogdf::HyperedgeElement::succ
hyperedge succ() const
Returns the successor in the list of all hyperedges.
Definition: Hypergraph.h:210
ogdf::HypergraphRegistry::calculateArraySize
int calculateArraySize(int add) const
Definition: Hypergraph.h:359
ogdf::HypergraphRegistry::graphOf
Hypergraph * graphOf() const
Returns a pointer to the associated hypergraph.
Definition: Hypergraph.h:364
ogdf::HypernodeElement::allHyperedges
void allHyperedges(NODELIST &hyperedges) const
Returns a list with all incident hyperedges of the hypernode.
Definition: Hypergraph.h:296
ogdf::AdjHypergraphElement::index
int index() const
Returns the index of this adjacency element.
Definition: Hypergraph.h:117
ogdf::HyperedgeElement::operator==
bool operator==(const hyperedge e) const
Equality operator.
Definition: Hypergraph.h:216
ogdf::Hypergraph::firstHypernode
hypernode firstHypernode() const
Returns the first hypernode in the list of all hypernodes.
Definition: Hypergraph.h:466
ogdf::AdjHypergraphElement::OGDF_NEW_DELETE
OGDF_NEW_DELETE
Definition: Hypergraph.h:142
ogdf::Hypergraph::lastHypernode
hypernode lastHypernode() const
Returns the last hypernode in the list of all hypernodes.
Definition: Hypergraph.h:469
ogdf::HyperedgeElement::m_adjHypernodes
internal::GraphList< AdjHypergraphElement > m_adjHypernodes
The adjacency list of the hyperedge.
Definition: Hypergraph.h:153
ogdf::internal::GraphList::head
T * head() const
Returns the first element in the list.
Definition: GraphList.h:324
ogdf::Hypergraph::hyperedgeRegistry
HypergraphRegistry< HyperedgeElement > & hyperedgeRegistry()
Returns a reference to the registry of hyperedge arrays associated with this hypergraph.
Definition: Hypergraph.h:569
ogdf::HypergraphRegistry::m_nextKeyIndex
int * m_nextKeyIndex
Definition: Hypergraph.h:332
ogdf::HypernodeElement::operator==
bool operator==(const hypernode v) const
Equality operator.
Definition: Hypergraph.h:320
basic.h
Basic declarations, included by all source files.
ogdf::HypernodeElement::degree
int degree() const
Returns the hypernode degree.
Definition: Hypergraph.h:277
ogdf::end
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::HypergraphRegisteredArray::hypergraphOf
Hypergraph * hypergraphOf() const
Returns a pointer to the associated hypergraph.
Definition: Hypergraph.h:388
ogdf::HypernodeElement::succ
hypernode succ() const
Returns the successor in the list of all hypernodes.
Definition: Hypergraph.h:314
ogdf::HyperedgeElement::allHypernodes
void allHypernodes(NODELIST &hypernodes) const
Returns a list with all incident hypernodes of the hyperedge.
Definition: Hypergraph.h:192
ogdf::HypernodeElement::lastAdj
adjHypergraphEntry lastAdj() const
Returns the last entry in the adjacency list.
Definition: Hypergraph.h:292
ogdf::HypernodeElement::HypernodeElement
HypernodeElement(int pIndex)
Constructor.
Definition: Hypergraph.h:265
ogdf::Hypergraph::hypernodeRegistry
HypergraphRegistry< HypernodeElement > & hypernodeRegistry()
Returns a reference to the registry of hypernode arrays associated with this hypergraph.
Definition: Hypergraph.h:559
ogdf::operator>>
std::istream & operator>>(std::istream &is, TokenIgnorer token)
ogdf::HypernodeElement::type
Type type() const
Returns the type of hypernode.
Definition: Hypergraph.h:283
ogdf::HyperedgeElement::lastAdj
adjHypergraphEntry lastAdj() const
Returns the last entry in the adjacency list.
Definition: Hypergraph.h:185
ogdf::RegistryBase< Key *, HypergraphRegistry< Key >, internal::GraphIterator< Key * > >::getArraySize
int getArraySize() const
Returns the current size of all registered arrays.
Definition: RegisteredArray.h:245
ogdf::HypernodeElement::m_type
Type m_type
The type of the hypernode.
Definition: Hypergraph.h:259
ogdf::Hypergraph
Definition: Hypergraph.h:409
memory.h
Declaration of memory manager for allocating small pieces of memory.
ogdf::AdjHypergraphElement::AdjHypergraphElement
AdjHypergraphElement(GraphElement *pElement)
Constructs an adjacency element for a given hyper{node,edge}.
Definition: Hypergraph.h:108
ogdf::HyperedgeElement::m_index
int m_index
The (unique) index of the hyperedge.
Definition: Hypergraph.h:156
ogdf::HypernodeElement
Class for the representation of hypernodes.
Definition: Hypergraph.h:226
ogdf::Hypergraph::m_regHyperedgeArrays
HypergraphRegistry< HyperedgeElement > m_regHyperedgeArrays
The registered hyperedge arrays.
Definition: Hypergraph.h:414
ogdf::HypernodeArray
HypergraphRegisteredArray< HypernodeElement, Value, WithDefault > HypernodeArray
Array for labeling the hypernodes in a Hypergraph with an arbitrary Value.
Definition: Hypergraph.h:399
ogdf::Hypergraph::m_hypernodeIdCount
int m_hypernodeIdCount
The Index that will be assigned to the next created hypernode.
Definition: Hypergraph.h:429