indigoX
|
#include <indigox/graph/condensed.hpp>
Public Types | |
using | ComponentContain = std::vector< VertContain > |
Type for storing components. More... | |
using | CycleEdgeContain = std::vector< EdgeContain > |
Type for storing edge cycles. More... | |
using | CycleVertContain = std::vector< VertContain > |
Type for storing vertex cycles. More... | |
using | EdgeContain = std::vector< CMGEdge > |
Container for edges. More... | |
using | EdgeIter = EdgeContain::const_iterator |
Type of the iterator returned by GetEdges() method. More... | |
using | EdgeMap = eastl::vector_map< MGEdge, CMGEdge > |
Container for mapping MGEdge to edges. More... | |
using | EdgeType = CMGEdge |
Type used for edges. More... | |
using | graph_type = BaseGraph< CMGVertex, CMGEdge, CondensedMolecularGraph > |
Type of the underlying IXGraphBase. More... | |
using | NbrsContain = std::map< CMGVertex, VertContain > |
Container for neighbours of vertices. More... | |
using | NbrsIter = NbrsContain::mapped_type::const_iterator |
Type of the iterator returned by GetNeighbours() method. More... | |
using | PredIter = typename graph_type::inv_adjacency_iterator |
Type for iterator over predecessors of a vertex descriptor. More... | |
using | SubgraphType = CondensedMolecularGraph |
using | VertContain = std::vector< CMGVertex > |
Container for vertices. More... | |
using | VertexType = CMGVertex |
Type used for vertices. More... | |
using | VertIter = VertContain::const_iterator |
Type of the iterator returned by GetVertices() method. More... | |
using | VertMap = eastl::vector_map< MGVertex, CMGVertex > |
Container for mapping MGVertex to vertices. More... | |
using | VertType = typename graph_type::vertex_descriptor |
Type of the graph vertex descriptor. More... | |
Public Member Functions | |
CondensedMolecularGraph ()=default | |
CondensedMolecularGraph (const CondensedMolecularGraph &)=default | |
CondensedMolecularGraph (CondensedMolecularGraph &&)=default | |
~ CondensedMolecularGraph ()=default | |
int64_t | Degree (const CMGVertex &v) const |
Degree of a vertex. More... | |
const CMGVertex & | GetCondensedVertex (const MGVertex &v) const |
const ComponentContain & | GetConnectedComponents () |
Get the connected components of the graph. More... | |
const CycleEdgeContain & | GetCycles () |
Get the cycles of the graph. More... | |
const CMGEdge & | GetEdge (const MGEdge &e) const |
Get the edge associated with an MGEdge. More... | |
CMGEdge | GetEdge (const CMGVertex &u, const CMGVertex &v) const |
Get the edge between two vertices. More... | |
const EdgeContain & | GetEdges () const |
Get the edges of the graph. More... | |
const MolecularGraph & | GetMolecularGraph () const |
Get the source MolecularGraph. More... | |
const VertContain & | GetNeighbours (const CMGVertex &v) |
Get the neighbouring vertices of a vertex. More... | |
const VertContain & | GetPredecessors (const CMGVertex &v) |
Get the predecessor vertices of a vertex. More... | |
CMGVertex | GetSourceVertex (const CMGEdge &e) const |
Get the source vertex of an edge. More... | |
const VertContain & | GetSuccessors (const CMGVertex &v) |
const CondensedMolecularGraph & | GetSuperGraph () const |
CMGVertex | GetTargetVertex (const CMGEdge &e) const |
Get the target vertex of an edge. More... | |
const CMGVertex & | GetVertex (const MGVertex &v) const |
Get the vertex associated with an MGVertex. More... | |
std::pair< CMGVertex, CMGVertex > | GetVertices (const CMGEdge &e) const |
Get the two vertices that make up an edge. More... | |
const VertContain & | GetVertices () const |
Get the vertices of the graph. More... | |
bool | HasCondensedVertex (const MGVertex &v) const |
Check of the graph has a vertex associated with an MGVertex. More... | |
bool | HasEdge (const CMGEdge &e) const |
Is the edge in the graph. More... | |
bool | HasEdge (const CMGVertex &u, const CMGVertex &v) const |
Does an edge exist between two vertices. More... | |
bool | HasEdge (const MGEdge &e) const |
Check if the graph has an edge associated with an MGEdge. More... | |
bool | HasVertex (const CMGVertex &v) const |
Is the vertex in the graph. More... | |
bool | HasVertex (const MGVertex &v) const |
Check if the graph has a vertex directly associated with an MGVertex. More... | |
int64_t | InDegree (const CMGVertex &v) const |
Indegree of a vertex. More... | |
bool | IsConnected () |
Determine if the graph is connected. More... | |
bool | IsCyclic (const CMGVertex &v) |
Determine if a vertex of this graph is cyclic. More... | |
bool | IsCyclic (const CMGVertex &v, uint32_t sz) |
bool | IsCyclic (const CMGEdge &e) |
Determine if an edge of this graph is cycle. More... | |
bool | IsCyclic (const CMGEdge &e, uint32_t sz) |
bool | IsSubgraph () const |
int64_t | NumConnectedComponents () |
Get the number of connected components of the graph. More... | |
int64_t | NumCycles () |
int64_t | NumEdges () const |
Number of edges in the graph. More... | |
int64_t | NumVertices () const |
Number of vertices in the graph. More... | |
operator bool () const | |
bool | operator!= (const CondensedMolecularGraph &G) const |
bool | operator< (const CondensedMolecularGraph &G) const |
bool | operator<= (const CondensedMolecularGraph &G) const |
CondensedMolecularGraph & | operator= (const CondensedMolecularGraph &)=default |
CondensedMolecularGraph & | operator= (CondensedMolecularGraph &&)=default |
bool | operator== (const CondensedMolecularGraph &G) const |
bool | operator> (const CondensedMolecularGraph &G) const |
bool | operator>= (const CondensedMolecularGraph &G) const |
CondensedMolecularGraph | Subgraph (std::vector< CMGVertex > &verts) |
Induce a subgraph from the range of vertices. More... | |
CondensedMolecularGraph | Subgraph (std::vector< CMGVertex > &verts, std::vector< CMGEdge > &edges) |
Create a subgraph from the range of vertices and edges. More... | |
Protected Member Functions | |
void | AddEdge (const CMGVertex &u, const CMGVertex &v, const CMGEdge &e) |
Add a new edge to the graph. More... | |
void | AddVertex (const CMGVertex &v) |
Add a new vertex to the graph. More... | |
void | RemoveEdge (const CMGEdge &e) |
Remove an edge from the graph. More... | |
void | RemoveEdge (const CMGVertex &u, const CMGVertex &v) |
Remove an edge from the graph. More... | |
void | RemoveVertex (const CMGVertex &v) |
Remove a vertex from the graph. More... | |
Protected Attributes | |
std::shared_ptr< BaseImpl > | m_basedata |
Friends | |
class | cereal::access |
Friendship allows serialisation. More... | |
CondensedMolecularGraph | Condense (const MolecularGraph &) |
Friendship allows for generating from a source. More... | |
class | MolecularGraph |
std::ostream & | operator<< (std::ostream &os, const CondensedMolecularGraph &G) |
|
inherited |
Type for storing components.
|
inherited |
Type for storing edge cycles.
|
inherited |
Type for storing vertex cycles.
using EdgeContain = std::vector<CMGEdge> |
Container for edges.
using EdgeIter = EdgeContain::const_iterator |
Type of the iterator returned by GetEdges() method.
using graph_type = BaseGraph<CMGVertex, CMGEdge, CondensedMolecularGraph> |
Type of the underlying IXGraphBase.
using NbrsContain = std::map<CMGVertex, VertContain> |
Container for neighbours of vertices.
using NbrsIter = NbrsContain::mapped_type::const_iterator |
Type of the iterator returned by GetNeighbours() method.
|
inherited |
Type for iterator over predecessors of a vertex descriptor.
|
inherited |
using VertContain = std::vector<CMGVertex> |
Container for vertices.
using VertexType = CMGVertex |
Type used for vertices.
using VertIter = VertContain::const_iterator |
Type of the iterator returned by GetVertices() method.
|
inherited |
Type of the graph vertex descriptor.
|
default |
|
default |
|
default |
|
default |
Add a new edge to the graph.
Vertex u is used as the source and vertex v as the target. If u and/or v are not already part of the graph, they are added. It is the callers responsibility to ensure that the edge is not part of the graph.
u,v | vertices the edge is between. |
e | the edge. |
|
protectedinherited |
Add a new vertex to the graph.
It is the callers responsability to ensure that the vertex added is not already part of the graph. If it is, a mismatch between the vertices in the graph and the what the _verts member thinks are in the graph may arise.
v | the vertex to add. |
|
inherited |
Degree of a vertex.
In the case of a directed graph, the degree of a vertex is the number of edges leaving the vertex.
v | the vertex to get the degree of. |
|
inherited |
Get the connected components of the graph.
|
inherited |
Get the cycles of the graph.
Get the edge associated with an MGEdge.
If the edge is not associated with an edge on this graph, the returned edge is null.
e | the edge to get the associated edge of. |
Get the edge between two vertices.
It is the callers responsibilty to ensure that the vertices are a part of the graph.
u,v | vertices to get the edge between. |
|
inherited |
Get the edges of the graph.
[out] | edges | the vector where the list of edges will be set. The vector is cleared before any edges are added to it. |
const MolecularGraph& GetMolecularGraph | ( | ) | const |
Get the source MolecularGraph.
|
inherited |
Get the neighbouring vertices of a vertex.
The neighbours of a vertex are those for which the edge v -> u exists within the graph. It is the callers responsibilty to ensure that the vertex is a part of the graph.
v | the vertex to get the neighbours of. | |
[out] | nbrs | the vector where the list of neighbours will be set. The vector is cleared before any neighbouring vertices are added to it. |
|
inherited |
Get the predecessor vertices of a vertex.
The predecessors of a vertex are those for which the edge u -> v exists within the graph. For an undirected graph, this is equivalent to the neighbours. It is the callers responsibilty to ensure that the vertex is a part of the graph.
[in] | v | the vertex to get the predecessors of. |
[out] | pres | the vector where the list of predecessors will be set. The vector is cleared before any predecessing vertices are added to it. |
Get the source vertex of an edge.
It is the callers responsibilty to ensure that the edge is a part of the graph.
e | the edge to get the source of. |
|
inherited |
const CondensedMolecularGraph& GetSuperGraph | ( | ) | const |
Get the target vertex of an edge.
It is the callers responsibilty to ensure that the edge is a part of the graph.
e | the edge to get the target of. |
Get the two vertices that make up an edge.
It is the callers responsibility to ensure that the edge is a part of the graph.
e | the edge to get vertices of. |
|
inherited |
Get the vertices of the graph.
[out] | verts | the vector where the list of vertices will be set. The vector is cleared before any vertices are added to it. |
bool HasCondensedVertex | ( | const MGVertex & | v | ) | const |
Check of the graph has a vertex associated with an MGVertex.
Association in this case includes a vertex where one of the condensed vertices is the provided vertex.
v | the vertex to check for. |
|
inherited |
Is the edge in the graph.
e | edge to search for. |
Does an edge exist between two vertices.
u,v | vertices to check between. |
bool HasEdge | ( | const MGEdge & | e | ) | const |
Check if the graph has an edge associated with an MGEdge.
e | the edge to check for. |
|
inherited |
Is the vertex in the graph.
v | vertex to search for. |
bool HasVertex | ( | const MGVertex & | v | ) | const |
Check if the graph has a vertex directly associated with an MGVertex.
Directly associated means that the vertex cannot be condensed into another vertex.
v | the vertex to check for. |
|
inherited |
Indegree of a vertex.
The indegree of a vertex is the number of edges entering the vertex. For an undirected graph, this is equivalent to Degree(V) const. It is the callers responsibilty to ensure that the vertex is a part of the graph.
v | the vertex to get indegree of. |
|
inherited |
Determine if the graph is connected.
|
inherited |
Determine if a vertex of this graph is cyclic.
v | the vertex to check if in a cycle |
|
inherited |
|
inherited |
Determine if an edge of this graph is cycle.
e | the edge to check if in a cycle. |
|
inherited |
bool IsSubgraph | ( | ) | const |
|
inherited |
Get the number of connected components of the graph.
|
inherited |
|
inherited |
Number of edges in the graph.
|
inherited |
Number of vertices in the graph.
|
inline |
|
inline |
bool operator< | ( | const CondensedMolecularGraph & | G | ) | const |
|
inline |
|
default |
|
default |
bool operator== | ( | const CondensedMolecularGraph & | G | ) | const |
bool operator> | ( | const CondensedMolecularGraph & | G | ) | const |
|
inline |
|
protectedinherited |
Remove an edge from the graph.
It is the callers responsibility to ensure that the edge is a part of the graph.
e | the edge to remove. |
Remove an edge from the graph.
It is the callers responsibility to ensure that there is an edge between u and v to remove.
u,v | vertices to remove an edge from between. |
|
protectedinherited |
Remove a vertex from the graph.
Removing a vertex also removes all edges incident on it. It is the callers responsibility to ensure that the vertex removed is within the graph.
v | the vertex to remove. |
|
virtual |
Induce a subgraph from the range of vertices.
Induced subgraph has the same vertices and edges as its parent graph. Additionally, its source MolecularGraph is the same. This is a vertex induced subgraph, meaning that all edges where both vertices are in the provided range will be in the induced graph.
InputIt | type of the iterator range provided. |
begin,end | marking the range of vertices to induce subgraph on. |
Implements BaseGraph< CMGVertex, CMGEdge, CondensedMolecularGraph >.
|
virtual |
Create a subgraph from the range of vertices and edges.
Subgraph has the same vertices and edges as its parent graph. Additionally, its source MolecularGraph is the same. This subgraph is such that only edges within the provided range are added to it, as long as both vertices are in the provided vertex range.
VertIt | type of the vertex iterator range provided. |
EdgeIt | type of the edge iterator range provided. |
v_begin,v_end | marking the range of vertices to create subgraph. |
e_begin,e_end | marking the range of edges to include in subgraph. |
Implements BaseGraph< CMGVertex, CMGEdge, CondensedMolecularGraph >.
|
friend |
Friendship allows serialisation.
|
friend |
Friendship allows for generating from a source.
|
friend |
|
friend |
|
protectedinherited |