votca 2024.2-dev
Loading...
Searching...
No Matches
votca::tools::EdgeContainer Class Reference

EdgeContainer is responsible for operations on groups of edges. More...

#include <edgecontainer.h>

Collaboration diagram for votca::tools::EdgeContainer:

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< IndexgetVerticesDegree (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< EdgegetEdges () const
 Get all the edges in vector form.
 
std::vector< IndexgetVertices () const
 Get all the vertices in vector form.
 
std::vector< IndexgetNeighVertices (Index vertex) const
 Get the vertices neighboring vert.
 
std::vector< EdgegetNeighEdges (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EdgeContainer() [1/3]

votca::tools::EdgeContainer::EdgeContainer ( )
default

Constructors can take no arguments a single Edge or a vector of edges.

◆ EdgeContainer() [2/3]

votca::tools::EdgeContainer::EdgeContainer ( Edge edge)

Definition at line 36 of file edgecontainer.cc.

◆ EdgeContainer() [3/3]

votca::tools::EdgeContainer::EdgeContainer ( std::vector< Edge > edges)

Definition at line 38 of file edgecontainer.cc.

Member Function Documentation

◆ addEdge()

void votca::tools::EdgeContainer::addEdge ( Edge edge)

Add an edge to the container.

Definition at line 113 of file edgecontainer.cc.

◆ addVertex()

void votca::tools::EdgeContainer::addVertex ( Index vertex)

Add a lone vertex.

Definition at line 134 of file edgecontainer.cc.

◆ edgeExist()

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.

◆ getDegree()

Index votca::tools::EdgeContainer::getDegree ( const Index vertex) const

Determine the degree of the vertex/number of edges attached.

Definition at line 55 of file edgecontainer.cc.

◆ getEdges()

vector< Edge > votca::tools::EdgeContainer::getEdges ( ) const

Get all the edges in vector form.

Definition at line 174 of file edgecontainer.cc.

◆ getMaxDegree()

Index votca::tools::EdgeContainer::getMaxDegree ( void ) const

Get the value of the max degree.

Definition at line 44 of file edgecontainer.cc.

◆ getNeighEdges()

vector< Edge > votca::tools::EdgeContainer::getNeighEdges ( Index vertex) const

Get the edges neighboring vert.

Definition at line 160 of file edgecontainer.cc.

◆ getNeighVertices()

vector< Index > votca::tools::EdgeContainer::getNeighVertices ( Index vertex) const

Get the vertices neighboring vert.

Definition at line 149 of file edgecontainer.cc.

◆ getVertices()

vector< Index > votca::tools::EdgeContainer::getVertices ( ) const

Get all the vertices in vector form.

Definition at line 140 of file edgecontainer.cc.

◆ getVerticesDegree()

vector< Index > votca::tools::EdgeContainer::getVerticesDegree ( Index degree) const

Contains vector of all vertices with degree.

Definition at line 74 of file edgecontainer.cc.

◆ vertexExist()

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.

◆ vertexExistWithDegree()

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.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const EdgeContainer edgecontainer )
friend

Print output of object.

Definition at line 192 of file edgecontainer.cc.

Member Data Documentation

◆ adj_list_

std::unordered_map<Index, std::unordered_map<Index, Index> > votca::tools::EdgeContainer::adj_list_
protected

The vertex, the neighboring vertices and the number of edges.

Definition at line 44 of file edgecontainer.h.


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