votca 2024.2-dev
|
#include <graphvisitor.h>
Public Member Functions | |
virtual void | exploreNode (std::pair< Index, GraphNode > &vertex_and_node, Graph &graph, Edge edge=DUMMY_EDGE) |
Edge(0,0) is a dummy value. | |
GraphVisitor ()=default | |
std::vector< Index > | getUnexploredVertex (const Edge edge) const |
Determine which vertices in the edge, if any, have not been explored. | |
virtual bool | queEmpty () const |
void | setStartingVertex (Index vertex) |
Index | getStartingVertex () const |
void | initialize (Graph &graph) |
Initialize the graphvisitor the default starting point is 0. | |
virtual void | exec (Graph &graph, Edge edge) |
Edge | nextEdge (Graph graph) |
std::set< Index > | getExploredVertices () const |
Get the set of all the vertices that have been explored. | |
bool | vertexExplored (const Index vertex) const |
Has the vertex been explored. | |
Protected Member Functions | |
virtual void | addEdges_ (const Graph &graph, Index vertex)=0 |
What is done to an individual graph node as it is explored. | |
virtual Edge | getEdge_ ()=0 |
Protected Attributes | |
std::set< Index > | explored_ |
set containing all the vertix ids that have been explored | |
Index | startingVertex_ = 0 |
The vertex the visitor started on. | |
Definition at line 52 of file graphvisitor.h.
|
default |
|
protectedpure virtual |
What is done to an individual graph node as it is explored.
Implemented in votca::tools::Graph_BF_Visitor, and votca::tools::Graph_DF_Visitor.
What the visitor does to each node as it is visited, it will simply add the vertex that was explored to the list of explored vertices in its current form.
Definition at line 67 of file graphvisitor.cc.
|
virtual |
Edge(0,0) is a dummy value.
Reimplemented in votca::tools::GraphDistVisitor.
Definition at line 39 of file graphvisitor.cc.
|
protectedpure virtual |
Implemented in votca::tools::Graph_BF_Visitor, and votca::tools::Graph_DF_Visitor.
set< Index > votca::tools::GraphVisitor::getExploredVertices | ( | ) | const |
Get the set of all the vertices that have been explored.
Definition at line 101 of file graphvisitor.cc.
|
inline |
Definition at line 79 of file graphvisitor.h.
Determine which vertices in the edge, if any, have not been explored.
Definition at line 44 of file graphvisitor.cc.
void votca::tools::GraphVisitor::initialize | ( | Graph & | graph | ) |
Initialize the graphvisitor the default starting point is 0.
Definition at line 59 of file graphvisitor.cc.
The next edge to be explored, note that when this function is called it removes the edge from the visitors queue and will no longer be accessible with a second call to nextEdge
Definition at line 87 of file graphvisitor.cc.
|
virtual |
Determine if the exploration is complete, this is determined by whether the edge queue is empty or not, it does not necessarily mean all vertices in a graph have been explored.
Reimplemented in votca::tools::Graph_BF_Visitor, and votca::tools::Graph_DF_Visitor.
Definition at line 37 of file graphvisitor.cc.
|
inline |
Definition at line 78 of file graphvisitor.h.
bool votca::tools::GraphVisitor::vertexExplored | ( | const Index | vertex | ) | const |
Has the vertex been explored.
Definition at line 55 of file graphvisitor.cc.
|
protected |
set containing all the vertix ids that have been explored
Definition at line 55 of file graphvisitor.h.
|
protected |
The vertex the visitor started on.
Definition at line 58 of file graphvisitor.h.