forked from zkan/dynamic-time-warping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdtw.h
42 lines (33 loc) · 811 Bytes
/
dtw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Author: Kan Ouivirach
* email: zkan at cs dot ait dot ac dot th
*
*/
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <sstream>
#include <fstream>
#include <string>
//#include <cv.h>
//#include <cxcore.h>
//#include <highgui.h>
#define DISCRETE 0
#define CONTINUOUS 1
using namespace std;
class DTW {
public:
vector< vector<int> > mGamma;
vector< vector<double> > mGamma_cont;
enum {
INF = 100000000
};
int min( int x, int y, int z );
double min( double x, double y, double z );
DTW( int n, int m ): mGamma( n, vector<int>( m, INF ) ) {};
DTW( int n, int m, int flag ): mGamma_cont( n, vector<double>( m, INF ) ) {};
~DTW() {};
int run( vector<int> v, vector<int> w );
double run( double** v, int vlength, double** w, int wlength, int dim );
};