Mercurial > hg > match-vamp
diff src/Matcher.cpp @ 83:10e76188c846 refactors
Expose diagonal weight as a parameter
author | Chris Cannam |
---|---|
date | Thu, 27 Nov 2014 10:49:11 +0000 |
parents | b9aa663a607b |
children | de7034e93dd0 |
line wrap: on
line diff
--- a/src/Matcher.cpp Thu Nov 27 10:14:07 2014 +0000 +++ b/src/Matcher.cpp Thu Nov 27 10:49:11 2014 +0000 @@ -339,10 +339,16 @@ void Matcher::updateValue(int i, int j, Advance dir, double value, float dMN) { + float weighted = dMN; + if (dir == AdvanceBoth) { + weighted *= m_params.diagonalWeight; + } + if (m_firstPM) { m_distance[i][j - m_first[i]] = dMN; - setPathCost(i, j, dir, value + (dir == AdvanceBoth ? dMN*2: dMN)); + + setPathCost(i, j, dir, value + weighted); } else { @@ -359,7 +365,7 @@ } m_otherMatcher->m_distance[j][idx] = dMN; - m_otherMatcher->setPathCost(j, i, dir, value + (dir == AdvanceBoth ? dMN*2: dMN)); + m_otherMatcher->setPathCost(j, i, dir, value + weighted); } }