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

Connects to vertices. More...

#include <edge.h>

Inheritance diagram for votca::tools::Edge:
Collaboration diagram for votca::tools::Edge:

Public Member Functions

 Edge ()=default
 
virtual ~Edge ()=default
 
 Edge (Index ID1, Index ID2)
 
Index getOtherEndPoint (Index ver) const
 Given one of the integers in the edge the other will be output.
 
Index getEndPoint1 () const
 grab the smaller integer
 
Index getEndPoint2 () const
 grab the larger integer
 
bool loop () const
 Checks to see if an edge loops back on itself.
 
bool contains (Index ID) const
 Determine if the edge contains the Index ID.
 
virtual bool operator== (const Edge &ed) const
 Checks if Edges are equivalent.
 
virtual bool operator!= (const Edge &ed) const
 Checks if Edges are not equivalent.
 
virtual bool operator< (const Edge &ed) const
 
virtual bool operator> (const Edge &ed) const
 
virtual bool operator<= (const Edge &ed) const
 
virtual bool operator>= (const Edge &ed) const
 

Protected Attributes

std::vector< Indexvertices_
 

Friends

std::ostream & operator<< (std::ostream &os, const Edge &ed)
 Print the contents of the edge.
 

Detailed Description

Connects to vertices.

The edge class stores the ids of two seperate vertices indictating that they are connected (id1,id2). Unlike a pair the vertex with the lower value is always placed in id1, this allows us to reduce ambiguity when dealing with a link.

Definition at line 42 of file edge.h.

Constructor & Destructor Documentation

◆ Edge() [1/2]

votca::tools::Edge::Edge ( )
default

◆ ~Edge()

virtual votca::tools::Edge::~Edge ( )
virtualdefault

◆ Edge() [2/2]

votca::tools::Edge::Edge ( Index ID1,
Index ID2 )

Creates an edge the smallest integer value will be placed in the id1 spot and the larger in the id2 spot

Definition at line 33 of file edge.cc.

Member Function Documentation

◆ contains()

bool votca::tools::Edge::contains ( Index ID) const

Determine if the edge contains the Index ID.

Definition at line 45 of file edge.cc.

◆ getEndPoint1()

Index votca::tools::Edge::getEndPoint1 ( ) const
inline

grab the smaller integer

Definition at line 55 of file edge.h.

◆ getEndPoint2()

Index votca::tools::Edge::getEndPoint2 ( ) const
inline

grab the larger integer

Definition at line 57 of file edge.h.

◆ getOtherEndPoint()

Index votca::tools::Edge::getOtherEndPoint ( Index ver) const

Given one of the integers in the edge the other will be output.

Definition at line 37 of file edge.cc.

◆ loop()

bool votca::tools::Edge::loop ( ) const
inline

Checks to see if an edge loops back on itself.

If both ends of the edge point to the same vertex than it is considered a loop.

Definition at line 65 of file edge.h.

◆ operator!=()

bool votca::tools::Edge::operator!= ( const Edge & ed) const
virtual

Checks if Edges are not equivalent.

Reimplemented in votca::tools::ReducedEdge.

Definition at line 61 of file edge.cc.

◆ operator<()

bool votca::tools::Edge::operator< ( const Edge & ed) const
virtual

If the vertices are smaller in value Edge ed1(2,3); Edge ed2(1,5); Edge ed3(4,1); priority is given to the smallest vertex assert(ed2<ed1); // will return true assert(ed3<ed1); // will return true assert(ed3<ed1); // will return true

Reimplemented in votca::tools::ReducedEdge.

Definition at line 63 of file edge.cc.

◆ operator<=()

bool votca::tools::Edge::operator<= ( const Edge & ed) const
virtual

Reimplemented in votca::tools::ReducedEdge.

Definition at line 76 of file edge.cc.

◆ operator==()

bool votca::tools::Edge::operator== ( const Edge & ed) const
virtual

Checks if Edges are equivalent.

Reimplemented in votca::tools::ReducedEdge.

Definition at line 49 of file edge.cc.

◆ operator>()

bool votca::tools::Edge::operator> ( const Edge & ed) const
virtual

Reimplemented in votca::tools::ReducedEdge.

Definition at line 80 of file edge.cc.

◆ operator>=()

bool votca::tools::Edge::operator>= ( const Edge & ed) const
virtual

Reimplemented in votca::tools::ReducedEdge.

Definition at line 82 of file edge.cc.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Edge & ed )
friend

Print the contents of the edge.

Definition at line 84 of file edge.cc.

Member Data Documentation

◆ vertices_

std::vector<Index> votca::tools::Edge::vertices_
protected

Definition at line 44 of file edge.h.


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