X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fgenealgorithms.cpp;h=78b0f0572dc283b1e7e8f7278303954ff77cddac;hp=a32968eaea3454f1081649335a34c7e8c201077f;hb=9299a79715f5b11b0ab26bff80ab7a610030b126;hpb=052ccbc26078638efee3614cd7cc2ea485313cad diff --git a/src/genealgorithms.cpp b/src/genealgorithms.cpp index a32968e..78b0f05 100644 --- a/src/genealgorithms.cpp +++ b/src/genealgorithms.cpp @@ -139,10 +139,9 @@ std::vector findComponents(const GeneOrder& go){ os[Sdir.top()] = (os[Sdir.top()] == os[s] ? os[s] : 0); s = Sdir.top(); } - if (go[i] > 0 && dir[i] == dir[s] && i - s == p[i] - p[s]) + if (go[i] > 0 && dir[i] == dir[s] && static_cast(i - s) == p[i] - p[s]) components.push_back(Component(p[s],p[i],(s+1 == i ? 0 : os[s]))); - //Reverse if (p[i-1] < p[i]) Mrev.push(p[i-1]); @@ -156,8 +155,8 @@ std::vector findComponents(const GeneOrder& go){ os[Srev.top()] *= (os[Srev.top()] == os[s] ? 1 : 0); s = Srev.top(); } - if (go[i] < 0 && rev[i] == rev[s] && i - s == p[s] - p[i]) - components.push_back(Component(-p[s],-p[i],os[s])); + if (go[i] < 0 && rev[i] == rev[s] && static_cast(i - s) == p[s] - p[i]) + components.push_back(Component(-p[s],-p[i],(s+1 == i ? 0 : os[s]))); //Update stacks if (go[i] > 0)