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