comparison src/Finder.h @ 84:de7034e93dd0 refactors

More error checking (check advance as well as cost)
author Chris Cannam
date Thu, 27 Nov 2014 10:53:00 +0000
parents 3616d541d69e
children a540b26db228
comparison
equal deleted inserted replaced
83:10e76188c846 84:de7034e93dd0
66 int retrievePath(bool smooth, std::vector<int> &pathx, std::vector<int> &pathy); 66 int retrievePath(bool smooth, std::vector<int> &pathx, std::vector<int> &pathy);
67 67
68 protected: 68 protected:
69 #ifdef PERFORM_ERROR_CHECKS 69 #ifdef PERFORM_ERROR_CHECKS
70 struct ErrorPosition { 70 struct ErrorPosition {
71 enum Type { NoError = 0, CostError, NoAdvance }; 71 enum Type { NoError = 0, WrongCost, WrongAdvance, NoAdvance };
72 ErrorPosition() : type(NoError) { } 72 ErrorPosition() : type(NoError) { }
73 Type type; 73 Type type;
74 int r; 74 int r;
75 int c; 75 int c;
76 double prevCost; 76 double prevCost;
77 float distance; 77 float distance;
78 Matcher::Advance advance;
79 double costWas; 78 double costWas;
80 double costShouldBe; 79 double costShouldBe;
80 Matcher::Advance advanceWas;
81 Matcher::Advance advanceShouldBe;
81 }; 82 };
82 ErrorPosition checkPathCostMatrix(); 83 ErrorPosition checkPathCostMatrix();
83 #endif 84 #endif
84 85
85 Matcher *m_m; 86 Matcher *m_m;