Cluster sets. More...
#include <ogdf/cluster/ClusterSet.h>
Public Member Functions | |
ClusterSet (const ClusterGraph &C) | |
Creates an empty cluster set associated with clustered graph C . | |
~ClusterSet () | |
void | clear () |
Removes all clusters from S. | |
const List< cluster > & | clusters () const |
Returns a reference to the list of clusters contained in S. | |
void | insert (cluster c) |
Inserts cluster c into S. | |
bool | isMember (cluster c) const |
Returns true if cluster c is contained in S, false otherwise. | |
void | remove (cluster c) |
Removes cluster c from S. | |
int | size () const |
Returns the size of S. | |
Private Attributes | |
List< cluster > | m_clusters |
The list of clusters contained in S. | |
ClusterArray< ListIterator< cluster > > | m_it |
m_it[c] contains the list iterator pointing to c if c is contained in S, an invalid list iterator otherwise. | |
Cluster sets.
A cluster set maintains a subset S of the clusters contained in an associated clustered graph. This kind of cluster set provides efficient operations for testing membership, insertion and deletion of elements, and clearing the set.
In contrast to ClusterSetPure, a ClusterSet provides efficient access to the number of clusters stored in the set.
Definition at line 216 of file ClusterSet.h.
|
inlineexplicit |
Creates an empty cluster set associated with clustered graph C
.
Definition at line 219 of file ClusterSet.h.
|
inline |
Definition at line 222 of file ClusterSet.h.
|
inline |
Removes all clusters from S.
After this operation, S is empty and still associated with the same clustered graph. The runtime of this operations is O(k), where k is the number of clusters in S before this operation.
Definition at line 259 of file ClusterSet.h.
Returns a reference to the list of clusters contained in S.
This list can be used for iterating over all clusters in S.
Definition at line 288 of file ClusterSet.h.
Inserts cluster c
into S.
This operation has constant runtime.
c
is a cluster in the associated clustered graph. Definition at line 230 of file ClusterSet.h.
Returns true if cluster c
is contained in S, false otherwise.
This operation has constant runtime.
c
is a cluster in the associated graph. Definition at line 273 of file ClusterSet.h.
Removes cluster c
from S.
This operation has constant runtime.
c
is a cluster in the associated clustered graph. Definition at line 244 of file ClusterSet.h.
|
inline |
Returns the size of S.
This operation has constant runtime.
Definition at line 282 of file ClusterSet.h.
The list of clusters contained in S.
Definition at line 296 of file ClusterSet.h.
|
private |
m_it[c] contains the list iterator pointing to c if c is contained in S, an invalid list iterator otherwise.
Definition at line 293 of file ClusterSet.h.