comparison src/Matcher.cpp @ 205:010b91e44098 memory

Rename getRowRange/getColRange to make nature of arg clearer
author Chris Cannam
date Fri, 27 Feb 2015 12:21:58 +0000
parents 006fd4cb95b3
children fb799a1aabd8
comparison
equal deleted inserted replaced
204:006fd4cb95b3 205:010b91e44098
136 return m_otherMatcher->isInRange(j, i); 136 return m_otherMatcher->isInRange(j, i);
137 } 137 }
138 } 138 }
139 139
140 pair<int, int> 140 pair<int, int>
141 Matcher::getColRange(int i) 141 Matcher::getColRangeForRow(int i)
142 { 142 {
143 if (m_firstPM) { 143 if (m_firstPM) {
144 if (i < 0 || i >= int(m_first.size())) { 144 if (i < 0 || i >= int(m_first.size())) {
145 cerr << "ERROR: Matcher::getColRange(" << i << "): Index out of range" 145 cerr << "ERROR: Matcher::getColRange(" << i << "): Index out of range"
146 << endl; 146 << endl;
147 throw "Index out of range"; 147 throw "Index out of range";
148 } else { 148 } else {
149 return pair<int, int>(m_first[i], m_last[i]); 149 return pair<int, int>(m_first[i], m_last[i]);
150 } 150 }
151 } else { 151 } else {
152 return m_otherMatcher->getRowRange(i); 152 return m_otherMatcher->getRowRangeForCol(i);
153 } 153 }
154 } 154 }
155 155
156 pair<int, int> 156 pair<int, int>
157 Matcher::getRowRange(int j) 157 Matcher::getRowRangeForCol(int j)
158 { 158 {
159 if (m_firstPM) { 159 if (m_firstPM) {
160 160
161 //!!! tedious, examine uses (& consider restoring use of 161 //!!! tedious, examine uses (& consider restoring use of
162 //!!! first/last in "other" matcher) 162 //!!! first/last in "other" matcher)
174 } else { 174 } else {
175 return pair<int, int>(a, b + 1); 175 return pair<int, int>(a, b + 1);
176 } 176 }
177 177
178 } else { 178 } else {
179 return m_otherMatcher->getColRange(j); 179 return m_otherMatcher->getColRangeForRow(j);
180 } 180 }
181 } 181 }
182 182
183 distance_t 183 distance_t
184 Matcher::getDistance(int i, int j) 184 Matcher::getDistance(int i, int j)