graph_analysis
HyperEdge.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_HYPER_EDGE_HPP
2 #define GRAPH_ANALYSIS_HYPER_EDGE_HPP
3 
4 #include <string>
5 #include "Vertex.hpp"
6 
7 namespace graph_analysis
8 {
9 
10 class BaseGraph;
11 
17 class HyperEdge : public Vertex
18 {
19 public:
20  typedef shared_ptr< HyperEdge > Ptr;
21 
22  HyperEdge(const std::string& label = std::string());
23 
24  HyperEdge(const Vertex::PtrList& vertices, const std::string& label = std::string());
25 
26  virtual ~HyperEdge() {}
27 
28  // Get class name
29  // \return class name
30  virtual std::string getClassName() const;
31 
36  virtual std::string toString() const;
37 
42  virtual std::string toString(uint32_t indent) const;
43 
47  virtual const Vertex::PtrList& getVertices() const { return mVertices; }
48 
52  virtual void setVertices(const Vertex::PtrList& vertices) { mVertices = vertices; }
53 
58  static std::vector<Vertex::Ptr> getInvolvedVertices(const HyperEdge::Ptr& e0, const HyperEdge::Ptr& e1);
59 
64  static bool areMeeting(const HyperEdge::Ptr& e0, const HyperEdge::Ptr& e1);
65 
66 protected:
70  virtual Vertex* getClone() const { return new HyperEdge(*this); }
71 
73 };
74 
75 } // end namespace graph_analysis
76 #endif // GRAPH_ANALYSIS_HYPER_EDGE_HPP
graph_analysis::HyperEdge::getInvolvedVertices
static std::vector< Vertex::Ptr > getInvolvedVertices(const HyperEdge::Ptr &e0, const HyperEdge::Ptr &e1)
Definition: HyperEdge.cpp:41
graph_analysis::HyperEdge::setVertices
virtual void setVertices(const Vertex::PtrList &vertices)
Definition: HyperEdge.hpp:52
graph_analysis::HyperEdge::HyperEdge
HyperEdge(const std::string &label=std::string())
Definition: HyperEdge.cpp:8
graph_analysis::Vertex::PtrList
std::vector< Ptr > PtrList
Definition: Vertex.hpp:24
graph_analysis::Vertex
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19
Vertex.hpp
graph_analysis::HyperEdge::areMeeting
static bool areMeeting(const HyperEdge::Ptr &e0, const HyperEdge::Ptr &e1)
Definition: HyperEdge.cpp:49
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::HyperEdge
A HyperEdge represents a set of vertices.
Definition: HyperEdge.hpp:17
graph_analysis::HyperEdge::mVertices
Vertex::PtrList mVertices
Definition: HyperEdge.hpp:72
graph_analysis::HyperEdge::~HyperEdge
virtual ~HyperEdge()
Definition: HyperEdge.hpp:26
graph_analysis::HyperEdge::getClassName
virtual std::string getClassName() const
Definition: HyperEdge.cpp:18
graph_analysis::HyperEdge::getClone
virtual Vertex * getClone() const
Definition: HyperEdge.hpp:70
graph_analysis::HyperEdge::Ptr
shared_ptr< HyperEdge > Ptr
Definition: HyperEdge.hpp:20
graph_analysis::HyperEdge::toString
virtual std::string toString() const
Definition: HyperEdge.cpp:23
graph_analysis::HyperEdge::getVertices
virtual const Vertex::PtrList & getVertices() const
Definition: HyperEdge.hpp:47