The function library needs only one global private data structure, namely for storing the saved templates. This data structure
will be implemented as a STL vector containing pointers to DTWTemplate
structs, which is declared followingly:
struct DTWTemplate { float* values; int length; }
The members of the structure are rather self-explanatory. values
is an array containing the template itself and
length
is the length of the template.
The following struct is also defined for internal use:
struct WarpingGridPoint { float costsofar; long lengthsofar; int previ; int prevj; }This sturcture is used in calculating the Dynamic Time Warping Grid. Each point of the grid is represented by one instance of this struct. The members:
costsofar
: The DTW cost up to the point in question.
lengthsofar
: The DTW path length up to the point in question.
previ, prevj
: The previous point on the warping path.