Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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) More...
 
 ~RandomNodeSet ()
 destructor More...
 
node chooseNode () const
 chooses a node from the available nodes in O(1) More...
 
bool isAvailable (node v) const
 
int nodesLeft () const
 number of nodes available More...
 
void removeNode (node v)
 removes a node from available nodes (assumes v is available) in O(1) More...
 

Private Member Functions

void allocate ()
 
void deallocate ()
 

Private Attributes

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

Detailed Description

utility class to select multiple nodes randomly

Definition at line 187 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 190 of file FastUtils.h.

◆ ~RandomNodeSet()

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

destructor

Definition at line 193 of file FastUtils.h.

Member Function Documentation

◆ allocate()

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

Definition at line 220 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 196 of file FastUtils.h.

◆ deallocate()

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

Definition at line 233 of file FastUtils.h.

◆ isAvailable()

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

Definition at line 214 of file FastUtils.h.

◆ nodesLeft()

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

number of nodes available

Definition at line 217 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 204 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 239 of file FastUtils.h.

◆ m_graph

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

the graph

Definition at line 236 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 242 of file FastUtils.h.

◆ m_numNodes

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

total num nodes

Definition at line 245 of file FastUtils.h.

◆ m_numNodesChoosen

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

num available nodes

Definition at line 248 of file FastUtils.h.


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