summaryrefslogtreecommitdiff
path: root/lib/include/graph.hpp
blob: d746dddb49bae7c3ab5a5caf23eaf0a90dc63329 (plain)
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

#pragma once

#include <cmath>
#include <vector>
#include <array>
#include <unordered_map>
#include <random>
#include <list>
#include <exception>


class graph {
  public:
    typedef struct coordinate {
      double x;
      double y;
    } coordinate;

    typedef struct vertex {
      coordinate r;
      std::vector<coordinate> polygon;
    } vertex;

    typedef struct edge {
      std::array<unsigned int, 2> v;
      coordinate r;
    } edge;

    coordinate L;

    std::vector<vertex> vertices;
    std::vector<edge> edges;

    std::vector<vertex> dual_vertices;
    std::vector<edge> dual_edges;

    graph(unsigned int Nx, unsigned int Ny);
    graph(unsigned int Nx, unsigned int Ny, std::mt19937& rng, double = 0.25);
};