From 295452c3a4be1eaec424b140f23e836a869a3aa9 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 23 Mar 2021 16:01:30 +0100 Subject: Ran clang-format. --- biroli-mezard.cpp | 31 +++++++++++++------------------ 1 file 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 #include +#include #include #include #include @@ -240,7 +240,7 @@ public: if (t < v.occupiedNeighbors) { return false; } - + if (v.empty()) { for (const Vertex& 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& 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& 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(L, ms, r), r.pick(s.vertices)); nC += nn; clusterDist[nn]++; -// s.sweepLocal(r); -// nC += s.size(); -// s.sweepSwap(r); -// s.swendsenWang(Transformation(L, ms, r), r); + // s.sweepLocal(r); + // nC += s.size(); + // s.sweepSwap(r); + // s.swendsenWang(Transformation(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) { -- cgit v1.2.3-70-g09d2