comparison src/Matcher.h @ 182:a67663dc698d types

Start using properly-named types
author Chris Cannam
date Thu, 19 Feb 2015 16:57:19 +0000
parents 8e7f96432570
children ba0d2104abec
comparison
equal deleted inserted replaced
181:8e7f96432570 182:a67663dc698d
146 * warping algorithm. 146 * warping algorithm.
147 * 147 *
148 * The supplied features must always be of the same size (within 148 * The supplied features must always be of the same size (within
149 * any pair of Matcher objects). 149 * any pair of Matcher objects).
150 */ 150 */
151 void consumeFeatureVector(std::vector<double> feature); 151 void consumeFeatureVector(const feature_t &feature);
152 152
153 /** Tests whether a location is in range in the minimum cost matrix. 153 /** Tests whether a location is in range in the minimum cost matrix.
154 * 154 *
155 * @param i the frame number of this Matcher 155 * @param i the frame number of this Matcher
156 * @param j the frame number of the other Matcher 156 * @param j the frame number of the other Matcher
200 * 200 *
201 * @param i the frame number of this Matcher 201 * @param i the frame number of this Matcher
202 * @param j the frame number of the other Matcher 202 * @param j the frame number of the other Matcher
203 * @return the distance metric at this location 203 * @return the distance metric at this location
204 */ 204 */
205 float getDistance(int i, int j); 205 distance_t getDistance(int i, int j);
206 206
207 /** Sets a value to the distance matrix. 207 /** Sets a value to the distance matrix.
208 * 208 *
209 * @param i the frame number of this Matcher 209 * @param i the frame number of this Matcher
210 * @param j the frame number of the other Matcher 210 * @param j the frame number of the other Matcher
211 * @param value the distance metric to set for this location 211 * @param value the distance metric to set for this location
212 */ 212 */
213 void setDistance(int i, int j, float distance); 213 void setDistance(int i, int j, distance_t distance);
214 214
215 /** Retrieves a value from the minimum cost matrix. 215 /** Retrieves a value from the minimum cost matrix.
216 * 216 *
217 * @param i the frame number of this Matcher 217 * @param i the frame number of this Matcher
218 * @param j the frame number of the other Matcher 218 * @param j the frame number of the other Matcher
219 * @return the cost of the minimum cost path to this location 219 * @return the cost of the minimum cost path to this location
220 */ 220 */
221 double getPathCost(int i, int j); 221 pathcost_t getPathCost(int i, int j);
222 222
223 /** Sets a value and an advance direction to the minimum cost matrix. 223 /** Sets a value and an advance direction to the minimum cost matrix.
224 * 224 *
225 * @param i the frame number of this Matcher 225 * @param i the frame number of this Matcher
226 * @param j the frame number of the other Matcher 226 * @param j the frame number of the other Matcher
227 * @param dir the direction from which this position is reached with 227 * @param dir the direction from which this position is reached with
228 * minimum cost 228 * minimum cost
229 * @param value the cost of the minimum cost path to set for this location 229 * @param value the cost of the minimum cost path to set for this location
230 */ 230 */
231 void setPathCost(int i, int j, advance_t dir, double value); 231 void setPathCost(int i, int j, advance_t dir, pathcost_t value);
232 232
233 /** Retrieves a value from the minimum cost matrix, normalised for 233 /** Retrieves a value from the minimum cost matrix, normalised for
234 * path length. 234 * path length.
235 * 235 *
236 * @param i the frame number of this Matcher 236 * @param i the frame number of this Matcher
237 * @param j the frame number of the other Matcher 237 * @param j the frame number of the other Matcher
238 * @return the cost of the minimum cost path to this location, 238 * @return the cost of the minimum cost path to this location,
239 * normalised by the Manhattan distance from 0,0 to i,j 239 * normalised by the Manhattan distance from 0,0 to i,j
240 */ 240 */
241 double getNormalisedPathCost(int i, int j); 241 pathcost_t getNormalisedPathCost(int i, int j);
242 242
243 /** Retrieves an advance direction from the matrix. 243 /** Retrieves an advance direction from the matrix.
244 * 244 *
245 * @param i the frame number of this Matcher 245 * @param i the frame number of this Matcher
246 * @param j the frame number of the other Matcher 246 * @param j the frame number of the other Matcher
263 * @param dir the direction from which this position is reached with 263 * @param dir the direction from which this position is reached with
264 * minimum cost 264 * minimum cost
265 * @param value the cost of the minimum path except the current step 265 * @param value the cost of the minimum path except the current step
266 * @param dMN the distance cost between the two frames 266 * @param dMN the distance cost between the two frames
267 */ 267 */
268 void updateValue(int i, int j, advance_t dir, double value, float dMN); 268 void updateValue(int i, int j, advance_t dir, pathcost_t value, distance_t dMN);
269 269
270 void calcAdvance(); 270 void calcAdvance();
271 271
272 /** Points to the other performance with which this one is being 272 /** Points to the other performance with which this one is being
273 * compared. The data for the distance metric and the dynamic 273 * compared. The data for the distance metric and the dynamic
299 299
300 /** A block of previously seen feature frames is stored in this 300 /** A block of previously seen feature frames is stored in this
301 * structure for calculation of the distance matrix as the new 301 * structure for calculation of the distance matrix as the new
302 * frames are received. One can think of the structure of the 302 * frames are received. One can think of the structure of the
303 * array as a circular buffer of vectors. */ 303 * array as a circular buffer of vectors. */
304 vector<vector<double> > m_frames; 304 featureseq_t m_features;
305 305
306 /** The best path cost matrix. */ 306 /** The best path cost matrix. */
307 vector<vector<double> > m_bestPathCost; 307 pathcostmat_t m_bestPathCost;
308 308
309 /** The distance matrix. */ 309 /** The distance matrix. */
310 vector<vector<float> > m_distance; 310 distancemat_t m_distance;
311 311
312 /** The advance direction matrix. */ 312 /** The advance direction matrix. */
313 vector<vector<advance_t> > m_advance; 313 advancemat_t m_advance;
314 314
315 /** The bounds of each row of data in the distance, path cost, and 315 /** The bounds of each row of data in the distance, path cost, and
316 * advance direction matrices.*/ 316 * advance direction matrices.*/
317 vector<int> m_first; 317 vector<int> m_first;
318 vector<int> m_last; 318 vector<int> m_last;