diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-03-16 18:19:09 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-03-16 18:19:09 -0400 |
commit | 2faf0e4598c7c046d58107d23145f95db334200c (patch) | |
tree | 149ed852adfabdf881042167c7eb1131ea3e53ea /src/analysis_tools.cpp | |
parent | 19d657b60b22159359f7a229f5a5b73e729cff79 (diff) | |
download | fuse_networks-2faf0e4598c7c046d58107d23145f95db334200c.tar.gz fuse_networks-2faf0e4598c7c046d58107d23145f95db334200c.tar.bz2 fuse_networks-2faf0e4598c7c046d58107d23145f95db334200c.zip |
Implemented new behavior when w=0 or w=1.
Diffstat (limited to 'src/analysis_tools.cpp')
-rw-r--r-- | src/analysis_tools.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/analysis_tools.cpp b/src/analysis_tools.cpp index 2965915..8ad8235 100644 --- a/src/analysis_tools.cpp +++ b/src/analysis_tools.cpp @@ -30,10 +30,22 @@ std::pair<std::array<unsigned, 2>, std::set<unsigned>> find_minimal_crack(const } if (all_good) { - if (cycles[0].second.size() > cycles[1].second.size()) { - return cycles[1]; + if (n.two_sides) { + if (cycles[0].second.size() > cycles[1].second.size()) { + return cycles[1]; + } else { + return cycles[0]; + } } else { - return cycles[0]; + if (cycles[0].first[0] % 2 == 0) { + return cycles[0]; + } else { + return cycles[1]; + } + } + } else if (!n.two_sides) { + if (cycles[!not_good].first[0] % 2 == 0) { + return cycles[!not_good]; } } @@ -63,7 +75,7 @@ std::pair<std::array<unsigned, 2>, std::set<unsigned>> find_minimal_crack(const pos++; } - if (cycles[!not_good].second.size() > new_cycle.size()) { + if (cycles[!not_good].second.size() > new_cycle.size() || !n.two_sides) { return {{sum_sig_0, sum_sig_1}, new_cycle}; } else { return cycles[!not_good]; |