72 base.m_pClusterGraph =
nullptr;
97 m_it =
pC->registerArray(
this);
108 base.m_pClusterGraph =
nullptr;
218 OGDF_DEPRECATED(
"Cluster arrays should be indexed by a cluster, not an integer index.")
224 OGDF_DEPRECATED(
"Cluster arrays should be indexed by a cluster, not an integer index.")
Declaration and implementation of Array class and Array algorithms.
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
The parameterized class Array implements dynamic arrays of type E.
const_reference operator[](INDEX i) const
Returns a reference to the element at position i.
void resize(INDEX newSize, const E &x)
Resizes (enlarges or shrinks) the array to hold newSize elements and sets new elements to x.
INDEX high() const
Returns the maximal array index.
void init()
Reinitializes the array to an array with empty index set.
void fill(const E &x)
Sets all elements to x.
Array< E, INDEX > & operator=(const Array< E, INDEX > &A)
Assignment operator.
INDEX low() const
Returns the minimal array index.
int size() const
Returns the size (number of elements) of the array.
Abstract base class for cluster arrays.
virtual void reinit(int initTableSize)=0
Virtual function called when table has to be reinitialized.
ListIterator< ClusterArrayBase * > m_it
Pointer to list element in the list of all registered cluster arrays which references this array.
ClusterArrayBase(ClusterArrayBase &base)
Moves cluster array base to this cluster array.
virtual ~ClusterArrayBase()
virtual void enlargeTable(int newTableSize)=0
Virtual function called when table size has to be enlarged.
void reregister(const ClusterGraph *pC)
Associates the array with a new cluster graph.
const ClusterGraph * m_pClusterGraph
The associated cluster graph.
ClusterArrayBase()
Initializes a cluster array not associated with a cluster graph.
ClusterArrayBase(const ClusterGraph *pC)
Initializes a cluster array associated with pC.
void moveRegister(ClusterArrayBase &base)
Moves array registration from base to this array.
virtual void disconnect()=0
Virtual function called when array is disconnected from the cluster graph.
Dynamic arrays indexed with clusters.
T m_x
The default value for array elements.
virtual void enlargeTable(int newTableSize)
Virtual function called when table size has to be enlarged.
const_iterator cend() const
Returns a const iterator to one-past-last entry in the cluster array.
const_iterator end() const
Returns a const iterator to one-past-last entry in the cluster array.
const_iterator cbegin() const
Returns a const iterator to the first entry in the cluster array.
static key_type findSuccKey(key_type key)
const_iterator begin() const
Returns a const iterator to the first entry in the cluster array.
ClusterArray< T > & operator=(ClusterArray< T > &&a)
Assignment operator (move semantics).
ClusterArray(const ClusterGraph &C)
Constructs a cluster array associated with C.
ClusterArray(ClusterArray< T > &&A)
Constructs a cluster array containing the elements of A (move semantics).
iterator begin()
Returns an iterator to the first entry in the cluster array.
T & operator()(cluster c)
Returns a reference to the element with index c.
ClusterArray(const ClusterGraph &C, const T &x)
Constructs a cluster array associated with C.
static key_type findPredKey(key_type key)
ClusterArray(const ClusterArray< T > &A)
Constructs a cluster array that is a copy of A.
internal::GraphArrayConstIterator< ClusterArray< T > > const_iterator
The type for cluster array const iterators.
const ClusterGraph * graphOf() const
Returns a pointer to the associated cluster graph.
ClusterArray()
Constructs an empty cluster array associated with no graph.
virtual void disconnect()
Virtual function called when array is disconnected from the cluster graph.
ClusterArray(const ClusterGraph &C, const T &x, int size)
Constructs a cluster array associated with C and a given size (for static use).
void init(const ClusterGraph &C, const T &x)
Reinitializes the array. Associates the array with C.
const T & operator[](cluster c) const
Returns a reference to the element with index c.
const T & operator()(cluster c) const
Returns a reference to the element with index c.
bool valid() const
Returns true iff the array is associated with a graph.
void fill(const T &x)
Sets all array elements to x.
void init()
Reinitializes the array. Associates the array with no cluster graph.
T value_type
The type for array entries.
iterator end()
Returns an iterator to one-past-last entry in the cluster array.
void init(const ClusterGraph &C)
Reinitializes the array. Associates the array with C.
internal::GraphArrayIterator< ClusterArray< T > > iterator
The type for cluster array iterators.
T & operator[](cluster c)
Returns a reference to the element with index c.
ClusterArray< T > & operator=(const ClusterArray< T > &a)
Assignment operator.
virtual void reinit(int initTableSize)
Virtual function called when table has to be reinitialized.
Representation of clusters in a clustered graph.
int index() const
Returns the (unique) index of the cluster.
cluster pred() const
Returns the predecessor of the cluster in the list of all clusters.
cluster succ() const
Returns the successor of the cluster in the list of all clusters.
Representation of clustered graphs.
void unregisterArray(ListIterator< ClusterArrayBase * > it) const
Unregisters a cluster array.
void moveRegisterArray(ListIterator< ClusterArrayBase * > it, ClusterArrayBase *pClusterArray) const
Move the registration it of a cluster array to pClusterArray (used with move semantics for cluster ar...
ListIterator< ClusterArrayBase * > registerArray(ClusterArrayBase *pClusterArray) const
Registers a cluster array.
cluster firstCluster() const
Returns the first cluster in the list of all clusters.
int maxClusterIndex() const
Returns the maximal used cluster index.
int clusterArrayTableSize() const
Returns the table size of cluster arrays associated with this graph.
Encapsulates a pointer to a list element.
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
ClusterElement * cluster
The type of clusters.