indigoX
IXAssignmentGraph Class Reference

Class used to assign electrons to a molecule. More...

#include <indigox/graph/assignment.hpp>

Public Types

using NbrsIter = VertContain::const_iterator
 Type of the iterator returned by the GetNeihbours() method. More...
 
using VertIter = VertContain::const_iterator
 Type of the iterator returned by the GetVertices() method. More...
 

Public Member Functions

 IXAssignmentGraph ()=delete
 
 IXAssignmentGraph (MolecularGraph g)
 Construct from a molecular graph. More...
 
size_t Degree (const AGVertex &v) const
 Get the degree of a vertex. More...
 
std::pair< NbrsIter, NbrsIterGetNeighbours (const AGVertex &v) const
 Get the neighbours of a vertex. More...
 
AGVertex GetVertex (const MGVertex &v) const
 Get the AGVertex associated with an MGVertex. More...
 
AGVertex GetVertex (const MGEdge &e) const
 Get the AGVertex associated with an MGEdge. More...
 
std::pair< VertIter, VertIterGetVertices () const
 Get the vertices of the graph. More...
 
bool HasVertex (const AGVertex &v) const
 Check if an IXAGVertex belongs to this graph. More...
 
bool HasVertex (const MGVertex &v) const
 Check if an IXMGVertex has an associated vertex in this graph. More...
 
bool HasVertex (const MGEdge &e) const
 Check if an IXMGEdge has an associated vertex in this graph. More...
 
size_t NumVertices () const
 Get the number of vertices in the graph. More...
 
void PreassignElectrons ()
 Check if the graph is connected. More...
 

Friends

struct indigox::test::TestAssignmentGraph
 Friendship allows IXAssignmentGraph to be properly tested. More...
 

Detailed Description

Class used to assign electrons to a molecule.

An IXAssignmentGraph is generated from an IXMolecularGraph at a fixed point in time. This means that there are no modification methods available for adding or removing vertices to/from an IXAssignmentGraph. Additionally, the edges of the graph are not accessible in any way.

Member Typedef Documentation

◆ NbrsIter

using NbrsIter = VertContain::const_iterator

Type of the iterator returned by the GetNeihbours() method.

◆ VertIter

using VertIter = VertContain::const_iterator

Type of the iterator returned by the GetVertices() method.

Constructor & Destructor Documentation

◆ IXAssignmentGraph() [1/2]

IXAssignmentGraph ( )
delete

◆ IXAssignmentGraph() [2/2]

Construct from a molecular graph.

Parameters
gmolecular graph to construct from.

Member Function Documentation

◆ Degree()

size_t Degree ( const AGVertex v) const
inline

Get the degree of a vertex.

If the provided vertex is not part of the graph, the returned value is std::numeric_limits<size_>::max()

Returns
the degree of the vertex.

◆ GetNeighbours()

std::pair<NbrsIter, NbrsIter> GetNeighbours ( const AGVertex v) const
inline

Get the neighbours of a vertex.

If the vertex is not part of the graph, the returned iterator pair are an empty range.

Parameters
vthe vertex to get neighbours of.
Returns
a pair of iterators across the neighbours of the vertex.

◆ GetVertex() [1/2]

AGVertex GetVertex ( const MGVertex v) const
inline

Get the AGVertex associated with an MGVertex.

If the provided MGVertex is not associated with the graph, the returned AGVertex is empty.

Parameters
vthe MGVertex to get associated AGVertex for.
Returns
the AGVertex associated with the MGVertex.

◆ GetVertex() [2/2]

AGVertex GetVertex ( const MGEdge e) const
inline

Get the AGVertex associated with an MGEdge.

If the provided MGEdge is not associated with the graph, the returned AGVertex is empty.

Parameters
ethe MGEdge to get associated AGVertex for.
Returns
the AGVertex associated with the MGEdge.

◆ GetVertices()

std::pair<VertIter, VertIter> GetVertices ( ) const
inline

Get the vertices of the graph.

Returns
a pair of iterators across the vertices of the graph.

◆ HasVertex() [1/3]

bool HasVertex ( const AGVertex v) const
inline

Check if an IXAGVertex belongs to this graph.

Parameters
vthe vertex to check for.
Returns
if v is part of the graph or not.

Referenced by IXAssignmentGraph::Degree(), IXAssignmentGraph::GetNeighbours(), and IXAssignmentGraph::GetVertex().

◆ HasVertex() [2/3]

bool HasVertex ( const MGVertex v) const
inline

Check if an IXMGVertex has an associated vertex in this graph.

Parameters
vthe IXMGVertex to check for.
Returns
if v is associated with the graph or not.

◆ HasVertex() [3/3]

bool HasVertex ( const MGEdge e) const
inline

Check if an IXMGEdge has an associated vertex in this graph.

Parameters
ethe edge to check for.
Returns
if e is associated with the graph or not.

◆ NumVertices()

size_t NumVertices ( ) const
inline

Get the number of vertices in the graph.

Returns
the number of vertices in the graph.

◆ PreassignElectrons()

void PreassignElectrons ( )

Check if the graph is connected.

Returns
if the graph is connected or not.

Populate the pre-assigned state of all vertices.

The assigned electrons are as follows:

  • Six electrons on one coordinate F, Cl, and Br.
  • Four electrons on one coordinate O, and S.
  • Two electrons on one coordinate N.
  • Four electrons on two coordinate O, and S.
  • No electrons on all other types of atoms.
  • Two electrons on all bonds.

Friends And Related Function Documentation

◆ indigox::test::TestAssignmentGraph

friend struct indigox::test::TestAssignmentGraph
friend

Friendship allows IXAssignmentGraph to be properly tested.


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