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 | |
node * | m_array |
the set of all nodes (at the end the available nodes) | |
const Graph & | m_graph |
the graph | |
NodeArray< int > | m_nodeIndex |
the index in the array of the nodes | |
int | m_numNodes |
total num nodes | |
int | m_numNodesChoosen |
num available nodes | |
utility class to select multiple nodes randomly
Definition at line 180 of file FastUtils.h.
init the random node set with the given graph. takes O(n)
Definition at line 183 of file FastUtils.h.
|
inline |
destructor
Definition at line 186 of file FastUtils.h.
|
inlineprivate |
Definition at line 213 of file FastUtils.h.
|
inline |
chooses a node from the available nodes in O(1)
Definition at line 189 of file FastUtils.h.
|
inlineprivate |
Definition at line 226 of file FastUtils.h.
Definition at line 207 of file FastUtils.h.
|
inline |
number of nodes available
Definition at line 210 of file FastUtils.h.
removes a node from available nodes (assumes v is available) in O(1)
Definition at line 197 of file FastUtils.h.
|
private |
the set of all nodes (at the end the available nodes)
Definition at line 232 of file FastUtils.h.
the graph
Definition at line 229 of file FastUtils.h.
the index in the array of the nodes
Definition at line 235 of file FastUtils.h.
|
private |
total num nodes
Definition at line 238 of file FastUtils.h.
|
private |
num available nodes
Definition at line 241 of file FastUtils.h.