From 14f96d8bf0e22e8f004c22a0c438d328ec2210ac Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 13 Mar 2017 11:22:43 -0400 Subject: [PATCH] Invert reverse d-paths as appropriate. --- src/SES/Myers.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SES/Myers.hs b/src/SES/Myers.hs index a98a9a187..f73e31bd6 100644 --- a/src/SES/Myers.hs +++ b/src/SES/Myers.hs @@ -108,7 +108,7 @@ decompose myers = let ?callStack = popCallStack callStack in case myers of backwardV <- gets backward let reverseEndpoint = let x = backwardV `at` k in Endpoint x (x - k) if odd delta && k `inInterval` (delta - pred d, delta + pred d) && overlaps graph forwardEndpoint reverseEndpoint then - return (Just (Snake reverseEndpoint forwardEndpoint, EditDistance $ 2 * d - 1)) + return (Just (Snake (Endpoint (n - x reverseEndpoint) (m - y reverseEndpoint)) forwardEndpoint, EditDistance $ 2 * d - 1)) else continue) <*> for [negate d, negate d + 2 .. d] (\ k -> do @@ -116,7 +116,7 @@ decompose myers = let ?callStack = popCallStack callStack in case myers of forwardV <- gets forward let forwardEndpoint = let x = forwardV `at` (k + delta) in Endpoint x (x - k) if even delta && (k + delta) `inInterval` (negate d, d) && overlaps graph forwardEndpoint reverseEndpoint then - return (Just (Snake reverseEndpoint forwardEndpoint, EditDistance $ 2 * d)) + return (Just (Snake (Endpoint (n - x reverseEndpoint) (m - y reverseEndpoint)) forwardEndpoint, EditDistance $ 2 * d)) else continue)