diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-12-20 14:54:31 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-12-20 14:54:31 -0500 |
commit | 0d4bda66c7c6f92409b41459208287dc47bc6d98 (patch) | |
tree | 3a92ab648ec3283a5c1a109184e6b4f97b810020 | |
parent | 147012d4d524f5f0f7417d639cefc30ddb43da4f (diff) | |
download | code-0d4bda66c7c6f92409b41459208287dc47bc6d98.tar.gz code-0d4bda66c7c6f92409b41459208287dc47bc6d98.tar.bz2 code-0d4bda66c7c6f92409b41459208287dc47bc6d98.zip |
maybe fixed it
-rw-r--r-- | hadamard_pt.hpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp index c658389..f101446 100644 --- a/hadamard_pt.hpp +++ b/hadamard_pt.hpp @@ -72,6 +72,8 @@ public: std::vector<color> colors(Ms.size(), none); std::vector<unsigned> nu(Ms.size(), 0); std::vector<unsigned> nd(Ms.size(), 0); + colors.front() = down; + colors.back() = up; for (unsigned i = 0; i < n; i++) { #pragma omp parallel for @@ -82,10 +84,16 @@ public: for (unsigned j = 0; j < Ms.size() - 1; j++) { if (this->step(j, j + 1, true)) { std::swap(colors[j], colors[j + 1]); + colors.front() = down; + colors.back() = up; + } + if (this->step(Ms.size() - 2 - j, Ms.size() - 1 - j, true)) { + std::swap(colors[Ms.size() - 2 - j], colors[Ms.size() - 1 - j]); + colors.front() = down; + colors.back() = up; } } - colors.front() = down; - colors.back() = up; + if (i > n / 2) { for (unsigned j = 0; j < Ms.size(); j++) { if (colors[j] == up) { @@ -118,7 +126,7 @@ public: std::vector<double> η(Ms.size() - 1); for (unsigned i = 0; i < Ms.size() - 1; i++) { - η[η.size() - i - 1] = sqrt((f[i + 1] - f[i]) / (1 / Ms[i].β - 1 / Ms[i+1].β)); + η[η.size() - i - 1] = sqrt((f[i + 1] - f[i])) / (1 / Ms[i].β - 1 / Ms[i+1].β); } double C = 0; |