diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-03-29 19:05:19 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-03-29 19:05:19 -0400 |
commit | 880df6024e143de15e86dc216f885e367be05d7a (patch) | |
tree | 37fa61a80625c3996f162a42fcf39589cc77c2e0 /lib | |
parent | f0d8192d387c99dd766484883abe307d4bbe7807 (diff) | |
download | fuse_networks-880df6024e143de15e86dc216f885e367be05d7a.tar.gz fuse_networks-880df6024e143de15e86dc216f885e367be05d7a.tar.bz2 fuse_networks-880df6024e143de15e86dc216f885e367be05d7a.zip |
Fixed bug that prematurely marked some bowtie flaps as unbreakable.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/src/network.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/src/network.cpp b/lib/src/network.cpp index 58dde78..2bbd9b8 100644 --- a/lib/src/network.cpp +++ b/lib/src/network.cpp @@ -310,8 +310,6 @@ void network::update_backbone(const std::vector<double>& c, const std::array<dou // if any of them spans the torus and therefore can carry current. if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_current)) { // If none does, we remove it from the backbone! - seen_pairs_x[{G.dual_edges[i].v[0], G.dual_edges[i].v[1]}] = true; - seen_pairs_y[{G.dual_edges[i].v[0], G.dual_edges[i].v[1]}] = true; backbone[i] = true; // We're not done yet: we've severed the stem but the pop remains! We @@ -347,7 +345,9 @@ void network::update_backbone(const std::vector<double>& c, const std::array<dou } } } - } else if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_wrap_x)) { + } + + if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_wrap_x)) { // If the bond separates a wrapping path, breaking it would end the // fracture and therefore it will never be removed from the backbone // in this manner. We can skip it in the future. @@ -462,10 +462,6 @@ void network::update_backbone(const std::vector<double>& c, const std::array<dou } if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_current)) { - // one of our pairs qualifies for trimming! - seen_pairs_x[{d1, d2}] = true; - seen_pairs_y[{d1, d2}] = true; - // We separate the flaps of the bowtie (there may be more than // two!) into distinct sets. std::list<std::set<unsigned>> flaps = this->get_tie_flaps(v); @@ -498,7 +494,9 @@ void network::update_backbone(const std::vector<double>& c, const std::array<dou } } } - } else if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_wrap_x)) { + } + + if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_wrap_x)) { seen_pairs_x[{d1, d2}] = true; } else if (std::any_of(all_sigs.begin(), all_sigs.end(), cycle_check_wrap_y)) { seen_pairs_y[{d1, d2}] = true; |