votca 2024.2-dev
|
EdgeContainer is responsible for operations on groups of edges. More...
#include <edgecontainer.h>
Public Member Functions | |
EdgeContainer ()=default | |
Constructors can take no arguments a single Edge or a vector of edges. | |
EdgeContainer (Edge edge) | |
EdgeContainer (std::vector< Edge > edges) | |
Index | getMaxDegree () const |
Get the value of the max degree. | |
std::vector< Index > | getVerticesDegree (Index degree) const |
Contains vector of all vertices with degree. | |
Index | getDegree (const Index vertex) const |
Determine the degree of the vertex/number of edges attached. | |
bool | vertexExistWithDegree (Index degree) const |
Determine if a vertex with the specified degree exists. | |
bool | edgeExist (const Edge &edge) const |
Check if the edge exists returns true or false. | |
bool | vertexExist (Index vertex) const |
Check if the vertex exists returns true or false. | |
void | addEdge (Edge edge) |
Add an edge to the container. | |
void | addVertex (Index vertex) |
Add a lone vertex. | |
std::vector< Edge > | getEdges () const |
Get all the edges in vector form. | |
std::vector< Index > | getVertices () const |
Get all the vertices in vector form. | |
std::vector< Index > | getNeighVertices (Index vertex) const |
Get the vertices neighboring vert. | |
std::vector< Edge > | getNeighEdges (Index vertex) const |
Get the edges neighboring vert. | |
Protected Attributes | |
std::unordered_map< Index, std::unordered_map< Index, Index > > | adj_list_ |
The vertex, the neighboring vertices and the number of edges. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const EdgeContainer edgecontainer) |
Print output of object. | |
EdgeContainer is responsible for operations on groups of edges.
Such operations have to deal with finding edges attached to a vertex finding neighboring vertices etc.
Definition at line 41 of file edgecontainer.h.
|
default |
Constructors can take no arguments a single Edge or a vector of edges.
votca::tools::EdgeContainer::EdgeContainer | ( | Edge | edge | ) |
Definition at line 36 of file edgecontainer.cc.
votca::tools::EdgeContainer::EdgeContainer | ( | std::vector< Edge > | edges | ) |
Definition at line 38 of file edgecontainer.cc.
void votca::tools::EdgeContainer::addEdge | ( | Edge | edge | ) |
Add an edge to the container.
Definition at line 113 of file edgecontainer.cc.
void votca::tools::EdgeContainer::addVertex | ( | Index | vertex | ) |
Add a lone vertex.
Definition at line 134 of file edgecontainer.cc.
bool votca::tools::EdgeContainer::edgeExist | ( | const Edge & | edge | ) | const |
Check if the edge exists returns true or false.
Definition at line 95 of file edgecontainer.cc.
Determine the degree of the vertex/number of edges attached.
Definition at line 55 of file edgecontainer.cc.
vector< Edge > votca::tools::EdgeContainer::getEdges | ( | ) | const |
Get all the edges in vector form.
Definition at line 174 of file edgecontainer.cc.
Index votca::tools::EdgeContainer::getMaxDegree | ( | void | ) | const |
Get the value of the max degree.
Definition at line 44 of file edgecontainer.cc.
Get the edges neighboring vert.
Definition at line 160 of file edgecontainer.cc.
Get the vertices neighboring vert.
Definition at line 149 of file edgecontainer.cc.
vector< Index > votca::tools::EdgeContainer::getVertices | ( | ) | const |
Get all the vertices in vector form.
Definition at line 140 of file edgecontainer.cc.
Contains vector of all vertices with degree.
Definition at line 74 of file edgecontainer.cc.
bool votca::tools::EdgeContainer::vertexExist | ( | Index | vertex | ) | const |
Check if the vertex exists returns true or false.
Definition at line 109 of file edgecontainer.cc.
bool votca::tools::EdgeContainer::vertexExistWithDegree | ( | Index | degree | ) | const |
Determine if a vertex with the specified degree exists.
Definition at line 85 of file edgecontainer.cc.
|
friend |
Print output of object.
Definition at line 192 of file edgecontainer.cc.
|
protected |
The vertex, the neighboring vertices and the number of edges.
Definition at line 44 of file edgecontainer.h.