-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCircle.h
More file actions
37 lines (30 loc) · 953 Bytes
/
Circle.h
File metadata and controls
37 lines (30 loc) · 953 Bytes
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
#ifndef CIRCLE_H_INCLUDED
#define CIRCLE_H_INCLUDED
#include <vector>
#include <utility>
#include <cstddef>
#include <cstdint>
//first edge of edges is not part
//of the underlying tree
class Circle {
public:
void print() const;
//default constructor
void addEdge(size_t node0, size_t node1, bool isResidual);
const std::vector<std::pair<size_t, size_t>>& getEdges() const;
const std::vector<char>& getIsResidual() const;
size_t size() const;
//function is needed for Network simplex
void update(Circle& c);
//true means reverse circle
void rotateBy (size_t index, bool toReverse);
//both values are to be set
//circles don’t know about their graphs
intmax_t flow = 0, costPerFlow = 0;
private:
size_t length = 0;
std::vector<std::pair<size_t, size_t>> edges;
//std::vector<char>, because std::vector<bool> is broken
std::vector<char> isResidual;
};
#endif // CIRCLE_H_INCLUDED