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
Vertex::PtrList mVertices
Definition: HyperEdge.hpp:72
virtual ~HyperEdge()
Definition: HyperEdge.hpp:26
virtual std::string getClassName() const
Definition: HyperEdge.cpp:18
virtual Vertex * getClone() const
Definition: HyperEdge.hpp:70
shared_ptr< HyperEdge > Ptr
Definition: HyperEdge.hpp:20
virtual std::string toString() const
Definition: HyperEdge.cpp:23
std::vector< Ptr > PtrList
Definition: Vertex.hpp:24
static std::vector< Vertex::Ptr > getInvolvedVertices(const HyperEdge::Ptr &e0, const HyperEdge::Ptr &e1)
Definition: HyperEdge.cpp:41
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
virtual const Vertex::PtrList & getVertices() const
Definition: HyperEdge.hpp:47
A HyperEdge represents a set of vertices.
Definition: HyperEdge.hpp:17
virtual void setVertices(const Vertex::PtrList &vertices)
Definition: HyperEdge.hpp:52
HyperEdge(const std::string &label=std::string())
Definition: HyperEdge.cpp:8
static bool areMeeting(const HyperEdge::Ptr &e0, const HyperEdge::Ptr &e1)
Definition: HyperEdge.cpp:49
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19