Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::fast_multipole_embedder::RandomNodeSet Class Reference

utility class to select multiple nodes randomly More...

#include <ogdf/energybased/fast_multipole_embedder/FastUtils.h>

Public Member Functions

 RandomNodeSet (const Graph &G)
 init the random node set with the given graph. takes O(n)
 
 ~RandomNodeSet ()
 destructor
 
node chooseNode () const
 chooses a node from the available nodes in O(1)
 
bool isAvailable (node v) const
 
int nodesLeft () const
 number of nodes available
 
void removeNode (node v)
 removes a node from available nodes (assumes v is available) in O(1)
 

Private Member Functions

void allocate ()
 
void deallocate ()
 

Private Attributes

nodem_array
 the set of all nodes (at the end the available nodes)
 
const Graphm_graph
 the graph
 
NodeArray< intm_nodeIndex
 the index in the array of the nodes
 
int m_numNodes
 total num nodes
 
int m_numNodesChoosen
 num available nodes
 

Detailed Description

utility class to select multiple nodes randomly

Definition at line 180 of file FastUtils.h.

Constructor & Destructor Documentation

◆ RandomNodeSet()

ogdf::fast_multipole_embedder::RandomNodeSet::RandomNodeSet ( const Graph G)
inlineexplicit

init the random node set with the given graph. takes O(n)

Definition at line 183 of file FastUtils.h.

◆ ~RandomNodeSet()

ogdf::fast_multipole_embedder::RandomNodeSet::~RandomNodeSet ( )
inline

destructor

Definition at line 186 of file FastUtils.h.

Member Function Documentation

◆ allocate()

void ogdf::fast_multipole_embedder::RandomNodeSet::allocate ( )
inlineprivate

Definition at line 213 of file FastUtils.h.

◆ chooseNode()

node ogdf::fast_multipole_embedder::RandomNodeSet::chooseNode ( ) const
inline

chooses a node from the available nodes in O(1)

Definition at line 189 of file FastUtils.h.

◆ deallocate()

void ogdf::fast_multipole_embedder::RandomNodeSet::deallocate ( )
inlineprivate

Definition at line 226 of file FastUtils.h.

◆ isAvailable()

bool ogdf::fast_multipole_embedder::RandomNodeSet::isAvailable ( node  v) const
inline

Definition at line 207 of file FastUtils.h.

◆ nodesLeft()

int ogdf::fast_multipole_embedder::RandomNodeSet::nodesLeft ( ) const
inline

number of nodes available

Definition at line 210 of file FastUtils.h.

◆ removeNode()

void ogdf::fast_multipole_embedder::RandomNodeSet::removeNode ( node  v)
inline

removes a node from available nodes (assumes v is available) in O(1)

Definition at line 197 of file FastUtils.h.

Member Data Documentation

◆ m_array

node* ogdf::fast_multipole_embedder::RandomNodeSet::m_array
private

the set of all nodes (at the end the available nodes)

Definition at line 232 of file FastUtils.h.

◆ m_graph

const Graph& ogdf::fast_multipole_embedder::RandomNodeSet::m_graph
private

the graph

Definition at line 229 of file FastUtils.h.

◆ m_nodeIndex

NodeArray<int> ogdf::fast_multipole_embedder::RandomNodeSet::m_nodeIndex
private

the index in the array of the nodes

Definition at line 235 of file FastUtils.h.

◆ m_numNodes

int ogdf::fast_multipole_embedder::RandomNodeSet::m_numNodes
private

total num nodes

Definition at line 238 of file FastUtils.h.

◆ m_numNodesChoosen

int ogdf::fast_multipole_embedder::RandomNodeSet::m_numNodesChoosen
private

num available nodes

Definition at line 241 of file FastUtils.h.


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