Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::Hypergraph Class Reference

#include <ogdf/hypergraph/Hypergraph.h>

Public Member Functions

 Hypergraph ()
 Constructs an empty hypergraph. More...
 
 Hypergraph (const Hypergraph &H)
 Constructs a hypergraph that is a copy of H. More...
 
 ~Hypergraph ()
 Destructor. More...
 
template<class LIST >
void allHyperedges (LIST &hyperedgeList) const
 Returns a list with all hyperedges of the hypergraph. More...
 
template<class LIST >
void allHypernodes (LIST &hypernodeList) const
 Returns a list with all hypernodes of the hypergraph. More...
 
void clear ()
 Removes all hypernodes and all hyperedges from the hypergraph. More...
 
bool consistency () const
 Checks the consistency of the data structure. More...
 
void delHyperedge (hyperedge e)
 Removes hyperedge e from the hypergraph. More...
 
void delHypernode (hypernode v)
 Removes hypernode v and all incident hyperedges from the hypergraph. More...
 
bool empty () const
 Returns true iff the hypergraph is empty (ie. contains no hypernodes). More...
 
hyperedge firstHyperedge () const
 Returns the first hyperedge in the list of all hyperedges. More...
 
hypernode firstHypernode () const
 Returns the first hypernode in the list of all hypernodes. More...
 
int hyperedgeArrayTableSize () const
 Returns the table size of hyperedge arrays within the hypergraph. More...
 
internal::GraphList< HyperedgeElementhyperedges () const
 Returns the list of all hyperedges. More...
 
int hypernodeArrayTableSize () const
 Returns the table size of hypernode arrays with the hypergraph. More...
 
internal::GraphList< HypernodeElementhypernodes () const
 Returns the list of all hypernodes. More...
 
hyperedge lastHyperEdge () const
 Returns the last hyperedge in the list of all hyperedges. More...
 
hypernode lastHypernode () const
 Returns the last hypernode in the list of all hypernodes. More...
 
void loadPlaHypergraph (const char *fileName)
 Reads hypergraph in pla format from the file. More...
 
int maxHyperedgeIndex () const
 Returns the largest used hyperedge index. More...
 
int maxHypernodeIndex () const
 Returns the largest used hypernode index. More...
 
hyperedge newHyperedge (int pIndex, List< hypernode > &hypernodes)
 Creates a new hyperedge between hypernodes and returns it. More...
 
hyperedge newHyperedge (List< hypernode > &hypernodes)
 Creates a new hyperedge btween hypernodes and returns it. More...
 
hypernode newHypernode ()
 Creates a new hypernode and returns it. More...
 
hypernode newHypernode (HypernodeElement::Type pType)
 Creates a new hypernode with given pType and returns it. More...
 
hypernode newHypernode (int pIndex)
 Creates a new hypernode with given pIndex and returns it. More...
 
hypernode newHypernode (int pIndex, HypernodeElement::Type pType)
 Creates a new hypernode with given pIndex and pType and returns it. More...
 
int numberOfHyperedges () const
 Returns the number of hyperedges in the hypergraph. More...
 
int numberOfHypernodes () const
 Returns the number of hypernodes in the hypergraph. More...
 
Hypergraphoperator= (const Hypergraph &H)
 
hyperedge randomHyperedge () const
 Returns a randomly chosen hyperedge. More...
 
hypernode randomHypernode () const
 Returns a randomly chosen hypergraph. More...
 
void readBenchHypergraph (const char *filename)
 Reads hypergraph in bench format from the file. More...
 
void readBenchHypergraph (std::istream &is)
 Reads hypergraph in bench format from the input stream. More...
 
void readPlaHypergraph (std::istream &is)
 Reads hypergraph in pla format from the input stream. More...
 
ListIterator< HypergraphArrayBase * > registerHyperedgeArray (HypergraphArrayBase *pHyperedgeArray) const
 
ListIterator< HypergraphArrayBase * > registerHypernodeArray (HypergraphArrayBase *pHypernodeArray) const
 Registers a node array. More...
 
ListIterator< HypergraphObserver * > registerObserver (HypergraphObserver *pObserver) const
 Registers a hypergraph observer (e.g. a EdgeStandardRep). More...
 
void unregisterHyperedgeArray (ListIterator< HypergraphArrayBase * > it) const
 Unregisters an hyperedge array. More...
 
void unregisterHypernodeArray (ListIterator< HypergraphArrayBase * > it) const
 Unregisters a hypernode array. More...
 
void unregisterObserver (ListIterator< HypergraphObserver * > it) const
 Unregisters a hypergraph observer. More...
 

Public Attributes

 OGDF_MALLOC_NEW_DELETE
 

Private Member Functions

HypernodeElement::Type gateType (string gate)
 
void initArrays ()
 
void initObservers ()
 
int nextEntry (char *buffer, int from, string stop)
 

Private Attributes

ListPure< HypergraphArrayBase * > m_hyperedgeArrays
 
int m_hyperedgeArrayTableSize
 The current table size of hyperedge arrays within the hypergraph. More...
 
int m_hyperedgeIdCount
 The Index that will be assigned to the next created hyperedge. More...
 
internal::GraphList< HyperedgeElementm_hyperedges
 The list of all hyperedges. More...
 
ListPure< HypergraphArrayBase * > m_hypernodeArrays
 The registered hypergraph arrays & observers. More...
 
int m_hypernodeArrayTableSize
 The current table size of hypernode arrays within the hypergraph. More...
 
int m_hypernodeIdCount
 The Index that will be assigned to the next created hypernode. More...
 
internal::GraphList< HypernodeElementm_hypernodes
 The list of all hypernodes. More...
 
int m_nHyperedges
 The number of hyperedges in the hypergraph. More...
 
int m_nHypernodes
 The number of hypernodes in the hypergraph. More...
 
ListPure< HypergraphObserver * > m_observers
 

Friends

std::ostream & operator<< (std::ostream &os, ogdf::Hypergraph &H)
 
std::istream & operator>> (std::istream &is, ogdf::Hypergraph &H)
 

Detailed Description

Definition at line 405 of file Hypergraph.h.

Constructor & Destructor Documentation

◆ Hypergraph() [1/2]

ogdf::Hypergraph::Hypergraph ( )

Constructs an empty hypergraph.

◆ Hypergraph() [2/2]

ogdf::Hypergraph::Hypergraph ( const Hypergraph H)

Constructs a hypergraph that is a copy of H.

◆ ~Hypergraph()

ogdf::Hypergraph::~Hypergraph ( )

Destructor.

Member Function Documentation

◆ allHyperedges()

template<class LIST >
void ogdf::Hypergraph::allHyperedges ( LIST &  hyperedgeList) const
inline

Returns a list with all hyperedges of the hypergraph.

Definition at line 582 of file Hypergraph.h.

◆ allHypernodes()

template<class LIST >
void ogdf::Hypergraph::allHypernodes ( LIST &  hypernodeList) const
inline

Returns a list with all hypernodes of the hypergraph.

Definition at line 574 of file Hypergraph.h.

◆ clear()

void ogdf::Hypergraph::clear ( )

Removes all hypernodes and all hyperedges from the hypergraph.

◆ consistency()

bool ogdf::Hypergraph::consistency ( ) const

Checks the consistency of the data structure.

◆ delHyperedge()

void ogdf::Hypergraph::delHyperedge ( hyperedge  e)

Removes hyperedge e from the hypergraph.

Parameters
eis the hyperegde that will be deleted.

◆ delHypernode()

void ogdf::Hypergraph::delHypernode ( hypernode  v)

Removes hypernode v and all incident hyperedges from the hypergraph.

Parameters
vis the hypernode that will be deleted.

◆ empty()

bool ogdf::Hypergraph::empty ( ) const
inline

Returns true iff the hypergraph is empty (ie. contains no hypernodes).

Definition at line 448 of file Hypergraph.h.

◆ firstHyperedge()

hyperedge ogdf::Hypergraph::firstHyperedge ( ) const
inline

Returns the first hyperedge in the list of all hyperedges.

Definition at line 502 of file Hypergraph.h.

◆ firstHypernode()

hypernode ogdf::Hypergraph::firstHypernode ( ) const
inline

Returns the first hypernode in the list of all hypernodes.

Definition at line 490 of file Hypergraph.h.

◆ gateType()

HypernodeElement::Type ogdf::Hypergraph::gateType ( string  gate)
private

◆ hyperedgeArrayTableSize()

int ogdf::Hypergraph::hyperedgeArrayTableSize ( ) const
inline

Returns the table size of hyperedge arrays within the hypergraph.

Definition at line 520 of file Hypergraph.h.

◆ hyperedges()

internal::GraphList<HyperedgeElement> ogdf::Hypergraph::hyperedges ( ) const
inline

Returns the list of all hyperedges.

Definition at line 460 of file Hypergraph.h.

◆ hypernodeArrayTableSize()

int ogdf::Hypergraph::hypernodeArrayTableSize ( ) const
inline

Returns the table size of hypernode arrays with the hypergraph.

Definition at line 514 of file Hypergraph.h.

◆ hypernodes()

internal::GraphList<HypernodeElement> ogdf::Hypergraph::hypernodes ( ) const
inline

Returns the list of all hypernodes.

Definition at line 454 of file Hypergraph.h.

◆ initArrays()

void ogdf::Hypergraph::initArrays ( )
private

◆ initObservers()

void ogdf::Hypergraph::initObservers ( )
private

◆ lastHyperEdge()

hyperedge ogdf::Hypergraph::lastHyperEdge ( ) const
inline

Returns the last hyperedge in the list of all hyperedges.

Definition at line 508 of file Hypergraph.h.

◆ lastHypernode()

hypernode ogdf::Hypergraph::lastHypernode ( ) const
inline

Returns the last hypernode in the list of all hypernodes.

Definition at line 496 of file Hypergraph.h.

◆ loadPlaHypergraph()

void ogdf::Hypergraph::loadPlaHypergraph ( const char *  fileName)

Reads hypergraph in pla format from the file.

◆ maxHyperedgeIndex()

int ogdf::Hypergraph::maxHyperedgeIndex ( ) const
inline

Returns the largest used hyperedge index.

Definition at line 484 of file Hypergraph.h.

◆ maxHypernodeIndex()

int ogdf::Hypergraph::maxHypernodeIndex ( ) const
inline

Returns the largest used hypernode index.

Definition at line 478 of file Hypergraph.h.

◆ newHyperedge() [1/2]

hyperedge ogdf::Hypergraph::newHyperedge ( int  pIndex,
List< hypernode > &  hypernodes 
)

Creates a new hyperedge between hypernodes and returns it.

Parameters
pIndexis the unique index of the newly created hyperedge.
hypernodesare the hypernodes of the newly created hyperedge.
Returns
the newly created hyperedge.

◆ newHyperedge() [2/2]

hyperedge ogdf::Hypergraph::newHyperedge ( List< hypernode > &  hypernodes)

Creates a new hyperedge btween hypernodes and returns it.

Parameters
hypernodesare the hypernodes of the newly created hyperedge.
Returns
the newly created hyperedge.

◆ newHypernode() [1/4]

hypernode ogdf::Hypergraph::newHypernode ( )

Creates a new hypernode and returns it.

◆ newHypernode() [2/4]

hypernode ogdf::Hypergraph::newHypernode ( HypernodeElement::Type  pType)

Creates a new hypernode with given pType and returns it.

◆ newHypernode() [3/4]

hypernode ogdf::Hypergraph::newHypernode ( int  pIndex)

Creates a new hypernode with given pIndex and returns it.

◆ newHypernode() [4/4]

hypernode ogdf::Hypergraph::newHypernode ( int  pIndex,
HypernodeElement::Type  pType 
)

Creates a new hypernode with given pIndex and pType and returns it.

◆ nextEntry()

int ogdf::Hypergraph::nextEntry ( char *  buffer,
int  from,
string  stop 
)
private

◆ numberOfHyperedges()

int ogdf::Hypergraph::numberOfHyperedges ( ) const
inline

Returns the number of hyperedges in the hypergraph.

Definition at line 472 of file Hypergraph.h.

◆ numberOfHypernodes()

int ogdf::Hypergraph::numberOfHypernodes ( ) const
inline

Returns the number of hypernodes in the hypergraph.

Definition at line 466 of file Hypergraph.h.

◆ operator=()

Hypergraph& ogdf::Hypergraph::operator= ( const Hypergraph H)

◆ randomHyperedge()

hyperedge ogdf::Hypergraph::randomHyperedge ( ) const

Returns a randomly chosen hyperedge.

◆ randomHypernode()

hypernode ogdf::Hypergraph::randomHypernode ( ) const

Returns a randomly chosen hypergraph.

◆ readBenchHypergraph() [1/2]

void ogdf::Hypergraph::readBenchHypergraph ( const char *  filename)

Reads hypergraph in bench format from the file.

◆ readBenchHypergraph() [2/2]

void ogdf::Hypergraph::readBenchHypergraph ( std::istream &  is)

Reads hypergraph in bench format from the input stream.

◆ readPlaHypergraph()

void ogdf::Hypergraph::readPlaHypergraph ( std::istream &  is)

Reads hypergraph in pla format from the input stream.

◆ registerHyperedgeArray()

ListIterator<HypergraphArrayBase *> ogdf::Hypergraph::registerHyperedgeArray ( HypergraphArrayBase pHyperedgeArray) const

◆ registerHypernodeArray()

ListIterator<HypergraphArrayBase *> ogdf::Hypergraph::registerHypernodeArray ( HypergraphArrayBase pHypernodeArray) const

Registers a node array.

◆ registerObserver()

ListIterator<HypergraphObserver *> ogdf::Hypergraph::registerObserver ( HypergraphObserver pObserver) const

Registers a hypergraph observer (e.g. a EdgeStandardRep).

◆ unregisterHyperedgeArray()

void ogdf::Hypergraph::unregisterHyperedgeArray ( ListIterator< HypergraphArrayBase * >  it) const

Unregisters an hyperedge array.

◆ unregisterHypernodeArray()

void ogdf::Hypergraph::unregisterHypernodeArray ( ListIterator< HypergraphArrayBase * >  it) const

Unregisters a hypernode array.

◆ unregisterObserver()

void ogdf::Hypergraph::unregisterObserver ( ListIterator< HypergraphObserver * >  it) const

Unregisters a hypergraph observer.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
ogdf::Hypergraph H 
)
friend

◆ operator>>

std::istream& operator>> ( std::istream &  is,
ogdf::Hypergraph H 
)
friend

Member Data Documentation

◆ m_hyperedgeArrays

ListPure<HypergraphArrayBase *> ogdf::Hypergraph::m_hyperedgeArrays
mutableprivate

Definition at line 433 of file Hypergraph.h.

◆ m_hyperedgeArrayTableSize

int ogdf::Hypergraph::m_hyperedgeArrayTableSize
private

The current table size of hyperedge arrays within the hypergraph.

Definition at line 429 of file Hypergraph.h.

◆ m_hyperedgeIdCount

int ogdf::Hypergraph::m_hyperedgeIdCount
private

The Index that will be assigned to the next created hyperedge.

Definition at line 423 of file Hypergraph.h.

◆ m_hyperedges

internal::GraphList<HyperedgeElement> ogdf::Hypergraph::m_hyperedges
private

The list of all hyperedges.

Definition at line 411 of file Hypergraph.h.

◆ m_hypernodeArrays

ListPure<HypergraphArrayBase *> ogdf::Hypergraph::m_hypernodeArrays
mutableprivate

The registered hypergraph arrays & observers.

Definition at line 432 of file Hypergraph.h.

◆ m_hypernodeArrayTableSize

int ogdf::Hypergraph::m_hypernodeArrayTableSize
private

The current table size of hypernode arrays within the hypergraph.

Definition at line 426 of file Hypergraph.h.

◆ m_hypernodeIdCount

int ogdf::Hypergraph::m_hypernodeIdCount
private

The Index that will be assigned to the next created hypernode.

Definition at line 420 of file Hypergraph.h.

◆ m_hypernodes

internal::GraphList<HypernodeElement> ogdf::Hypergraph::m_hypernodes
private

The list of all hypernodes.

Definition at line 408 of file Hypergraph.h.

◆ m_nHyperedges

int ogdf::Hypergraph::m_nHyperedges
private

The number of hyperedges in the hypergraph.

Definition at line 417 of file Hypergraph.h.

◆ m_nHypernodes

int ogdf::Hypergraph::m_nHypernodes
private

The number of hypernodes in the hypergraph.

Definition at line 414 of file Hypergraph.h.

◆ m_observers

ListPure<HypergraphObserver *> ogdf::Hypergraph::m_observers
mutableprivate

Definition at line 434 of file Hypergraph.h.

◆ OGDF_MALLOC_NEW_DELETE

ogdf::Hypergraph::OGDF_MALLOC_NEW_DELETE

Definition at line 630 of file Hypergraph.h.


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