bool secondaryStructures::NoChainBreaksBetween(std::size_t Resi1, std::size_t Resi2) const{
bool flag{true};
+ std::size_t i{};
if ( Resi1 < Resi2){
- for (; Resi1 != Resi2; ++Resi1){
- flag = !SecondaryStructuresStatusMap[Resi1].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi1 + 1]) || !SecondaryStructuresStatusMap[Resi1 + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi1]);
- }
+ i = Resi1;
}
else if ( Resi1 > Resi2) {
- for (; Resi2 != Resi1; ++Resi2){
- flag = !SecondaryStructuresStatusMap[Resi2].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi2 + 1]) || !SecondaryStructuresStatusMap[Resi2 + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi2]);
- }
+ i = Resi2;
+ }
+ else{
+ return true;
}
+
+ for (; i != Resi2; ++i){
+ flag = !(SecondaryStructuresStatusMap[i].isBreakPartnerWith(&SecondaryStructuresStatusMap[i + 1]) || SecondaryStructuresStatusMap[i + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[i]));
+ }
+
if (!flag){
- std::cout << "Chainbreak between " << Resi1 << " and " << Resi2 << std::endl;
+ std::cout << "Patternsearch has detected a CHAINBREAK between " << Resi1 << " and " << Resi2 << std::endl;
}
return flag;
}