Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::ClusterSet Class Reference

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. More...
 
 ~ClusterSet ()
 
void clear ()
 Removes all clusters from S. More...
 
const List< cluster > & clusters () const
 Returns a reference to the list of clusters contained in S. More...
 
void insert (cluster c)
 Inserts cluster c into S. More...
 
bool isMember (cluster c) const
 Returns true if cluster c is contained in S, false otherwise. More...
 
void remove (cluster c)
 Removes cluster c from S. More...
 
int size () const
 Returns the size of S. More...
 

Private Attributes

List< clusterm_clusters
 The list of clusters contained in S. More...
 
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. More...
 

Detailed Description

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.

See also
- ClusterSetPure, ClusterSetSimple

Definition at line 229 of file ClusterSet.h.

Constructor & Destructor Documentation

◆ ClusterSet()

ogdf::ClusterSet::ClusterSet ( const ClusterGraph C)
inlineexplicit

Creates an empty cluster set associated with clustered graph C.

Definition at line 232 of file ClusterSet.h.

◆ ~ClusterSet()

ogdf::ClusterSet::~ClusterSet ( )
inline

Definition at line 235 of file ClusterSet.h.

Member Function Documentation

◆ clear()

void ogdf::ClusterSet::clear ( )
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 272 of file ClusterSet.h.

◆ clusters()

const List<cluster>& ogdf::ClusterSet::clusters ( ) const
inline

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 304 of file ClusterSet.h.

◆ insert()

void ogdf::ClusterSet::insert ( cluster  c)
inline

Inserts cluster c into S.

This operation has constant runtime.

Precondition
c is a cluster in the associated clustered graph.

Definition at line 243 of file ClusterSet.h.

◆ isMember()

bool ogdf::ClusterSet::isMember ( cluster  c) const
inline

Returns true if cluster c is contained in S, false otherwise.

This operation has constant runtime.

Precondition
c is a cluster in the associated graph.

Definition at line 287 of file ClusterSet.h.

◆ remove()

void ogdf::ClusterSet::remove ( cluster  c)
inline

Removes cluster c from S.

This operation has constant runtime.

Precondition
c is a cluster in the associated clustered graph.

Definition at line 256 of file ClusterSet.h.

◆ size()

int ogdf::ClusterSet::size ( ) const
inline

Returns the size of S.

This operation has constant runtime.

Definition at line 296 of file ClusterSet.h.

Member Data Documentation

◆ m_clusters

List<cluster> ogdf::ClusterSet::m_clusters
private

The list of clusters contained in S.

Definition at line 314 of file ClusterSet.h.

◆ m_it

ClusterArray<ListIterator<cluster> > ogdf::ClusterSet::m_it
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 311 of file ClusterSet.h.


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