-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVertex.h
45 lines (30 loc) · 1 KB
/
Vertex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
// Models a vertex of a hypergraph.
//
//////////////////////////////////////////////////////////////////////
#if !defined(CLS_VERTEX)
#define CLS_VERTEX
#include <string>
#include <memory>
#include <set>
#include "Globals.h"
#include "NamedEntity.h"
using namespace std;
class Vertex : public NamedEntity
{
public:
Vertex(uint id, const string& name) : NamedEntity(id,name) { }
Vertex(const string& name);
virtual~Vertex();
void setAllLabels(int label = 0) const { setLabel(0); }
friend std::ostream& operator<< (std::ostream &out, const Vertex &v);
};
using VertexSharedPtr = std::shared_ptr<Vertex>;
using VertexSet = unordered_set<VertexSharedPtr, NamedEntityHash>;
using VertexVector = vector<VertexSharedPtr>;
// Outputs a set of vertices
std::ostream& operator<< (std::ostream &out, const VertexSet &v);
using set_type = set<std::shared_ptr<Vertex>>;
using powerset_type = set<set_type>;
powerset_type powerset(set_type const& set);
#endif