diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-03-23 16:01:30 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-03-23 16:01:30 +0100 |
commit | 295452c3a4be1eaec424b140f23e836a869a3aa9 (patch) | |
tree | 0dc6882180df1dfd2f8c26d17387e41fffd22666 | |
parent | 0f6b8a65aed52b92d980662aaa7eaa36aeb132fe (diff) | |
download | lattice_glass-295452c3a4be1eaec424b140f23e836a869a3aa9.tar.gz lattice_glass-295452c3a4be1eaec424b140f23e836a869a3aa9.tar.bz2 lattice_glass-295452c3a4be1eaec424b140f23e836a869a3aa9.zip |
Ran clang-format.
-rw-r--r-- | biroli-mezard.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/biroli-mezard.cpp b/biroli-mezard.cpp index e5a6405..35360d0 100644 --- a/biroli-mezard.cpp +++ b/biroli-mezard.cpp @@ -1,5 +1,5 @@ -#include <iostream> #include <fstream> +#include <iostream> #include <limits> #include <list> #include <queue> @@ -240,7 +240,7 @@ public: if (t < v.occupiedNeighbors) { return false; } - + if (v.empty()) { for (const Vertex<D>& vn : v.neighbors) { if (vn.maximumNeighbors < vn.occupiedNeighbors + 1) { @@ -315,7 +315,7 @@ public: int o = 0; for (unsigned i = 0; i < size(); i++) { - unsigned t2 = + unsigned t2 = s.vertices[vectorToIndex(orientation.inverse().apply(indexToVector(i)))].maximumNeighbors; if (t2 == vertices[i].maximumNeighbors) { o++; @@ -354,9 +354,7 @@ public: return m; } - unsigned types() const { - return N.size() - 1; - } + unsigned types() const { return N.size() - 1; } double density() const { return (double)occupancy() / size(); } @@ -371,7 +369,7 @@ public: while (true) { Vertex<D>& v = r.pick(vertices); if (v.empty()) { - insert(v, r.pick({1,2,2,2,2,2,3,3,3,3})); + insert(v, r.pick({1, 2, 2, 2, 2, 2, 3, 3, 3, 3})); break; } } @@ -457,14 +455,12 @@ public: if (q.empty()) { for (Vertex<D>& vv : vertices) { if (!vv.marked && !overlaps(vv).empty()) { -// std::cerr << "Found bad state at end" << std::endl; + // std::cerr << "Found bad state at end" << std::endl; q.push(vv); } } } } - - } if (n > size() / 4) { @@ -477,7 +473,6 @@ public: return n; } - }; void print(const System<2>& s) { @@ -512,7 +507,7 @@ int main() { if (!s.compatible()) { std::cerr << "Storted incompatible!" << std::endl; return 1; - } + } while (s.density() < 0.57) { s.sweepGrandCanonical(z, r); @@ -521,7 +516,7 @@ int main() { if (!s.compatible()) { std::cerr << "Not compatible!" << std::endl; return 1; - } + } std::cerr << "Found state with appropriate density." << std::endl; @@ -542,17 +537,17 @@ int main() { unsigned nn = s.flipCluster(Transformation<D>(L, ms, r), r.pick(s.vertices)); nC += nn; clusterDist[nn]++; -// s.sweepLocal(r); -// nC += s.size(); -// s.sweepSwap(r); -// s.swendsenWang(Transformation<D>(L, ms, r), r); + // s.sweepLocal(r); + // nC += s.size(); + // s.sweepSwap(r); + // s.swendsenWang(Transformation<D>(L, ms, r), r); i++; } if (!s.compatible()) { std::cerr << "Not compatible!" << std::endl; return 1; - } + } std::ofstream file("dist.dat"); for (unsigned i : clusterDist) { |