Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::NodeSetSimple Class Reference

Simple node sets. More...

#include <ogdf/basic/NodeSet.h>

Public Member Functions

 NodeSetSimple (const Graph &G)
 Creates an empty node set associated with graph G. More...
 
 ~NodeSetSimple ()
 
void clear ()
 Removes all nodes from S. More...
 
void insert (node v)
 Inserts node v into S. More...
 
bool isMember (node v) const
 Returns true if node v is contained in S, false otherwise. More...
 
const SListPure< node > & nodes () const
 Returns a reference to the list of nodes contained in S. More...
 

Private Attributes

NodeArray< bool > m_isContained
 m_isContained[v] is true iff v is contained in S. More...
 
SListPure< node > m_nodes
 The list of nodes contained in S. More...
 

Detailed Description

Simple node sets.

A node set maintains a subset S of the nodes contained in an associated graph. This kind of node set only provides efficient operation for testing membership, insertion, and clearing the set.

See also

Definition at line 56 of file NodeSet.h.

Constructor & Destructor Documentation

◆ NodeSetSimple()

ogdf::NodeSetSimple::NodeSetSimple ( const Graph &  G)
inlineexplicit

Creates an empty node set associated with graph G.

Definition at line 59 of file NodeSet.h.

◆ ~NodeSetSimple()

ogdf::NodeSetSimple::~NodeSetSimple ( )
inline

Definition at line 62 of file NodeSet.h.

Member Function Documentation

◆ clear()

void ogdf::NodeSetSimple::clear ( )
inline

Removes all nodes from S.

After this operation, S is empty and still associated with the same graph. The runtime of this operations is O(k), where k is the number of nodes in S before this operation.

Definition at line 85 of file NodeSet.h.

◆ insert()

void ogdf::NodeSetSimple::insert ( node  v)
inline

Inserts node v into S.

This operation has constant runtime.

Precondition
v is a node in the associated graph.

Definition at line 70 of file NodeSet.h.

◆ isMember()

bool ogdf::NodeSetSimple::isMember ( node  v) const
inline

Returns true if node v is contained in S, false otherwise.

This operation has constant runtime.

Precondition
v is a node in the associated graph.

Definition at line 98 of file NodeSet.h.

◆ nodes()

const SListPure<node>& ogdf::NodeSetSimple::nodes ( ) const
inline

Returns a reference to the list of nodes contained in S.

This list can be used for iterating over all nodes in S.

Definition at line 107 of file NodeSet.h.

Member Data Documentation

◆ m_isContained

NodeArray<bool> ogdf::NodeSetSimple::m_isContained
private

m_isContained[v] is true iff v is contained in S.

Definition at line 113 of file NodeSet.h.

◆ m_nodes

SListPure<node> ogdf::NodeSetSimple::m_nodes
private

The list of nodes contained in S.

Definition at line 116 of file NodeSet.h.


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