summaryrefslogtreecommitdiff
path: root/lib/include/graph.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/include/graph.hpp')
-rw-r--r--lib/include/graph.hpp79
1 files changed, 39 insertions, 40 deletions
diff --git a/lib/include/graph.hpp b/lib/include/graph.hpp
index 0452339..9d2b5a1 100644
--- a/lib/include/graph.hpp
+++ b/lib/include/graph.hpp
@@ -1,50 +1,49 @@
#pragma once
-#include <cmath>
-#include <vector>
+#include <algorithm>
#include <array>
-#include <unordered_map>
-#include <random>
-#include <list>
+#include <cmath>
#include <exception>
-#include <algorithm>
+#include <list>
+#include <random>
+#include <unordered_map>
+#include <vector>
#include "array_hash.hpp"
class graph {
- public:
- typedef struct coordinate {
- double x;
- double y;
- } coordinate;
-
- typedef struct vertex {
- coordinate r;
- std::vector<unsigned> nd;
- std::vector<unsigned> ne;
- std::vector<coordinate> polygon;
- } vertex;
-
- typedef struct edge {
- std::array<unsigned, 2> v;
- coordinate r;
- std::array<bool, 2> crossings;
- } edge;
-
- coordinate L;
-
- std::vector<vertex> vertices;
- std::vector<edge> edges;
-
- std::vector<vertex> dual_vertices;
- std::vector<edge> dual_edges;
-
- graph(unsigned Nx, unsigned Ny);
- graph(double Lx, double Ly, std::mt19937& rng);
- graph(unsigned n, double a, std::mt19937& rng);
-
- void helper(unsigned n, std::mt19937& rng);
- graph const rotate();
+public:
+ typedef struct coordinate {
+ double x;
+ double y;
+ } coordinate;
+
+ typedef struct vertex {
+ coordinate r;
+ std::vector<unsigned> nd;
+ std::vector<unsigned> ne;
+ std::vector<coordinate> polygon;
+ } vertex;
+
+ typedef struct edge {
+ std::array<unsigned, 2> v;
+ coordinate r;
+ std::array<bool, 2> crossings;
+ } edge;
+
+ coordinate L;
+
+ std::vector<vertex> vertices;
+ std::vector<edge> edges;
+
+ std::vector<vertex> dual_vertices;
+ std::vector<edge> dual_edges;
+
+ graph(unsigned Nx, unsigned Ny);
+ graph(double Lx, double Ly, std::mt19937& rng);
+ graph(unsigned n, double a, std::mt19937& rng);
+
+ void helper(unsigned n, std::mt19937& rng);
+ graph const rotate();
};
-