Mercurial > hg > match-vamp
comparison src/Matcher.cpp @ 96:6b91e40b2c04 refactors
Tidy
author | Chris Cannam |
---|---|
date | Thu, 27 Nov 2014 16:50:14 +0000 |
parents | 13be4158251d |
children | 6636aca831c0 |
comparison
equal
deleted
inserted
replaced
95:bc3b60d65a5f | 96:6b91e40b2c04 |
---|---|
375 | 375 |
376 m_otherMatcher->m_runCount = 0; | 376 m_otherMatcher->m_runCount = 0; |
377 } | 377 } |
378 | 378 |
379 void | 379 void |
380 Matcher::updateValue(int i, int j, Advance dir, double value, float dMN) | 380 Matcher::updateValue(int i, int j, Advance dir, double value, float distance) |
381 { | 381 { |
382 float weighted = dMN; | 382 float weighted = distance; |
383 if (dir == AdvanceBoth) { | 383 if (dir == AdvanceBoth) { |
384 weighted *= m_params.diagonalWeight; | 384 weighted *= m_params.diagonalWeight; |
385 } | 385 } |
386 | 386 |
387 if (m_firstPM) { | 387 if (m_firstPM) { |
388 | 388 |
389 m_distance[i][j - m_first[i]] = dMN; | 389 setDistance(i, j, distance); |
390 setPathCost(i, j, dir, value + weighted); | 390 setPathCost(i, j, dir, value + weighted); |
391 | 391 |
392 } else { | 392 } else { |
393 | 393 |
394 if (dir == AdvanceThis) dir = AdvanceOther; | 394 if (dir == AdvanceThis) dir = AdvanceOther; |
404 m_otherMatcher->m_bestPathCost[j].resize(idx * 2, -1); | 404 m_otherMatcher->m_bestPathCost[j].resize(idx * 2, -1); |
405 m_otherMatcher->m_distance[j].resize(idx * 2, -1); | 405 m_otherMatcher->m_distance[j].resize(idx * 2, -1); |
406 m_otherMatcher->m_advance[j].resize(idx * 2, AdvanceNone); | 406 m_otherMatcher->m_advance[j].resize(idx * 2, AdvanceNone); |
407 } | 407 } |
408 | 408 |
409 m_otherMatcher->m_distance[j][idx] = dMN; | 409 m_otherMatcher->setDistance(j, i, distance); |
410 m_otherMatcher->setPathCost(j, i, dir, value + weighted); | 410 m_otherMatcher->setPathCost(j, i, dir, value + weighted); |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 Matcher::Advance | 414 Matcher::Advance |