summaryrefslogtreecommitdiff
path: root/lib/include/network.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/include/network.hpp')
-rw-r--r--lib/include/network.hpp61
1 files changed, 32 insertions, 29 deletions
diff --git a/lib/include/network.hpp b/lib/include/network.hpp
index 8748ea9..29bf55a 100644
--- a/lib/include/network.hpp
+++ b/lib/include/network.hpp
@@ -1,20 +1,20 @@
#pragma once
-#include <vector>
#include <functional>
-#include <utility>
-#include <random>
#include <limits>
-#include <valarray>
+#include <random>
#include <set>
+#include <utility>
+#include <valarray>
+#include <vector>
-#include "problem.hpp"
-#include "graph.hpp"
-#include "hooks.hpp"
-#include "current_info.hpp"
#include "array_hash.hpp"
#include "clusters.hpp"
+#include "current_info.hpp"
+#include "graph.hpp"
+#include "hooks.hpp"
+#include "problem.hpp"
#define CURRENT_CUTOFF 1e-10
@@ -27,7 +27,7 @@ class network {
friend class elastic_network;
friend class percolation_network;
- private:
+private:
problem px;
problem py;
std::unordered_map<std::array<unsigned, 2>, bool> seen_pairs;
@@ -36,14 +36,15 @@ class network {
void break_edge(unsigned, bool unbreak = false);
void get_cycle_edges_helper(std::set<unsigned>&, std::set<unsigned>&, unsigned, unsigned) const;
std::set<unsigned> get_cycle_edges(unsigned) const;
- bool find_cycle_helper(std::array<unsigned, 2>&, const std::set<unsigned>&, unsigned, unsigned, unsigned) const;
+ bool find_cycle_helper(std::array<unsigned, 2>&, const std::set<unsigned>&, unsigned, unsigned,
+ unsigned) const;
std::array<unsigned, 2> find_cycle(const std::set<unsigned>&, unsigned, unsigned) const;
void get_cluster_edges_helper(std::set<unsigned>&, unsigned) const;
std::set<unsigned> get_cluster_edges(unsigned) const;
void get_tie_flaps_helper(std::set<unsigned>&, unsigned, unsigned) const;
std::list<std::set<unsigned>> get_tie_flaps(unsigned) const;
- public:
+public:
const graph& G;
ClusterTree C;
@@ -57,36 +58,38 @@ class network {
void set_thresholds(double, std::mt19937&);
void fracture(hooks&, bool one_axis = true);
- virtual current_info get_current_info() {current_info empty; return empty;};
+ virtual current_info get_current_info() {
+ current_info empty;
+ return empty;
+ };
};
class fuse_network : public network {
- private:
- double weight;
+private:
+ double weight;
- public:
- fuse_network(const graph&, cholmod_common*, double weight = 1.0);
- fuse_network(const fuse_network&);
+public:
+ fuse_network(const graph&, cholmod_common*, double weight = 1.0);
+ fuse_network(const fuse_network&);
- current_info get_current_info() override;
+ current_info get_current_info() override;
};
class elastic_network : public network {
- private:
- double weight;
+private:
+ double weight;
- public:
- elastic_network(const graph&, cholmod_common*, double weight = 0.5);
- elastic_network(const elastic_network&);
+public:
+ elastic_network(const graph&, cholmod_common*, double weight = 0.5);
+ elastic_network(const elastic_network&);
- current_info get_current_info() override;
+ current_info get_current_info() override;
};
class percolation_network : public network {
- public:
- percolation_network(const graph&, cholmod_common*);
- percolation_network(const percolation_network&);
+public:
+ percolation_network(const graph&, cholmod_common*);
+ percolation_network(const percolation_network&);
- current_info get_current_info() override;
+ current_info get_current_info() override;
};
-