changeset 54:30567d4fb83a cheap_diagonals

Do not penalise diagonals
author Chris Cannam
date Fri, 14 Nov 2014 10:22:27 +0000
parents 331a17753663
children bbdcf79f3916
files src/Finder.cpp src/Matcher.cpp
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/Finder.cpp	Fri Nov 14 10:09:10 2014 +0000
+++ b/src/Finder.cpp	Fri Nov 14 10:22:27 2014 +0000
@@ -230,7 +230,7 @@
                     if ((c > prevRowStart) && (c <= prevRowStop)) {
                         // diagonal from (r-1,c-1)
                         min = pm1->m_bestPathCost[r-1][c-pm1->m_first[r-1]-1] +
-                            newCost * 2;
+                            newCost;
                         dir = Matcher::AdvanceBoth;
                     }
                     if ((c >= prevRowStart) && (c < prevRowStop)) {
--- a/src/Matcher.cpp	Fri Nov 14 10:09:10 2014 +0000
+++ b/src/Matcher.cpp	Fri Nov 14 10:22:27 2014 +0000
@@ -259,8 +259,7 @@
         int jdx = j - m_first[i];
         m_distance[i][jdx] = dMN;
         m_advance[i][jdx] = dir;
-        m_bestPathCost[i][jdx] =
-            (value + (dir == AdvanceBoth ? dMN*2: dMN));
+        m_bestPathCost[i][jdx] = value + dMN;
 
     } else {
 
@@ -285,8 +284,7 @@
 
         m_otherMatcher->m_distance[j][idx] = dMN;
         m_otherMatcher->m_advance[j][idx] = dir;
-        m_otherMatcher->m_bestPathCost[j][idx] =
-            (value + (dir == AdvanceBoth ? dMN*2: dMN));
+        m_otherMatcher->m_bestPathCost[j][idx] = value + dMN;
     }
 } // setValue()