comparison src/Matcher.cpp @ 94:13be4158251d refactors

Ah, it's subtler than that -- we have to handle the case where this is not the first matcher as well, if we're to get precisely the same results
author Chris Cannam
date Thu, 27 Nov 2014 16:05:19 +0000
parents 8b33cb568b10
children 6b91e40b2c04
comparison
equal deleted inserted replaced
93:8b33cb568b10 94:13be4158251d
339 double cost3 = min3 + diagDistance; 339 double cost3 = min3 + diagDistance;
340 340
341 // Choosing is easy if there is a strict cheapest of the 341 // Choosing is easy if there is a strict cheapest of the
342 // three. If two or more share the lowest cost, we choose 342 // three. If two or more share the lowest cost, we choose
343 // in order of preference: cost3 (AdvanceBoth), cost2 343 // in order of preference: cost3 (AdvanceBoth), cost2
344 // (AdvanceThis), cost1 (AdvanceOther). 344 // (AdvanceThis), cost1 (AdvanceOther) if we are the first
345 345 // matcher; and cost3 (AdvanceBoth), cost1 (AdvanceOther),
346 if (cost1 < cost2) { 346 // cost2 (AdvanceThis) if we are the second matcher. That
347 // is, we always prioritise the diagonal followed by the
348 // first matcher.
349
350 if (( m_firstPM && (cost1 < cost2)) ||
351 (!m_firstPM && (cost1 <= cost2))) {
347 if (cost3 <= cost1) { 352 if (cost3 <= cost1) {
348 updateValue(m_frameCount, index, AdvanceBoth, 353 updateValue(m_frameCount, index, AdvanceBoth,
349 min3, distance); 354 min3, distance);
350 } else { 355 } else {
351 updateValue(m_frameCount, index, AdvanceOther, 356 updateValue(m_frameCount, index, AdvanceOther,