-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSeparator.h
executable file
·60 lines (40 loc) · 1.52 KB
/
Separator.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
#pragma once
#if !defined(CLS_SEPARATOR)
#define CLS_SEPARATOR
#include<string>
#include "Hyperedge.h"
#include "BaseSeparator.h"
class Separator : public BaseSeparator
{
private:
HyperedgeVector MySep;
public:
Separator() {};
Separator(const HyperedgeVector &sep) : MySep{ sep } {}
void label(int lbl = -1) const;
void insert(const HyperedgeSharedPtr &ptr) { MySep.push_back(ptr); }
void push_back(const HyperedgeSharedPtr &ptr) { insert(ptr); }
bool contains(const HyperedgeSharedPtr &ptr) const { return find(MySep.begin(),MySep.end(),ptr) != MySep.end(); }
bool contains(const VertexSharedPtr &v) const;
auto allEdges() -> decltype(make_iterable(MySep.begin(), MySep.end()))
{
return make_iterable(MySep.begin(), MySep.end());
}
auto allEdges() const -> decltype(make_iterable(MySep.begin(), MySep.end()))
{
return make_iterable(MySep.begin(), MySep.end());
}
bool empty() const { return MySep.size() == 0; }
auto size() const { return MySep.size(); }
auto cbegin() const { return MySep.cbegin(); }
auto cend() const { return MySep.cend(); }
auto begin() { return MySep.begin(); }
auto end() { return MySep.end(); }
auto begin() const { return MySep.begin(); }
auto end() const { return MySep.end(); }
VertexSet covers();
const HyperedgeVector &edges() const { return MySep; }
friend bool operator==(const std::shared_ptr<Separator>& lhs, const std::shared_ptr<Separator>& rhs);
};
using SeparatorSharedPtr = std::shared_ptr<Separator>;
#endif