AvogadroLibs 1.95.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ConnectedGroup Class Reference

The ConnectedGroup class represents a bidirectional Map data structure between size_t (group) and a size_t set (nodes).

#include <avogadro/core/ConnectedGroup.h>

Public Member Functions

 ConnectedGroup ()
 
 ConnectedGroup (size_t n)
 
 ~ConnectedGroup ()
 
void addNode (size_t index)
 
void addNode (size_t node, size_t group)
 
void addNodes (size_t n)
 
void addNodes (size_t n, size_t group)
 
void addConnection (size_t a, size_t b)
 
void removeNode (size_t index)
 
void removeConnections ()
 
void removeConnection (size_t index)
 
void removeConnection (size_t a, size_t b, const std::set< size_t > &neighbors)
 
void removeGroup (size_t group)
 
void addGroup (size_t group)
 
void clear ()
 
size_t getGroup (size_t node) const
 
size_t getGroupSize (size_t node) const
 
std::vector< std::set< size_t > > getAllGroups () const
 
std::set< size_t > getNodes (size_t group) const
 
size_t groupCount () const
 
size_t atomCount () const
 
bool hasAtom (size_t atom) const
 

Constructor & Destructor Documentation

◆ ConnectedGroup() [1/2]

Creates a new, empty ConnectedGroup.

◆ ConnectedGroup() [2/2]

ConnectedGroup ( size_t  n)
explicit

Creates a new ConnectedGroup containing size n vertices.

◆ ~ConnectedGroup()

Destroys the ConnectedGroup.

Member Function Documentation

◆ addNode()

void addNode ( size_t  index)

check if index is already in a group otherwise create one for it

◆ addNodes()

void addNodes ( size_t  n)

create n groups with 1 node each

◆ addConnection()

void addConnection ( size_t  a,
size_t  b 
)

node a and b will be in the same group

◆ removeNode()

void removeNode ( size_t  index)

Removes the node at index.

◆ removeConnections()

void removeConnections ( )

Makes all the nodes individual groups.

◆ removeConnection() [1/2]

void removeConnection ( size_t  index)

Makes index an individual group.

◆ removeConnection() [2/2]

void removeConnection ( size_t  a,
size_t  b,
const std::set< size_t > &  neighbors 
)

Checks if a and b whould be still connected and separate them if they don't

◆ clear()

void clear ( )

Removes everything.

◆ getGroup()

size_t getGroup ( size_t  node) const
Returns
the group ID from the node .

◆ getGroupSize()

size_t getGroupSize ( size_t  node) const
Returns
the group size from the node.

◆ getAllGroups()

std::vector< std::set< size_t > > getAllGroups ( ) const
Returns
all groups and their nodes

◆ getNodes()

std::set< size_t > getNodes ( size_t  group) const
Returns
all the nodes in the group.

◆ groupCount()

size_t groupCount ( ) const
Returns
the total groups existing

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