From 1d9d60ab5e47eee55faae4b397d0f7ef314c0868 Mon Sep 17 00:00:00 2001 From: XavierM Date: Tue, 21 Jun 2022 17:09:44 +0200 Subject: [PATCH] Check if there exists a Path+1 and invert odd/even ring The if line 379 should check if there is a Path+1 with a size > 1. The odd and even ring was also inverted (based on the Supplementary Material algorithm of the RP-Path paper) --- src/chemkit/rppath.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/chemkit/rppath.h b/src/chemkit/rppath.h index 485f1888..ad6c373d 100644 --- a/src/chemkit/rppath.h +++ b/src/chemkit/rppath.h @@ -373,19 +373,18 @@ inline std::vector > rppath(const Graph &graph) if(P(i, j).size() == 1 && Pt(i, j).size() == 0){ continue; } - else{ - T size; + + T size; - if(P(i, j).size() > 1){ - size = 2 * D(i, j); - } - else{ - size = 2 * D(i, j) + 1; - } + if(Pt(i, j).size() > 1){ + size = 2 * D(i, j) + 1; + } + else{ + size = 2 * D(i, j); + } - if(size > 2){ - candidates.push_back(RingCandidate(size, i, j)); - } + if(size > 2){ + candidates.push_back(RingCandidate(size, i, j)); } } }