Node sets.
More...
#include <ogdf/basic/NodeSet.h>
Node sets.
A node set maintains a subset S of the nodes contained in an associated graph. This kind of node set provides efficient operations for testing membership, insertion and deletion of elements, and clearing the set.
In contrast to NodeSetPure, a NodeSet provides efficient access to the number of nodes stored in the set.
- See also
-
Definition at line 249 of file NodeSet.h.
◆ NodeSet() [1/2]
| ogdf::NodeSet::NodeSet |
( |
const Graph & |
G | ) |
|
|
inlineexplicit |
Creates an empty node set associated with graph G.
Definition at line 252 of file NodeSet.h.
◆ ~NodeSet()
| ogdf::NodeSet::~NodeSet |
( |
| ) |
|
|
inline |
◆ NodeSet() [2/2]
| ogdf::NodeSet::NodeSet |
( |
const NodeSet & |
V | ) |
|
|
inline |
◆ clear()
| void ogdf::NodeSet::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 292 of file NodeSet.h.
◆ insert()
| void ogdf::NodeSet::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 263 of file NodeSet.h.
◆ isMember()
| bool ogdf::NodeSet::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 306 of file NodeSet.h.
◆ nodes()
| const List<node>& ogdf::NodeSet::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 323 of file NodeSet.h.
◆ operator=()
Assignment operator.
Definition at line 335 of file NodeSet.h.
◆ remove()
| void ogdf::NodeSet::remove |
( |
node |
v | ) |
|
|
inline |
Removes node v from S.
This operation has constant runtime.
- Precondition
v is a node in the associated graph.
Definition at line 276 of file NodeSet.h.
◆ size()
| int ogdf::NodeSet::size |
( |
| ) |
const |
|
inline |
Returns the size of S.
This operation has constant runtime.
Definition at line 315 of file NodeSet.h.
◆ m_it
m_it[v] contains the list iterator pointing to v if v is contained in S, an invalid list iterator otherwise.
Definition at line 347 of file NodeSet.h.
◆ m_nodes
The list of nodes contained in S.
Definition at line 350 of file NodeSet.h.
The documentation for this class was generated from the following file: