summaryrefslogtreecommitdiff
path: root/lib/include
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-12-28 17:33:35 -0500
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-12-28 17:33:35 -0500
commit9e1610143f0e96b77ca962a7113d79a2fbcbf6f5 (patch)
tree17d5f699769c9eb7cec602c19b68438e6e6cec14 /lib/include
parenta20ac5471a35c9c2a70b48fc4393d2323b52bd85 (diff)
downloadfuse_networks-9e1610143f0e96b77ca962a7113d79a2fbcbf6f5.tar.gz
fuse_networks-9e1610143f0e96b77ca962a7113d79a2fbcbf6f5.tar.bz2
fuse_networks-9e1610143f0e96b77ca962a7113d79a2fbcbf6f5.zip
partially fixed problems that arise in small systems by reworking the way that boundary edges are identified
Diffstat (limited to 'lib/include')
-rw-r--r--lib/include/array_hash.hpp27
-rw-r--r--lib/include/graph.hpp2
-rw-r--r--lib/include/network.hpp1
3 files changed, 30 insertions, 0 deletions
diff --git a/lib/include/array_hash.hpp b/lib/include/array_hash.hpp
new file mode 100644
index 0000000..3b35e4a
--- /dev/null
+++ b/lib/include/array_hash.hpp
@@ -0,0 +1,27 @@
+
+#pragma once
+
+#include <array>
+#include <unordered_map>
+
+namespace std
+{
+ template<typename T, size_t N>
+ struct hash<array<T, N> >
+ {
+ typedef array<T, N> argument_type;
+ typedef size_t result_type;
+
+ result_type operator()(const argument_type& a) const
+ {
+ hash<T> hasher;
+ result_type h = 0;
+ for (result_type i = 0; i < N; ++i)
+ {
+ h = h * 31 + hasher(a[i]);
+ }
+ return h;
+ }
+ };
+}
+
diff --git a/lib/include/graph.hpp b/lib/include/graph.hpp
index c1ad4f0..ea08214 100644
--- a/lib/include/graph.hpp
+++ b/lib/include/graph.hpp
@@ -9,6 +9,7 @@
#include <list>
#include <exception>
+#include "array_hash.hpp"
class graph {
public:
@@ -25,6 +26,7 @@ class graph {
typedef struct edge {
std::array<unsigned int, 2> v;
coordinate r;
+ std::array<bool, 2> crossings;
} edge;
coordinate L;
diff --git a/lib/include/network.hpp b/lib/include/network.hpp
index d955e43..70173e6 100644
--- a/lib/include/network.hpp
+++ b/lib/include/network.hpp
@@ -12,6 +12,7 @@
#include "graph.hpp"
#include "hooks.hpp"
#include "current_info.hpp"
+#include "array_hash.hpp"
#ifdef FRACTURE_LONGINT