-
Notifications
You must be signed in to change notification settings - Fork 3
/
VertexSeparator.h
executable file
·61 lines (41 loc) · 1.66 KB
/
VertexSeparator.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#if !defined(CLS_VERTEXSEPARATOR)
#define CLS_VERTEXSEPARATOR
#include<string>
#include "Hyperedge.h"
#include "BaseSeparator.h"
class VertexSeparator : public BaseSeparator
{
private:
VertexSet MySep;
public:
VertexSeparator() {};
VertexSeparator(const VertexSet &sep) : MySep{ sep } {}
void label(int lbl = -1) const { for (auto v : MySep) v->setAllLabels(lbl); }
void insert(const VertexSharedPtr &ptr) { MySep.insert(ptr); }
void erase(const VertexSharedPtr &ptr) { MySep.erase(ptr); }
void push_back(const VertexSharedPtr &ptr) { insert(ptr); }
bool contains(const HyperedgeSharedPtr &ptr) const;
bool contains(const VertexSharedPtr &v) const { return find(MySep.begin(), MySep.end(), v) != MySep.end(); };
auto allVertices() -> decltype(make_iterable(MySep.begin(), MySep.end()))
{
return make_iterable(MySep.begin(), MySep.end());