Mercurial > hg > match-vamp
comparison src/Finder.cpp @ 86:f07b9b7f1ab6 refactors
Previous commit was a mistake: the ahead-of-time business is in Finder::getExpandDirection. In fact we were failing to swap advance directions in forward path when writing to the "other" finder. This does not actually affect the backward path calculation, but it does mean we can restore the sanity check.
author | Chris Cannam |
---|---|
date | Thu, 27 Nov 2014 12:08:16 +0000 |
parents | a540b26db228 |
children | 1f5291760ed9 |
comparison
equal
deleted
inserted
replaced
85:a540b26db228 | 86:f07b9b7f1ab6 |
---|---|
220 dir = Matcher::AdvanceOther; | 220 dir = Matcher::AdvanceOther; |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 if (dir != Matcher::AdvanceNone) { | 224 if (dir != Matcher::AdvanceNone) { |
225 if (m_m->getAdvance(r, c) != dir) { | |
226 cerr << "WrongAdvance found" << endl; | |
227 err.type = ErrorPosition::WrongAdvance; | |
228 err.r = r; | |
229 err.c = c; | |
230 err.costWas = m_m->getPathCost(r, c); | |
231 err.costShouldBe = updateTo; | |
232 err.advanceWas = m_m->getAdvance(r, c); | |
233 err.advanceShouldBe = dir; | |
234 return err; | |
235 } | |
225 if (m_m->getPathCost(r, c) != updateTo) { | 236 if (m_m->getPathCost(r, c) != updateTo) { |
226 cerr << "WrongCost found" << endl; | 237 cerr << "WrongCost found" << endl; |
227 err.type = ErrorPosition::WrongCost; | 238 err.type = ErrorPosition::WrongCost; |
228 err.r = r; | 239 err.r = r; |
229 err.c = c; | 240 err.c = c; |