comparison src/Matcher.cpp @ 135:42381e437fcd refactors

The finder is supposed to use normalised path-cost when calculation expand direction (as in Java implementation). Also, provide a way to query the forward path.
author Chris Cannam
date Thu, 18 Dec 2014 17:56:54 +0000
parents 6636aca831c0
children cfba9aec7569
comparison
equal deleted inserted replaced
134:046f51a2ca25 135:42381e437fcd
149 } 149 }
150 m_distance[i][j - m_first[i]] = distance; 150 m_distance[i][j - m_first[i]] = distance;
151 } else { 151 } else {
152 m_otherMatcher->setDistance(j, i, distance); 152 m_otherMatcher->setDistance(j, i, distance);
153 } 153 }
154 }
155
156 double
157 Matcher::getNormalisedPathCost(int i, int j)
158 {
159 // normalised for path length. 1+ prevents division by zero here
160 return getPathCost(i, j) / (1 + i + j);
154 } 161 }
155 162
156 double 163 double
157 Matcher::getPathCost(int i, int j) 164 Matcher::getPathCost(int i, int j)
158 { 165 {